[PATCH] D123196: [AArch64] Refactor shouldExpandAtomicRMWInIR [NFC]

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 17:05:36 PDT 2022


efriedma added a comment.

The logic is basically the following:

1. If we can use LSE, return "none" and let isel lower it.
2. If we can use outlined atomic helpers, return "none" and let SelectionDAG generate the outlined call.
3. If we can use LLSC, use LLSC expansion
4. If we can use cmpxchg, use cmpxchg expansion
5. If we can't use any of the above, we... crash?  Really, this we shouldn't get here; we should call setMaxAtomicSizeInBitsSupported() and let AtomicExpand handle it.

The proposed refactoring seems to make it harder to understand this.

If you want to separate out "can use LSE" and "can use outlined atomic helpers" into separate functions/lambas, that would be an improvement, I guess.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123196



More information about the llvm-commits mailing list