--- /dev/null
+--- !Missed
+Pass: inline
+Name: NoDefinition
+DebugLoc: { File: Inputs/dm.c, Line: 3, Column: 12 }
+Function: foo
+Args:
+ - Callee: bar
+ - String: ' will not be inlined into '
+ - Caller: foo
+ DebugLoc: { File: Inputs/dm.c, Line: 2, Column: 0 }
+ - String: ' because its definition is unavailable'
+...
+--- !Analysis
+Pass: inline
+Name: CanBeInlined
+DebugLoc: { File: Inputs/dm.c, Line: 7, Column: 3 }
+Function: quack
+Args:
+ - Callee: foo
+ DebugLoc: { File: Inputs/dm.c, Line: 2, Column: 0 }
+ - String: ' can be inlined into '
+ - Caller: quack
+ DebugLoc: { File: Inputs/dm.c, Line: 6, Column: 0 }
+ - String: ' with cost='
+ - Cost: '-35'
+ - String: ' (threshold='
+ - Threshold: '375'
+ - String: ')'
+...
+--- !Passed
+Pass: inline
+Name: Inlined
+DebugLoc: { File: Inputs/dm.c, Line: 7, Column: 3 }
+Function: quack
+Args:
+ - Callee: foo
+ DebugLoc: { File: Inputs/dm.c, Line: 2, Column: 0 }
+ - String: ' inlined into '
+ - Caller: quack
+ DebugLoc: { File: Inputs/dm.c, Line: 6, Column: 0 }
+...
+--- !Analysis
+Pass: inline
+Name: CanBeInlined
+DebugLoc: { File: Inputs/dm.c, Line: 11, Column: 3 }
+Function: quack2
+Args:
+ - Callee: foo
+ DebugLoc: { File: Inputs/dm.c, Line: 2, Column: 0 }
+ - String: ' can be inlined into '
+ - Caller: quack2
+ DebugLoc: { File: Inputs/dm.c, Line: 10, Column: 0 }
+ - String: ' with cost='
+ - Cost: '-5'
+ - String: ' (threshold='
+ - Threshold: '375'
+ - String: ')'
+...
+--- !Passed
+Pass: inline
+Name: Inlined
+DebugLoc: { File: Inputs/dm.c, Line: 11, Column: 3 }
+Function: quack2
+Args:
+ - Callee: foo
+ DebugLoc: { File: Inputs/dm.c, Line: 2, Column: 0 }
+ - String: ' inlined into '
+ - Caller: quack2
+ DebugLoc: { File: Inputs/dm.c, Line: 10, Column: 0 }
+...
+--- !Analysis
+Pass: loop-vectorize
+Name: CFGNotUnderstood
+DebugLoc: { File: Inputs/dm.c, Line: 3, Column: 28 }
+Function: foo
+Args:
+ - String: 'loop not vectorized: '
+ - String: loop control flow is not understood by vectorizer
+...
+--- !Missed
+Pass: loop-vectorize
+Name: MissedDetails
+DebugLoc: { File: Inputs/dm.c, Line: 3, Column: 28 }
+Function: foo
+Args:
+ - String: loop not vectorized
+...
+--- !Analysis
+Pass: loop-vectorize
+Name: CFGNotUnderstood
+DebugLoc: { File: Inputs/dm.c, Line: 3, Column: 28 }
+Function: quack
+Args:
+ - String: 'loop not vectorized: '
+ - String: loop control flow is not understood by vectorizer
+...
+--- !Missed
+Pass: loop-vectorize
+Name: MissedDetails
+DebugLoc: { File: Inputs/dm.c, Line: 3, Column: 28 }
+Function: quack
+Args:
+ - String: loop not vectorized
+...
--- /dev/null
+RUN: llvm-opt-report -r %p %p/Inputs/dm.yaml | FileCheck -strict-whitespace %s
+
+; CHECK: < {{.*[/\]}}dm.c
+; CHECK-NEXT: 1 | void bar(void);
+; CHECK-NEXT: 2 | void foo(int n) {
+; CHECK-NEXT: 3 | if (n) { bar(); } else { while (1) {} }
+; CHECK-NEXT: 4 | }
+; CHECK-NEXT: 5 |
+; CHECK-NEXT: 6 | void quack(void) {
+; CHECK-NEXT: 7 I | foo(0);
+; CHECK-NEXT: 8 | }
+; CHECK-NEXT: 9 |
+; CHECK-NEXT: 10 | void quack2(void) {
+; CHECK-NEXT: 11 I | foo(4);
+; CHECK-NEXT: 12 | }
+; CHECK-NEXT: 13 |
+
std::map<int, OptReportLocationInfo> ColsInfo;
unsigned InlinedCols = 0, UnrolledCols = 0, VectorizedCols = 0;
- if (LII != FileInfo.end()) {
+ if (LII != FileInfo.end() && !FuncNameSet.empty()) {
const auto &LineInfo = LII->second;
for (auto &CI : LineInfo.find(*FuncNameSet.begin())->second) {
std::map<std::map<int, OptReportLocationInfo>,
std::set<std::string>> UniqueLIs;
+ OptReportLocationInfo AllLI;
if (LII != FileInfo.end()) {
const auto &FuncLineInfo = LII->second;
- for (const auto &FLII : FuncLineInfo)
+ for (const auto &FLII : FuncLineInfo) {
UniqueLIs[FLII.second].insert(FLII.first);
+
+ for (const auto &OI : FLII.second)
+ AllLI |= OI.second;
+ }
}
- if (UniqueLIs.size() > 1) {
+ bool NothingHappened = !AllLI.Inlined.Transformed &&
+ !AllLI.Unrolled.Transformed &&
+ !AllLI.Vectorized.Transformed;
+ if (UniqueLIs.size() > 1 && !NothingHappened) {
OS << " [[\n";
for (const auto &FSLI : UniqueLIs)
PrintLine(true, FSLI.second);