[EarlyIfConversion] Avoid producing selects with identical operands
authorJon Roelofs <jonathan_roelofs@apple.com>
Thu, 29 Apr 2021 15:40:41 +0000 (08:40 -0700)
committerJon Roelofs <jonathan_roelofs@apple.com>
Fri, 30 Apr 2021 21:42:39 +0000 (14:42 -0700)
commit3d27b5d28aabf8516aa1fefc78a6878b89a992f0
tree4602845d53301010ed6807604a39b956883ed9f6
parentc00fc180ecdac4b13caddd1ba506ffa3f6e7e206
[EarlyIfConversion] Avoid producing selects with identical operands

This extends the early-ifcvt pass to avoid a few more cases where the resulting
select instructions would have matching operands.  Additionally, we now use TII
to determine "sameness" of the operands so that as TII gets smarter, so too
will ifcvt.

The attached test case was bugpoint-reduced down from CINT2000/252.eon in the
test-suite. See: https://clang.godbolt.org/z/WvnrcrGEn

Differential Revision: https://reviews.llvm.org/D101508
llvm/lib/CodeGen/EarlyIfConversion.cpp
llvm/test/CodeGen/AArch64/early-ifcvt-same-value.mir [new file with mode: 0644]