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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 05:52:16 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.
----------------
jayfoad wrote:

I tend to agree that this is a step in the right direction. The emitter change seems quite nice to me -- it can just bail out (fail to import) if the saturation and result types do not match.

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


More information about the llvm-commits mailing list