[PATCH] D36395: [InstCombine] narrow rotate left/right patterns to eliminate zext/trunc (PR34046)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 16:40:39 PDT 2017


craig.topper added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:484
+  Type *DestTy = Trunc.getType();
+  unsigned NarrowWidth = DestTy->getScalarSizeInBits();
+  if (NarrowWidth != *BitWidthC)
----------------
Since we don't support vectors here. Should this be getIntegerBitWidth()?


================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:485
+  unsigned NarrowWidth = DestTy->getScalarSizeInBits();
+  if (NarrowWidth != *BitWidthC)
+    return nullptr;
----------------
Could you have used m_SpecificInt in the matchers above? to avoid this separate check?


https://reviews.llvm.org/D36395





More information about the llvm-commits mailing list