[PATCH] D130621: [RISCV] Add target feature to force-enable atomics

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 05:58:05 PDT 2022


nikic added a comment.

In D130621#3681861 <https://reviews.llvm.org/D130621#3681861>, @jrtc27 wrote:

> Why atomics-32 and not something that generalises to include 64-bit atomics on RV64?

Good point. I've changed this to a `+force-atomics` feature that works for both riscv32 and riscv64. (If this patch lands, I'll also rename the ARM feature to match.)



================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoA.td:111
+let Predicates = [HasAtomicLdSt32] in {
+  defm : LdPat<atomic_load_8,  LB>;
+  defm : LdPat<atomic_load_16, LH>;
----------------
pcwang-thead wrote:
> nikic wrote:
> > jrtc27 wrote:
> > > Don’t duplicate patterns
> > What's the right way to avoid the duplication here? Is there a way to use "or" inside Predicates?
> You can define an `or` predicate in RISCV.td like `HasStdExtMOrZmmul`, `HasStdExtZfhOrZfhmin`, etc.
Thanks, I did that now!


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

https://reviews.llvm.org/D130621



More information about the llvm-commits mailing list