[llvm] [NVPTX] Attempt to load params using symbol addition node directly (PR #119935)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 7 16:56:33 PST 2025
Artem-B wrote:
Let's get back to the start of the conversation. Before we dig deeper into how to deal with the problem, I would like to understand what we're solving and why.
To recap:
> We're already lowering loads as [symbol+offset] without the patch: https://godbolt.org/z/zWsnvqPjd
...
> Here's what I get for llc (assertions trunk): https://godbolt.org/z/95fx4nMxq. An illegal add is on line 25 of the output.
...
> Whoa. We get different output with assertions enabled? Now, that does sound like a bug to me.
IIUIC, you want to fix that that invalid PTX on the line 25.
I wonder if the real root cause here is whatever is altering compiler output if assertions are enabled. If we violate some assertions, I would expect non-assert build to produce invalid compilation result, but in this case it's the opposite - non assert build works fine, but assert-enabled build produces wrong results, but does not trigger any assertions. It looks like that code somehow breaks things and you may be attempting to fix the damage it causes, and, effectively, hide the problem.
I think we should first figure out why compiler output is different with assertions. If compiler output was unchanged, we would not have the invalid PTX to fix.
If it turns out that the compiler output changes are intentional (I'd be curious to know why), and the changes are legitimate, then, we may indeed need to figure out to to make the NVPTX back-end handle it correctly, but without knowing that, it's probably premature to dive into this yet.
https://github.com/llvm/llvm-project/pull/119935
More information about the llvm-commits
mailing list