[PATCH] D22238: Reapply "InstCombine: Reduce trunc (shl x, K) width."

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 12:22:41 PDT 2016


arsenm added inline comments.

================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:551
@@ +550,3 @@
+    // dest type isn't non-native and cst < dest size.
+    if (match(Src, m_Shl(m_Value(A), m_ConstantInt(Cst))) &&
+        !match(A, m_Shr(m_Value(), m_Constant()))) {
----------------
majnemer wrote:
> Consider using `m_APInt` here, it handles vector splats.
This just adds more clutter without changing the other code before this since it's re-using Cst and the whole block is already skipped for !isa<IntegerType>


https://reviews.llvm.org/D22238





More information about the llvm-commits mailing list