Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 4d4b609

Browse files
committed
[OptDiag,LDist] Convert remaining opt remarks to use the new API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276340 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 0414f48 commit 4d4b609

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

lib/Transforms/Scalar/LoopDistribute.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,7 @@ class LoopDistributeForLoop {
748748

749749
++NumLoopsDistributed;
750750
// Report the success.
751-
emitOptimizationRemark(F->getContext(), LDIST_NAME, *F, L->getStartLoc(),
752-
"distributed loop");
751+
ORE->emitOptimizationRemark(LDIST_NAME, L, "distributed loop");
753752
return true;
754753
}
755754

@@ -768,10 +767,10 @@ class LoopDistributeForLoop {
768767

769768
// With Rpass-analysis report why. This is on by default if distribution
770769
// was requested explicitly.
771-
emitOptimizationRemarkAnalysis(
772-
Ctx, Forced ? DiagnosticInfoOptimizationRemarkAnalysis::AlwaysPrint
773-
: LDIST_NAME,
774-
*F, L->getStartLoc(), Twine("loop not distributed: ") + Message);
770+
ORE->emitOptimizationRemarkAnalysis(
771+
Forced ? DiagnosticInfoOptimizationRemarkAnalysis::AlwaysPrint
772+
: LDIST_NAME,
773+
L, Twine("loop not distributed: ") + Message);
775774

776775
// Also issue a warning if distribution was requested explicitly but it
777776
// failed.

test/Transforms/LoopDistribute/diagnostics-with-hotness.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
; RUN: opt -loop-distribute -S -pass-remarks-missed=loop-distribute \
2+
; RUN: -pass-remarks-analysis=loop-distribute \
23
; RUN: -pass-remarks-with-hotness < %s 2>&1 | FileCheck %s --check-prefix=HOTNESS
34
; RUN: opt -loop-distribute -S -pass-remarks-missed=loop-distribute \
5+
; RUN: -pass-remarks-analysis=loop-distribute \
46
; RUN: < %s 2>&1 | FileCheck %s --check-prefix=NO_HOTNESS
57

68
; RUN: opt -passes='require<aa>,loop-distribute' -S -pass-remarks-missed=loop-distribute \
9+
; RUN: -pass-remarks-analysis=loop-distribute \
710
; RUN: -pass-remarks-with-hotness < %s 2>&1 | FileCheck %s --check-prefix=HOTNESS
811
; RUN: opt -passes='require<aa>,loop-distribute' -S -pass-remarks-missed=loop-distribute \
12+
; RUN: -pass-remarks-analysis=loop-distribute \
913
; RUN: < %s 2>&1 | FileCheck %s --check-prefix=NO_HOTNESS
1014

1115
; This is the input program:
@@ -21,7 +25,9 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
2125
target triple = "x86_64-apple-macosx10.11.0"
2226

2327
; HOTNESS: remark: /tmp/t.c:3:3: loop not distributed: use -Rpass-analysis=loop-distribute for more info (hotness: 300)
28+
; HOTNESS: remark: /tmp/t.c:3:3: loop not distributed: memory operations are safe for vectorization (hotness: 300)
2429
; NO_HOTNESS: remark: /tmp/t.c:3:3: loop not distributed: use -Rpass-analysis=loop-distribute for more info{{$}}
30+
; NO_HOTNESS: remark: /tmp/t.c:3:3: loop not distributed: memory operations are safe for vectorization{{$}}
2531

2632
define void @forced(i8* %A, i8* %B, i8* %C, i32 %N) !dbg !7 !prof !22 {
2733
entry:

0 commit comments

Comments
 (0)