projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e678e0
)
Make this work for FP constantexprs
author
Chris Lattner
<sabre@nondot.org>
Mon, 17 Oct 2005 20:18:38 +0000
(20:18 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Mon, 17 Oct 2005 20:18:38 +0000
(20:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23773
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/InstructionCombining.cpp
b/lib/Transforms/Scalar/InstructionCombining.cpp
index d92e126b080c8e15ed3b53ae02853f283ca9bc95..f4d44a17755132160b023065d1b5af35c663d562 100644
(file)
--- a/
lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/
lib/Transforms/Scalar/InstructionCombining.cpp
@@
-697,8
+697,9
@@
Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
if (!I.getType()->isFloatingPoint()) { // NOTE: -0 + +0 = +0.
if (RHSC->isNullValue())
return ReplaceInstUsesWith(I, LHS);
- } else if (cast<ConstantFP>(RHSC)->isExactlyValue(-0.0)) {
- return ReplaceInstUsesWith(I, LHS);
+ } else if (ConstantFP *CFP = dyn_cast<ConstantFP>(RHSC)) {
+ if (CFP->isExactlyValue(-0.0))
+ return ReplaceInstUsesWith(I, LHS);
}
// X + (signbit) --> X ^ signbit