mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
[SLPVectorizer] minimize tests and auto-generate full checks; NFC
llvm-svn: 317437
This commit is contained in:
parent
01b828cb80
commit
bbeb11e732
@ -11,133 +11,127 @@ declare double @sqrt(double)
|
|||||||
declare i64 @round(i64)
|
declare i64 @round(i64)
|
||||||
|
|
||||||
|
|
||||||
; CHECK: sin_libm
|
define void @sin_libm(double* %a, double* %b) {
|
||||||
; CHECK: call <2 x double> @llvm.sin.v2f64
|
; CHECK-LABEL: @sin_libm(
|
||||||
; CHECK: ret void
|
; CHECK-NEXT: [[TMP1:%.*]] = bitcast double* %a to <2 x double>*
|
||||||
define void @sin_libm(double* %a, double* %b, double* %c) {
|
; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, <2 x double>* [[TMP1]], align 8
|
||||||
entry:
|
; CHECK-NEXT: [[TMP3:%.*]] = call <2 x double> @llvm.sin.v2f64(<2 x double> [[TMP2]])
|
||||||
%i0 = load double, double* %a, align 8
|
; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* %b to <2 x double>*
|
||||||
%i1 = load double, double* %b, align 8
|
; CHECK-NEXT: store <2 x double> [[TMP3]], <2 x double>* [[TMP4]], align 8
|
||||||
%mul = fmul double %i0, %i1
|
; CHECK-NEXT: ret void
|
||||||
%call = tail call double @sin(double %mul) nounwind readnone
|
;
|
||||||
%arrayidx3 = getelementptr inbounds double, double* %a, i64 1
|
%a0 = load double, double* %a, align 8
|
||||||
%i3 = load double, double* %arrayidx3, align 8
|
%idx1 = getelementptr inbounds double, double* %a, i64 1
|
||||||
%arrayidx4 = getelementptr inbounds double, double* %b, i64 1
|
%a1 = load double, double* %idx1, align 8
|
||||||
%i4 = load double, double* %arrayidx4, align 8
|
%sin1 = tail call double @sin(double %a0) nounwind readnone
|
||||||
%mul5 = fmul double %i3, %i4
|
%sin2 = tail call double @sin(double %a1) nounwind readnone
|
||||||
%call5 = tail call double @sin(double %mul5) nounwind readnone
|
store double %sin1, double* %b, align 8
|
||||||
store double %call, double* %c, align 8
|
%idx2 = getelementptr inbounds double, double* %b, i64 1
|
||||||
%arrayidx5 = getelementptr inbounds double, double* %c, i64 1
|
store double %sin2, double* %idx2, align 8
|
||||||
store double %call5, double* %arrayidx5, align 8
|
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; CHECK: cos_libm
|
define void @cos_libm(double* %a, double* %b) {
|
||||||
; CHECK: call <2 x double> @llvm.cos.v2f64
|
; CHECK-LABEL: @cos_libm(
|
||||||
; CHECK: ret void
|
; CHECK-NEXT: [[TMP1:%.*]] = bitcast double* %a to <2 x double>*
|
||||||
define void @cos_libm(double* %a, double* %b, double* %c) {
|
; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, <2 x double>* [[TMP1]], align 8
|
||||||
entry:
|
; CHECK-NEXT: [[TMP3:%.*]] = call <2 x double> @llvm.cos.v2f64(<2 x double> [[TMP2]])
|
||||||
%i0 = load double, double* %a, align 8
|
; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* %b to <2 x double>*
|
||||||
%i1 = load double, double* %b, align 8
|
; CHECK-NEXT: store <2 x double> [[TMP3]], <2 x double>* [[TMP4]], align 8
|
||||||
%mul = fmul double %i0, %i1
|
; CHECK-NEXT: ret void
|
||||||
%call = tail call double @cos(double %mul) nounwind readnone
|
;
|
||||||
%arrayidx3 = getelementptr inbounds double, double* %a, i64 1
|
%a0 = load double, double* %a, align 8
|
||||||
%i3 = load double, double* %arrayidx3, align 8
|
%idx1 = getelementptr inbounds double, double* %a, i64 1
|
||||||
%arrayidx4 = getelementptr inbounds double, double* %b, i64 1
|
%a1 = load double, double* %idx1, align 8
|
||||||
%i4 = load double, double* %arrayidx4, align 8
|
%cos1 = tail call double @cos(double %a0) nounwind readnone
|
||||||
%mul5 = fmul double %i3, %i4
|
%cos2 = tail call double @cos(double %a1) nounwind readnone
|
||||||
%call5 = tail call double @cos(double %mul5) nounwind readnone
|
store double %cos1, double* %b, align 8
|
||||||
store double %call, double* %c, align 8
|
%idx2 = getelementptr inbounds double, double* %b, i64 1
|
||||||
%arrayidx5 = getelementptr inbounds double, double* %c, i64 1
|
store double %cos2, double* %idx2, align 8
|
||||||
store double %call5, double* %arrayidx5, align 8
|
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; CHECK: pow_libm
|
define void @pow_libm(double* %a, double* %b) {
|
||||||
; CHECK: call <2 x double> @llvm.pow.v2f64
|
; CHECK-LABEL: @pow_libm(
|
||||||
; CHECK: ret void
|
; CHECK-NEXT: [[TMP1:%.*]] = bitcast double* %a to <2 x double>*
|
||||||
define void @pow_libm(double* %a, double* %b, double* %c) {
|
; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, <2 x double>* [[TMP1]], align 8
|
||||||
entry:
|
; CHECK-NEXT: [[TMP3:%.*]] = call <2 x double> @llvm.pow.v2f64(<2 x double> [[TMP2]], <2 x double> [[TMP2]])
|
||||||
%i0 = load double, double* %a, align 8
|
; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* %b to <2 x double>*
|
||||||
%i1 = load double, double* %b, align 8
|
; CHECK-NEXT: store <2 x double> [[TMP3]], <2 x double>* [[TMP4]], align 8
|
||||||
%mul = fmul double %i0, %i1
|
; CHECK-NEXT: ret void
|
||||||
%call = tail call double @pow(double %mul,double %mul) nounwind readnone
|
;
|
||||||
%arrayidx3 = getelementptr inbounds double, double* %a, i64 1
|
%a0 = load double, double* %a, align 8
|
||||||
%i3 = load double, double* %arrayidx3, align 8
|
%idx1 = getelementptr inbounds double, double* %a, i64 1
|
||||||
%arrayidx4 = getelementptr inbounds double, double* %b, i64 1
|
%a1 = load double, double* %idx1, align 8
|
||||||
%i4 = load double, double* %arrayidx4, align 8
|
%pow1 = tail call double @pow(double %a0, double %a0) nounwind readnone
|
||||||
%mul5 = fmul double %i3, %i4
|
%pow2 = tail call double @pow(double %a1, double %a1) nounwind readnone
|
||||||
%call5 = tail call double @pow(double %mul5,double %mul5) nounwind readnone
|
store double %pow1, double* %b, align 8
|
||||||
store double %call, double* %c, align 8
|
%idx2 = getelementptr inbounds double, double* %b, i64 1
|
||||||
%arrayidx5 = getelementptr inbounds double, double* %c, i64 1
|
store double %pow2, double* %idx2, align 8
|
||||||
store double %call5, double* %arrayidx5, align 8
|
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define void @exp_libm(double* %a, double* %b) {
|
||||||
; CHECK: exp2_libm
|
; CHECK-LABEL: @exp_libm(
|
||||||
; CHECK: call <2 x double> @llvm.exp2.v2f64
|
; CHECK-NEXT: [[TMP1:%.*]] = bitcast double* %a to <2 x double>*
|
||||||
; CHECK: ret void
|
; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, <2 x double>* [[TMP1]], align 8
|
||||||
define void @exp2_libm(double* %a, double* %b, double* %c) {
|
; CHECK-NEXT: [[TMP3:%.*]] = call <2 x double> @llvm.exp2.v2f64(<2 x double> [[TMP2]])
|
||||||
entry:
|
; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* %b to <2 x double>*
|
||||||
%i0 = load double, double* %a, align 8
|
; CHECK-NEXT: store <2 x double> [[TMP3]], <2 x double>* [[TMP4]], align 8
|
||||||
%i1 = load double, double* %b, align 8
|
; CHECK-NEXT: ret void
|
||||||
%mul = fmul double %i0, %i1
|
;
|
||||||
%call = tail call double @exp2(double %mul) nounwind readnone
|
%a0 = load double, double* %a, align 8
|
||||||
%arrayidx3 = getelementptr inbounds double, double* %a, i64 1
|
%idx1 = getelementptr inbounds double, double* %a, i64 1
|
||||||
%i3 = load double, double* %arrayidx3, align 8
|
%a1 = load double, double* %idx1, align 8
|
||||||
%arrayidx4 = getelementptr inbounds double, double* %b, i64 1
|
%exp1 = tail call double @exp2(double %a0) nounwind readnone
|
||||||
%i4 = load double, double* %arrayidx4, align 8
|
%exp2 = tail call double @exp2(double %a1) nounwind readnone
|
||||||
%mul5 = fmul double %i3, %i4
|
store double %exp1, double* %b, align 8
|
||||||
%call5 = tail call double @exp2(double %mul5) nounwind readnone
|
%idx2 = getelementptr inbounds double, double* %b, i64 1
|
||||||
store double %call, double* %c, align 8
|
store double %exp2, double* %idx2, align 8
|
||||||
%arrayidx5 = getelementptr inbounds double, double* %c, i64 1
|
|
||||||
store double %call5, double* %arrayidx5, align 8
|
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define void @sqrt_libm(double* %a, double* %b) {
|
||||||
; CHECK: sqrt_libm
|
; CHECK-LABEL: @sqrt_libm(
|
||||||
; CHECK: call nnan <2 x double> @llvm.sqrt.v2f64
|
; CHECK-NEXT: [[TMP1:%.*]] = bitcast double* %a to <2 x double>*
|
||||||
; CHECK: ret void
|
; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, <2 x double>* [[TMP1]], align 8
|
||||||
define void @sqrt_libm(double* %a, double* %b, double* %c) {
|
; CHECK-NEXT: [[TMP3:%.*]] = call nnan <2 x double> @llvm.sqrt.v2f64(<2 x double> [[TMP2]])
|
||||||
entry:
|
; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* %b to <2 x double>*
|
||||||
%i0 = load double, double* %a, align 8
|
; CHECK-NEXT: store <2 x double> [[TMP3]], <2 x double>* [[TMP4]], align 8
|
||||||
%i1 = load double, double* %b, align 8
|
; CHECK-NEXT: ret void
|
||||||
%mul = fmul double %i0, %i1
|
;
|
||||||
%call = tail call nnan double @sqrt(double %mul) nounwind readnone
|
%a0 = load double, double* %a, align 8
|
||||||
%arrayidx3 = getelementptr inbounds double, double* %a, i64 1
|
%idx1 = getelementptr inbounds double, double* %a, i64 1
|
||||||
%i3 = load double, double* %arrayidx3, align 8
|
%a1 = load double, double* %idx1, align 8
|
||||||
%arrayidx4 = getelementptr inbounds double, double* %b, i64 1
|
%sqrt1 = tail call nnan double @sqrt(double %a0) nounwind readnone
|
||||||
%i4 = load double, double* %arrayidx4, align 8
|
%sqrt2 = tail call nnan double @sqrt(double %a1) nounwind readnone
|
||||||
%mul5 = fmul double %i3, %i4
|
store double %sqrt1, double* %b, align 8
|
||||||
%call5 = tail call nnan double @sqrt(double %mul5) nounwind readnone
|
%idx2 = getelementptr inbounds double, double* %b, i64 1
|
||||||
store double %call, double* %c, align 8
|
store double %sqrt2, double* %idx2, align 8
|
||||||
%arrayidx5 = getelementptr inbounds double, double* %c, i64 1
|
|
||||||
store double %call5, double* %arrayidx5, align 8
|
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
; Negative test case
|
; Negative test case
|
||||||
; CHECK: round_custom
|
define void @round_custom(i64* %a, i64* %b) {
|
||||||
; CHECK-NOT: load <4 x i64>
|
; CHECK-LABEL: @round_custom(
|
||||||
; CHECK: ret void
|
; CHECK-NEXT: [[A0:%.*]] = load i64, i64* %a, align 8
|
||||||
define void @round_custom(i64* %a, i64* %b, i64* %c) {
|
; CHECK-NEXT: [[IDX1:%.*]] = getelementptr inbounds i64, i64* %a, i64 1
|
||||||
entry:
|
; CHECK-NEXT: [[A1:%.*]] = load i64, i64* [[IDX1]], align 8
|
||||||
%i0 = load i64, i64* %a, align 8
|
; CHECK-NEXT: [[ROUND1:%.*]] = tail call i64 @round(i64 [[A0]]) #2
|
||||||
%i1 = load i64, i64* %b, align 8
|
; CHECK-NEXT: [[ROUND2:%.*]] = tail call i64 @round(i64 [[A1]]) #2
|
||||||
%mul = mul i64 %i0, %i1
|
; CHECK-NEXT: store i64 [[ROUND1]], i64* %b, align 8
|
||||||
%call = tail call i64 @round(i64 %mul) nounwind readnone
|
; CHECK-NEXT: [[IDX2:%.*]] = getelementptr inbounds i64, i64* %b, i64 1
|
||||||
%arrayidx3 = getelementptr inbounds i64, i64* %a, i64 1
|
; CHECK-NEXT: store i64 [[ROUND2]], i64* [[IDX2]], align 8
|
||||||
%i3 = load i64, i64* %arrayidx3, align 8
|
; CHECK-NEXT: ret void
|
||||||
%arrayidx4 = getelementptr inbounds i64, i64* %b, i64 1
|
;
|
||||||
%i4 = load i64, i64* %arrayidx4, align 8
|
%a0 = load i64, i64* %a, align 8
|
||||||
%mul5 = mul i64 %i3, %i4
|
%idx1 = getelementptr inbounds i64, i64* %a, i64 1
|
||||||
%call5 = tail call i64 @round(i64 %mul5) nounwind readnone
|
%a1 = load i64, i64* %idx1, align 8
|
||||||
store i64 %call, i64* %c, align 8
|
%round1 = tail call i64 @round(i64 %a0) nounwind readnone
|
||||||
%arrayidx5 = getelementptr inbounds i64, i64* %c, i64 1
|
%round2 = tail call i64 @round(i64 %a1) nounwind readnone
|
||||||
store i64 %call5, i64* %arrayidx5, align 8
|
store i64 %round1, i64* %b, align 8
|
||||||
|
%idx2 = getelementptr inbounds i64, i64* %b, i64 1
|
||||||
|
store i64 %round2, i64* %idx2, align 8
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user