[llvm] [X86] Try Folding icmp of v8i32 -> fcmp of v8f32 on AVX (PR #82290)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 26 12:15:26 PST 2024
================
@@ -2313,6 +2313,26 @@ bool TargetLowering::SimplifyDemandedBits(
Known = TLO.DAG.computeKnownBits(Op, DemandedElts, Depth);
break;
}
+ case ISD::SINT_TO_FP: {
+ EVT InnerVT = Op.getOperand(0).getValueType();
+ const APInt &DemandedBitsToUse =
+ TLO.DAG.getTargetLoweringInfo().isBitcastFree(VT, InnerVT)
+ ? OriginalDemandedBits
+ : DemandedBits;
+ if (DemandedBitsToUse.isSignMask() &&
+ VT.getScalarSizeInBits() == InnerVT.getScalarSizeInBits())
+ return TLO.CombineTo(Op, TLO.DAG.getBitcast(VT, Op.getOperand(0)));
+
+ Known = TLO.DAG.computeKnownBits(Op, DemandedElts, Depth);
+ break;
+ }
+ case ISD::UINT_TO_FP: {
+ if (OriginalDemandedBits.isSignMask())
+ return TLO.CombineTo(Op, TLO.DAG.getConstant(0, dl, VT));
+
+ Known = TLO.DAG.computeKnownBits(Op, DemandedElts, Depth);
+ break;
+ }
----------------
goldsteinn wrote:
I could move this to `simplfySExtOfDecomposedSetCC` if there are concerns putting it here.
https://github.com/llvm/llvm-project/pull/82290
More information about the llvm-commits
mailing list