diff options
Diffstat (limited to 'test/Transforms/InstCombine/fast-math.ll')
-rw-r--r-- | test/Transforms/InstCombine/fast-math.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fast-math.ll b/test/Transforms/InstCombine/fast-math.ll index a9a7015..d8ba2a5 100644 --- a/test/Transforms/InstCombine/fast-math.ll +++ b/test/Transforms/InstCombine/fast-math.ll @@ -202,6 +202,18 @@ define float @fmul2(float %f1) { ; CHECK: fdiv fast float 1.200000e+07, %f1 } +; X/C1 * C2 => X * (C2/C1) is disabled if X/C1 has multiple uses +@fmul2_external = external global float +define float @fmul2_disable(float %f1) { + %div = fdiv fast float 1.000000e+00, %f1 + store float %div, float* @fmul2_external + %mul = fmul fast float %div, 2.000000e+00 + ret float %mul +; CHECK-LABEL: @fmul2_disable +; CHECK: store +; CHECK: fmul fast +} + ; X/C1 * C2 => X * (C2/C1) (if C2/C1 is normal Fp) define float @fmul3(float %f1, float %f2) { %t1 = fdiv float %f1, 2.0e+3 |