diff options
author | Philip Reames <listmail@philipreames.com> | 2015-09-23 19:48:43 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2015-09-23 19:48:43 +0000 |
commit | d63df5107e097ba4ab82a82c6a30e4f4ee9f88dd (patch) | |
tree | b79df74c86eb1c3431ac7a7c23f087c29f51a54b /llvm/lib/IR/Value.cpp | |
parent | e5ffa089cc88fc730b005d1dba9cb57857a9ba66 (diff) | |
download | llvm-d63df5107e097ba4ab82a82c6a30e4f4ee9f88dd.zip llvm-d63df5107e097ba4ab82a82c6a30e4f4ee9f88dd.tar.gz llvm-d63df5107e097ba4ab82a82c6a30e4f4ee9f88dd.tar.bz2 |
Remove handling of AddrSpaceCast in stripAndAccumulateInBoundsConstantOffsets
Patch by: simoncook
Unlike BitCasts, AddrSpaceCasts do not always produce an output the same size as its input, which was previously assumed. This fixes cases where two address spaces do not have the same size pointer, as an assertion failure would occur when trying to prove deferenceability. LoopUnswitch is used in the particular test, but LICM also exhibits the same problem.
Differential Revision: http://reviews.llvm.org/D13008
llvm-svn: 248422
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r-- | llvm/lib/IR/Value.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index f554d59..925f205 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -490,8 +490,7 @@ Value *Value::stripAndAccumulateInBoundsConstantOffsets(const DataLayout &DL, return V; Offset = GEPOffset; V = GEP->getPointerOperand(); - } else if (Operator::getOpcode(V) == Instruction::BitCast || - Operator::getOpcode(V) == Instruction::AddrSpaceCast) { + } else if (Operator::getOpcode(V) == Instruction::BitCast) { V = cast<Operator>(V)->getOperand(0); } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) { V = GA->getAliasee(); |