[Reassociate] Improve rank debug information. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221999 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chad Rosier 2014-11-14 15:01:38 +00:00
parent 239d5231f3
commit 1945dcff86

View File

@ -278,9 +278,11 @@ static bool isUnmovableInstruction(Instruction *I) {
void Reassociate::BuildRankMap(Function &F) {
unsigned i = 2;
// Assign distinct ranks to function arguments
for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
// Assign distinct ranks to function arguments.
for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) {
ValueRankMap[&*I] = ++i;
DEBUG(dbgs() << "Calculated Rank[" << I->getName() << "] = " << i << "\n");
}
ReversePostOrderTraversal<Function*> RPOT(&F);
for (ReversePostOrderTraversal<Function*>::rpo_iterator I = RPOT.begin(),
@ -324,8 +326,7 @@ unsigned Reassociate::getRank(Value *V) {
!BinaryOperator::isFNeg(I)))
++Rank;
//DEBUG(dbgs() << "Calculated Rank[" << V->getName() << "] = "
// << Rank << "\n");
DEBUG(dbgs() << "Calculated Rank[" << V->getName() << "] = " << Rank << "\n");
return ValueRankMap[I] = Rank;
}