Skip to content

Commit 46cb7e4

Browse files
authored
[LoopDist] Update the pragma info of loop distribute, NFC (#69825)
Base on D19403, the exact pragma of distribute is `#pragma clang loop distribute`
1 parent 4f6757c commit 46cb7e4

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

flang/test/Driver/optimization-remark.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
! MISSED-REGEX-LOOP-ONLY: optimization-remark.f90:76:4: remark: loop not vectorized [-Rpass-missed=loop-vectorize]
4848

4949

50-
! ANALYSIS-REGEX-LOOP-ONLY: optimization-remark.f90:79:7: remark: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
50+
! ANALYSIS-REGEX-LOOP-ONLY: optimization-remark.f90:79:7: remark: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
5151
! ANALYSIS-REGEX-LOOP-ONLY: Unknown data dependence. Memory location is the same as accessed at optimization-remark.f90:78:7 [-Rpass-analysis=loop-vectorize]
5252
! ANALYSIS-REGEX-LOOP-ONLY-NOT: remark: {{.*}}: IR instruction count changed from {{[0-9]+}} to {{[0-9]+}}; Delta: {{-?[0-9]+}} [-Rpass-analysis=size-info]
5353

@@ -56,10 +56,10 @@
5656

5757
! MISSED: optimization-remark.f90:77:7: remark: failed to hoist load with loop-invariant address because load is conditionally executed [-Rpass-missed=licm]
5858
! MISSED: optimization-remark.f90:76:4: remark: loop not vectorized [-Rpass-missed=loop-vectorize]
59-
! MISSED-NOT: optimization-remark.f90:79:7: remark: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
59+
! MISSED-NOT: optimization-remark.f90:79:7: remark: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
6060
! MISSED-NOT: Unknown data dependence. Memory location is the same as accessed at optimization-remark.f90:78:7 [-Rpass-analysis=loop-vectorize]
6161

62-
! ANALYSIS: optimization-remark.f90:79:7: remark: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
62+
! ANALYSIS: optimization-remark.f90:79:7: remark: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
6363
! ANALYSIS: Unknown data dependence. Memory location is the same as accessed at optimization-remark.f90:78:7 [-Rpass-analysis=loop-vectorize]
6464
! ANALYSIS: remark: {{.*}}: IR instruction count changed from {{[0-9]+}} to {{[0-9]+}}; Delta: {{-?[0-9]+}} [-Rpass-analysis=size-info]
6565
! ANALYSIS-NOT: optimization-remark.f90:77:7: remark: failed to hoist load with loop-invariant address because load is conditionally executed [-Rpass-missed=licm]

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2532,7 +2532,7 @@ void LoopAccessInfo::emitUnsafeDependenceRemark() {
25322532
HasForcedDistribution
25332533
? "unsafe dependent memory operations in loop."
25342534
: "unsafe dependent memory operations in loop. Use "
2535-
"#pragma loop distribute(enable) to allow loop distribution "
2535+
"#pragma clang loop distribute(enable) to allow loop distribution "
25362536
"to attempt to isolate the offending operations into a separate "
25372537
"loop";
25382538
OptimizationRemarkAnalysis &R =

llvm/lib/Transforms/Scalar/LoopDistribute.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ static cl::opt<unsigned> DistributeSCEVCheckThreshold(
104104
static cl::opt<unsigned> PragmaDistributeSCEVCheckThreshold(
105105
"loop-distribute-scev-check-threshold-with-pragma", cl::init(128),
106106
cl::Hidden,
107-
cl::desc(
108-
"The maximum number of SCEV checks allowed for Loop "
109-
"Distribution for loop marked with #pragma loop distribute(enable)"));
107+
cl::desc("The maximum number of SCEV checks allowed for Loop "
108+
"Distribution for loop marked with #pragma clang loop "
109+
"distribute(enable)"));
110110

111111
static cl::opt<bool> EnableLoopDistribute(
112112
"enable-loop-distribute", cl::Hidden,

llvm/test/Analysis/LoopAccessAnalysis/pointer-phis.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ exit: ; preds = %loop.latch
202202
define i32 @store_with_pointer_phi_incoming_phi(ptr %A, ptr %B, ptr %C, i1 %c.0, i1 %c.1) {
203203
; CHECK-LABEL: 'store_with_pointer_phi_incoming_phi'
204204
; CHECK-NEXT: loop.header:
205-
; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
205+
; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
206206
; CHECK-NEXT: Unknown data dependence.
207207
; CHECK-NEXT: Dependences:
208208
; CHECK-NEXT: Unknown:
@@ -279,7 +279,7 @@ exit: ; preds = %loop.latch
279279
define i32 @store_with_pointer_phi_incoming_phi_irreducible_cycle(ptr %A, ptr %B, ptr %C, i1 %c.0, i1 %c.1) {
280280
; CHECK-LABEL: 'store_with_pointer_phi_incoming_phi_irreducible_cycle'
281281
; CHECK-NEXT: loop.header:
282-
; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
282+
; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
283283
; CHECK-NEXT: Unknown data dependence.
284284
; CHECK-NEXT: Dependences:
285285
; CHECK-NEXT: Unknown:
@@ -417,7 +417,7 @@ exit: ; preds = %loop.latch
417417
define void @phi_load_store_memdep_check(i1 %c, ptr %A, ptr %B, ptr %C) {
418418
; CHECK-LABEL: Loop access info in function 'phi_load_store_memdep_check':
419419
; CHECK-NEXT: for.body:
420-
; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
420+
; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
421421
; CHECK-NEXT: Unknown data dependence.
422422
; CHECK-NEXT: Dependences:
423423
; CHECK-NEXT: Unknown:

llvm/test/Transforms/LoopVectorize/diag-with-hotness-info-2.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
; 19 }
2222
; 20 }
2323

24-
; CHECK: remark: /tmp/s.c:3:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
24+
; CHECK: remark: /tmp/s.c:3:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
2525
; CHECK-NEXT: Backward loop carried data dependence. Memory location is the same as accessed at /tmp/s.c:3:16 (hotness: 300)
26-
; CHECK: remark: /tmp/s.c:10:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
26+
; CHECK: remark: /tmp/s.c:10:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
2727
; CHECK-NEXT: Backward loop carried data dependence. Memory location is the same as accessed at /tmp/s.c:10:16 (hotness: 5000)
28-
; CHECK: remark: /tmp/s.c:17:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
28+
; CHECK: remark: /tmp/s.c:17:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
2929
; CHECK-NEXT: Backward loop carried data dependence. Memory location is the same as accessed at /tmp/s.c:17:16{{$}}
3030

3131
; ModuleID = '/tmp/s.c'

llvm/test/Transforms/LoopVectorize/memory-dep-remarks.ll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ for.body: ; preds = %entry, %for.body
149149
; }
150150
; }
151151

152-
; CHECK: remark: source.c:48:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
152+
; CHECK: remark: source.c:48:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
153153
; CHECK-NEXT: Backward loop carried data dependence. Memory location is the same as accessed at source.c:47:5
154154

155155
define void @test_backward_dep(i64 %n, ptr nocapture %A) {
@@ -194,7 +194,7 @@ for.body: ; preds = %for.body.preheader,
194194
; }
195195
; }
196196

197-
; CHECK: remark: source.c:61:12: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
197+
; CHECK: remark: source.c:61:12: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
198198
; CHECK-NEXT: Forward loop carried data dependence that prevents store-to-load forwarding. Memory location is the same as accessed at source.c:60:5
199199

200200
define void @test_forwardButPreventsForwarding_dep(i64 %n, ptr nocapture %A, ptr nocapture %B) !dbg !166 {
@@ -232,7 +232,7 @@ for.body: ; preds = %entry, %for.body
232232
; }
233233
; }
234234

