summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-03-05 08:38:57 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-03-05 08:38:57 +0000
commitbcb26d6880b246d29ec716e5cd6aabbb4703bfac (patch)
treeac35bcf94679bc0ad97767836fb6d0aea7a86ab8 /llvm/test
parent35b3dbc4a3edd5e48c7913e11e4f9e3aa05b8e98 (diff)
downloadbcm5719-llvm-bcb26d6880b246d29ec716e5cd6aabbb4703bfac.tar.gz
bcm5719-llvm-bcb26d6880b246d29ec716e5cd6aabbb4703bfac.zip
[InstCombine] Fix an assertion when fmul has a ConstantExpr operand
isNormalFp and isFiniteNonZeroFp should not assume vector operands can not be constant expressions. Patch by Pawel Jurek <pawel.jurek@intel.com> Differential Revision: http://reviews.llvm.org/D8053 llvm-svn: 231359
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/fast-math.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fast-math.ll b/llvm/test/Transforms/InstCombine/fast-math.ll
index c6081c39925..4eebdbdfacf 100644
--- a/llvm/test/Transforms/InstCombine/fast-math.ll
+++ b/llvm/test/Transforms/InstCombine/fast-math.ll
@@ -267,6 +267,14 @@ define <4 x float> @fmul3_vec(<4 x float> %f1, <4 x float> %f2) {
; CHECK: fmul fast <4 x float> %f1, <float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 1.000000e+00>
}
+; Make sure fmul with constant expression doesn't assert.
+define <4 x float> @fmul3_vec_constexpr(<4 x float> %f1, <4 x float> %f2) {
+ %constExprMul = bitcast i128 trunc (i160 bitcast (<5 x float> <float 6.0e+3, float 6.0e+3, float 2.0e+3, float 1.0e+3, float undef> to i160) to i128) to <4 x float>
+ %t1 = fdiv <4 x float> %f1, <float 2.0e+3, float 3.0e+3, float 2.0e+3, float 1.0e+3>
+ %t3 = fmul fast <4 x float> %t1, %constExprMul
+ ret <4 x float> %t3
+}
+
; Rule "X/C1 * C2 => X * (C2/C1) is not applicable if C2/C1 is either a special
; value of a denormal. The 0x3810000000000000 here take value FLT_MIN
;
OpenPOWER on IntegriCloud