[llvm] [GlobalIsel] [Utility] [NFC] Added isConstantOrConstantSplatVectorFP to handle float constants. (PR #120935)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 00:06:30 PST 2024


================
@@ -522,6 +522,13 @@ std::optional<APInt>
 isConstantOrConstantSplatVector(MachineInstr &MI,
                                 const MachineRegisterInfo &MRI);
 
+/// Determines if \p MI defines a float constant integer or a splat vector of
+/// float constant integers.
+/// \returns the float constant or std::nullopt.
+std::optional<APFloat>
----------------
arsenm wrote:

I thought we had switched the integer versions over to using ConstantInt* to avoid temporary copies of APInt, but I see the integer version above isn't doing that. We can change the pair as a set later

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


More information about the llvm-commits mailing list