X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FCodeGen%2FX86%2Ffmul-combines.ll;h=7d75611e13305093c97241b4f2d34e5c95e96fe7;hb=58bf2827d3eeabcfabb27c6d31d5d9593bcb8a90;hp=703651153c1196ac478889eda90264f7d5c16599;hpb=558cd3c6a218571e15d54f911560cae15e8fa2c3;p=oota-llvm.git diff --git a/test/CodeGen/X86/fmul-combines.ll b/test/CodeGen/X86/fmul-combines.ll index 703651153c1..7d75611e133 100644 --- a/test/CodeGen/X86/fmul-combines.ll +++ b/test/CodeGen/X86/fmul-combines.ll @@ -103,6 +103,40 @@ define <4 x float> @fmul_v4f32_two_consts_no_splat_multiple_use(<4 x float> %x) ret <4 x float> %a } +; PR22698 - http://llvm.org/bugs/show_bug.cgi?id=22698 +; Make sure that we don't infinite loop swapping constants back and forth. + +define <4 x float> @PR22698_splats(<4 x float> %a) #0 { + %mul1 = fmul fast <4 x float> , + %mul2 = fmul fast <4 x float> , %mul1 + %mul3 = fmul fast <4 x float> %a, %mul2 + ret <4 x float> %mul3 + +; CHECK: float 2.400000e+01 +; CHECK: float 2.400000e+01 +; CHECK: float 2.400000e+01 +; CHECK: float 2.400000e+01 +; CHECK-LABEL: PR22698_splats: +; CHECK: mulps +; CHECK: ret +} + +; Same as above, but verify that non-splat vectors are handled correctly too. +define <4 x float> @PR22698_no_splats(<4 x float> %a) #0 { + %mul1 = fmul fast <4 x float> , + %mul2 = fmul fast <4 x float> , %mul1 + %mul3 = fmul fast <4 x float> %a, %mul2 + ret <4 x float> %mul3 + +; CHECK: float 4.500000e+01 +; CHECK: float 1.200000e+02 +; CHECK: float 2.310000e+02 +; CHECK: float 3.840000e+02 +; CHECK-LABEL: PR22698_no_splats: +; CHECK: mulps +; CHECK: ret +} + ; CHECK-LABEL: fmul_c2_c4_f32: ; CHECK-NOT: addss ; CHECK: mulss