Skip to content

Commit c3aa63c

Browse files
Addressing reviewers (2)
1 parent 7e20927 commit c3aa63c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2495,9 +2495,9 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI,
24952495
// We can safety handle math functions that have vectorized
24962496
// counterparts and have the memory write-only attribute set.
24972497
if (isMathLibCallMemWriteOnly(TLI, I)) {
2498-
LLVM_DEBUG(dbgs()
2499-
<< "LAA: allow math function with write-only attribute:"
2500-
<< I << "\n");
2498+
LLVM_DEBUG(dbgs() << "LAA: Allow to vectorize math function with "
2499+
"write-only attribute:"
2500+
<< I << "\n");
25012501
continue;
25022502
}
25032503

llvm/test/Analysis/LoopAccessAnalysis/attr-mem-write-only.ll

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
; RUN: opt < %s -mattr=+sve -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s
1+
; RUN: opt < %s -passes='print<access-info>' -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s
22

33
; REQUIRES: asserts
44

5-
target triple = "aarch64-unknown-linux-gnu"
6-
7-
; TODO: add mappings for frexp/frexpf
85

96
define void @frexp_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) {
7+
; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call double @frexp
108
entry:
119
%cmp4 = icmp sgt i32 %N, 0
1210
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
@@ -33,6 +31,7 @@ for.body:
3331
declare double @frexp(double, ptr) #1
3432

3533
define void @frexp_f32(ptr readonly %in, ptr %out1, ptr %out2, i32 %N) {
34+
; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call float @frexpf
3635
entry:
3736
%cmp4 = icmp sgt i32 %N, 0
3837
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
@@ -59,7 +58,7 @@ for.body:
5958
declare float @frexpf(float , ptr) #1
6059

6160
define void @modf_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) {
62-
; CHECK: LAA: allow math function with write-only attribute: %call = tail call double @modf
61+
; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call double @modf
6362
entry:
6463
%cmp7 = icmp sgt i32 %N, 0
6564
br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup
@@ -87,7 +86,7 @@ for.body:
8786
declare double @modf(double , ptr ) #1
8887

8988
define void @modf_f32(ptr %in, ptr %out1, ptr %out2, i32 %N) {
90-
; CHECK: LAA: allow math function with write-only attribute: %call = tail call float @modff
89+
; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call float @modff
9190
entry:
9291
%cmp7 = icmp sgt i32 %N, 0
9392
br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup

llvm/test/Transforms/LoopVectorize/AArch64/veclib-function-calls-linear-ptrs.ll

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
target triple = "aarch64-unknown-linux-gnu"
55

6-
; TODO: add mappings for frexp/frexpf
6+
; Vectorization can not happen because there is no scalar to vector mapping in
7+
; TLI for frexp/frexpf. Tests will need to be changed when such mappings are
8+
; added.
79

810
define void @frexp_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) {
911
; CHECK-LABEL: define void @frexp_f64(

0 commit comments

Comments
 (0)