OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5762a45
)
[ValueTracking] simplify code in CannotBeNegativeZero() with match(); NFCI
author
Sanjay Patel
<spatel@rotateright.com>
Mon, 13 Nov 2017 17:40:47 +0000
(17:40 +0000)
committer
Sanjay Patel
<spatel@rotateright.com>
Mon, 13 Nov 2017 17:40:47 +0000
(17:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318055
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Analysis/ValueTracking.cpp
patch
|
blob
|
history
diff --git
a/lib/Analysis/ValueTracking.cpp
b/lib/Analysis/ValueTracking.cpp
index
9a0df74
..
af35e4f
100644
(file)
--- a/
lib/Analysis/ValueTracking.cpp
+++ b/
lib/Analysis/ValueTracking.cpp
@@
-2607,11
+2607,9
@@
bool llvm::CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,
if (FPO->hasNoSignedZeros())
return true;
- // (add x, 0.0) is guaranteed to return +0.0, not -0.0.
- if (I->getOpcode() == Instruction::FAdd)
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(I->getOperand(1)))
- if (CFP->isNullValue())
- return true;
+ // (fadd x, 0.0) is guaranteed to return +0.0, not -0.0.
+ if (match(I, m_FAdd(m_Value(), m_Zero())))
+ return true;
// sitofp and uitofp turn into +0.0 for zero.
if (isa<SIToFPInst>(I) || isa<UIToFPInst>(I))