[llvm-branch-commits] [llvm] [X86] Remove shouldCastAtomicLoadInIR; use DAG combine instead (PR #199520)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Jun 6 01:11:51 PDT 2026


================
@@ -54226,6 +54220,29 @@ static SDValue combineConstantPoolLoads(SDNode *N, const SDLoc &dl,
   return SDValue();
 }
 
+static SDValue combineAtomicLoad(SDNode *N, SelectionDAG &DAG,
+                                 TargetLowering::DAGCombinerInfo &DCI) {
+  if (!DCI.isBeforeLegalize())
+    return SDValue();
+
+  auto *AN = cast<AtomicSDNode>(N);
+  EVT VT = AN->getValueType(0);
+  if (!VT.getScalarType().isFloatingPoint())
+    return SDValue();
+
+  unsigned BitWidth = VT.getStoreSizeInBits();
+  if (BitWidth == 0 || BitWidth != VT.getSizeInBits())
----------------
jofrn wrote:

You're correct. The check for FP types implies we can't have zero BitWidth. Thank you.

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


More information about the llvm-branch-commits mailing list