[llvm] [RISCV] Lower vector UINT_TO_FP i1 to VSELECT 1.0/0.0 (PR #219426)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 28 10:10:37 PDT 2026
================
@@ -8521,6 +8521,16 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op,
return lowerStrictFPExtendOrRoundLike(Op, DAG);
case ISD::SINT_TO_FP:
case ISD::UINT_TO_FP:
+ // An unsigned i1-to-fp conversion is equivalent to selecting between
+ // 1.0 and 0.0. This avoids extending the mask before converting it.
+ if (Op.getOpcode() == ISD::UINT_TO_FP && Op.getValueType().isVector() &&
----------------
topperc wrote:
Can we do something similar for SINT_TO_FP with -1.0 and 0.0?
https://github.com/llvm/llvm-project/pull/219426
More information about the llvm-commits
mailing list