[llvm] r213449 - Handle AddrSpaceCast in stripAndAccumulateInBoundsConstantOffsets

Hal Finkel hfinkel at anl.gov
Fri Jul 18 20:32:02 PDT 2014


Author: hfinkel
Date: Fri Jul 18 22:32:02 2014
New Revision: 213449

URL: http://llvm.org/viewvc/llvm-project?rev=213449&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/IR/Value.cpp

Modified: llvm/trunk/lib/IR/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Value.cpp?rev=213449&r1=213448&r2=213449&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Value.cpp (original)
+++ llvm/trunk/lib/IR/Value.cpp Fri Jul 18 22:32:02 2014
@@ -455,7 +455,8 @@ Value *Value::stripAndAccumulateInBounds
         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<Operator>(V)->getOperand(0);
     } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
       V = GA->getAliasee();





More information about the llvm-commits mailing list