Currently there is a middle-end or backend issue
https://github.com/llvm/llvm-project/issues/58176
which causes values loaded from bool pointer incorrect when
bool range metadata is emitted. Temporarily
disable bool range metadata until the backend issue
is fixed.
Details
Diff Detail
Event Timeline
Is there more info about the issue? What does AMDGPU currently emit for the test case?
AFAICT from running it on CE (https://godbolt.org/z/ccq3vnbrM) llvm optimizes it to essentially *y = *x and generates a 1-byte load+store for both NVPTX and AMDGPU.
The issue happens to more complicated test cases which I cannot reduce right now.
Basically 8018d6be3459780e81a5da128a9915eb27909902 caused regressions in some PyTorch tests. Investigation shows the propagation of range metadata for bool type triggered some optimizations which caused some bool values to be loaded incorrectly. I will continue investigating the issue. However, I need a workaround for now.
clang/lib/CodeGen/CGExpr.cpp | ||
---|---|---|
1792–1794 | It would be great to open a github issue, if we don't have one yet, and reference it here, so we can tell later what exactly it is we're working around here and know for sure when/whether we can undo the change. | |
clang/test/CodeGenCUDA/bool-range.cu | ||
15 | Ditto, a bug reference would help. |
clang/lib/CodeGen/CGExpr.cpp | ||
---|---|---|
1792–1794 |
Checking back here, have you made any progress on reducing the issue?
cc @arsenm for awareness
Checking back here again on whether there is any progress on finding the root cause of the issue. If no progress is expected in the near future, I'd ask for this patch to be reverted.
Thanks for the ping. I would also like to see this reverted as it enables some optimizations. I do not have a definitive answer at the moment (w.r.t reverting this), but hope to provide one soon
As for now, the issue we are seeing from (https://github.com/llvm/llvm-project/commit/8018d6be3459780e81a5da128a9915eb27909902) seems most likely to be a source code issue (first document of issue https://github.com/pytorch/pytorch/issues/54789 . upstream PyTorch currently skips problematic test https://github.com/pytorch/pytorch/blob/b738da8c8e4d9142ad38a1bd8c35d0bfef4b5e3c/torch/testing/_internal/common_methods_invocations.py#L14891) . I will provide a better update soon.
It would be great to open a github issue, if we don't have one yet, and reference it here, so we can tell later what exactly it is we're working around here and know for sure when/whether we can undo the change.