Skip to content

Commit 19007a6

Browse files
committed
SimplifyCFG add tracing
1 parent ca1c46b commit 19007a6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/SILOptimizer/Transforms/SimplifyCFG.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ static bool tryDominatorBasedSimplifications(
597597
if (stripExpectIntrinsic(Op.get()) == DominatingCondition) {
598598
if (!EdgeValue)
599599
EdgeValue = createValueForEdge(UserInst, DominatingTerminator, Idx);
600+
LLVM_DEBUG(llvm::dbgs() << "replace dominated operand\n in "
601+
<< *UserInst << " with " << EdgeValue);
600602
Op.set(EdgeValue);
601603
Changed = true;
602604
}
@@ -1207,6 +1209,14 @@ bool SimplifyCFG::tryJumpThreading(BranchInst *BI) {
12071209
/// result in exposing opportunities for CFG simplification.
12081210
bool SimplifyCFG::simplifyBranchOperands(OperandValueArrayRef Operands) {
12091211
InstModCallbacks callbacks;
1212+
#ifndef NDEBUG
1213+
callbacks = callbacks.onDelete(
1214+
[](SILInstruction *instToKill) {
1215+
LLVM_DEBUG(llvm::dbgs() << "simplify and erase " << *instToKill);
1216+
instToKill->eraseFromParent();
1217+
});
1218+
#endif
1219+
12101220
for (auto O = Operands.begin(), E = Operands.end(); O != E; ++O) {
12111221
// All of our interesting simplifications are on single-value instructions
12121222
// for now.

0 commit comments

Comments
 (0)