[PATCH] D76847: [Target][ARM] Replace re-uses of old VPR values with VPNOTs

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 02:39:17 PDT 2020


dmgreen accepted this revision.
dmgreen added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.



================
Comment at: llvm/lib/Target/ARM/MVEVPTOptimisationsPass.cpp:250
+      if (!IsWritingToVCCR(*Iter) ||
+          getVPTInstrPredicate(*Iter) != ARMVCC::None)
+        continue;
----------------
Pierre-vh wrote:
> 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? 
It's not about "not executing", a predicated vcmp acts as a "and %0, <newcond>".

Overlapping ranges of different predicates certainly does sound more complex though. Lets leave that for other patches if we find cases where it's needed.


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

https://reviews.llvm.org/D76847





More information about the llvm-commits mailing list