[PATCH] D19455: InstCombine: Reduce trunc (shl x, K) width.
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri May 27 16:26:58 PDT 2016
arsenm added inline comments.
================
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)))) {
----------------
majnemer wrote:
> You don't seem to check if the dest type is legal.
This is handled by the above ShouldChangeType
http://reviews.llvm.org/D19455
More information about the llvm-commits
mailing list