[PATCH] D88316: [InstCombine] recognizeBSwapOrBitReverseIdiom - recognise zext(bswap(trunc(x))) patterns (PR39793)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 10:44:14 PDT 2020


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:3027-3029
+  if (isPowerOf2_32(BitProvenance.size())) {
+    // Keep halving the demanded width while the upper half is zero.
+    while (BitProvenance.size() > 2) {
----------------
Why is this restricted to powers of two?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88316



More information about the llvm-commits mailing list