summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-01-09 19:23:24 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-01-09 19:23:24 +0000
commitc189a392ced3a4466f313b6784d618ec22c2663a (patch)
tree980693df6bc87b3304e08b591463330e731d3c85 /llvm/lib
parent2f2edd3fb168a50708e738c810f60a99f998ffe3 (diff)
downloadbcm5719-llvm-c189a392ced3a4466f313b6784d618ec22c2663a.tar.gz
bcm5719-llvm-c189a392ced3a4466f313b6784d618ec22c2663a.zip
[ObjCARC Debug Messages] This is a squashed commit of 3x debug message commits ala echristo's suggestion.
1. Added debug messages when in OptimizeIndividualCalls we move calls into predecessors and then erase the original call. 2. Added debug messages when in the process of moving calls in ObjCARCOpt::MoveCalls we create new RR and delete old RR. 3. Added a debug message when we visit a specific retain instruction in ObjCARCOpt::PerformCodePlacement. llvm-svn: 171988
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/ObjCARC.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/ObjCARC.cpp b/llvm/lib/Transforms/Scalar/ObjCARC.cpp
index e6ec841aa5b..8eb9d19939e 100644
--- a/llvm/lib/Transforms/Scalar/ObjCARC.cpp
+++ b/llvm/lib/Transforms/Scalar/ObjCARC.cpp
@@ -2562,10 +2562,16 @@ void ObjCARCOpt::OptimizeIndividualCalls(Function &F) {
Op = new BitCastInst(Op, ParamTy, "", InsertPos);
Clone->setArgOperand(0, Op);
Clone->insertBefore(InsertPos);
+
+ DEBUG(dbgs() << "ObjCARCOpt::OptimizeIndividualCalls: Cloning "
+ << *CInst << "\n"
+ " And inserting "
+ "clone at " << *InsertPos << "\n");
Worklist.push_back(std::make_pair(Clone, Incoming));
}
}
// Erase the original call.
+ DEBUG(dbgs() << "Erasing: " << *CInst << "\n");
EraseInstruction(CInst);
continue;
}
@@ -3226,6 +3232,11 @@ void ObjCARCOpt::MoveCalls(Value *Arg,
MDNode::get(M->getContext(), ArrayRef<Value *>()));
else
Call->setTailCall();
+
+ DEBUG(dbgs() << "ObjCARCOpt::MoveCalls: Inserting new Release: " << *Call
+ << "\n"
+ " At insertion point: " << *InsertPt
+ << "\n");
}
for (SmallPtrSet<Instruction *, 2>::const_iterator
PI = RetainsToMove.ReverseInsertPts.begin(),
@@ -3241,6 +3252,11 @@ void ObjCARCOpt::MoveCalls(Value *Arg,
Call->setDoesNotThrow();
if (ReleasesToMove.IsTailCallRelease)
Call->setTailCall();
+
+ DEBUG(dbgs() << "ObjCARCOpt::MoveCalls: Inserting new Retain: " << *Call
+ << "\n"
+ " At insertion point: " << *InsertPt
+ << "\n");
}
// Delete the original retain and release calls.
@@ -3250,6 +3266,8 @@ void ObjCARCOpt::MoveCalls(Value *Arg,
Instruction *OrigRetain = *AI;
Retains.blot(OrigRetain);
DeadInsts.push_back(OrigRetain);
+ DEBUG(dbgs() << "ObjCARCOpt::MoveCalls: Deleting retain: " << *OrigRetain <<
+ "\n");
}
for (SmallPtrSet<Instruction *, 2>::const_iterator
AI = ReleasesToMove.Calls.begin(),
@@ -3257,6 +3275,8 @@ void ObjCARCOpt::MoveCalls(Value *Arg,
Instruction *OrigRelease = *AI;
Releases.erase(OrigRelease);
DeadInsts.push_back(OrigRelease);
+ DEBUG(dbgs() << "ObjCARCOpt::MoveCalls: Deleting release: " << *OrigRelease
+ << "\n");
}
}
@@ -3282,6 +3302,10 @@ ObjCARCOpt::PerformCodePlacement(DenseMap<const BasicBlock *, BBState>
if (!V) continue; // blotted
Instruction *Retain = cast<Instruction>(V);
+
+ DEBUG(dbgs() << "ObjCARCOpt::PerformCodePlacement: Visiting: " << *Retain
+ << "\n");
+
Value *Arg = GetObjCArg(Retain);
// If the object being released is in static or stack storage, we know it's
OpenPOWER on IntegriCloud