[PATCH] D105802: [LoopFlatten] Fix missed LoopFlatten opportunity

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 13:26:47 PDT 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFlatten.cpp:175
+    Value *LatchValue = InductionPHI->getIncomingValueForBlock(Latch);
+    if (match(LatchValue,
+              m_c_Add(m_Specific(InductionPHI), m_ConstantInt<1>()))) {
----------------
Those kinds of patterns are very fragile in general. Would it be possible to use SCEV instead, which makes it easy to analyse the induction variables & trip counts in a more robust way?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105802



More information about the llvm-commits mailing list