[llvm] CodeGen: Add ISD::AssertNoFPClass (PR #138839)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed May 14 23:27:39 PDT 2025


================
@@ -2996,10 +3009,18 @@ SDValue DAGTypeLegalizer::PromoteFloatRes_UnaryOp(SDNode *N) {
   EVT VT = N->getValueType(0);
   EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
   SDValue Op = GetPromotedFloat(N->getOperand(0));
-
   return DAG.getNode(N->getOpcode(), SDLoc(N), NVT, Op);
 }
 
+// Unary operation with a more non-float operand where the result and the
+// operand have PromoteFloat type action.  Construct a new SDNode with the
+// promoted float value of the old operand.
+SDValue DAGTypeLegalizer::PromoteFloatRes_AssertNoFPClass(SDNode *N) {
+  EVT VT = N->getValueType(0);
+  EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
+  SDValue Op = GetPromotedFloat(N->getOperand(0));
----------------
arsenm wrote:

It's not safe to preserve the assert in all cases, I think this should just return Op here. We would need a conservative stripping of any properties that may change after the promotion operation. If we want that it's best to leave it for a follow up.

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


More information about the llvm-commits mailing list