[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
Fri Jun 9 01:35:48 PDT 2023


vedant-amd added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:7911
+
       if (L && L->getOpcode() == Instruction::Shl) {
         // X = Shl A, n
----------------
nikic wrote:
> We already have code to handle the general shl+ashr pattern here, including for the case where n and m are not the same. We should reuse the same code. For your pattern, we'd just have an extra add at the start.
That could be done, but it would be a major refactoring. I will post a patch anyways.


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