[Verifier] Allow undef/poison token argument to llvm.experimental.gc.result
authordbakunevich <dbakunevich@azul.com>
Wed, 19 Oct 2022 13:40:54 +0000 (20:40 +0700)
committerdbakunevich <dbakunevich@azul.com>
Wed, 19 Oct 2022 13:51:21 +0000 (20:51 +0700)
commitfecfd012523f963666caeb7e65cca3cd0ec1c159
treedf3a2e48c4711a890886ce3d2919bd4b22e9b7e1
parent52d31be80eea6d051b7271528e70b852c490e201
[Verifier] Allow undef/poison token argument to llvm.experimental.gc.result

As part of the optimization in the unreachable code, we remove
tokens, thereby replacing them with undef/poison in intrinsics.
But the verifier falls on the assertion, within of what it sees
token poison in unreachable code, which in turn is incorrect.

bug: 57871, https://github.com/llvm/llvm-project/issues/57871
Differential Revision: https://reviews.llvm.org/D134427
llvm/lib/IR/Verifier.cpp
llvm/test/Verifier/gc_result_token.ll [new file with mode: 0644]