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

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 20:00:48 PDT 2016


majnemer added a comment.

Sorry for the delay, I forgot to hit submit...


================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:579
@@ +578,3 @@
+    // Transform "trunc (shl X, cst)" -> "shl (trunc X), cst" so long as the
+    // dest type isn't non-native and cst < dest size.
+    if (match(Src, m_Shl(m_Value(A), m_ConstantInt(Cst))) &&
----------------
> isn't non-native

Can we simplify that down to "native" ?

================
Comment at: test/Transforms/InstCombine/cast.ll:990
@@ -989,3 +989,3 @@
   %q = bitcast double* %p to i8*
-  %pp = getelementptr inbounds i8, i8* %q, i64 %o
+  %pp = getelementptr i8, i8* %q, i64 %o
   %r = bitcast i8* %pp to double*
----------------
This seems like a pessimization.  Any ideas?


https://reviews.llvm.org/D22238





More information about the llvm-commits mailing list