summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/RISCV/RISCVISelLowering.h
diff options
context:
space:
mode:
authorAlex Bradbury <asb@lowrisc.org>2018-11-29 20:43:42 +0000
committerAlex Bradbury <asb@lowrisc.org>2018-11-29 20:43:42 +0000
commit66d9a752b9c4c7de32f21f921d1678799a254259 (patch)
tree883e834f03d6c63309867b074bdb2658180989b9 /llvm/lib/Target/RISCV/RISCVISelLowering.h
parent7eb1c2864fb3b3482432bb979f40c740ca99f023 (diff)
downloadbcm5719-llvm-66d9a752b9c4c7de32f21f921d1678799a254259.tar.gz
bcm5719-llvm-66d9a752b9c4c7de32f21f921d1678799a254259.zip
[RISCV] Implement codegen for cmpxchg on RV32IA
Utilise a similar ('late') lowering strategy to D47882. The changes to AtomicExpandPass allow this strategy to be utilised by other targets which implement shouldExpandAtomicCmpXchgInIR. All cmpxchg are lowered as 'strong' currently and failure ordering is ignored. This is conservative but correct. Differential Revision: https://reviews.llvm.org/D48131 llvm-svn: 347914
Diffstat (limited to 'llvm/lib/Target/RISCV/RISCVISelLowering.h')
-rw-r--r--llvm/lib/Target/RISCV/RISCVISelLowering.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.h b/llvm/lib/Target/RISCV/RISCVISelLowering.h
index fe988bb14de..a99e2c2f53b 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.h
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.h
@@ -126,6 +126,13 @@ private:
virtual Value *emitMaskedAtomicRMWIntrinsic(
IRBuilder<> &Builder, AtomicRMWInst *AI, Value *AlignedAddr, Value *Incr,
Value *Mask, Value *ShiftAmt, AtomicOrdering Ord) const override;
+ TargetLowering::AtomicExpansionKind
+ shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *CI) const override;
+ virtual Value *
+ emitMaskedAtomicCmpXchgIntrinsic(IRBuilder<> &Builder, AtomicCmpXchgInst *CI,
+ Value *AlignedAddr, Value *CmpVal,
+ Value *NewVal, Value *Mask,
+ AtomicOrdering Ord) const override;
};
}
OpenPOWER on IntegriCloud