[PATCH] D91038: [LoopIdiom] Introduce 'left-shift until bittest' idiom

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 14:17:41 PST 2020


craig.topper added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:2069
+///     %x.masked.numactivebits = sub i32 32, %x.masked.numleadingzeros
+///     %x.masked.leadingonepos = sub i32 %x.masked.numactivebits, 1
+///     %backedgetakencount = sub i32 %bitpos, %x.masked.leadingonepos
----------------
Should this be add -1 to match the code?


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:2166
+      XMaskedNumActiveBits, Constant::getAllOnesValue(BitMask->getType()),
+      XMasked->getName() + ".numleadingonepos");
+
----------------
This is called ".leadingonepos" in the comment block.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91038



More information about the llvm-commits mailing list