[LegalizeDAG] Implement promotion rules for SELECT_CC
authorLemonBoy <thatlemon@gmail.com>
Fri, 5 Mar 2021 15:46:10 +0000 (16:46 +0100)
committerLemonBoy <thatlemon@gmail.com>
Fri, 5 Mar 2021 17:22:55 +0000 (18:22 +0100)
commit2ec43e416734bdead6bfeeaf5ab54c479b6f444e
tree34e136404b420c074e9cb5b002068120ef3ddd77
parent3998a8e79761fa4bb67c14d9c7720a64423f4a99
[LegalizeDAG] Implement promotion rules for SELECT_CC

Implement the promotion rule for SELECT_CC nodes by upcasting all the parameters and downcasting the result.
The AArch64 target makes use of this rule and, since it was not implemented, in some cases the instruction selector would hit an assertion upon encountering the illegal node.

This patch requires D97840, the included test cases hit both problems.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D97859
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/test/CodeGen/AArch64/vecreduce-fmax-legalization.ll
llvm/test/CodeGen/AArch64/vecreduce-fmin-legalization.ll