summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2014-01-16 20:36:42 +0000
committerOwen Anderson <resistor@mac.com>2014-01-16 20:36:42 +0000
commita2a8bbb30f271843dd0678f563a62154919e09b4 (patch)
tree8c5978b68565ac64471a374b82da3f20efeb412c /test/Transforms
parenta560d155d91012e4f3fa9f1742d98ac7562c0bc0 (diff)
downloadllvm-a2a8bbb30f271843dd0678f563a62154919e09b4.tar.gz
llvm-a2a8bbb30f271843dd0678f563a62154919e09b4.tar.bz2
llvm-a2a8bbb30f271843dd0678f563a62154919e09b4.tar.xz
Teach InstCombine that (fmul X, -1.0) can be simplified to (fneg X), which LLVM expresses as (fsub -0.0, X).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/InstCombine/fmul.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fmul.ll b/test/Transforms/InstCombine/fmul.ll
index 402ee52e62..71b7138b64 100644
--- a/test/Transforms/InstCombine/fmul.ll
+++ b/test/Transforms/InstCombine/fmul.ll
@@ -93,3 +93,15 @@ for.body: ; preds = %for.cond
for.end: ; preds = %for.cond
ret void
}
+
+; X * -1.0 => -0.0 - X
+define float @test9(float %x) {
+ %mul = fmul float %x, -1.0
+ ret float %mul
+
+; CHECK-LABEL: @test9(
+; CHECK-NOT: fmul
+; CHECK: fsub
+}
+
+