Open Quuxplusone opened 3 years ago
Bugzilla Link | PR51435 |
Status | NEW |
Importance | P enhancement |
Reported by | Shivam Gupta (shivam98.tkg@gmail.com) |
Reported on | 2021-08-10 12:06:30 -0700 |
Last modified on | 2021-10-19 11:20:30 -0700 |
Version | trunk |
Hardware | PC Linux |
CC | efriedma@quicinc.com, jyknight@google.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, richard-llvm@metafoo.co.uk, spatel+llvm@rotateright.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I reproduced. (For whatever reason, this only seems to show up at -O1, not any other optimization level.)
The IR is wrong; we're somehow turning an atomic load into a non-atomic load. I think InstCombinerImpl::foldPHIArgLoadIntoPHI isn't correctly checking for atomic operations?
I was not actually the original reporter of this issue. So trying to understand the problem & fix.
What needs to be done for x86 & aarch64. Can someone write the correct assembly in both cases?
I can definitely try to fix it after that.
Thanks.
I think for the aarch64 testcase, the last ldr should be ldar, or something
like that?
If you looking into fixing, start with my last comment:
> The IR is wrong; we're somehow turning an atomic load into a non-atomic
> load. I think InstCombinerImpl::foldPHIArgLoadIntoPHI isn't correctly
> checking for atomic operations?