[llvm] [GlobalISel] Remove `fp_to_[s/u]int_sat_gi` node (PR #202908)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 02:56:55 PDT 2026


================
@@ -954,6 +954,25 @@ Expected<InstructionMatcher &> GlobalISelEmitter::createAndImportSelDAGMatcher(
       }
     }
 
+    // The SDAG fp_to_[su]int_sat nodes carry a trailing ValueType operand
+    // encoding the saturation width. G_FPTOSI_SAT/G_FPTOUI_SAT instead saturate
+    // to their result type and have no such operand, so drop the trailing child
+    // before matching the operands.
----------------
arsenm wrote:

They should have the type operand, just as the DAG needs it. That's the real problem which needs to be solved here. Using the operation type only works if the original type was legal, the operation needs to encode the original IR type if it needs to be widened 

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


More information about the llvm-commits mailing list