[PATCH] D94470: [LSR] Don't break a critical edge if parent ends with "callbr"

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 13:40:26 PST 2021


nickdesaulniers accepted this revision.
nickdesaulniers added a comment.
This revision is now accepted and ready to land.

Patch LGTM; just curious about the comment, since that's not what's occurring in the test AFAICT. Thanks for the patch!



================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5594-5595
+
+       // Also bail out if we have a PHI with a value from a block ending in a
+       // CallBrInst, because those also can't be split for similar reasons.
+       for (BasicBlock *PredBB : PN->blocks())
----------------
Can this comment be made more precise, I don't think what's described is what's being tested?


================
Comment at: llvm/test/CodeGen/Generic/callbr-critical-edge-splitting.ll:21
+do.body.i.i.do.body.i.i_crit_edge:                ; preds = %do.body.i.i.do.body.i.i_crit_edge, %cond.true.i
+  %pgocount711 = phi i64 [ %0, %do.body.i.i.do.body.i.i_crit_edge ], [ 0, %cond.true.i ]
+  %0 = add nuw nsw i64 %pgocount711, 1
----------------
(I'm surprised we can refer to values in the IR before they've been assigned to).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94470



More information about the llvm-commits mailing list