[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
Mon May 11 06:24:20 PDT 2020


Pierre-vh added inline comments.


================
Comment at: llvm/lib/Target/ARM/MVEVPTOptimisationsPass.cpp:250
+      if (!IsWritingToVCCR(*Iter) ||
+          getVPTInstrPredicate(*Iter) != ARMVCC::None)
+        continue;
----------------
dmgreen wrote:
> We not do this for predicated VCMP's?
Currently, no, to keep things simple.
I think that allowing predicated vcmps would require a bit more analysis to ensure that we don't make things worse by accident, and I'm not even sure it'd be worth it (are there any cases where it could be beneficial?)

```
%0:vccr = vpt ...
%1:vccr = vcmp /* predicated on %0 */
%2:vccr = vcmp /* unpredicated, opposite of %1 */
``` 
If we replace the second vcmp with `vpnot %1:vccr`, what happens if the first vcmp isn't executed? 


================
Comment at: llvm/lib/Target/ARM/MVEVPTOptimisationsPass.cpp:269
+      // Else, just set VCCRValue if it's a VCMP.
+      if (IsVCMP(Iter->getOpcode()))
+        VCCRValue = Dst;
----------------
dmgreen wrote:
> What makes us not do this for other opcodes? (I guess vcmp is the vast majority of cases?)
It's just that vcmp is the vast majority of cases. There's no issue with enabling it for other instructions that write to VPR.
I've removed this restriction and added a test with vmsr.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76847/new/

https://reviews.llvm.org/D76847





More information about the llvm-commits mailing list