[llvm] [SelectionDAG] Look through FREEZE in getCopyToRegs when checking isZExtFree (PR #195285)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 11:29:12 PDT 2026


================
@@ -993,8 +993,13 @@ void RegsForValue::getCopyToRegs(SDValue Val, SelectionDAG &DAG,
                                *DAG.getContext(), *CallConv, RegVTs[Value])
                          : RegVTs[Value];
 
-    if (ExtendKind == ISD::ANY_EXTEND && TLI.isZExtFree(Val, RegisterVT))
-      ExtendKind = ISD::ZERO_EXTEND;
+    if (ExtendKind == ISD::ANY_EXTEND) {
+      SDValue PeeledVal = Val;
+      if (PeeledVal.getOpcode() == ISD::FREEZE)
+        PeeledVal = PeeledVal.getOperand(0);
----------------
arsenm wrote:

Probably should introduce a utility function for this, since it seems to becoming a common problem 

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


More information about the llvm-commits mailing list