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 | f0537ab6815c3b2b7ef4d8cd4779285108fe8a08 (patch) | |
tree | aa324e2f0a74a501a10afe60eaa4b50fa2563d97 /llvm/test/Transforms | |
parent | 14da440018e0817c243f7d568092facba2bf4952 (diff) | |
download | bcm5719-llvm-f0537ab6815c3b2b7ef4d8cd4779285108fe8a08.tar.gz bcm5719-llvm-f0537ab6815c3b2b7ef4d8cd4779285108fe8a08.zip |
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.
llvm-svn: 171922
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r-- | llvm/test/Transforms/InstCombine/fast-math.ll | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/fast-math.ll b/llvm/test/Transforms/InstCombine/fast-math.ll index 5d40d71f875..df0455a2032 100644 --- a/llvm/test/Transforms/InstCombine/fast-math.ll +++ b/llvm/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 +} |