1. [LegalizeVectorOps] Split most of ExpandStrictFPOp into a separate (details)
  2. [TargetLowering] In expandFP_TO_UINT, add proper extend or truncate for (details)
  3. [LegalizeVectorOps][X86] Enable expansion of vector fp_to_uint in (details)
Commit 285d5e6b8b1ecc70c25468b6c7458d2adadeddf3 by craig.topper
[LegalizeVectorOps] Split most of ExpandStrictFPOp into a separate
UnrollStrictFPOp method. Call that method from ExpandUINT_TO_FLOAT.
ExpandStrictFPOp calls ExpandUINT_TO_FLOAT. Previously,
ExpandUINT_TO_FLOAT returned SDValue() if it wasn't able to handle and
needed to unroll. Then ExpandStrictFPOp would detect his SDValue() and
do the unroll.
After this change, ExpandUINT_TO_FLOAT will directly call
UnrollStrictFPOp and return the unrolled result.
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
Commit 16a67d252c72332423bae6597a0685248fc3501f by craig.topper
[TargetLowering] In expandFP_TO_UINT, add proper extend or truncate for
the condition to feed the DstVT select.
Previously, for vectors we created a vselect with a condition that
didn't match what the target wanted according to getSetCCResultType.
To make up for this, X86 had a special DAG combine to detect if the
condition was all sign bits and then insert its own truncate or extend.
By adding the extend/truncate here explicitly we can avoid that.
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Commit 4e37d60f2a6b66ce95a039e6c929e7e38af30cd1 by craig.topper
[LegalizeVectorOps][X86] Enable expansion of vector fp_to_uint in
LegalizeVectorOps to avoid scalarization.
The code here isn't great in all caess. Particularly v4f64->v4i32 on
64-bit AVX targets. But there is some improvement in some
There's definitely some issues with computeNumSignBits with
X86ISD::STRICT_FCMP. As well as not being able to propagate sign bits
through merge_values nodes that get created during custom legalization.
The file was modifiedllvm/test/CodeGen/X86/vec-strict-fptoint-256.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
The file was modifiedllvm/test/CodeGen/X86/vec-strict-fptoint-128.ll
The file was modifiedllvm/test/CodeGen/X86/vector-constrained-fp-intrinsics.ll