[PATCH] D32240: InstCombineCast AShr transformation

Mark Schimmel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 15:06:06 PDT 2017


marksl updated this revision to Diff 95832.
marksl added a comment.

Added test case


https://reviews.llvm.org/D32240

Files:
  cast.ll


Index: cast.ll
===================================================================
--- cast.ll
+++ cast.ll
@@ -1432,3 +1432,13 @@
   %tmp6 = bitcast <4 x half> <half undef, half undef, half undef, half 0xH3C00> to <2 x i32>
   ret <2 x i32> %tmp6
 }
+
+define i32 @test91(i32 %i) {
+; CHECK-LABEL: @test91(
+; CHECK: ashr
+; CHECK: ret
+  %a = lshr i32 %i, 16
+  %b = trunc i32 %a to i16
+  %c = sext i16 %b to i32
+  ret i32 %c
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32240.95832.patch
Type: text/x-patch
Size: 432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170419/da7d4d04/attachment.bin>


More information about the llvm-commits mailing list