[PATCH] D152278: [SCEV] Compute SCEV for ashr(add(shl(x, n), c), m) instr triplet

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 14:09:41 PDT 2023


efriedma added inline comments.


================
Comment at: llvm/test/Analysis/ScalarEvolution/sext-add-inreg-unequal.ll:12
+; CHECK-NEXT:    %ashr = ashr exact i64 %shl, 8
+; CHECK-NEXT:    --> (sext i56 (4 * (trunc i64 %a to i56)) to i64) U: [0,-3) S: [-36028797018963968,36028797018963965)
+; CHECK-NEXT:  Determining loop execution counts for: @test00
----------------
How is this equivalent?  Say %a is zero; the original function returns 1, this SCEV expression returns 0.  (I think maybe the "ashr" of the constant is shifting by 10, instead of shifting by 8?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152278



More information about the llvm-commits mailing list