[llvm] [AMDGPU] Re-enable closed-world assumption as an opt-out feature (PR #115371)
Jon Chesterfield via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 8 10:49:55 PST 2024
JonChesterfield wrote:
We can't ship "miscompile by default". Some people will see their code is faster and not notice any problems and they'll be happy. Other people will see that their code stops working, track it down to this commit and be angry at us.
This assumption is a really high value one. It ties into the rdc (or non-rdc, don't remember) cuda thing. It trivialises escape analysis. The attribute propagator thing will love it. I'd like it for the LDS allocator. But it will break code, and we really can't deliberately break code on the default options. Add the option as an opt-in and ideally set it in that cuda mode, and document it as a good idea when the conditions are met.
What we could do, if we wanted to be aggressive, is switch it on as part of -Ofast. I think that's reasonable because Ofast is already a break-my-code command and people using it are relatively likely to want this feature, and used to their code stopping working when the compiler changes (and thus likely to be open to adding the disable version if needed).
Please add the flag, but default it to "correct" instead of to "fast"
https://github.com/llvm/llvm-project/pull/115371
More information about the llvm-commits
mailing list