summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-03-15 01:03:19 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-03-15 01:03:19 +0000
commit86ecb1bdaf2e7570ac33cc9e00d76375cf00d5d2 (patch)
tree69452bd906dd406f717aa34057b76a49b8a141fb /llvm/lib/Transforms
parent11d509dba06aeff0744a8964ac4a19f58dd80a02 (diff)
downloadbcm5719-llvm-86ecb1bdaf2e7570ac33cc9e00d76375cf00d5d2.tar.gz
bcm5719-llvm-86ecb1bdaf2e7570ac33cc9e00d76375cf00d5d2.zip
[opaque pointer type] IRBuilder gep migration progress
llvm-svn: 232294
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
index 23dbe59087e..0625d8deca0 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -1460,11 +1460,16 @@ Instruction *InstCombiner::commonPointerCastTransforms(CastInst &CI) {
APInt Offset(OffsetBits, 0);
BitCastInst *BCI = dyn_cast<BitCastInst>(GEP->getOperand(0));
if (GEP->hasOneUse() && BCI && GEP->accumulateConstantOffset(DL, Offset)) {
+ // FIXME: This is insufficiently tested - just a no-crash test
+ // (test/Transforms/InstCombine/2007-05-14-Crash.ll)
+ //
// Get the base pointer input of the bitcast, and the type it points to.
Value *OrigBase = BCI->getOperand(0);
SmallVector<Value*, 8> NewIndices;
if (FindElementAtOffset(OrigBase->getType(), Offset.getSExtValue(),
NewIndices)) {
+ // FIXME: This codepath is completely untested - could be unreachable
+ // for all I know.
// If we were able to index down into an element, create the GEP
// and bitcast the result. This eliminates one bitcast, potentially
// two.
OpenPOWER on IntegriCloud