[PATCH] D19455: InstCombine: Reduce trunc (shl x, K) width.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 15:41:27 PDT 2016


majnemer added a subscriber: majnemer.

================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:579-580
@@ +578,4 @@
+
+    // Transform "trunc (shl X, cst)" -> "shl (trunc X), cst" so long as the dest
+    // type isn't non-native and cst < size / 2
+    if (match(Src, m_Shl(m_Value(A), m_ConstantInt(Cst)))) {
----------------
You don't seem to check if the dest type is legal.


http://reviews.llvm.org/D19455





More information about the llvm-commits mailing list