Skip to content

Commit

Permalink
[AIX][PGO] Enable PGO continuous mode support on AIX (llvm#110196)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wael Yehia committed Sep 27, 2024
1 parent 3d715e1 commit f0083c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/lib/profile/InstrProfilingFile.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static int mmapForContinuousMode(uint64_t CurrentFileOffset, FILE *File) {
}
return 0;
}
#elif defined(__ELF__) || defined(_WIN32)
#elif defined(__ELF__) || defined(_WIN32) || defined(_AIX)

#define INSTR_PROF_PROFILE_COUNTER_BIAS_DEFAULT_VAR \
INSTR_PROF_CONCAT(INSTR_PROF_PROFILE_COUNTER_BIAS_VAR, _default)
Expand Down Expand Up @@ -862,7 +862,7 @@ static int parseFilenamePattern(const char *FilenamePat,
__llvm_profile_disable_continuous_mode();
return -1;
}
#if defined(__APPLE__) || defined(__ELF__) || defined(_WIN32)
#if defined(__APPLE__) || defined(__ELF__) || defined(_WIN32) || defined(_AIX)
__llvm_profile_set_page_size(getpagesize());
__llvm_profile_enable_continuous_mode();
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// REQUIRES: target={{.*(linux|solaris|windows-msvc).*}}
// REQUIRES: target={{.*(linux|solaris|windows-msvc|aix).*}}

// RUN: %clang -fprofile-instr-generate -fcoverage-mapping -mllvm -runtime-counter-relocation=true -o %t.exe %s
// RUN: echo "garbage" > %t.profraw
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe
// RUN: llvm-profdata show --counts --all-functions %t.profraw | FileCheck %s -check-prefix=CHECK-COUNTS
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
// RUN: llvm-cov report %t.exe -instr-profile %t.profdata | FileCheck %s -check-prefix=CHECK-COVERAGE
// RUN: %if !target={{.*aix.*}} %{ llvm-cov report %t.exe -instr-profile %t.profdata | FileCheck %s -check-prefix=CHECK-COVERAGE %}

// CHECK-COUNTS: Counters:
// CHECK-COUNTS-NEXT: main:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: target={{.*(darwin|linux|solaris).*}}
// REQUIRES: target={{.*(darwin|linux|solaris|aix).*}}

// Test using __llvm_profile_set_file_object in continuous mode (%c).
// Create & cd into a temporary directory.
Expand Down

0 comments on commit f0083c6

Please sign in to comment.