Skip to content

Commit 1e84cb5

Browse files
authored
[DA] Address followup comments on #128782 (#162645)
This is a follow-up PR for post-commit comments in #128782 . - Fix variable name to camel case. - Change the output format to make it easier to handle with FileCheck. - Regenerate assertions of regression tests.
1 parent 027b647 commit 1e84cb5

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

llvm/include/llvm/Analysis/DependenceAnalysis.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class LLVM_ABI Dependence {
160160

161161
/// getDVEntry - Returns the DV entry associated with a regular or a
162162
/// SameSD level
163-
DVEntry getDVEntry(unsigned Level, bool isSameSD) const;
163+
DVEntry getDVEntry(unsigned Level, bool IsSameSD) const;
164164

165165
/// getDirection - Returns the direction associated with a particular
166166
/// common or SameSD level.
@@ -234,7 +234,7 @@ class LLVM_ABI Dependence {
234234

235235
/// dumpImp - For debugging purposes. Dumps a dependence to OS with or
236236
/// without considering the SameSD levels.
237-
void dumpImp(raw_ostream &OS, bool SameSD = false) const;
237+
void dumpImp(raw_ostream &OS, bool IsSameSD = false) const;
238238

239239
protected:
240240
Instruction *Src, *Dst;
@@ -282,8 +282,8 @@ class LLVM_ABI FullDependence final : public Dependence {
282282

283283
/// getDVEntry - Returns the DV entry associated with a regular or a
284284
/// SameSD level.
285-
DVEntry getDVEntry(unsigned Level, bool isSameSD) const {
286-
if (!isSameSD) {
285+
DVEntry getDVEntry(unsigned Level, bool IsSameSD) const {
286+
if (!IsSameSD) {
287287
assert(0 < Level && Level <= Levels && "Level out of range");
288288
return DV[Level - 1];
289289
} else {

llvm/lib/Analysis/DependenceAnalysis.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ bool Dependence::isAnti() const {
275275
// if no subscript in the source or destination mention the induction
276276
// variable associated with the loop at this level.
277277
// Leave this out of line, so it will serve as a virtual method anchor
278-
bool Dependence::isScalar(unsigned level, bool isSameSD) const { return false; }
278+
bool Dependence::isScalar(unsigned level, bool IsSameSD) const { return false; }
279279

280280
//===----------------------------------------------------------------------===//
281281
// FullDependence methods
@@ -351,38 +351,38 @@ bool FullDependence::normalize(ScalarEvolution *SE) {
351351

352352
// getDirection - Returns the direction associated with a particular common or
353353
// SameSD level.
354-
unsigned FullDependence::getDirection(unsigned Level, bool isSameSD) const {
355-
return getDVEntry(Level, isSameSD).Direction;
354+
unsigned FullDependence::getDirection(unsigned Level, bool IsSameSD) const {
355+
return getDVEntry(Level, IsSameSD).Direction;
356356
}
357357

358358
// Returns the distance (or NULL) associated with a particular common or
359359
// SameSD level.
360-
const SCEV *FullDependence::getDistance(unsigned Level, bool isSameSD) const {
361-
return getDVEntry(Level, isSameSD).Distance;
360+
const SCEV *FullDependence::getDistance(unsigned Level, bool IsSameSD) const {
361+
return getDVEntry(Level, IsSameSD).Distance;
362362
}
363363

364364
// Returns true if a particular regular or SameSD level is scalar; that is,
365365
// if no subscript in the source or destination mention the induction variable
366366
// associated with the loop at this level.
367-
bool FullDependence::isScalar(unsigned Level, bool isSameSD) const {
368-
return getDVEntry(Level, isSameSD).Scalar;
367+
bool FullDependence::isScalar(unsigned Level, bool IsSameSD) const {
368+
return getDVEntry(Level, IsSameSD).Scalar;
369369
}
370370

371371
// Returns true if peeling the first iteration from this regular or SameSD
372372
// loop level will break this dependence.
373-
bool FullDependence::isPeelFirst(unsigned Level, bool isSameSD) const {
374-
return getDVEntry(Level, isSameSD).PeelFirst;
373+
bool FullDependence::isPeelFirst(unsigned Level, bool IsSameSD) const {
374+
return getDVEntry(Level, IsSameSD).PeelFirst;
375375
}
376376

377377
// Returns true if peeling the last iteration from this regular or SameSD
378378
// loop level will break this dependence.
379-
bool FullDependence::isPeelLast(unsigned Level, bool isSameSD) const {
380-
return getDVEntry(Level, isSameSD).PeelLast;
379+
bool FullDependence::isPeelLast(unsigned Level, bool IsSameSD) const {
380+
return getDVEntry(Level, IsSameSD).PeelLast;
381381
}
382382

383383
// Returns true if splitting loop will break the dependence.
384-
bool FullDependence::isSplitable(unsigned Level, bool isSameSD) const {
385-
return getDVEntry(Level, isSameSD).Splitable;
384+
bool FullDependence::isSplitable(unsigned Level, bool IsSameSD) const {
385+
return getDVEntry(Level, IsSameSD).Splitable;
386386
}
387387

388388
// inSameSDLoops - Returns true if this level is an SameSD level, i.e.,
@@ -691,7 +691,7 @@ void Dependence::dump(raw_ostream &OS) const {
691691
dumpImp(OS);
692692
unsigned SameSDLevels = getSameSDLevels();
693693
if (SameSDLevels > 0) {
694-
OS << "! / assuming " << SameSDLevels << " loop level(s) fused: ";
694+
OS << " / assuming " << SameSDLevels << " loop level(s) fused: ";
695695
dumpImp(OS, true);
696696
}
697697
}
@@ -706,13 +706,13 @@ void Dependence::dump(raw_ostream &OS) const {
706706

707707
// For debugging purposes. Dumps a dependence to OS with or without considering
708708
// the SameSD levels.
709-
void Dependence::dumpImp(raw_ostream &OS, bool isSameSD) const {
709+
void Dependence::dumpImp(raw_ostream &OS, bool IsSameSD) const {
710710
bool Splitable = false;
711711
unsigned Levels = getLevels();
712712
unsigned SameSDLevels = getSameSDLevels();
713713
bool OnSameSD = false;
714714
unsigned LevelNum = Levels;
715-
if (isSameSD)
715+
if (IsSameSD)
716716
LevelNum += SameSDLevels;
717717
OS << " [";
718718
for (unsigned II = 1; II <= LevelNum; ++II) {

llvm/test/Analysis/DependenceAnalysis/PreliminaryNoValidityCheckFixedSize.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ define void @p2(i64 %n, ptr %A, ptr %B) nounwind uwtable ssp {
2020
; CHECK-NEXT: Src: store i64 %i.011, ptr %arrayidx8, align 8 --> Dst: store i64 %i.011, ptr %arrayidx8, align 8
2121
; CHECK-NEXT: da analyze - none!
2222
; CHECK-NEXT: Src: store i64 %i.011, ptr %arrayidx8, align 8 --> Dst: %0 = load i64, ptr %arrayidx17, align 8
23-
; CHECK-NEXT: da analyze - flow [-3 -2]!
23+
; CHECK-NEXT: da analyze - flow [-3 -2] / assuming 1 loop level(s) fused: [-3 -2 -1]!
2424
; CHECK-NEXT: Src: store i64 %i.011, ptr %arrayidx8, align 8 --> Dst: store i64 %0, ptr %B.addr.24, align 8
2525
; CHECK-NEXT: da analyze - confused!
2626
; CHECK-NEXT: Src: %0 = load i64, ptr %arrayidx17, align 8 --> Dst: %0 = load i64, ptr %arrayidx17, align 8

llvm/test/Analysis/DependenceAnalysis/SameSDLoops.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ define void @samebd0(ptr %A) nounwind uwtable ssp {
1818
; CHECK-NEXT: Src: store i64 %i.013, ptr %arrayidx12, align 8 --> Dst: store i64 %i.013, ptr %arrayidx12, align 8
1919
; CHECK-NEXT: da analyze - none!
2020
; CHECK-NEXT: Src: store i64 %i.013, ptr %arrayidx12, align 8 --> Dst: store i64 %l17.04, ptr %arrayidx24, align 8
21-
; CHECK-NEXT: da analyze - output [-4 -3]! / assuming 2 loop level(s) fused: [-4 -3 -3 -1]!
21+
; CHECK-NEXT: da analyze - output [-4 -3] / assuming 2 loop level(s) fused: [-4 -3 -3 -1]!
2222
; CHECK-NEXT: Src: store i64 %l17.04, ptr %arrayidx24, align 8 --> Dst: store i64 %l17.04, ptr %arrayidx24, align 8
2323
; CHECK-NEXT: da analyze - none!
2424
;
@@ -96,7 +96,7 @@ define void @samebd1(ptr %A) nounwind uwtable ssp {
9696
; CHECK-NEXT: Src: store i64 %i.03, ptr %arrayidx, align 4 --> Dst: store i64 %i.03, ptr %arrayidx, align 4
9797
; CHECK-NEXT: da analyze - none!
9898
; CHECK-NEXT: Src: store i64 %i.03, ptr %arrayidx, align 4 --> Dst: %0 = load i64, ptr %arrayidx7, align 4
99-
; CHECK-NEXT: da analyze - flow [|<]! / assuming 1 loop level(s) fused: [<=|<]!
99+
; CHECK-NEXT: da analyze - flow [|<] / assuming 1 loop level(s) fused: [<=|<]!
100100
; CHECK-NEXT: Src: %0 = load i64, ptr %arrayidx7, align 4 --> Dst: %0 = load i64, ptr %arrayidx7, align 4
101101
; CHECK-NEXT: da analyze - none!
102102
;
@@ -148,7 +148,7 @@ define void @non_samebd0(ptr %A) nounwind uwtable ssp {
148148
; CHECK-NEXT: Src: store i64 %i.013, ptr %arrayidx12, align 8 --> Dst: store i64 %i.013, ptr %arrayidx12, align 8
149149
; CHECK-NEXT: da analyze - none!
150150
; CHECK-NEXT: Src: store i64 %i.013, ptr %arrayidx12, align 8 --> Dst: store i64 %l17.04, ptr %arrayidx24, align 8
151-
; CHECK-NEXT: da analyze - output [-4 -3]!{{$}}
151+
; CHECK-NEXT: da analyze - output [-4 -3]!
152152
; CHECK-NEXT: Src: store i64 %l17.04, ptr %arrayidx24, align 8 --> Dst: store i64 %l17.04, ptr %arrayidx24, align 8
153153
; CHECK-NEXT: da analyze - none!
154154
;
@@ -227,7 +227,7 @@ define void @non_samebd1(ptr %A) nounwind uwtable ssp {
227227
; CHECK-NEXT: Src: store i64 %i.03, ptr %arrayidx, align 4 --> Dst: store i64 %i.03, ptr %arrayidx, align 4
228228
; CHECK-NEXT: da analyze - none!
229229
; CHECK-NEXT: Src: store i64 %i.03, ptr %arrayidx, align 4 --> Dst: %0 = load i64, ptr %arrayidx7, align 4
230-
; CHECK-NEXT: da analyze - flow [|<]!{{$}}
230+
; CHECK-NEXT: da analyze - flow [|<]!
231231
; CHECK-NEXT: Src: %0 = load i64, ptr %arrayidx7, align 4 --> Dst: %0 = load i64, ptr %arrayidx7, align 4
232232
; CHECK-NEXT: da analyze - none!
233233
;

0 commit comments

Comments
 (0)