Skip to content

Commit

Permalink
[CHERI-RISC-V] Expand capability AtomicRMW XCHG in hybrid mode
Browse files Browse the repository at this point in the history
This allows expanding e.g. `atomicrmw xchg i32 addrspace(200)*` without a
library call. Code generation could be improved by adding an explicit
pseudo but that can be done as a follow-up change
  • Loading branch information
arichardson committed Aug 15, 2022
1 parent ae3ca30 commit 1211aff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9299,7 +9299,7 @@ RISCVTargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const {
if (DL.isFatPointer(AI->getPointerOperand()->getType())) {
if (!RISCVABI::isCheriPureCapABI(Subtarget.getTargetABI()) &&
AI->getOperation() == AtomicRMWInst::Xchg &&
DL.isFatPointer(AI->getPointerOperand()->getType()))
DL.isFatPointer(AI->getValOperand()->getType()))
return AtomicExpansionKind::CmpXChg;
return AtomicExpansionKind::None;
}
Expand Down

0 comments on commit 1211aff

Please sign in to comment.