[llvm] [SPIRV] Preserve FP types in atomic load/store instead of casting to integer (PR #194583)
Dmitry Sidorov via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 28 06:14:37 PDT 2026
================
@@ -685,3 +685,18 @@ SPIRVTargetLowering::shouldCastAtomicRMWIInIR(AtomicRMWInst *RMWI) const {
// SPIR-V only supports atomic exchange for integer and floating-point types.
return AtomicExpansionKind::None;
}
+
+TargetLowering::AtomicExpansionKind
+SPIRVTargetLowering::shouldCastAtomicLoadInIR(LoadInst *LI) const {
+ // TODO: pointer load should return CastToInteger, but
+ // convertAtomicLoadToIntegerType uses BitCast which asserts on pointer types.
+ return AtomicExpansionKind::None;
+}
+
+TargetLowering::AtomicExpansionKind
+SPIRVTargetLowering::shouldCastAtomicStoreInIR(StoreInst *SI) const {
+ // TODO: pointer store should return CastToInteger, but
+ // convertAtomicStoreToIntegerType uses BitCast which asserts on pointer
+ // types.
+ return AtomicExpansionKind::None;
+}
----------------
MrSidims wrote:
I'm not really understanding, what these overloads affect, but changes in the tests seem to be reasonable.
https://github.com/llvm/llvm-project/pull/194583
More information about the llvm-commits
mailing list