[LSV] Fix the ContextInst for computeKnownBits.
authorJustin Lebar <justin.lebar@gmail.com>
Sun, 28 May 2023 14:53:04 +0000 (07:53 -0700)
committerJustin Lebar <justin.lebar@gmail.com>
Sun, 28 May 2023 15:00:52 +0000 (08:00 -0700)
commitf225471c68881d31835a06c6b2f2b40bdaa287d5
tree11951c666fb97dab35f496bb4d56b052b770f948
parent5b4fed66efe245bb0cc246755a669ab3a17de9ed
[LSV] Fix the ContextInst for computeKnownBits.

Previously we used the later of GEPA or GEPB.  This is hacky because
really we should be using the later of the two load/store instructions
being considered.  But also it's flat-out incorrect, because GEPA and
GEPB might be in different BBs, in which case we cannot ask which one
comes last (assertion failure,
https://reviews.llvm.org/D149893#4378332).

Fixed, now we use the correct context instruction.

Differential Revision: https://reviews.llvm.org/D151630
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/gep-bitcast.ll