aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/IPA/InlineCost.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-07-20 04:09:00 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-07-20 04:09:00 +0000
commitff29d235ed70d8d7aa03b2d9f9665d2b85f0e195 (patch)
treee7a1c9eb19e40c81372f56cb4eaf6013c74963f0 /lib/Analysis/IPA/InlineCost.cpp
parent6cc16a04797b0d231405f4fb6ccd22a85269ad20 (diff)
downloadexternal_llvm-ff29d235ed70d8d7aa03b2d9f9665d2b85f0e195.zip
external_llvm-ff29d235ed70d8d7aa03b2d9f9665d2b85f0e195.tar.gz
external_llvm-ff29d235ed70d8d7aa03b2d9f9665d2b85f0e195.tar.bz2
Have InlineCost check constant fcmps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/InlineCost.cpp')
-rw-r--r--lib/Analysis/IPA/InlineCost.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Analysis/IPA/InlineCost.cpp b/lib/Analysis/IPA/InlineCost.cpp
index 35c45e6..37d73a8 100644
--- a/lib/Analysis/IPA/InlineCost.cpp
+++ b/lib/Analysis/IPA/InlineCost.cpp
@@ -124,7 +124,7 @@ class CallAnalyzer : public InstVisitor<CallAnalyzer, bool> {
bool visitIntToPtr(IntToPtrInst &I);
bool visitCastInst(CastInst &I);
bool visitUnaryInstruction(UnaryInstruction &I);
- bool visitICmp(ICmpInst &I);
+ bool visitCmpInst(CmpInst &I);
bool visitSub(BinaryOperator &I);
bool visitBinaryOperator(BinaryOperator &I);
bool visitLoad(LoadInst &I);
@@ -490,7 +490,7 @@ bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) {
return false;
}
-bool CallAnalyzer::visitICmp(ICmpInst &I) {
+bool CallAnalyzer::visitCmpInst(CmpInst &I) {
Value *LHS = I.getOperand(0), *RHS = I.getOperand(1);
// First try to handle simplified comparisons.
if (!isa<Constant>(LHS))
@@ -499,12 +499,16 @@ bool CallAnalyzer::visitICmp(ICmpInst &I) {
if (!isa<Constant>(RHS))
if (Constant *SimpleRHS = SimplifiedValues.lookup(RHS))
RHS = SimpleRHS;
- if (Constant *CLHS = dyn_cast<Constant>(LHS))
+ if (Constant *CLHS = dyn_cast<Constant>(LHS)) {
if (Constant *CRHS = dyn_cast<Constant>(RHS))
- if (Constant *C = ConstantExpr::getICmp(I.getPredicate(), CLHS, CRHS)) {
+ if (Constant *C = ConstantExpr::getCompare(I.getPredicate(), CLHS, CRHS)) {
SimplifiedValues[&I] = C;
return true;
}
+ }
+
+ if (I.getOpcode() == Instruction::FCmp)
+ return false;
// Otherwise look for a comparison between constant offset pointers with
// a common base.