summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-07-21 15:15:37 +0000
committerJay Foad <jay.foad@gmail.com>2011-07-21 15:15:37 +0000
commit2f5fc8c67d9c7220a3fe8940c00aa274cedbbaf0 (patch)
treebd988632ab5b18c31d84d5faedec05c0f574377c /llvm/lib/Transforms/IPO/GlobalOpt.cpp
parent3aa2f0a064f511fd5469f83032ee74ffc92d2258 (diff)
downloadbcm5719-llvm-2f5fc8c67d9c7220a3fe8940c00aa274cedbbaf0.tar.gz
bcm5719-llvm-2f5fc8c67d9c7220a3fe8940c00aa274cedbbaf0.zip
Make better use of ConstantExpr::getGetElementPtr's InBounds parameter.
llvm-svn: 135676
Diffstat (limited to 'llvm/lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 2d971a1e192..fd263c901ba 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -2407,9 +2407,9 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end();
i != e; ++i)
GEPOps.push_back(getVal(Values, *i));
- InstResult = cast<GEPOperator>(GEP)->isInBounds() ?
- ConstantExpr::getInBoundsGetElementPtr(P, GEPOps) :
- ConstantExpr::getGetElementPtr(P, GEPOps);
+ InstResult =
+ ConstantExpr::getGetElementPtr(P, GEPOps,
+ cast<GEPOperator>(GEP)->isInBounds());
} else if (LoadInst *LI = dyn_cast<LoadInst>(CurInst)) {
if (LI->isVolatile()) return false; // no volatile accesses.
InstResult = ComputeLoadResult(getVal(Values, LI->getOperand(0)),
OpenPOWER on IntegriCloud