auto *P = &OptDiagBase;
*Out << P;
}
- // FIXME: now that IsVerbose is part of DI, filtering for this will be moved
- // from here to clang.
- if (!OptDiag.isVerbose() || shouldEmitVerbose())
- F->getContext().diagnose(OptDiag);
+ F->getContext().diagnose(OptDiag);
}
OptimizationRemarkEmitterWrapperPass::OptimizationRemarkEmitterWrapperPass()
// pattern, passed via one of the -pass-remarks* flags, matches the name of
// the pass that is emitting the diagnostic. If there is no match, ignore the
// diagnostic and return.
+ //
+ // Also noisy remarks are only enabled if we have hotness information to sort
+ // them.
if (auto *Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
- return Remark->isEnabled();
+ return Remark->isEnabled() &&
+ (!Remark->isVerbose() || Remark->getHotness());
return true;
}
; CHECK: foz not inlined into bar because it should never be inlined (cost=never)
; Function Attrs: alwaysinline nounwind uwtable
-define i32 @foo(i32 %x, i32 %y) #0 {
+define i32 @foo(i32 %x, i32 %y) #0 !prof !1 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
}
; Function Attrs: noinline nounwind uwtable
-define float @foz(i32 %x, i32 %y) #1 {
+define float @foz(i32 %x, i32 %y) #1 !prof !1 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
declare i32 @fox()
; Function Attrs: nounwind uwtable
-define i32 @bar(i32 %j) #2 {
+define i32 @bar(i32 %j) #2 !prof !1 {
entry:
%j.addr = alloca i32, align 4
store i32 %j, i32* %j.addr, align 4
!llvm.ident = !{!0}
!0 = !{!"clang version 3.5.0 "}
+!1 = !{!"function_entry_count", i64 10}