[PATCH] D119488: [SCEV] Extend `i1 cond ? i1 x : i1 y` (where either x or y is a constant integer) to arbitrary-sized integers

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 12:06:44 PST 2022


nikic added inline comments.


================
Comment at: llvm/test/Analysis/ScalarEvolution/increasing-or-decreasing-iv.ll:14
 ; CHECK-NEXT:    %iv = phi i32 [ %start, %entry ], [ %iv.next, %loop ]
-; CHECK-NEXT:    --> {%start,+,%step}<%loop> U: [0,128) S: [0,128) Exits: ((127 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
+; CHECK-NEXT:    --> {(127 + (-127 umin (-1 + (-1 * (sext i1 %c to i32))<nsw>)<nsw>)),+,(-1 + (2 umin (-1 + (-1 * (sext i1 %c to i32))<nsw>)<nsw>))<nsw>}<%loop> U: full-set S: full-set Exits: ((127 * (2 umin (-1 + (-1 * (sext i1 %c to i32))<nsw>)<nsw>))<nuw><nsw> + (-127 umin (-1 + (-1 * (sext i1 %c to i32))<nsw>)<nsw>)) LoopDispositions: { %loop: Computable }
 ; CHECK-NEXT:    %iv.next = add i32 %iv, %step
----------------
It looks like the ranges computed in this file regress. You probably need to update the getRangeViaFactoring() code, which assumes that the selects here will be SCEVUnknowns.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119488



More information about the llvm-commits mailing list