[RISCV] Add test case to show a case where (mul (and X, 0xffffffff), (and Y, 0xffffff...
authorCraig Topper <craig.topper@sifive.com>
Sun, 21 Mar 2021 00:43:30 +0000 (17:43 -0700)
committerCraig Topper <craig.topper@sifive.com>
Sun, 21 Mar 2021 00:54:28 +0000 (17:54 -0700)
commit27bc30c39d62f50fd762a8bcc2dcb0401e7263f7
tree45dc241b9977c6ad93c5b9286a8a85c76dd0a406
parent361b7d125b438cda13fa45f13790767a62252be9
[RISCV] Add test case to show a case where (mul (and X, 0xffffffff), (and Y, 0xffffffff)) optimization does not improve code.

If the mul add two users, one of which was a sext.w, the mul
would also be selected to a MULW before our pattern runs. This
causes the ANDs to now be used by the already selected MULW and
the mul we still need to select. They are unneeded on the MULW
since MULW only reads the lower bits. So they get selected to
SLLI+SRLI for the MULW use. The use for the
(mul (and X, 0xffffffff), (and Y, 0xffffffff)) manages to reuse
the SLLI.

The end result is increased register pressure and no improvement
to how soon we can start the MULW.
llvm/test/CodeGen/RISCV/xaluo.ll