[PATCH] D113291: [AggressiveInstCombine] Lower Table Based CTTZ

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 28 01:15:09 PDT 2022


dmgreen accepted this revision.
dmgreen added a comment.

Thanks for the updates. LGTM



================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:604
+
+  // Shift should extract top 5..7 bits.
+  if (InputBits - Log2_32(InputBits) != ShiftConst &&
----------------
craig.topper wrote:
> If we’re only handling 32 and 64, this comment should be 5..6
I believe it is 7 because the table can be twice the size. Hence the -1 in the formula below. See the ctz2 test.


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

https://reviews.llvm.org/D113291



More information about the llvm-commits mailing list