Skip to content

Commit e775ba3

Browse files
committed
[SLP][NFC]Add some extra values to avoid constant expressions in the test.
1 parent 11ac97c commit e775ba3

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

llvm/test/Transforms/SLPVectorizer/AArch64/reorder-fmuladd-crash.ll

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
22
; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=aarch64-w32-windows-gnu | FileCheck %s
33

4-
define i32 @foo() {
4+
define i32 @foo(i32 %v1, double %v2) {
55
; CHECK-LABEL: @foo(
66
; CHECK-NEXT: entry:
7+
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> <i32 poison, i32 undef>, i32 [[V1:%.*]], i32 0
8+
; CHECK-NEXT: [[TMP1:%.*]] = sitofp <2 x i32> [[TMP0]] to <2 x double>
9+
; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x double> [[TMP1]], <2 x double> poison, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
710
; CHECK-NEXT: br label [[FOR_COND15_PREHEADER:%.*]]
811
; CHECK: for.cond15.preheader:
912
; CHECK-NEXT: br label [[IF_END:%.*]]
@@ -13,21 +16,24 @@ define i32 @foo() {
1316
; CHECK-NEXT: br label [[FOR_COND15:%.*]]
1417
; CHECK: for.end39:
1518
; CHECK-NEXT: switch i32 undef, label [[DO_BODY:%.*]] [
16-
; CHECK-NEXT: i32 0, label [[SW_BB:%.*]]
17-
; CHECK-NEXT: i32 1, label [[SW_BB195:%.*]]
19+
; CHECK-NEXT: i32 0, label [[SW_BB:%.*]]
20+
; CHECK-NEXT: i32 1, label [[SW_BB195:%.*]]
1821
; CHECK-NEXT: ]
1922
; CHECK: sw.bb:
2023
; CHECK-NEXT: [[ARRAYIDX43:%.*]] = getelementptr inbounds [4 x [2 x double]], ptr undef, i32 0, i64 1, i64 0
21-
; CHECK-NEXT: [[TMP1:%.*]] = load <4 x double>, ptr [[ARRAYIDX43]], align 8
22-
; CHECK-NEXT: [[TMP2:%.*]] = fmul <4 x double> [[TMP1]], <double 0x7FF8000000000000, double 0x7FF8000000000000, double 0x7FF8000000000000, double 0x7FF8000000000000>
23-
; CHECK-NEXT: [[TMP3:%.*]] = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> undef, <4 x double> zeroinitializer, <4 x double> [[TMP2]])
24+
; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x double> <double poison, double undef>, double [[V2:%.*]], i32 0
25+
; CHECK-NEXT: [[TMP4:%.*]] = fmul <2 x double> [[TMP3]], [[TMP1]]
26+
; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x double> [[TMP4]], <2 x double> poison, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
27+
; CHECK-NEXT: [[TMP6:%.*]] = load <4 x double>, ptr [[ARRAYIDX43]], align 8
28+
; CHECK-NEXT: [[TMP7:%.*]] = fmul <4 x double> [[TMP6]], [[TMP5]]
29+
; CHECK-NEXT: [[TMP8:%.*]] = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> undef, <4 x double> [[TMP2]], <4 x double> [[TMP7]])
2430
; CHECK-NEXT: br label [[SW_EPILOG:%.*]]
2531
; CHECK: sw.bb195:
2632
; CHECK-NEXT: br label [[SW_EPILOG]]
2733
; CHECK: do.body:
2834
; CHECK-NEXT: unreachable
2935
; CHECK: sw.epilog:
30-
; CHECK-NEXT: [[TMP4:%.*]] = phi <4 x double> [ undef, [[SW_BB195]] ], [ [[TMP3]], [[SW_BB]] ]
36+
; CHECK-NEXT: [[TMP9:%.*]] = phi <4 x double> [ undef, [[SW_BB195]] ], [ [[TMP8]], [[SW_BB]] ]
3137
; CHECK-NEXT: ret i32 undef
3238
; CHECK: if.end.1:
3339
; CHECK-NEXT: br label [[FOR_COND15_1:%.*]]
@@ -36,7 +42,7 @@ define i32 @foo() {
3642
;
3743
entry:
3844
%conv = sitofp i32 undef to double
39-
%conv2 = sitofp i32 undef to double
45+
%conv2 = sitofp i32 %v1 to double
4046
br label %for.cond15.preheader
4147

4248
for.cond15.preheader: ; preds = %for.cond15.1, %entry
@@ -63,7 +69,7 @@ sw.bb: ; preds = %for.end39
6369
%2 = load double, ptr %arrayidx51, align 8
6470
%arrayidx58 = getelementptr inbounds [4 x [2 x double]], ptr undef, i32 0, i64 1, i64 1
6571
%3 = load double, ptr %arrayidx58, align 8
66-
%mul = fmul double undef, %conv2
72+
%mul = fmul double %v2, %conv2
6773
%mul109 = fmul double undef, %conv
6874
%mul143 = fmul double %0, %mul
6975
%4 = call double @llvm.fmuladd.f64(double undef, double %conv2, double %mul143)

0 commit comments

Comments
 (0)