[PATCH] D53505: [hot-cold-split] Add missing FileCheck invocations
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 22 10:08:41 PDT 2018
tejohnson updated this revision to Diff 170448.
tejohnson added a comment.
- [hot-cold-split] Add opt remark on success
Repository:
rL LLVM
https://reviews.llvm.org/D53505
Files:
lib/Transforms/IPO/HotColdSplitting.cpp
test/Transforms/HotColdSplit/split-cold-2.ll
Index: test/Transforms/HotColdSplit/split-cold-2.ll
===================================================================
--- test/Transforms/HotColdSplit/split-cold-2.ll
+++ test/Transforms/HotColdSplit/split-cold-2.ll
@@ -1,9 +1,10 @@
-; RUN: opt -hotcoldsplit -S < %s
-; RUN: opt -passes=hotcoldsplit -S < %s
+; RUN: opt -hotcoldsplit -pass-remarks=hotcoldsplit -S < %s 2>&1 | FileCheck %s
+; RUN: opt -passes=hotcoldsplit -pass-remarks=hotcoldsplit -S < %s 2>&1 | FileCheck %s
; Make sure this compiles. This test used to fail with an invalid phi node: the
; two predecessors were outlined and the SSA representation was invalid.
+; CHECK: remark: <unknown>:0:0: fun split cold code into fun_if.else
; CHECK-LABEL: @fun
; CHECK: codeRepl:
; CHECK-NEXT: call void @fun_if.else
Index: lib/Transforms/IPO/HotColdSplitting.cpp
===================================================================
--- lib/Transforms/IPO/HotColdSplitting.cpp
+++ lib/Transforms/IPO/HotColdSplitting.cpp
@@ -335,6 +335,7 @@
HotColdSplitting::extractColdRegion(const SmallVectorImpl<BasicBlock *> &Region,
DominatorTree *DT, BlockFrequencyInfo *BFI,
OptimizationRemarkEmitter &ORE) {
+ assert(!Region.empty());
LLVM_DEBUG(for (auto *BB : Region)
llvm::dbgs() << "\nExtracting: " << *BB;);
@@ -348,6 +349,7 @@
if (Outputs.size() > 0)
return nullptr;
+ Function *OrigF = Region[0]->getParent();
if (Function *OutF = CE.extractCodeRegion()) {
User *U = *OutF->user_begin();
CallInst *CI = cast<CallInst>(U);
@@ -359,6 +361,12 @@
}
CI->setIsNoInline();
LLVM_DEBUG(llvm::dbgs() << "Outlined Region: " << *OutF);
+ ORE.emit([&]() {
+ return OptimizationRemark(DEBUG_TYPE, "HotColdSplit",
+ &*Region[0]->begin())
+ << ore::NV("Original", OrigF) << " split cold code into "
+ << ore::NV("Split", OutF);
+ });
return OutF;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53505.170448.patch
Type: text/x-patch
Size: 2008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181022/de8cd462/attachment.bin>
More information about the llvm-commits
mailing list