[PATCH] D149786: [SCEV] Try smaller ZExts when using loop guard info.

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 21:15:26 PDT 2023


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:14941
+            return SE.getZeroExtendExpr(I->second, Ty);
+          Bitwidth = Bitwidth / 2;
+        }
----------------
If `Bitwidth` is `8 * 9 = 72`, at some point you will end up with `BitWidth = 9` and enter this loop, and then on division you will lose a meaningful last bit. Was it your intention?

I think `Bitwidth % 8 == 0` thingy should be in `while` loop.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149786



More information about the llvm-commits mailing list