IR: Add atomicrmw uinc_wrap and udec_wrap
These are essentially add/sub 1 with a clamping value. AMDGPU has instructions for these. CUDA/HIP expose these as atomicInc/atomicDec. Currently we use target intrinsics for these, but those do no carry the ordering and syncscope. Add these to atomicrmw so we can carry these and benefit from the regular legalization processes.
This commit is contained in:
committed by
Matt Arsenault
parent
e44a305690
commit
778cf5431c
@@ -1256,6 +1256,10 @@ static AtomicRMWInst::BinOp getDecodedRMWOperation(unsigned Val) {
|
||||
case bitc::RMW_FSUB: return AtomicRMWInst::FSub;
|
||||
case bitc::RMW_FMAX: return AtomicRMWInst::FMax;
|
||||
case bitc::RMW_FMIN: return AtomicRMWInst::FMin;
|
||||
case bitc::RMW_UINC_WRAP:
|
||||
return AtomicRMWInst::UIncWrap;
|
||||
case bitc::RMW_UDEC_WRAP:
|
||||
return AtomicRMWInst::UDecWrap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user