================
@@ -215,6 +229,34 @@ bool AtomicInfo::emitMemSetZeroIfNecessary() const {
return false;
}
+/// Return true if \param valueTy is a type that should be casted to integer
+/// around the atomic memory operation. If \param cmpxchg is true, then the
+/// cast of a floating point type is made as that instruction can not have
+/// floating point operands. TODO: Allow compare-and-exchange and FP - see
+/// comment in CIRGenAtomicExpandPass.cpp.
+static bool shouldCastToInt(mlir::Type valueTy, bool cmpxchg) {
+ if (cir::isAnyFloatingPointType(valueTy))
+ return isa<cir::FP80Type>(valueTy) || cmpxchg;
----------------
Lancern wrote:
Added a test case that covers this branch, but it seems like we cannot make a
return value of `true` for now. I think I'll leave it as-is.
https://github.com/llvm/llvm-project/pull/165872
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits