1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Fix debug printing spacing.

Fix missing newlines, missing and extra spaces in printed messages.

llvm-svn: 191851
This commit is contained in:
Matt Arsenault 2013-10-02 20:04:29 +00:00
parent 26cc78f548
commit 15633246b6

View File

@ -867,14 +867,14 @@ private:
if (isPowerOf2_32(Val) && Val <= MaxVectorWidth) if (isPowerOf2_32(Val) && Val <= MaxVectorWidth)
Width = Val; Width = Val;
else else
DEBUG(dbgs() << "LV: ignoring invalid width hint metadata"); DEBUG(dbgs() << "LV: ignoring invalid width hint metadata\n");
} else if (Hint == "unroll") { } else if (Hint == "unroll") {
if (isPowerOf2_32(Val) && Val <= MaxUnrollFactor) if (isPowerOf2_32(Val) && Val <= MaxUnrollFactor)
Unroll = Val; Unroll = Val;
else else
DEBUG(dbgs() << "LV: ignoring invalid unroll hint metadata"); DEBUG(dbgs() << "LV: ignoring invalid unroll hint metadata\n");
} else { } else {
DEBUG(dbgs() << "LV: ignoring unknown hint " << Hint); DEBUG(dbgs() << "LV: ignoring unknown hint " << Hint << '\n');
} }
} }
}; };
@ -915,7 +915,7 @@ struct LoopVectorize : public LoopPass {
return false; return false;
if (DL == NULL) { if (DL == NULL) {
DEBUG(dbgs() << "LV: Not vectorizing because of missing data layout"); DEBUG(dbgs() << "LV: Not vectorizing because of missing data layout\n");
return false; return false;
} }
@ -966,8 +966,8 @@ struct LoopVectorize : public LoopPass {
} }
DEBUG(dbgs() << "LV: Found a vectorizable loop ("<< VF.Width << ") in "<< DEBUG(dbgs() << "LV: Found a vectorizable loop ("<< VF.Width << ") in "<<
F->getParent()->getModuleIdentifier()<<"\n"); F->getParent()->getModuleIdentifier() << '\n');
DEBUG(dbgs() << "LV: Unroll Factor is " << UF << "\n"); DEBUG(dbgs() << "LV: Unroll Factor is " << UF << '\n');
if (VF.Width == 1) { if (VF.Width == 1) {
if (UF == 1) if (UF == 1)
@ -1400,7 +1400,7 @@ InnerLoopVectorizer::addRuntimeCheck(LoopVectorizationLegality *Legal,
Starts.push_back(Ptr); Starts.push_back(Ptr);
Ends.push_back(Ptr); Ends.push_back(Ptr);
} else { } else {
DEBUG(dbgs() << "LV: Adding RT check for range:" << *Ptr <<"\n"); DEBUG(dbgs() << "LV: Adding RT check for range:" << *Ptr << '\n');
Value *Start = Exp.expandCodeFor(PtrRtCheck->Starts[i], PtrArithTy, Loc); Value *Start = Exp.expandCodeFor(PtrRtCheck->Starts[i], PtrArithTy, Loc);
Value *End = Exp.expandCodeFor(PtrRtCheck->Ends[i], PtrArithTy, Loc); Value *End = Exp.expandCodeFor(PtrRtCheck->Ends[i], PtrArithTy, Loc);
@ -2745,7 +2745,7 @@ bool LoopVectorizationLegality::canVectorize() {
// We need to have a loop header. // We need to have a loop header.
BasicBlock *Latch = TheLoop->getLoopLatch(); BasicBlock *Latch = TheLoop->getLoopLatch();
DEBUG(dbgs() << "LV: Found a loop: " << DEBUG(dbgs() << "LV: Found a loop: " <<
TheLoop->getHeader()->getName() << "\n"); TheLoop->getHeader()->getName() << '\n');
// ScalarEvolution needs to be able to find the exit count. // ScalarEvolution needs to be able to find the exit count.
const SCEV *ExitCount = SE->getBackedgeTakenCount(TheLoop); const SCEV *ExitCount = SE->getBackedgeTakenCount(TheLoop);
@ -2815,7 +2815,7 @@ static bool hasOutsideLoopUser(const Loop *TheLoop, Instruction *Inst,
Instruction *U = cast<Instruction>(*I); Instruction *U = cast<Instruction>(*I);
// This user may be a reduction exit value. // This user may be a reduction exit value.
if (!TheLoop->contains(U)) { if (!TheLoop->contains(U)) {
DEBUG(dbgs() << "LV: Found an outside user for : "<< *U << "\n"); DEBUG(dbgs() << "LV: Found an outside user for : " << *U << '\n');
return true; return true;
} }
} }
@ -2953,7 +2953,7 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
// Check that the instruction return type is vectorizable. // Check that the instruction return type is vectorizable.
if (!VectorType::isValidElementType(it->getType()) && if (!VectorType::isValidElementType(it->getType()) &&
!it->getType()->isVoidTy()) { !it->getType()->isVoidTy()) {
DEBUG(dbgs() << "LV: Found unvectorizable type." << "\n"); DEBUG(dbgs() << "LV: Found unvectorizable type.\n");
return false; return false;
} }
@ -3158,7 +3158,7 @@ bool AccessAnalysis::canCheckPtrAtRT(
RtCheck.insert(SE, TheLoop, Ptr, IsWrite, DepId); RtCheck.insert(SE, TheLoop, Ptr, IsWrite, DepId);
DEBUG(dbgs() << "LV: Found a runtime check ptr:" << *Ptr <<"\n"); DEBUG(dbgs() << "LV: Found a runtime check ptr:" << *Ptr << '\n');
} else { } else {
CanDoRT = false; CanDoRT = false;
} }
@ -3567,7 +3567,7 @@ bool MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
if (Val == 0) { if (Val == 0) {
if (ATy == BTy) if (ATy == BTy)
return false; return false;
DEBUG(dbgs() << "LV: Zero dependence difference but different types"); DEBUG(dbgs() << "LV: Zero dependence difference but different types\n");
return true; return true;
} }
@ -3576,7 +3576,7 @@ bool MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
// Positive distance bigger than max vectorization factor. // Positive distance bigger than max vectorization factor.
if (ATy != BTy) { if (ATy != BTy) {
DEBUG(dbgs() << DEBUG(dbgs() <<
"LV: ReadWrite-Write positive dependency with different types"); "LV: ReadWrite-Write positive dependency with different types\n");
return false; return false;
} }
@ -3593,7 +3593,7 @@ bool MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
2*TypeByteSize > MaxSafeDepDistBytes || 2*TypeByteSize > MaxSafeDepDistBytes ||
Distance < TypeByteSize * ForcedUnroll * ForcedFactor) { Distance < TypeByteSize * ForcedUnroll * ForcedFactor) {
DEBUG(dbgs() << "LV: Failure because of Positive distance " DEBUG(dbgs() << "LV: Failure because of Positive distance "
<< Val.getSExtValue() << "\n"); << Val.getSExtValue() << '\n');
return true; return true;
} }
@ -3606,7 +3606,7 @@ bool MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
return true; return true;
DEBUG(dbgs() << "LV: Positive distance " << Val.getSExtValue() << DEBUG(dbgs() << "LV: Positive distance " << Val.getSExtValue() <<
" with max VF=" << MaxSafeDepDistBytes/TypeByteSize << "\n"); " with max VF = " << MaxSafeDepDistBytes / TypeByteSize << '\n');
return false; return false;
} }
@ -4209,7 +4209,7 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize,
// Find the trip count. // Find the trip count.
unsigned TC = SE->getSmallConstantTripCount(TheLoop, TheLoop->getLoopLatch()); unsigned TC = SE->getSmallConstantTripCount(TheLoop, TheLoop->getLoopLatch());
DEBUG(dbgs() << "LV: Found trip count:"<<TC<<"\n"); DEBUG(dbgs() << "LV: Found trip count: " << TC << '\n');
unsigned WidestType = getWidestType(); unsigned WidestType = getWidestType();
unsigned WidestRegister = TTI.getRegisterBitWidth(true); unsigned WidestRegister = TTI.getRegisterBitWidth(true);
@ -4220,7 +4220,8 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize,
WidestRegister : MaxSafeDepDist); WidestRegister : MaxSafeDepDist);
unsigned MaxVectorSize = WidestRegister / WidestType; unsigned MaxVectorSize = WidestRegister / WidestType;
DEBUG(dbgs() << "LV: The Widest type: " << WidestType << " bits.\n"); DEBUG(dbgs() << "LV: The Widest type: " << WidestType << " bits.\n");
DEBUG(dbgs() << "LV: The Widest register is:" << WidestRegister << "bits.\n"); DEBUG(dbgs() << "LV: The Widest register is: "
<< WidestRegister << " bits.\n");
if (MaxVectorSize == 0) { if (MaxVectorSize == 0) {
DEBUG(dbgs() << "LV: The target has no vector registers.\n"); DEBUG(dbgs() << "LV: The target has no vector registers.\n");
@ -4415,7 +4416,7 @@ LoopVectorizationCostModel::selectUnrollFactor(bool OptForSize,
// We assume that the cost overhead is 1 and we use the cost model // We assume that the cost overhead is 1 and we use the cost model
// to estimate the cost of the loop and unroll until the cost of the // to estimate the cost of the loop and unroll until the cost of the
// loop overhead is about 5% of the cost of the loop. // loop overhead is about 5% of the cost of the loop.
DEBUG(dbgs() << "LV: Loop cost is "<< LoopCost <<" \n"); DEBUG(dbgs() << "LV: Loop cost is " << LoopCost << '\n');
if (LoopCost < SmallLoopCost) { if (LoopCost < SmallLoopCost) {
DEBUG(dbgs() << "LV: Unrolling to reduce branch cost.\n"); DEBUG(dbgs() << "LV: Unrolling to reduce branch cost.\n");
unsigned NewUF = SmallLoopCost / (LoopCost + 1); unsigned NewUF = SmallLoopCost / (LoopCost + 1);
@ -4523,16 +4524,16 @@ LoopVectorizationCostModel::calculateRegisterUsage() {
MaxUsage = std::max(MaxUsage, OpenIntervals.size()); MaxUsage = std::max(MaxUsage, OpenIntervals.size());
DEBUG(dbgs() << "LV(REG): At #" << i << " Interval # " << DEBUG(dbgs() << "LV(REG): At #" << i << " Interval # " <<
OpenIntervals.size() <<"\n"); OpenIntervals.size() << '\n');
// Add the current instruction to the list of open intervals. // Add the current instruction to the list of open intervals.
OpenIntervals.insert(I); OpenIntervals.insert(I);
} }
unsigned Invariant = LoopInvariants.size(); unsigned Invariant = LoopInvariants.size();
DEBUG(dbgs() << "LV(REG): Found max usage: " << MaxUsage << " \n"); DEBUG(dbgs() << "LV(REG): Found max usage: " << MaxUsage << '\n');
DEBUG(dbgs() << "LV(REG): Found invariant usage: " << Invariant << " \n"); DEBUG(dbgs() << "LV(REG): Found invariant usage: " << Invariant << '\n');
DEBUG(dbgs() << "LV(REG): LoopSize: " << R.NumInstructions << " \n"); DEBUG(dbgs() << "LV(REG): LoopSize: " << R.NumInstructions << '\n');
R.LoopInvariantRegs = Invariant; R.LoopInvariantRegs = Invariant;
R.MaxLocalUsers = MaxUsage; R.MaxLocalUsers = MaxUsage;
@ -4557,7 +4558,7 @@ unsigned LoopVectorizationCostModel::expectedCost(unsigned VF) {
unsigned C = getInstructionCost(it, VF); unsigned C = getInstructionCost(it, VF);
BlockCost += C; BlockCost += C;
DEBUG(dbgs() << "LV: Found an estimated cost of " << C << " for VF " << DEBUG(dbgs() << "LV: Found an estimated cost of " << C << " for VF " <<
VF << " For instruction: "<< *it << "\n"); VF << " For instruction: " << *it << '\n');
} }
// We assume that if-converted blocks have a 50% chance of being executed. // We assume that if-converted blocks have a 50% chance of being executed.