diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-20 04:09:00 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-20 04:09:00 +0000 |
| commit | 727aa349ad3c49d590693961ae0d0dfb39d95089 (patch) | |
| tree | 507abcf56762fadf081b59c624f9bede246efe02 /llvm/lib/Analysis/IPA/InlineCost.cpp | |
| parent | 8ed6f2aacfe83bb823de2eb7975e704b89d1264b (diff) | |
| download | bcm5719-llvm-727aa349ad3c49d590693961ae0d0dfb39d95089.tar.gz bcm5719-llvm-727aa349ad3c49d590693961ae0d0dfb39d95089.zip | |
Have InlineCost check constant fcmps
llvm-svn: 186758
Diffstat (limited to 'llvm/lib/Analysis/IPA/InlineCost.cpp')
| -rw-r--r-- | llvm/lib/Analysis/IPA/InlineCost.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/IPA/InlineCost.cpp b/llvm/lib/Analysis/IPA/InlineCost.cpp index 35c45e61808..37d73a80f7a 100644 --- a/llvm/lib/Analysis/IPA/InlineCost.cpp +++ b/llvm/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. |

