[RISCV] Prevent formation of shXadd(.uw) and add.uw if it prevents the use of addi.
authorCraig Topper <craig.topper@sifive.com>
Sat, 19 Jun 2021 18:54:59 +0000 (11:54 -0700)
committerCraig Topper <craig.topper@sifive.com>
Sat, 19 Jun 2021 19:10:42 +0000 (12:10 -0700)
commitb663f30fa45ce86c8a3362624b87ccb372bd036a
tree633d9adaab57f00fff783c065c308cf421eda942
parent834aafa55bd175efce0575e6e596f19cdf317d91
[RISCV] Prevent formation of shXadd(.uw) and add.uw if it prevents the use of addi.

If the outer add has an simm12 immediate operand we should prefer
it instead of materializing it in a register. This would guarantee
and extra instruction and temporary register. Since we don't check
one use on the shl or zext we might generate more instructions if
there is an additional user.
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
llvm/test/CodeGen/RISCV/rv64zba.ll