[PATCH] D103232: [AtomicExpandPass][AArch64] Promote xchg with floating-point types to integer ones

LemonBoy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 28 01:14:13 PDT 2021


LemonBoy added a comment.

In D103232#2785963 <https://reviews.llvm.org/D103232#2785963>, @efriedma wrote:

> I don't really like unconditionally messing with the type of the atomic operation; not sure what kind of impact that will have.
>
> Maybe it would make sense to add a new AtomicExpansionKind?

The impact is minimal and, according to the test diff, it's quite positive: it fixes the LL/SC lowering for ARM and AArch64 targets (Hexagon, the other target to make use of this expansion, is already integer-expanding the operands) and, if you consider the lower-to-cmpxchg case, pulling the bitcast out of the CAS loop makes the code slimmer at `-O0`.

I'd be against adding a new AtomicExpansionKind, the `TODO` comment about adding a TLI hook to precisely control the expansion serves the same purpose IMO.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103232



More information about the llvm-commits mailing list