[llvm] [LLVM][InstCombine] Preserve vector types when shrinking FP constants. (PR #163598)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 15 12:53:10 PDT 2025


================
@@ -1643,33 +1643,43 @@ Instruction *InstCombinerImpl::visitSExt(SExtInst &Sext) {
 
 /// Return a Constant* for the specified floating-point constant if it fits
 /// in the specified FP type without changing its value.
-static bool fitsInFPType(ConstantFP *CFP, const fltSemantics &Sem) {
+static bool fitsInFPType(APFloat F, const fltSemantics &Sem) {
----------------
nikic wrote:

```suggestion
static bool fitsInFPType(const APFloat &F, const fltSemantics &Sem) {
```

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


More information about the llvm-commits mailing list