[InstCombine] don't assume 'inbounds' for bitcast deref or null pointer in non-defaul...
authorSanjay Patel <spatel@rotateright.com>
Sun, 13 Oct 2019 17:19:08 +0000 (17:19 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 13 Oct 2019 17:19:08 +0000 (17:19 +0000)
commitf90728c3227d86794819e945ab79f46a6933f95a
tree24c988be10e91b413d3f0e952c655fe8386f2e55
parent9d80a722d7fb1ff9871677e12611af56cb96cf7a
[InstCombine] don't assume 'inbounds' for bitcast deref or null pointer in non-default address space

Follow-up to D68244 to account for a corner case discussed in:
https://bugs.llvm.org/show_bug.cgi?id=43501

Add one more restriction: if the pointer is deref-or-null and in a non-default
(non-zero) address space, we can't assume inbounds.

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

llvm-svn: 374728
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/load-bitcast-vec.ll