From f59e548ba7520aedacb7f0d5993b56ea40992650 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Fri, 14 Nov 2014 15:01:38 +0000 Subject: [PATCH] [Reassociate] Improve rank debug information. NFC. llvm-svn: 221999 --- llvm/lib/Transforms/Scalar/Reassociate.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp index baa6b08..c86317d 100644 --- a/llvm/lib/Transforms/Scalar/Reassociate.cpp +++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp @@ -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 RPOT(&F); for (ReversePostOrderTraversal::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; } -- 2.7.4