[PATCH] D101898: [ARM] Prevent spilling between ldrex/strex pairs

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 14:26:42 PDT 2021


efriedma added inline comments.


================
Comment at: llvm/test/CodeGen/ARM/atomicrmw_exclusive_monitor_ints.ll:380
 ; THUMB1: bl __sync_fetch_and_sub_8
-; BASELINE64: bl __sync_fetch_and_sub_8
+; BASELINE64: bl __sync_val_compare_and_swap_8
 entry:
----------------
Just realized I wasn't looking carefully enough when I reviewed this...

In the case where we're generating a call to the runtime library, we want to call `__sync_fetch_and_sub_8`, not `__sync_val_compare_and_swap_8`.  Same for other similar atomicrmw operations.  I mean, it's not semantically wrong the way it is, but using `__sync_val_compare_and_swap_8` is worse for codesize.

I think the way to handle this is to switch around the logic to return AtomicExpansionKind::None instead of AtomicExpansionKind::CmpXChg in this case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101898



More information about the llvm-commits mailing list