Skip to content

Commit 4b7b976

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

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
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

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

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

7-
; TODO: add mappings for frexp/frexpf
7+
; LoopVectorizer's Legality does not let vectorization to happen because there
8+
; is no scalar to vector mapping in TLI for frexp/frexpf. As a result, LAA will
9+
; never encounter such loops.
10+
; Tests will need to be changed when such mappings are added.
811

912
define void @frexp_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) {
13+
; CHECK-NOT: LAA: Allow to vectorize math function with write-only attribute: %call = tail call double @frexp
1014
entry:
1115
%cmp4 = icmp sgt i32 %N, 0
1216
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
@@ -33,6 +37,7 @@ for.body:
3337
declare double @frexp(double, ptr) #1
3438

3539
define void @frexp_f32(ptr readonly %in, ptr %out1, ptr %out2, i32 %N) {
40+
; CHECK-NOT: LAA: Allow to vectorize math function with write-only attribute: %call = tail call float @frexpf
3641
entry:
3742
%cmp4 = icmp sgt i32 %N, 0
3843
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
@@ -59,7 +64,7 @@ for.body:
5964
declare float @frexpf(float , ptr) #1
6065

6166
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
67+
; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call double @modf
6368
entry:
6469
%cmp7 = icmp sgt i32 %N, 0
6570
br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup
@@ -87,7 +92,7 @@ for.body:
8792
declare double @modf(double , ptr ) #1
8893

8994
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
95+
; CHECK: LAA: Allow to vectorize math function with write-only attribute: %call = tail call float @modff
9196
entry:
9297
%cmp7 = icmp sgt i32 %N, 0
9398
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)