diff options
| author | Sam Parker <sam.parker@arm.com> | 2020-01-09 11:57:04 +0000 |
|---|---|---|
| committer | Sam Parker <sam.parker@arm.com> | 2020-01-09 11:57:34 +0000 |
| commit | 15c7fa4d11eeb50095ae571c645427b9a267bdee (patch) | |
| tree | 561676b4e005427ff8bcb5f5428a060e46411b84 /llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | |
| parent | 795c38eb4df636d434a9821efecbfeb41ecba843 (diff) | |
| download | bcm5719-llvm-15c7fa4d11eeb50095ae571c645427b9a267bdee.tar.gz bcm5719-llvm-15c7fa4d11eeb50095ae571c645427b9a267bdee.zip | |
[ARM][MVE] Don't unroll intrinsic loops.
We don't unroll vector loops for MVE targets, but we miss the case
when loops only contain intrinsic calls. So just move the logic a
bit to catch this case.
Differential Revision: https://reviews.llvm.org/D72440
Diffstat (limited to 'llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp index 41ad8b0c04d..7ff05034c1f 100644 --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -1235,6 +1235,11 @@ void ARMTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE, unsigned Cost = 0; for (auto *BB : L->getBlocks()) { for (auto &I : *BB) { + // Don't unroll vectorised loop. MVE does not benefit from it as much as + // scalar code. + if (I.getType()->isVectorTy()) + return; + if (isa<CallInst>(I) || isa<InvokeInst>(I)) { ImmutableCallSite CS(&I); if (const Function *F = CS.getCalledFunction()) { @@ -1243,10 +1248,6 @@ void ARMTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE, } return; } - // Don't unroll vectorised loop. MVE does not benefit from it as much as - // scalar code. - if (I.getType()->isVectorTy()) - return; SmallVector<const Value*, 4> Operands(I.value_op_begin(), I.value_op_end()); |

