[PATCH] D68189: [InstCombine] recognize popcount implemented in hacker's delight.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 02:00:47 PDT 2019


shchenz marked 3 inline comments as done.
shchenz added inline comments.


================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:270
+  bool IsType32 = I.getType()->isIntegerTy(32);
+  uint16_t FinalShiftConst = IsType32 ? 24 : 56;
+  uint64_t MulConst = IsType32 ? 0x01010101 : 0x0101010101010101;
----------------
xbolva00 wrote:
> Type size - 8?
When type size is 8, we don't need the final `lshr`, so we can not do it in instcombine for opcode `lshr`,  but we can still do it based on final `mul`.
Currently I left it as a follow-up issue until a real world case found. Hope this is ok.


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

https://reviews.llvm.org/D68189





More information about the llvm-commits mailing list