Depends on D128900
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/test/CodeGen/LoongArch/ir-instruction/load-store-atomic.ll | ||
---|---|---|
140 | GCC uses one instruction for this: amswap_db.d $zero, $a1, $a0, and to me it's correct. Can we also use it? Likewise for i32 store release operation. |
llvm/lib/Target/LoongArch/LoongArchTargetMachine.cpp | ||
---|---|---|
116 | You may need to add tests in lvm/test/Transforms/AtomicExpand/LoongArch. |
llvm/lib/Target/LoongArch/LoongArchTargetMachine.cpp | ||
---|---|---|
116 | Thanks for reminding me.I will add tests. | |
llvm/test/CodeGen/LoongArch/ir-instruction/load-store-atomic.ll | ||
140 | Thank you for your reminder. This may be possible. Further, we can generate different instructions according to constraints (such as instructions without fences when unordered). I'm not sure whether this optimization should be implemented in this patch or another patch. Do you have any suggestions? |
llvm/test/CodeGen/LoongArch/ir-instruction/load-store-atomic.ll | ||
---|---|---|
140 | Maybe in another patch, as these two instructions are not explicitly emitted by the target code, but by some "internal LLVM magic". |
I agree with @xry111 that the optimization to use amswap_db.d $zero, x, y for atomic stores can be done in a later patch. For now this LGTM but I'd like someone else to take a look too.
You may need to add tests in lvm/test/Transforms/AtomicExpand/LoongArch.