aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaschalis Mpeis <Paschalis.Mpeis@arm.com>2024-04-30 15:31:18 +0100
committerPaschalis Mpeis <Paschalis.Mpeis@arm.com>2024-05-09 14:25:52 +0100
commitf684acdf111ec66ac01869d3844d1fb1dd22f9f6 (patch)
tree564f79fd8920a0128df65e912db714aeaf4e24f2
parent4e4c77299390d7e84c7b2fa048811c20c09a1706 (diff)
downloadllvm-f684acdf111ec66ac01869d3844d1fb1dd22f9f6.zip
llvm-f684acdf111ec66ac01869d3844d1fb1dd22f9f6.tar.gz
llvm-f684acdf111ec66ac01869d3844d1fb1dd22f9f6.tar.bz2
Addressing reviewers (2)
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp6
-rw-r--r--llvm/test/Analysis/LoopAccessAnalysis/attr-mem-write-only.ll11
-rw-r--r--llvm/test/Transforms/LoopVectorize/AArch64/veclib-function-calls-linear-ptrs.ll4
3 files changed, 11 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 27859d8..ebafd12 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -2496,9 +2496,9 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI,
// We can safety handle math functions that have vectorized
// counterparts and have the memory write-only attribute set.
if (isMathLibCallMemWriteOnly(TLI, I)) {
- LLVM_DEBUG(dbgs()
- << "LAA: allow math function with write-only attribute:"
- << I << "\n");
+ LLVM_DEBUG(dbgs() << "LAA: Allow to vectorize math function with "
+ "write-only attribute:"
+ << I << "\n");
continue;
}
diff --git a/llvm/test/Analysis/LoopAccessAnalysis/attr-mem-write-only.ll b/llvm/test/Analysis/LoopAccessAnalysis/attr-mem-write-only.ll
index aca4e4a..8a2e952 100644
--- a/llvm/test/Analysis/LoopAccessAnalysis/attr-mem-write-only.ll
+++ b/llvm/test/Analysis/LoopAccessAnalysis/attr-mem-write-only.ll
@@ -1,12 +1,10 @@
-; RUN: opt < %s -mattr=+sve -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s
+; RUN: opt < %s -passes='print<access-info>' -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s
; REQUIRES: asserts
-target triple = "aarch64-unknown-linux-gnu"
-
-; TODO: add mappings for frexp/frexpf
define void @frexp_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) {
+; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call double @frexp
entry:
%cmp4 = icmp sgt i32 %N, 0
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
@@ -33,6 +31,7 @@ for.body:
declare double @frexp(double, ptr) #1
define void @frexp_f32(ptr readonly %in, ptr %out1, ptr %out2, i32 %N) {
+; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call float @frexpf
entry:
%cmp4 = icmp sgt i32 %N, 0
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
@@ -59,7 +58,7 @@ for.body:
declare float @frexpf(float , ptr) #1
define void @modf_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) {
-; CHECK: LAA: allow math function with write-only attribute: %call = tail call double @modf
+; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call double @modf
entry:
%cmp7 = icmp sgt i32 %N, 0
br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup
@@ -87,7 +86,7 @@ for.body:
declare double @modf(double , ptr ) #1
define void @modf_f32(ptr %in, ptr %out1, ptr %out2, i32 %N) {
-; CHECK: LAA: allow math function with write-only attribute: %call = tail call float @modff
+; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call float @modff
entry:
%cmp7 = icmp sgt i32 %N, 0
br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/veclib-function-calls-linear-ptrs.ll b/llvm/test/Transforms/LoopVectorize/AArch64/veclib-function-calls-linear-ptrs.ll
index 0a502f5..f513360 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/veclib-function-calls-linear-ptrs.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/veclib-function-calls-linear-ptrs.ll
@@ -3,7 +3,9 @@
target triple = "aarch64-unknown-linux-gnu"
-; TODO: add mappings for frexp/frexpf
+; Vectorization can not happen because there is no scalar to vector mapping in
+; TLI for frexp/frexpf. Tests will need to be changed when such mappings are
+; added.
define void @frexp_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) {
; CHECK-LABEL: define void @frexp_f64(