diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-03 16:06:07 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-03 16:06:07 +0000 |
commit | a199e01d8edd54f995dfd673e4fb6607fbeb09f9 (patch) | |
tree | eb92b2d9d70bdc04e50b217476cda559240c1745 /lib/Transforms/InstCombine/InstCombineCalls.cpp | |
parent | 28d95b0a04ced9a07ab8913d4b2211946394e2b2 (diff) | |
download | external_llvm-a199e01d8edd54f995dfd673e4fb6607fbeb09f9.zip external_llvm-a199e01d8edd54f995dfd673e4fb6607fbeb09f9.tar.gz external_llvm-a199e01d8edd54f995dfd673e4fb6607fbeb09f9.tar.bz2 |
replace 'break's with 'return 0' in visitCallInst code for objectsize, since there is no need to fallback to visitCallSite.
This gives a 0.9% in a test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156069 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineCalls.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index a3dc77d..5be7997 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -247,7 +247,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { default: break; case Intrinsic::objectsize: { // We need target data for just about everything so depend on it. - if (!TD) break; + if (!TD) return 0; Type *ReturnTy = CI.getType(); uint64_t DontKnow = II->getArgOperand(1) == Builder->getTrue() ? 0 : -1ULL; @@ -260,7 +260,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { // Try to look through constant GEPs. if (GEPOperator *GEP = dyn_cast<GEPOperator>(Op1)) { - if (!GEP->hasAllConstantIndices()) break; + if (!GEP->hasAllConstantIndices()) return 0; // Get the current byte offset into the thing. Use the original // operand in case we're looking through a bitcast. @@ -274,7 +274,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { // Make sure we're not a constant offset from an external // global. if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Op1)) - if (!GV->hasDefinitiveInitializer()) break; + if (!GV->hasDefinitiveInitializer()) return 0; } // If we've stripped down to a single global variable that we @@ -294,7 +294,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { Size = TD->getTypeAllocSize(AI->getAllocatedType()); if (AI->isArrayAllocation()) { const ConstantInt *C = dyn_cast<ConstantInt>(AI->getArraySize()); - if (!C) break; + if (!C) return 0; Size *= C->getZExtValue(); } } @@ -310,7 +310,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { // Do not return "I don't know" here. Later optimization passes could // make it possible to evaluate objectsize to a constant. if (Size == -1ULL) - break; + return 0; if (Size < Offset) { // Out of bound reference? Negative index normalized to large |