If an instruction's AVL operand is a PHI node in the same block,
we may be able to peek through the PHI to find vsetvli instructions
that produce the AVL in other basic blocks. If we can prove those
vsetvli instructions have the same VTYPE and were the last vsetvli
in their respective blocks, then we don't need to insert a vsetvli
for this pseudo instruction.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM. Thanks @craig.topper
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | ||
---|---|---|
36 | Just curious here: do you foresee this might get expensive or this is a debugging utility? |
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | ||
---|---|---|
36 | Paranoia. Combining phis and data flow made me a little nervous. Our earlier internal version of this in the EPIRemoveRedundantVSETVLGlobal pass was missing the check that the phi was in the same basic block. A miscompile from it was found months later. I wonder if we should also have a disable on the global cross BB code. I think EPIRemoveRedundantVSETVLGlobal has a disable right? |
Just curious here: do you foresee this might get expensive or this is a debugging utility?