InferAddressSpaces: Fix assert with unreachable code
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 15 Sep 2020 17:46:23 +0000 (13:46 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 15 Sep 2020 19:48:43 +0000 (15:48 -0400)
commit7d6ca2ec57073b9eabe6808ff1fe0560586c5ffb
treeea76723ea5f3a479986b3bff13418b3def9b6e93
parentf1a3ab904439a63b21ba1c4521765c46630687c6
InferAddressSpaces: Fix assert with unreachable code

Invalid IR in unreachable code is technically valid IR. In this case,
the address space of the value was never inferred, and we tried to
rewrite it with an invalid address space value which would assert.
llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
llvm/test/Transforms/InferAddressSpaces/AMDGPU/self-phi.ll [new file with mode: 0644]
llvm/test/Transforms/InferAddressSpaces/AMDGPU/unreachable-code-assert.ll [new file with mode: 0644]