summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-06-30 09:19:23 +0000
committerGabor Greif <ggreif@gmail.com>2010-06-30 09:19:23 +0000
commit743b3fd196e027fadb4ea890cd2289e63bcfd5f5 (patch)
tree4956183892c353fee2dc82b4f3f3da2f9cfb2099
parentf628ecd15f62d7dd4e9b56fd72e47de6cbf31ebe (diff)
downloadbcm5719-llvm-743b3fd196e027fadb4ea890cd2289e63bcfd5f5.tar.gz
bcm5719-llvm-743b3fd196e027fadb4ea890cd2289e63bcfd5f5.zip
use getArgOperand (corrected by CallInst::ArgOffset) instead of getOperand
llvm-svn: 107273
-rw-r--r--llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
index f645a5a1c4a..272066c8c0c 100644
--- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -548,7 +548,8 @@ protected:
CI->eraseFromParent();
}
bool isFoldable(unsigned SizeCIOp, unsigned, bool) const {
- if (ConstantInt *SizeCI = dyn_cast<ConstantInt>(CI->getOperand(SizeCIOp)))
+ if (ConstantInt *SizeCI = dyn_cast<ConstantInt>(CI->getArgOperand(SizeCIOp
+ - CallInst::ArgOffset)))
return SizeCI->isAllOnesValue();
return false;
}
OpenPOWER on IntegriCloud