[PATCH] D79175: [ARM][MVE] Tail-Predication: use @llvm.get.active.lane.mask to get the BTC

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 05:57:28 PDT 2020


samparker added a comment.

A glorious amount of red in this diff.



================
Comment at: llvm/lib/Target/ARM/MVETailPredication.cpp:348
+  Value *NumElements = Builder.CreateAdd(ScalarBTC,
+      ConstantInt::get(ScalarBTC->getType(), 1), "num.elements");
+
----------------
efriedma wrote:
> This addition can overflow.
And that's not okay, right? Trip count will always be BTC + 1 and we don't handle uncountable loops.


================
Comment at: llvm/lib/Target/ARM/MVETailPredication.cpp:382
   // TODO: This add likely already exists in the loop.
   Value *Remaining = Builder.CreateSub(Processed, Factor);
   Processed->addIncoming(Remaining, L->getLoopLatch());
----------------
efriedma wrote:
> This subtraction can also overflow.
But that's okay, right? This predication is only really useful when wrapping happens and the intrinsic reflects that overflow can/will happen.


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

https://reviews.llvm.org/D79175





More information about the llvm-commits mailing list