[PATCH] D76847: [Target][ARM] Replace re-uses of old VPR values with VPNOTs
Pierre van Houtryve via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 29 23:57:41 PDT 2020
Pierre-vh marked 3 inline comments as done.
Pierre-vh added inline comments.
================
Comment at: llvm/lib/Target/ARM/MVEVPTOptimisationsPass.cpp:233
+ // on "VPNOTOperand".
+ for (MachineBasicBlock::instr_iterator Iter = ++Instr.getIterator();
+ Iter != MBB.end(); ++Iter) {
----------------
dmgreen wrote:
> Should this not be replacing _all_ uses of the old condition with the value from the VPNOT?
>
> As in, if we see input code like:
> a = VCMP ..
> use(a)
> b = VPNOT a
> ..
> use(b)
> ..
> use(a)
>
> Could it not be generally beneficial to insert a VPNOT between use of b and the second use of a? We could also probably have any amount of code between the predicated uses and it might still be beneficial, considering the costs of spills/reloads vs a single VPNOT.
I believe it's already doing that. I'll add more tests to show it.
I can certainly do the optimisation even outside blocks of predicated instruction, I just need to remove these lines and add a few tests:
```
// Stop as soon as we leave the block of predicated instructions
if (getVPTInstrPredicate(*Iter) == ARMVCC::None)
break;
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76847/new/
https://reviews.llvm.org/D76847
More information about the llvm-commits
mailing list