[flang-commits] [clang] [flang] [llvm] Fix and reapply IR PGO support for Flang (PR #142892)

via flang-commits flang-commits at lists.llvm.org
Thu Jun 12 02:19:31 PDT 2025


================
@@ -69,24 +69,24 @@ ProfileList::ProfileList(ArrayRef<std::string> Paths, SourceManager &SM)
 
 ProfileList::~ProfileList() = default;
 
-static StringRef getSectionName(CodeGenOptions::ProfileInstrKind Kind) {
+static StringRef getSectionName(llvm::driver::ProfileInstrKind Kind) {
   switch (Kind) {
-  case CodeGenOptions::ProfileNone:
+  case llvm::driver::ProfileInstrKind::ProfileNone:
     return "";
-  case CodeGenOptions::ProfileClangInstr:
+  case llvm::driver::ProfileInstrKind::ProfileClangInstr:
     return "clang";
-  case CodeGenOptions::ProfileIRInstr:
+  case llvm::driver::ProfileInstrKind::ProfileIRInstr:
     return "llvm";
-  case CodeGenOptions::ProfileCSIRInstr:
+  case llvm::driver::ProfileInstrKind::ProfileCSIRInstr:
     return "csllvm";
   case CodeGenOptions::ProfileIRSampleColdCov:
----------------
fanju110 wrote:

This warning is probably due to a duplicate definition of `ProfileInstrKind`. Because the flang IR PGO does not use `ProfileIRSampleColdCov`, the original code left it in `ProfileInstrKind `in `clang`. Today I move `ProfileIRSampleColdCov `to `llvm `and removed the definition in `clang`.



https://github.com/llvm/llvm-project/pull/142892


More information about the flang-commits mailing list