diff options
author | Shuxin Yang <shuxin.llvm@gmail.com> | 2013-01-09 00:13:41 +0000 |
---|---|---|
committer | Shuxin Yang <shuxin.llvm@gmail.com> | 2013-01-09 00:13:41 +0000 |
commit | 935e35d2b9f889566207b76a7026b63a1619742c (patch) | |
tree | cc26ce74146b052bea87a9ca28314767d6cef72b /test/Transforms/InstCombine/fast-math.ll | |
parent | b6714227eda5d499f7667fc865f931126a8dc488 (diff) | |
download | external_llvm-935e35d2b9f889566207b76a7026b63a1619742c.zip external_llvm-935e35d2b9f889566207b76a7026b63a1619742c.tar.gz external_llvm-935e35d2b9f889566207b76a7026b63a1619742c.tar.bz2 |
Consider expression "0.0 - X" as the negation of X if
- this expression is explicitly marked no-signed-zero, or
- no-signed-zero of this expression can be derived from some context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171922 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/fast-math.ll')
-rw-r--r-- | test/Transforms/InstCombine/fast-math.ll | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/Transforms/InstCombine/fast-math.ll b/test/Transforms/InstCombine/fast-math.ll index 5d40d71..df0455a 100644 --- a/test/Transforms/InstCombine/fast-math.ll +++ b/test/Transforms/InstCombine/fast-math.ll @@ -243,5 +243,16 @@ define float @fmul5(float %f1, float %f2) { ; CHECK: fdiv fast float %f1, 0x47E8000000000000 } - - +; ========================================================================= +; +; Testing-cases about negation +; +; ========================================================================= +define float @fneg1(float %f1, float %f2) { + %sub = fsub float -0.000000e+00, %f1 + %sub1 = fsub nsz float 0.000000e+00, %f2 + %mul = fmul float %sub, %sub1 + ret float %mul +; CHECK: @fneg1 +; CHECK: fmul float %f1, %f2 +} |