[ValueTracking] Fix crash in GetPointerBaseWithConstantOffset()
authorTom Stellard <thomas.stellard@amd.com>
Fri, 7 Oct 2016 14:23:29 +0000 (14:23 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 7 Oct 2016 14:23:29 +0000 (14:23 +0000)
commit17eb3413cdfbe259fa1fd7f532395f1de551d56b
tree82ad31511ff288dc3164d1de7eb44fa71cbbbc52
parent88b9d66d4acbff4b88ec91026b1f7df4de326ec2
[ValueTracking] Fix crash in GetPointerBaseWithConstantOffset()

Summary:
While walking defs of pointer operands we were assuming that the pointer
size would remain constant.  This is not true, because addresspacecast
instructions may cast the pointer to an address space with a different
pointer width.

This partial reverts r282612, which was a more conservative solution
to this problem.

Reviewers: reames, sanjoy, apilipenko

Subscribers: wdng, llvm-commits

Differential Revision: https://reviews.llvm.org/D24772

llvm-svn: 283557
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Analysis/ValueTracking/get-pointer-base-with-const-off.ll [new file with mode: 0644]
llvm/test/Transforms/GVN/addrspace-cast.ll [deleted file]