[llvm] AtomicExpand: Allow incrementally legalizing atomicrmw (PR #103371)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 12:41:45 PDT 2024


efriedma-quic wrote:

The AArch64 backend has a late fallback for cmpxchg because at -O0, expanding ll/sc loops at the IR level doesn't work: the register allocator inserts memory ops in unfortunate places.  But when optimization is on, expanding ll/sc loops usually generates slightly better code.  It looks like this was somehow using the -O0 codepath when it wasn't supposed to.

The generated code with the patch is pretty messy, though; we somehow end up with conditional branches on constants.  Maybe that's taildup?  If it is, can we optimize the IR to avoid that?

https://github.com/llvm/llvm-project/pull/103371


More information about the llvm-commits mailing list