diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-07-19 03:32:02 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-07-19 03:32:02 +0000 |
commit | b8e7c736fba3150a6576cdc398bcd4ea1df9652e (patch) | |
tree | f661ad26a19f831fda4c2eae7c916b8b8a86ac0f /llvm/lib/IR/Value.cpp | |
parent | ab184fb88d0f9bbab1462aa46fe7f37fb26beec9 (diff) | |
download | llvm-b8e7c736fba3150a6576cdc398bcd4ea1df9652e.zip llvm-b8e7c736fba3150a6576cdc398bcd4ea1df9652e.tar.gz llvm-b8e7c736fba3150a6576cdc398bcd4ea1df9652e.tar.bz2 |
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.
llvm-svn: 213449
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r-- | llvm/lib/IR/Value.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index 94f979a3..1ab2183 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/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<Operator>(V)->getOperand(0); } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) { V = GA->getAliasee(); |