[llvm] [AMDGPU] expand-fp: Change frem expansion criterion (PR #158285)
Frederik Harwath via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 12 05:38:16 PDT 2025
================
@@ -423,7 +423,7 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(const TargetMachine &TM,
setOperationAction({ISD::LRINT, ISD::LLRINT}, {MVT::f16, MVT::f32, MVT::f64},
Expand);
- setOperationAction(ISD::FREM, {MVT::f16, MVT::f32, MVT::f64}, Expand);
+ setOperationAction(ISD::FREM, {MVT::f16, MVT::f32, MVT::f64}, LibCall);
----------------
frederik-h wrote:
Could you suggest a different condition? The issue is that once I remove the early exit based on the MaxLegalFpConvertBitWidth value, the pass starts expanding frem instructions for different other targets. The present approach is one way to precisely control if the expansion should run or not. Personally, I would prefer to add a flag, say, `enableExpandFpFrem` to the `TargetLowering` to selectively enable the expansion for a target.
https://github.com/llvm/llvm-project/pull/158285
More information about the llvm-commits
mailing list