Skip to content

Commit f7c8ffa

Browse files
committed
[NFC] Add debug msgs to SILCombine
1 parent 23a823a commit f7c8ffa

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/SILOptimizer/SILCombiner/SILCombine.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,12 @@ bool SILCombiner::doOneIteration(SILFunction &F, unsigned Iteration) {
420420
MadeChange = true;
421421
continue;
422422
}
423+
#ifndef NDEBUG
424+
std::string OrigIStr;
425+
#endif
426+
LLVM_DEBUG(llvm::raw_string_ostream SS(OrigIStr); I->print(SS);
427+
OrigIStr = SS.str(););
428+
LLVM_DEBUG(llvm::dbgs() << "SC: Visiting: " << OrigIStr << '\n');
423429

424430
// Canonicalize the instruction.
425431
if (scCanonicalize.tryCanonicalize(I)) {
@@ -456,13 +462,6 @@ bool SILCombiner::doOneIteration(SILFunction &F, unsigned Iteration) {
456462
// Then begin... SILCombine.
457463
Builder.setInsertionPoint(I);
458464

459-
#ifndef NDEBUG
460-
std::string OrigIStr;
461-
#endif
462-
LLVM_DEBUG(llvm::raw_string_ostream SS(OrigIStr); I->print(SS);
463-
OrigIStr = SS.str(););
464-
LLVM_DEBUG(llvm::dbgs() << "SC: Visiting: " << OrigIStr << '\n');
465-
466465
SILInstruction *currentInst = I;
467466
if (SILInstruction *Result = visit(I)) {
468467
++NumCombined;

0 commit comments

Comments
 (0)