[PredicateInfo] Print RenamedOp (NFC)

Make it easier to debug renaming issues.
This commit is contained in:
Nikita Popov 2020-07-09 22:58:45 +02:00
parent c2a61ef388
commit c0308fd154
3 changed files with 9 additions and 6 deletions

View File

@ -896,18 +896,21 @@ public:
PB->From->printAsOperand(OS);
OS << ",";
PB->To->printAsOperand(OS);
OS << "] }\n";
OS << "]";
} else if (const auto *PS = dyn_cast<PredicateSwitch>(PI)) {
OS << "; switch predicate info { CaseValue: " << *PS->CaseValue
<< " Switch:" << *PS->Switch << " Edge: [";
PS->From->printAsOperand(OS);
OS << ",";
PS->To->printAsOperand(OS);
OS << "] }\n";
OS << "]";
} else if (const auto *PA = dyn_cast<PredicateAssume>(PI)) {
OS << "; assume predicate info {"
<< " Comparison:" << *PA->Condition << " }\n";
<< " Comparison:" << *PA->Condition;
}
OS << ", RenamedOp: ";
PI->RenamedOp->printAsOperand(OS, false);
OS << " }\n";
}
}
};

View File

@ -138,7 +138,7 @@ define void @test4(i1 %b, i32 %x) {
; CHECK-NEXT: i32 2, label [[CASE0]]
; CHECK-NEXT: i32 3, label [[CASE3]]
; CHECK-NEXT: i32 4, label [[DEFAULT:%.*]]
; CHECK-NEXT: ] Edge: [label [[SW]],label %case1] }
; CHECK-NEXT: ] Edge: [label [[SW]],label %case1]
; CHECK-NEXT: [[X_0:%.*]] = call i32 @llvm.ssa.copy.{{.+}}(i32 [[X:%.*]])
; CHECK-NEXT: switch i32 [[X]], label [[DEFAULT]] [
; CHECK-NEXT: i32 0, label [[CASE0]]

View File

@ -7,12 +7,12 @@
; CHECK-LABEL: bb:
; CHECK: Has predicate info
; CHECK: branch predicate info { TrueEdge: 1 Comparison: %cmp1 = icmp ne %0* %arg, null Edge: [label %bb,label %bb1] }
; CHECK: branch predicate info { TrueEdge: 1 Comparison: %cmp1 = icmp ne %0* %arg, null Edge: [label %bb,label %bb1], RenamedOp: %arg }
; CHECK-NEXT: %arg.0 = call %0* @llvm.ssa.copy.{{.+}}(%0* %arg)
; CHECK-LABEL: bb1:
; CHECK: Has predicate info
; CHECK-NEXT: branch predicate info { TrueEdge: 0 Comparison: %cmp2 = icmp ne %1* null, %tmp Edge: [label %bb1,label %bb3] }
; CHECK-NEXT: branch predicate info { TrueEdge: 0 Comparison: %cmp2 = icmp ne %1* null, %tmp Edge: [label %bb1,label %bb3], RenamedOp: %tmp }
; CHECK-NEXT: %tmp.0 = call %1* @llvm.ssa.copy.{{.+}}(%1* %tmp)
define void @f0(%0* %arg, %1* %tmp) {