diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-10-25 15:16:39 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-10-25 15:16:39 +0000 |
commit | d59f7f9047fd7996ba6043004d4c190dae6d4611 (patch) | |
tree | a2ce109fd5e73c224612a4a46a6ddeece4c4886d /llvm/test/Transforms/InstCombine/icmp.ll | |
parent | bd449c27d5097e4f79e7aa694739fe829f4a1cb8 (diff) | |
download | bcm5719-llvm-d59f7f9047fd7996ba6043004d4c190dae6d4611.tar.gz bcm5719-llvm-d59f7f9047fd7996ba6043004d4c190dae6d4611.zip |
[InstCombine] add test and code comment to show potentially misguided icmp trunc transform
llvm-svn: 285075
Diffstat (limited to 'llvm/test/Transforms/InstCombine/icmp.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index da5913e3821..57e02a47e55 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/test/Transforms/InstCombine/icmp.ll @@ -1208,6 +1208,19 @@ define i1 @icmp_shl16(i32 %x) { ret i1 %cmp } +; FIXME: We shouldn't be creating illegal types like i15 in InstCombine. + +define i1 @icmp_shl17(i32 %x) { +; CHECK-LABEL: @icmp_shl17( +; CHECK-NEXT: [[TMP1:%.*]] = trunc i32 %x to i15 +; CHECK-NEXT: [[CMP:%.*]] = icmp slt i15 [[TMP1]], 18 +; CHECK-NEXT: ret i1 [[CMP]] +; + %shl = shl i32 %x, 17 + %cmp = icmp slt i32 %shl, 2359296 + ret i1 %cmp +} + define <2 x i1> @icmp_shl16_vec(<2 x i32> %x) { ; CHECK-LABEL: @icmp_shl16_vec( ; CHECK-NEXT: [[TMP1:%.*]] = trunc <2 x i32> %x to <2 x i16> |