[SelectionDAG] Handle unary SelectPatternFlavor for ABS case in SelectionDAGBuilder::visitSelect.
These changes are related to PR37743 and include:
- SelectionDAGBuilder::visitSelect handles the unary SelectPatternFlavor::SPF_ABS case to build ABS node.
- Delete the redundant recognizer of the integer ABS pattern from the DAGCombiner.
- Add promoting the integer ABS node in the LegalizeIntegerType.
- Expand-based legalization of integer result for the ABS nodes.
- Expand-based legalization of ABS vector operations.
- Add some integer abs testcases for different typesizes for Thumb arch
- Add the custom ABS expanding and change the SAD pattern recognizer for X86 arch: The i64 result of the ABS is expanded to:
tmp = (SRA, Hi, 31) Lo = (UADDO tmp, Lo) Hi = (XOR tmp, (ADDCARRY tmp, hi, Lo:1)) Lo = (XOR tmp, Lo)
The "detectZextAbsDiff" function is changed for the recognition of pattern
with the ABS node. Given a ABS node, detect the following pattern:
(ABS (SUB (ZERO_EXTEND a), (ZERO_EXTEND b))).
- Change integer abs testcases for codegen with the ABS node support for AArch64.
- Indicate that the ABS is legal for the i64 type when the NEON is supported.
- Change the integer abs testcases to show changing of codegen.
- Add combine and legalization of ABS nodes for Thumb arch.
- Extend 'matchSelectPattern' to recognize the ABS patterns with ICMP_SGE condition.
For discussion, see https://bugs.llvm.org/show_bug.cgi?id=37743
@nemanjai Use VT.is128BitVector() ? Worth adding as a pre-commit now?