[llvm] [LoopIdiomVectorize] Bail when vectorization is disabled (PR #181142)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 08:57:23 PST 2026


================
@@ -199,7 +204,17 @@ PreservedAnalyses LoopIdiomVectorizePass::run(Loop &L, LoopAnalysisManager &AM,
   if (ByteCmpVF.getNumOccurrences())
     BCVF = ByteCmpVF;
 
-  LoopIdiomVectorize LIV(VecStyle, BCVF, &AR.DT, &AR.LI, &AR.TTI, DL);
+  Function &F = *L.getHeader()->getParent();
+  auto &FAMP = AM.getResult<FunctionAnalysisManagerLoopProxy>(L, AR);
+  auto *ORE = FAMP.getCachedResult<OptimizationRemarkEmitterAnalysis>(F);
+
+  std::optional<OptimizationRemarkEmitter> ORELocal;
----------------
boomanaiden154 wrote:

Keeping it optional to keep it on the stack SGTM.

We need to ensure the ORE is required from the function pipeline, and I'm not sure of the guarantees there. If we're confident it is always available, we can just assert/error that `ORE != nullptr`.

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


More information about the llvm-commits mailing list