[PATCH] D128901: [LoongArch] Add codegen support for atomic fence, atomic load and atomic store

Gong LingQin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 4 01:10:07 PDT 2022


gonglingqin added inline comments.


================
Comment at: llvm/test/CodeGen/LoongArch/ir-instruction/load-store-atomic.ll:139
+; LA64-NEXT:    dbar 0
+; LA64-NEXT:    st.d $a0, $a1, 0
+; LA64-NEXT:    jirl $zero, $ra, 0
----------------
xry111 wrote:
> gonglingqin wrote:
> > xry111 wrote:
> > > 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.
> > 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?
> Maybe in another patch, as these two instructions are not explicitly emitted by the target code, but by some "internal LLVM magic".
Thanks for the suggestion, I will handle it in another patch.


================
Comment at: llvm/test/Transforms/AtomicExpand/LoongArch/load-store-atomic.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -mtriple=loongarch32 -atomic-expand %s | FileCheck %s --check-prefix=LA32
+; RUN: opt -S -mtriple=loongarch64 -atomic-expand %s | FileCheck %s --check-prefix=LA64
----------------
SixWeining wrote:
> SixWeining wrote:
> > It should be `--`.
> ditto
Thanks. I will change that.


================
Comment at: llvm/test/Transforms/AtomicExpand/LoongArch/load-store-atomic.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -mtriple=loongarch32 -atomic-expand %s | FileCheck %s --check-prefix=LA32
+; RUN: opt -S -mtriple=loongarch64 -atomic-expand %s | FileCheck %s --check-prefix=LA64
----------------
gonglingqin wrote:
> SixWeining wrote:
> > SixWeining wrote:
> > > It should be `--`.
> > ditto
> Thanks. I will change that.
Thanks. I will change that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128901/new/

https://reviews.llvm.org/D128901



More information about the llvm-commits mailing list