[llvm] [CodeGen] expand-fp: Change frem expansion criterion (PR #158285)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 10 03:32:14 PST 2025


================
@@ -587,7 +587,7 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM,
       setOperationAction(ISD::FSIN, VT, Expand);
       setOperationAction(ISD::FCOS, VT, Expand);
       setOperationAction(ISD::FSINCOS, VT, Expand);
-      setOperationAction(ISD::FREM, VT, Expand);
+      setOperationAction(ISD::FREM, VT, LibCall);
----------------
uweigand wrote:

I don't mind this particular change, if this is the way we decide to handle this.  It's a bit strange however to handle FREM differently from all the other (potential) libcalls here.  For example, FSINCOS is set to Expand, but that means that common code checks whether a libcall is available and uses it if so (see SelectionDAGLegalize::ExpandNode).

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


More information about the llvm-commits mailing list