[RISCV] Rework hasAllWUsers in RISCVSExtWRemoval. NFCI
authorCraig Topper <craig.topper@sifive.com>
Wed, 9 Nov 2022 07:40:15 +0000 (23:40 -0800)
committerCraig Topper <craig.topper@sifive.com>
Wed, 9 Nov 2022 19:32:19 +0000 (11:32 -0800)
commit5e3df94a1798a756a6bbe31a4c4f1f4009990c15
treeb48a82479e654144b45838157b5b098faeebbe83
parent0453857d740248a8991ac28981784445dffa8dee
[RISCV] Rework hasAllWUsers in RISCVSExtWRemoval. NFCI

Instead of storing the uses to check in the worklist, store the
instruction we want to check uses for.

Now we pop and instruction from the worklist, loop over its uses
and check them. If it's something we need to look across, we'll push
it to the worklist.

By doing it this way, we can have access to which operand
of the user is using the instruction. This will allow supporting
store instructions since we'll be able to disambiguate the the value
operand and the pointer operand. We can also improve support for
*add.uw instructions and shift amount uses.

Reviewed By: mohammed-nurulhoque, asb

Differential Revision: https://reviews.llvm.org/D137446
llvm/lib/Target/RISCV/RISCVSExtWRemoval.cpp