[llvm] [SDAG] Add missing float type legalizations for FMODF (PR #128055)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 11:19:34 PST 2025


================
@@ -2616,6 +2624,18 @@ bool SelectionDAG::expandMultipleResultFPLibCall(
 
   auto [Call, CallChain] = TLI->LowerCallTo(CLI);
 
+  if (CallRetResNo && !Node->hasAnyUseOfValue(*CallRetResNo)) {
+    // This is needed for x87, which uses a floating-point stack. If (for
----------------
MacDue wrote:

> The other possibility I was thinking about is whether we can pull the CopyFromReg inside the call sequence, so it's before the adjstackup instead of after it. That would give it the same scheduling protections as other bits of code inside call sequences. But I'm not sure if that would have other effects.

If this works, it sounds like the simplest solution (the `callseq_end` would do the same job as the `chain_barrier`), but I also don't know what the other implications could be. 

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


More information about the llvm-commits mailing list