diff options
| author | Elena Demikhovsky <elena.demikhovsky@intel.com> | 2016-09-07 20:54:33 +0000 |
|---|---|---|
| committer | Elena Demikhovsky <elena.demikhovsky@intel.com> | 2016-09-07 20:54:33 +0000 |
| commit | dcc86d5bb60baf79d8875a4b0b0d36902d542fc3 (patch) | |
| tree | cd7e0f070d8310e2027981009347b5639204bdb6 /llvm/test | |
| parent | def931e76a3dab88332a537e613d2b4c7a8edad1 (diff) | |
| download | bcm5719-llvm-dcc86d5bb60baf79d8875a4b0b0d36902d542fc3.tar.gz bcm5719-llvm-dcc86d5bb60baf79d8875a4b0b0d36902d542fc3.zip | |
Shift-left (ISD::SHL) operation crashes on "DAG Legalization" phase.
https://llvm.org/bugs/show_bug.cgi?id=29058.
While node legalization we tried to legalize its operands.
If an operand node is replaced during legalization the user node may be destroyed.
Differential Revision: https://reviews.llvm.org/D24244
llvm-svn: 280862
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/shl-crash-on-legalize.ll | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/shl-crash-on-legalize.ll b/llvm/test/CodeGen/X86/shl-crash-on-legalize.ll new file mode 100644 index 00000000000..2029bae8c46 --- /dev/null +++ b/llvm/test/CodeGen/X86/shl-crash-on-legalize.ll @@ -0,0 +1,33 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +;RUN: llc < %s | FileCheck %s + +; This test case failed on legalization of "shl" node. PR29058. + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@structMember = external local_unnamed_addr global i64, align 8 + +; Function Attrs: norecurse nounwind uwtable +define i32 @_Z3foov() local_unnamed_addr #0 { +; CHECK-LABEL: _Z3foov: +; CHECK: # BB#0: # %entry +; CHECK-NEXT: movq %rax, {{.*}}(%rip) +; CHECK-NEXT: retq +entry: + %bool_1 = icmp ne i8 undef, 0 + %bool_2 = icmp eq i8 undef, 0 + %0 = select i1 %bool_2, i32 2147483646, i32 undef + %or_1 = select i1 %bool_1, i32 undef, i32 -1 + %shl_1 = shl i32 %0, %or_1 + %conv = zext i32 %shl_1 to i64 + store i64 %conv, i64* @structMember, align 8 + %tmp = select i1 %bool_2, i32 2147483646, i32 undef + %lnot = icmp eq i8 undef, 0 + %or_2 = select i1 %lnot, i32 -1, i32 undef + %shl_2 = shl i32 %tmp, %or_2 + ret i32 %shl_2 +} + +attributes #0 = { norecurse nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } + |

