From d63df5107e097ba4ab82a82c6a30e4f4ee9f88dd Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Wed, 23 Sep 2015 19:48:43 +0000 Subject: 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 --- llvm/lib/IR/Value.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/IR/Value.cpp') 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(V)->getOperand(0); } else if (GlobalAlias *GA = dyn_cast(V)) { V = GA->getAliasee(); -- cgit v1.1