[all-commits] [llvm/llvm-project] e04810: [RISCV] Don't remove (and X, 0xffffffff) from inpu...
Craig Topper via All-commits
all-commits at lists.llvm.org
Thu Nov 26 23:29:38 PST 2020
Branch: refs/heads/temp-test-main
Home: https://github.com/llvm/llvm-project
Commit: e0481048abd33079261c9aa701c0916a52941dc3
https://github.com/llvm/llvm-project/commit/e0481048abd33079261c9aa701c0916a52941dc3
Author: Craig Topper <craig.topper at sifive.com>
Date: 2020-11-26 (Thu, 26 Nov 2020)
Changed paths:
M llvm/lib/Target/RISCV/RISCVInstrInfoM.td
Log Message:
-----------
[RISCV] Don't remove (and X, 0xffffffff) from inputs when matching RISCVISD::DIVUW/REMUW to 64-bit DIVU/REMU.
These patterns are using zexti32 which matches either assertzexti32
or (and X, 0xffffffff). But if we match (and X, 0xffffffff) it will
remove the AND and the inputs may no longer have the zero bits
needed to guarantee the result has enough zeros.
This commit changes the patterns to only match assertzexti32.
I'm not sure how to test the broken case since the DIVUW/REMUW nodes
are created during type legalization, but type legalization won't
create an (and X, 0xfffffffff) directly on the inputs.
I've also changed the zexti32 on the root of the pattern to just
checking for AND. We were previously also matching assertzexti32,
but I doubt that pattern would ever occur.
More information about the All-commits
mailing list