diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-06-23 18:42:15 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-06-23 18:42:15 +0000 |
commit | 3de6bad65f5264fb161bc0d1c54109a003d04326 (patch) | |
tree | 51fa8cc57786a7895995a56ee92362d53e9b9854 /llvm/test | |
parent | 19cee0d56c568a3f49b721dc3cd3d1674dc5698b (diff) | |
download | bcm5719-llvm-3de6bad65f5264fb161bc0d1c54109a003d04326.tar.gz bcm5719-llvm-3de6bad65f5264fb161bc0d1c54109a003d04326.zip |
[x86] fix value types for SBB transform (PR33560)
I'm not sure yet why this wouldn't fail in the simple case,
but clearly I used the wrong value type with:
https://reviews.llvm.org/rL306040
...and the bug manifests with:
https://bugs.llvm.org/show_bug.cgi?id=33560
llvm-svn: 306139
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/X86/sbb.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/sbb.ll b/llvm/test/CodeGen/X86/sbb.ll index 409af00d3b2..bc00fc7c66a 100644 --- a/llvm/test/CodeGen/X86/sbb.ll +++ b/llvm/test/CodeGen/X86/sbb.ll @@ -111,3 +111,28 @@ define i8 @i8_select_neg1_or_0_commuted_as_math(i8 %x) { ret i8 %add } +; Make sure we're creating nodes with the right value types. This would crash. +; https://bugs.llvm.org/show_bug.cgi?id=33560 + +define void @PR33560(i8 %x, i64 %y) { +; CHECK-LABEL: PR33560: +; CHECK: # BB#0: # %entry +; CHECK-NEXT: negb %dil +; CHECK-NEXT: sbbq %rax, %rax +; CHECK-NEXT: cmpq %rsi, %rax +; CHECK-NEXT: retq +entry: + %cmp1 = icmp eq i8 %x, 0 + %ext = zext i1 %cmp1 to i64 + %add = add i64 %ext, -1 + %cmp2 = icmp eq i64 %add, %y + br i1 %cmp2, label %end, label %else + +else: + %tmp7 = zext i1 %cmp1 to i8 + br label %end + +end: + ret void +} + |