[clang] [ClangFE] Improve handling of casting of atomic memory operations. (PR #86691)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 29 06:43:01 PDT 2024


================
@@ -1399,13 +1401,22 @@ RValue AtomicInfo::convertAtomicTempToRValue(Address addr,
       LVal.getBaseInfo(), TBAAAccessInfo()));
 }
 
+static bool shouldCastToInt(llvm::Type *ValTy, bool CmpXchg) {
+  bool KeepType =
+      (ValTy->isIntegerTy() || ValTy->isPointerTy() ||
+       (ValTy->isFloatingPointTy() && !ValTy->isX86_FP80Ty() && !CmpXchg));
+  return !KeepType;
----------------
arsenm wrote:

Invert the expression and directly return? 

https://github.com/llvm/llvm-project/pull/86691


More information about the cfe-commits mailing list