[PATCH] D99687: [SCEV] Compute ranges for ashr/lshr recurrences

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 31 14:28:34 PDT 2021


reames added inline comments.


================
Comment at: llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll:580
 ; CHECK-NEXT:    %iv.lshr = phi i8 [ -1, %entry ], [ %iv.lshr.next, %loop ]
-; CHECK-NEXT:    --> %iv.lshr U: [-1,-128) S: [-1,-128) Exits: 15 LoopDispositions: { %loop: Variant }
+; CHECK-NEXT:    --> %iv.lshr U: [15,0) S: [-1,-128) Exits: 15 LoopDispositions: { %loop: Variant }
 ; CHECK-NEXT:    %iv.next = add i64 %iv, 1
----------------
The choice of the inverted range here looks odd.  I dug into this a bit, and am suspecting a generic bug in the preferred range mechanism in ConstantRange.  The key point is that we're making a heuristic driven chosen between two possible ranges, and we simply happen to pick the other one after this patch.


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

https://reviews.llvm.org/D99687



More information about the llvm-commits mailing list