[PATCH] D144274: [InstCombine] use loop info when running the pass after loop vectorization

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 06:41:17 PST 2023


spatel added inline comments.


================
Comment at: llvm/lib/Passes/PassBuilderPipelines.cpp:1143
+    ExtraPasses.addPass(
+        InstCombinePass(InstCombineOptions().setUseLoopInfo(true)));
     FPM.addPass(std::move(ExtraPasses));
----------------
nikic wrote:
> Doesn't look right: SimplifyCFG invalidates LoopInfo.
I suspect we'll be fine not using LoopInfo on the pre-LICM invocations, so I can change these. 

But let me check my understanding: by not right, do you mean we could be regenerating loop info here, or there's a potential miscompile from using invalid LoopInfo? SimplifyCFG should report/invalidate if LoopInfo might have changed? InstCombine is now doing this:
  LI = &AM.getResult<LoopAnalysis>(F);

...so that should not get a stale/invalid analysis?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144274/new/

https://reviews.llvm.org/D144274



More information about the llvm-commits mailing list