235-
; CHECK: remark: source.c:74:5: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
235+
; CHECK: remark: source.c:74:5: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
236236
; CHECK: Backward loop carried data dependence that prevents store-to-load forwarding. Memory location is the same as accessed at source.c:74:21
237237

238238
define void @test_backwardVectorizableButPreventsForwarding(i64 %n, ptr nocapture %A) !dbg !189 {
@@ -268,7 +268,7 @@ for.body: ; preds = %entry, %for.body
268268
; }
269269
; }
270270

271-
; CHECK: remark: source.c:83:7: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
271+
; CHECK: remark: source.c:83:7: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
272272
; CHECK: Unknown data dependence. Memory location is the same as accessed at source.c:82:7
273273

274274
define void @test_unknown_dep(i64 %n, ptr nocapture %A) !dbg !214 {
@@ -315,7 +315,7 @@ for.body: ; preds = %entry, %for.body
315315
; YAML-NEXT: Function: test_backward_dep
316316
; YAML-NEXT: Args:
317317
; YAML-NEXT: - String: 'loop not vectorized: '
318-
; YAML-NEXT: - String: 'unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop'
318+
; YAML-NEXT: - String: 'unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop'
319319
; YAML-NEXT: - String: "\nBackward loop carried data dependence."
320320
; YAML-NEXT: - String: ' Memory location is the same as accessed at '
321321
; YAML-NEXT: - Location: 'source.c:47:5'
@@ -335,7 +335,7 @@ for.body: ; preds = %entry, %for.body
335335
; YAML-NEXT: Function: test_forwardButPreventsForwarding_dep
336336
; YAML-NEXT: Args:
337337
; YAML-NEXT: - String: 'loop not vectorized: '
338-
; YAML-NEXT: - String: 'unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop'
338+
; YAML-NEXT: - String: 'unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop'
339339
; YAML-NEXT: - String: "\nForward loop carried data dependence that prevents store-to-load forwarding."
340340
; YAML-NEXT: - String: ' Memory location is the same as accessed at '
341341
; YAML-NEXT: - Location: 'source.c:60:5'
@@ -355,7 +355,7 @@ for.body: ; preds = %entry, %for.body
355355
; YAML-NEXT: Function: test_backwardVectorizableButPreventsForwarding
356356
; YAML-NEXT: Args:
357357
; YAML-NEXT: - String: 'loop not vectorized: '
358-
; YAML-NEXT: - String: 'unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop'
358+
; YAML-NEXT: - String: 'unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop'
359359
; YAML-NEXT: - String: "\nBackward loop carried data dependence that prevents store-to-load forwarding."
360360
; YAML-NEXT: - String: ' Memory location is the same as accessed at '
361361
; YAML-NEXT: - Location: 'source.c:74:21'
@@ -375,7 +375,7 @@ for.body: ; preds = %entry, %for.body
375375
; YAML-NEXT: Function: test_unknown_dep
376376
; YAML-NEXT: Args:
377377
; YAML-NEXT: - String: 'loop not vectorized: '
378-
; YAML-NEXT: - String: 'unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop'
378+
; YAML-NEXT: - String: 'unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop'
379379
; YAML-NEXT: - String: "\nUnknown data dependence."
380380
; YAML-NEXT: - String: ' Memory location is the same as accessed at '
381381
; YAML-NEXT: - Location: 'source.c:82:7'

llvm/test/Transforms/LoopVectorize/unsafe-dep-remark.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
1111
; 5 }
1212
; 6 }
1313

14-
; CHECK: remark: /tmp/kk.c:3:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
14+
; CHECK: remark: /tmp/kk.c:3:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
1515

1616
define void @success(ptr nocapture %A, ptr nocapture readonly %B, ptr nocapture %C, ptr nocapture readonly %D, ptr nocapture readonly %E, i32 %N) !dbg !6 {
1717
entry:

0 commit comments

Comments
 (0)