summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/fast-math.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine/fast-math.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/fast-math.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fast-math.ll b/llvm/test/Transforms/InstCombine/fast-math.ll
index 47f1ec48046..edcbcc71dfb 100644
--- a/llvm/test/Transforms/InstCombine/fast-math.ll
+++ b/llvm/test/Transforms/InstCombine/fast-math.ll
@@ -130,6 +130,16 @@ define double @fail2(double %f1, double %f2) {
; CHECK: ret
}
+; c1 * x - x => (c1 - 1.0) * x
+define float @fold13(float %x) {
+ %mul = fmul fast float %x, 7.000000e+00
+ %sub = fsub fast float %mul, %x
+ ret float %sub
+; CHECK: fold13
+; CHECK: fmul fast float %x, 6.000000e+00
+; CHECK: ret
+}
+
; =========================================================================
;
; Testing-cases about fmul begin
OpenPOWER on IntegriCloud