summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSam Parker <sam.parker@arm.com>2019-09-30 08:03:23 +0000
committerSam Parker <sam.parker@arm.com>2019-09-30 08:03:23 +0000
commitaac03ae06a8a2eaac40c5cbb91b57c5a29e7fdad (patch)
tree150a7b47df31a237dbbd3607f07f11cbf71f5e2b /llvm/lib
parent5a2a14db0bc4cfd4f3c8f2fbac7ca9bc93a23699 (diff)
downloadbcm5719-llvm-aac03ae06a8a2eaac40c5cbb91b57c5a29e7fdad.tar.gz
bcm5719-llvm-aac03ae06a8a2eaac40c5cbb91b57c5a29e7fdad.zip
[ARM][MVE] Change VCTP operand
The VCTP instruction will calculate the predicate masked based upon the number of elements that need to be processed. I had inserted the sub before the vctp intrinsic and supplied it as the operand, but this is incorrect as the phi should directly feed the vctp. The sub is calculating the value for the next iteration. Differential Revision: https://reviews.llvm.org/D67921 llvm-svn: 373188
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/MVETailPredication.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/MVETailPredication.cpp b/llvm/lib/Target/ARM/MVETailPredication.cpp
index 844eafbcb38..4db8ab17c49 100644
--- a/llvm/lib/Target/ARM/MVETailPredication.cpp
+++ b/llvm/lib/Target/ARM/MVETailPredication.cpp
@@ -491,13 +491,13 @@ bool MVETailPredication::TryConvert(Value *TripCount) {
case 16: VCTPID = Intrinsic::arm_vctp8; break;
}
Function *VCTP = Intrinsic::getDeclaration(M, VCTPID);
- // TODO: This add likely already exists in the loop.
- Value *Remaining = Builder.CreateSub(Processed, Factor);
- Value *TailPredicate = Builder.CreateCall(VCTP, Remaining);
+ Value *TailPredicate = Builder.CreateCall(VCTP, Processed);
Predicate->replaceAllUsesWith(TailPredicate);
NewPredicates[Predicate] = cast<Instruction>(TailPredicate);
// Add the incoming value to the new phi.
+ // TODO: This add likely already exists in the loop.
+ Value *Remaining = Builder.CreateSub(Processed, Factor);
Processed->addIncoming(Remaining, L->getLoopLatch());
LLVM_DEBUG(dbgs() << "TP: Insert processed elements phi: "
<< *Processed << "\n"
OpenPOWER on IntegriCloud