[PATCH] D148244: [IRCE] Support inverted range check's predicate

Aleksandr Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 3 14:02:04 PDT 2023


aleksandr.popov marked 2 inline comments as done.
aleksandr.popov added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:374
+  // successor - outside it. Invert branch for opposite case
+  if (!L->contains(BI->getSuccessor(0)) && L->contains(BI->getSuccessor(1))) {
+    IRBuilder<> Builder(BI);
----------------
skatkov wrote:
> skatkov wrote:
> > Can we move this transformation AFTER profitability check? The idea is that if we will not add this check to consideration, no need to do modification.
> > 
> > I guess it should work:
> > 1) Get operand idx of edge coming to loop
> > 2) use this operand number in getEdgeProbability
> > 3) if we pass check, do transformation if operand idx != 0.
> No operand idx but successor idx...
Good point, thanks!


================
Comment at: llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:1901
 
   IRBuilder<> B(ExprInsertPt);
   for (InductiveRangeCheck &IRC : RangeChecks) {
----------------
skatkov wrote:
> Is it Dead variable?
Yeap, removed https://reviews.llvm.org/D154391


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

https://reviews.llvm.org/D148244



More information about the llvm-commits mailing list