From: Hal Finkel Date: Sat, 19 Jul 2014 03:32:02 +0000 (+0000) Subject: Handle AddrSpaceCast in stripAndAccumulateInBoundsConstantOffsets X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=07adbf3a870ab0ca8eb11534940aed2bf64af695;p=oota-llvm.git Handle AddrSpaceCast in stripAndAccumulateInBoundsConstantOffsets All of the other similar functions in that part of the file look through addrspacecast in addition to bitcast, and I see no reason why stripAndAccumulateInBoundsConstantOffsets shouldn't do so also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213449 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Value.cpp b/lib/IR/Value.cpp index 94f979a3002..1ab2183b656 100644 --- a/lib/IR/Value.cpp +++ b/lib/IR/Value.cpp @@ -455,7 +455,8 @@ Value *Value::stripAndAccumulateInBoundsConstantOffsets(const DataLayout &DL, return V; Offset = GEPOffset; V = GEP->getPointerOperand(); - } else if (Operator::getOpcode(V) == Instruction::BitCast) { + } else if (Operator::getOpcode(V) == Instruction::BitCast || + Operator::getOpcode(V) == Instruction::AddrSpaceCast) { V = cast(V)->getOperand(0); } else if (GlobalAlias *GA = dyn_cast(V)) { V = GA->getAliasee();