[llvm] r290702 - [InstCombine] Fix some of the AVX-512 scalar arithmetic test cases to do a better job of testing what they intended to test.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 28 18:29:05 PST 2016
Author: ctopper
Date: Wed Dec 28 20:29:04 2016
New Revision: 290702
URL: http://llvm.org/viewvc/llvm-project?rev=290702&view=rev
Log:
[InstCombine] Fix some of the AVX-512 scalar arithmetic test cases to do a better job of testing what they intended to test.
The accidentally had trivially dead code. Also needed to adjust the rounding mode to not CUR_DIRECTION so the intrinsics don't get converted to native operations before going through SimplifyDemandedVectorElts.
Modified:
llvm/trunk/test/Transforms/InstCombine/x86-avx512.ll
Modified: llvm/trunk/test/Transforms/InstCombine/x86-avx512.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/x86-avx512.ll?rev=290702&r1=290701&r2=290702&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/x86-avx512.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/x86-avx512.ll Wed Dec 28 20:29:04 2016
@@ -71,10 +71,10 @@ define float @test_add_ss_1(float %a, fl
%3 = insertelement <4 x float> %2, float 2.000000e+00, i32 2
%4 = insertelement <4 x float> %3, float 3.000000e+00, i32 3
%5 = insertelement <4 x float> undef, float %b, i32 0
- %6 = insertelement <4 x float> %1, float 4.000000e+00, i32 1
- %7 = insertelement <4 x float> %2, float 5.000000e+00, i32 2
- %8 = insertelement <4 x float> %3, float 6.000000e+00, i32 3
- %9 = tail call <4 x float> @llvm.x86.avx512.mask.add.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 4)
+ %6 = insertelement <4 x float> %5, float 4.000000e+00, i32 1
+ %7 = insertelement <4 x float> %6, float 5.000000e+00, i32 2
+ %8 = insertelement <4 x float> %7, float 6.000000e+00, i32 3
+ %9 = tail call <4 x float> @llvm.x86.avx512.mask.add.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 8)
%10 = extractelement <4 x float> %9, i32 1
ret float %10
}
@@ -138,8 +138,8 @@ define double @test_add_sd_1(double %a,
%1 = insertelement <2 x double> undef, double %a, i32 0
%2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
%3 = insertelement <2 x double> undef, double %b, i32 0
- %4 = insertelement <2 x double> %1, double 2.000000e+00, i32 1
- %5 = tail call <2 x double> @llvm.x86.avx512.mask.add.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 4)
+ %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
+ %5 = tail call <2 x double> @llvm.x86.avx512.mask.add.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 8)
%6 = extractelement <2 x double> %5, i32 1
ret double %6
}
@@ -213,10 +213,10 @@ define float @test_sub_ss_1(float %a, fl
%3 = insertelement <4 x float> %2, float 2.000000e+00, i32 2
%4 = insertelement <4 x float> %3, float 3.000000e+00, i32 3
%5 = insertelement <4 x float> undef, float %b, i32 0
- %6 = insertelement <4 x float> %1, float 4.000000e+00, i32 1
- %7 = insertelement <4 x float> %2, float 5.000000e+00, i32 2
- %8 = insertelement <4 x float> %3, float 6.000000e+00, i32 3
- %9 = tail call <4 x float> @llvm.x86.avx512.mask.sub.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 4)
+ %6 = insertelement <4 x float> %5, float 4.000000e+00, i32 1
+ %7 = insertelement <4 x float> %6, float 5.000000e+00, i32 2
+ %8 = insertelement <4 x float> %7, float 6.000000e+00, i32 3
+ %9 = tail call <4 x float> @llvm.x86.avx512.mask.sub.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 8)
%10 = extractelement <4 x float> %9, i32 1
ret float %10
}
@@ -280,8 +280,8 @@ define double @test_sub_sd_1(double %a,
%1 = insertelement <2 x double> undef, double %a, i32 0
%2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
%3 = insertelement <2 x double> undef, double %b, i32 0
- %4 = insertelement <2 x double> %1, double 2.000000e+00, i32 1
- %5 = tail call <2 x double> @llvm.x86.avx512.mask.sub.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 4)
+ %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
+ %5 = tail call <2 x double> @llvm.x86.avx512.mask.sub.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 8)
%6 = extractelement <2 x double> %5, i32 1
ret double %6
}
@@ -355,10 +355,10 @@ define float @test_mul_ss_1(float %a, fl
%3 = insertelement <4 x float> %2, float 2.000000e+00, i32 2
%4 = insertelement <4 x float> %3, float 3.000000e+00, i32 3
%5 = insertelement <4 x float> undef, float %b, i32 0
- %6 = insertelement <4 x float> %1, float 4.000000e+00, i32 1
- %7 = insertelement <4 x float> %2, float 5.000000e+00, i32 2
- %8 = insertelement <4 x float> %3, float 6.000000e+00, i32 3
- %9 = tail call <4 x float> @llvm.x86.avx512.mask.mul.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 4)
+ %6 = insertelement <4 x float> %5, float 4.000000e+00, i32 1
+ %7 = insertelement <4 x float> %6, float 5.000000e+00, i32 2
+ %8 = insertelement <4 x float> %7, float 6.000000e+00, i32 3
+ %9 = tail call <4 x float> @llvm.x86.avx512.mask.mul.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 8)
%10 = extractelement <4 x float> %9, i32 1
ret float %10
}
@@ -422,8 +422,8 @@ define double @test_mul_sd_1(double %a,
%1 = insertelement <2 x double> undef, double %a, i32 0
%2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
%3 = insertelement <2 x double> undef, double %b, i32 0
- %4 = insertelement <2 x double> %1, double 2.000000e+00, i32 1
- %5 = tail call <2 x double> @llvm.x86.avx512.mask.mul.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 4)
+ %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
+ %5 = tail call <2 x double> @llvm.x86.avx512.mask.mul.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 8)
%6 = extractelement <2 x double> %5, i32 1
ret double %6
}
@@ -497,10 +497,10 @@ define float @test_div_ss_1(float %a, fl
%3 = insertelement <4 x float> %2, float 2.000000e+00, i32 2
%4 = insertelement <4 x float> %3, float 3.000000e+00, i32 3
%5 = insertelement <4 x float> undef, float %b, i32 0
- %6 = insertelement <4 x float> %1, float 4.000000e+00, i32 1
- %7 = insertelement <4 x float> %2, float 5.000000e+00, i32 2
- %8 = insertelement <4 x float> %3, float 6.000000e+00, i32 3
- %9 = tail call <4 x float> @llvm.x86.avx512.mask.div.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 4)
+ %6 = insertelement <4 x float> %5, float 4.000000e+00, i32 1
+ %7 = insertelement <4 x float> %6, float 5.000000e+00, i32 2
+ %8 = insertelement <4 x float> %7, float 6.000000e+00, i32 3
+ %9 = tail call <4 x float> @llvm.x86.avx512.mask.div.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 8)
%10 = extractelement <4 x float> %9, i32 1
ret float %10
}
@@ -564,8 +564,8 @@ define double @test_div_sd_1(double %a,
%1 = insertelement <2 x double> undef, double %a, i32 0
%2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
%3 = insertelement <2 x double> undef, double %b, i32 0
- %4 = insertelement <2 x double> %1, double 2.000000e+00, i32 1
- %5 = tail call <2 x double> @llvm.x86.avx512.mask.div.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 4)
+ %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
+ %5 = tail call <2 x double> @llvm.x86.avx512.mask.div.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 8)
%6 = extractelement <2 x double> %5, i32 1
ret double %6
}
@@ -605,10 +605,10 @@ define float @test_max_ss_1(float %a, fl
%3 = insertelement <4 x float> %2, float 2.000000e+00, i32 2
%4 = insertelement <4 x float> %3, float 3.000000e+00, i32 3
%5 = insertelement <4 x float> undef, float %b, i32 0
- %6 = insertelement <4 x float> %1, float 4.000000e+00, i32 1
- %7 = insertelement <4 x float> %2, float 5.000000e+00, i32 2
- %8 = insertelement <4 x float> %3, float 6.000000e+00, i32 3
- %9 = tail call <4 x float> @llvm.x86.avx512.mask.max.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 4)
+ %6 = insertelement <4 x float> %5, float 4.000000e+00, i32 1
+ %7 = insertelement <4 x float> %6, float 5.000000e+00, i32 2
+ %8 = insertelement <4 x float> %7, float 6.000000e+00, i32 3
+ %9 = tail call <4 x float> @llvm.x86.avx512.mask.max.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 8)
%10 = extractelement <4 x float> %9, i32 1
ret float %10
}
@@ -642,8 +642,8 @@ define double @test_max_sd_1(double %a,
%1 = insertelement <2 x double> undef, double %a, i32 0
%2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
%3 = insertelement <2 x double> undef, double %b, i32 0
- %4 = insertelement <2 x double> %1, double 2.000000e+00, i32 1
- %5 = tail call <2 x double> @llvm.x86.avx512.mask.max.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 4)
+ %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
+ %5 = tail call <2 x double> @llvm.x86.avx512.mask.max.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 8)
%6 = extractelement <2 x double> %5, i32 1
ret double %6
}
@@ -683,10 +683,10 @@ define float @test_min_ss_1(float %a, fl
%3 = insertelement <4 x float> %2, float 2.000000e+00, i32 2
%4 = insertelement <4 x float> %3, float 3.000000e+00, i32 3
%5 = insertelement <4 x float> undef, float %b, i32 0
- %6 = insertelement <4 x float> %1, float 4.000000e+00, i32 1
- %7 = insertelement <4 x float> %2, float 5.000000e+00, i32 2
- %8 = insertelement <4 x float> %3, float 6.000000e+00, i32 3
- %9 = tail call <4 x float> @llvm.x86.avx512.mask.min.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 4)
+ %6 = insertelement <4 x float> %5, float 4.000000e+00, i32 1
+ %7 = insertelement <4 x float> %6, float 5.000000e+00, i32 2
+ %8 = insertelement <4 x float> %7, float 6.000000e+00, i32 3
+ %9 = tail call <4 x float> @llvm.x86.avx512.mask.min.ss.round(<4 x float> %4, <4 x float> %8, <4 x float> undef, i8 -1, i32 8)
%10 = extractelement <4 x float> %9, i32 1
ret float %10
}
@@ -720,8 +720,8 @@ define double @test_min_sd_1(double %a,
%1 = insertelement <2 x double> undef, double %a, i32 0
%2 = insertelement <2 x double> %1, double 1.000000e+00, i32 1
%3 = insertelement <2 x double> undef, double %b, i32 0
- %4 = insertelement <2 x double> %1, double 2.000000e+00, i32 1
- %5 = tail call <2 x double> @llvm.x86.avx512.mask.min.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 4)
+ %4 = insertelement <2 x double> %3, double 2.000000e+00, i32 1
+ %5 = tail call <2 x double> @llvm.x86.avx512.mask.min.sd.round(<2 x double> %2, <2 x double> %4, <2 x double> undef, i8 -1, i32 8)
%6 = extractelement <2 x double> %5, i32 1
ret double %6
}
More information about the llvm-commits
mailing list