[llvm] [LoopUnroll] Ignore inlinable calls if unrolling is forced (#88141) (PR #88149)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 08:34:44 PDT 2024


================
@@ -481,9 +481,10 @@ PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level,
   // attention to it.
   if (Phase != ThinOrFullLTOPhase::ThinLTOPreLink || !PGOOpt ||
       PGOOpt->Action != PGOOptions::SampleUse)
-    LPM2.addPass(LoopFullUnrollPass(Level.getSpeedupLevel(),
-                                    /* OnlyWhenForced= */ !PTO.LoopUnrolling,
-                                    PTO.ForgetAllSCEVInLoopUnroll));
+    LPM2.addPass(LoopFullUnrollPass(
+        Level.getSpeedupLevel(),
+        /* OnlyWhenForced= */ !PTO.LoopUnrolling, PTO.ForgetAllSCEVInLoopUnroll,
+        /* PrepareForLTO= */ isLTOPreLink(ThinOrFullLTOPhase::ThinLTOPreLink)));
----------------
aeubanks wrote:

`isLTOPreLink(Phase)`, ditto below

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


More information about the llvm-commits mailing list