This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Slightly weaken expanded seq_cst atomic op to match reference mapping in in the spec
ClosedPublic

Authored by asb on Mar 26 2023, 11:26 PM.

Details

Summary

Table A.6 in the RISC-V ISA Manual indicates that sequentially consistent atomic ops that have a matching instruction should be mapped to amo<op>.{w|d}.aqrl. But sequentially consistent operations that are mapped to lr/sc should produce loop: lr.{w|d}.aqrl; <op>; sc.{w|d}.rl; bnez loop. Previously, LLVM produced an sc.{w|d}.aqrl which was stronger than necessary. This patch adjusts the relevant logic so that a sc.{w|d}.rl is produced.

Diff Detail

Event Timeline

asb created this revision.Mar 26 2023, 11:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 26 2023, 11:26 PM
asb requested review of this revision.Mar 26 2023, 11:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 26 2023, 11:26 PM
This revision is now accepted and ready to land.Mar 29 2023, 10:17 AM