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

Vedant Paranjape via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 04:49:29 PDT 2023


vedant-amd added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:7899
+            // Add constant should be shifted right by AShr amount.
+            APInt AddOperand = AddOperandCI->getValue().ashr(AShrAmt);
+            const SCEV *AddConstant =
----------------
vedant-amd wrote:
> nikic wrote:
> > We should verify that the add constant has lowest n bits unset, to make reassociation valid. It doesn't matter if n==m, but it matters if n!=m.
> Do you mean to say check for unset bits from nth bit to the mth bit ? because anything lower than mth bit will anyways be irrelevant once we right shift by m amount.
I tried to understand this, I am not able to make sense of it. Can you explain further what you mean to say ?


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