[flang-commits] [flang] [llvm] [polly] [Passes] Replace OptimizationLevel with an enum (PR #209424)
Alexis Engelke via flang-commits
flang-commits at lists.llvm.org
Tue Jul 14 03:19:56 PDT 2026
================
@@ -570,7 +570,7 @@ PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level,
// attention to it.
if (!isThinLTOPreLink(Phase) || !PGOOpt ||
PGOOpt->Action != PGOOptions::SampleUse)
- LPM2.addPass(LoopFullUnrollPass(Level.getSpeedupLevel(),
+ LPM2.addPass(LoopFullUnrollPass(static_cast<int>(Level),
----------------
aengelke wrote:
OptimizationLevel is defined in Passes/ and only used in Passes/, LTO/ and a bit of Target/. To avoid layering problems, we'd need to move OptimizationLevel somewhere else first, probably IR/ or Support/ (where e.g. CodeGenOptLevel lives). (Ok, it's just a header now, but still.)
I considered changing all the ints to OptimizationLevels, but this would cause a fair amount of churn for a veery low benefit (IMO).
https://github.com/llvm/llvm-project/pull/209424
More information about the flang-commits
mailing list