llvm-project
0ee10e94 - [RISCV] Add additional fence for amocas when required by recent ABI change (#101023)

Commit
1 year ago
[RISCV] Add additional fence for amocas when required by recent ABI change (#101023) A recent atomics ABI change / fix requires that for the "A6C" and A6S" atomics ABIs (i.e. both of those supported by LLVM currently), an additional fence is inserted for an atomic_compare_exchange with seq_cst failure ordering. <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/445> This isn't trivial to support through the hooks used by AtomicExpandPass because that pass assumes that when fences are inserted, the original atomics ordering information can be removed from the instruction. Rather than try to change and complicate that API, this patch implements the needed fence insertion through a small special purpose pass.
Author
asb asb
Parents
Loading