diff options
author | Farzon Lotfi <farzonlotfi@microsoft.com> | 2025-10-10 15:38:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-10 15:38:24 -0400 |
commit | 28c5a2c46d810b70040b711afbb2532374a5b67d (patch) | |
tree | 3563aefae6727844770b93b6d6d105b5523770a0 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | bd3ddcf7e16af3358f4f2ef17079b3fcc41d41c4 (diff) | |
download | llvm-28c5a2c46d810b70040b711afbb2532374a5b67d.zip llvm-28c5a2c46d810b70040b711afbb2532374a5b67d.tar.gz llvm-28c5a2c46d810b70040b711afbb2532374a5b67d.tar.bz2 |
[Clang][HLSL][GVN] Prevent phi codgen of isTokenLike types (#162363)
fixes #161754
When the GVN pass calls `PerformLoadPRE` or `processNonLocalLoad` it can
invoke the `SSAUpdater` which adds a phi node for our tokenLike type. If
we check for if the load is on a token like type at the `processLoad` we
can cover both cases. This is because if we don't GVN will use the
SSAUpdater to insert a phi node to reduce duplicate resource.getpointer
calls.
Because in an earlier commit:
https://github.com/llvm/llvm-project/commit/01c0a8409a21344c822deba9467bd9d547f6e5d8
we made the verifier error with `PHI nodes cannot have token type!`
This test case will fail today if we try to perform this load
optimization
https://godbolt.org/z/xM69fY8zM
This will impact clang aswell because `isTokenLikeTy` also checks for
`isTokenTy` Clang is likely also failing validation with token types but
just doesn't have a test case because the validator would error if it
were in a phi node.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions