[RISCV] Refactor performSUBCombine to prepare for D132000.
authorCraig Topper <craig.topper@sifive.com>
Wed, 17 Aug 2022 16:40:29 +0000 (09:40 -0700)
committerCraig Topper <craig.topper@sifive.com>
Wed, 17 Aug 2022 16:50:08 +0000 (09:50 -0700)
commitab4cd154c6deffb0211ff4d2ac1f0932d8de0d74
treea78c4ba65be06de9d88da93e1ac7f89ee0de0c05
parent9525015c1bed5563813a440c5e5c871bd3c7eb24
[RISCV] Refactor performSUBCombine to prepare for D132000.

This refactors the code into a separate function with early returns.
D132000 adds an additional operation to the if/else that selects
NewLHS, but can otherwise share the rest of the code.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D132002
llvm/lib/Target/RISCV/RISCVISelLowering.cpp