[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:29:16 PDT 2025
================
@@ -1000,8 +1008,8 @@ static bool runImpl(Function &F, const TargetLowering &TLI,
if (ExpandFpConvertBits != llvm::IntegerType::MAX_INT_BITS)
MaxLegalFpConvertBitWidth = ExpandFpConvertBits;
- if (MaxLegalFpConvertBitWidth >= llvm::IntegerType::MAX_INT_BITS)
----------------
frederik-h wrote:
@arsenm I would really like to keep an early exit from the pass if it can be proved that it does not need to expand any instructions for the target. That's easy for the ExpandLargeFp part of the pass, but for frem, we would need to check up front if there is some type for which `shouldExpandFremType` returns true. This could be achieved easily by adding some way to enumerate all floating point types, e.g. llvm/lib/IR/Type.cpp. Are you aware of something like this? Alternatively, I could hardcode the floating point types support by the frem expansion.
https://github.com/llvm/llvm-project/pull/158285
More information about the llvm-commits
mailing list