[llvm] DXIL: Use correct type ID when writing ValueAsMetadata. (PR #94337)
Tim Besard via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 02:49:53 PDT 2024
maleadt wrote:
> Pointer values are a bit interesting because DXIL (and its usual source language, HLSL) don't generally expose pointers, so these code paths are probably not really reachable without fiddling with the IR we input to the DXIL backend.
Yeah, I noticed, and there turned out to be several more issues than the ones mentioned here. I ultimately took another approach, instead of inferring pointer types based on some later use (which can lead to conflicts that fall back to `i8*`, and can cause issues with instructions like `select` and `phi` that assume identically-typed inputs, https://github.com/JuliaGPU/llvm-downgrade/pull/7), only cast to and use typed pointers when an instruction requires it and cast back to opaque pointers right after (see https://github.com/JuliaGPU/llvm-downgrade/pull/5 for the implementation). That results in a lot of bitcasts, but it's assumed that the back-end could easily optimize those away.
I'll see about adding a test for the changes in here.
https://github.com/llvm/llvm-project/pull/94337
More information about the llvm-commits
mailing list