aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-01-05 01:10:40 +0000
committerDevang Patel <dpatel@apple.com>2010-01-05 01:10:40 +0000
commit44a29e066a24e88bdf127e88be4380a5f259c4b4 (patch)
tree26820d0116232725e3de4f9627ad255006c1d8a2 /lib/Transforms
parent4361bbfd0e41453224a1867d2c4d04ef7b3d723b (diff)
Remove dead debug info intrinsics.
Intrinsic::dbg_stoppoint Intrinsic::dbg_region_start Intrinsic::dbg_region_end Intrinsic::dbg_func_start AutoUpgrade simply ignores these intrinsics now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92557 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/InstCombine/InstructionCombining.cpp1
-rw-r--r--lib/Transforms/Scalar/LICM.cpp4
-rw-r--r--lib/Transforms/Utils/BasicBlockUtils.cpp13
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp16
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp45
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp7
6 files changed, 1 insertions, 85 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
index 0c9e135785..2785fa8286 100644
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -8643,7 +8643,6 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
BasicBlock::iterator InsertPos = DestBlock->getFirstNonPHI();
- CopyPrecedingStopPoint(I, InsertPos);
I->moveBefore(InsertPos);
++NumSunkInst;
return true;
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 99f3ae07f6..6a447dba12 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -384,10 +384,6 @@ bool LICM::canSinkOrHoistInst(Instruction &I) {
Size = AA->getTypeStoreSize(LI->getType());
return !pointerInvalidatedByLoop(LI->getOperand(0), Size);
} else if (CallInst *CI = dyn_cast<CallInst>(&I)) {
- if (isa<DbgStopPointInst>(CI)) {
- // Don't hoist/sink dbgstoppoints, we handle them separately
- return false;
- }
// Handle obvious cases efficiently.
AliasAnalysis::ModRefBehavior Behavior = AA->getModRefBehavior(CI);
if (Behavior == AliasAnalysis::DoesNotAccessMemory)
diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp
index 2962e8497e..840fe3ef71 100644
--- a/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -673,16 +673,3 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB,
return 0;
}
-/// CopyPrecedingStopPoint - If I is immediately preceded by a StopPoint,
-/// make a copy of the stoppoint before InsertPos (presumably before copying
-/// or moving I).
-void llvm::CopyPrecedingStopPoint(Instruction *I,
- BasicBlock::iterator InsertPos) {
- if (I != I->getParent()->begin()) {
- BasicBlock::iterator BBI = I; --BBI;
- if (DbgStopPointInst *DSPI = dyn_cast<DbgStopPointInst>(BBI)) {
- CallInst *newDSPI = cast<CallInst>(DSPI->clone());
- newDSPI->insertBefore(InsertPos);
- }
- }
-}
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index c287747b91..bd750ccd4d 100644
--- a/lib/Transforms/Utils/CloneFunction.cpp
+++ b/lib/Transforms/Utils/CloneFunction.cpp
@@ -184,7 +184,6 @@ namespace {
const char *NameSuffix;
ClonedCodeInfo *CodeInfo;
const TargetData *TD;
- Value *DbgFnStart;
public:
PruningFunctionCloner(Function *newFunc, const Function *oldFunc,
DenseMap<const Value*, Value*> &valueMap,
@@ -193,7 +192,7 @@ namespace {
ClonedCodeInfo *codeInfo,
const TargetData *td)
: NewFunc(newFunc), OldFunc(oldFunc), ValueMap(valueMap), Returns(returns),
- NameSuffix(nameSuffix), CodeInfo(codeInfo), TD(td), DbgFnStart(NULL) {
+ NameSuffix(nameSuffix), CodeInfo(codeInfo), TD(td) {
}
/// CloneBlock - The specified block is found to be reachable, clone it and
@@ -235,19 +234,6 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB,
continue;
}
- // Do not clone llvm.dbg.region.end. It will be adjusted by the inliner.
- if (const DbgFuncStartInst *DFSI = dyn_cast<DbgFuncStartInst>(II)) {
- if (DbgFnStart == NULL) {
- DISubprogram SP(DFSI->getSubprogram());
- if (SP.describes(BB->getParent()))
- DbgFnStart = DFSI->getSubprogram();
- }
- }
- if (const DbgRegionEndInst *DREIS = dyn_cast<DbgRegionEndInst>(II)) {
- if (DREIS->getContext() == DbgFnStart)
- continue;
- }
-
Instruction *NewInst = II->clone();
if (II->hasName())
NewInst->setName(II->getName()+NameSuffix);
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index 043046c813..17f8827fd5 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/lib/Transforms/Utils/InlineFunction.cpp
@@ -210,34 +210,6 @@ static void UpdateCallGraphAfterInlining(CallSite CS,
CallerNode->removeCallEdgeFor(CS);
}
-/// findFnRegionEndMarker - This is a utility routine that is used by
-/// InlineFunction. Return llvm.dbg.region.end intrinsic that corresponds
-/// to the llvm.dbg.func.start of the function F. Otherwise return NULL.
-///
-static const DbgRegionEndInst *findFnRegionEndMarker(const Function *F) {
-
- MDNode *FnStart = NULL;
- const DbgRegionEndInst *FnEnd = NULL;
- for (Function::const_iterator FI = F->begin(), FE =F->end(); FI != FE; ++FI)
- for (BasicBlock::const_iterator BI = FI->begin(), BE = FI->end(); BI != BE;
- ++BI) {
- if (FnStart == NULL) {
- if (const DbgFuncStartInst *FSI = dyn_cast<DbgFuncStartInst>(BI)) {
- DISubprogram SP(FSI->getSubprogram());
- assert (SP.isNull() == false && "Invalid llvm.dbg.func.start");
- if (SP.describes(F))
- FnStart = SP.getNode();
- }
- continue;
- }
-
- if (const DbgRegionEndInst *REI = dyn_cast<DbgRegionEndInst>(BI))
- if (REI->getContext() == FnStart)
- FnEnd = REI;
- }
- return FnEnd;
-}
-
// InlineFunction - This function inlines the called function into the basic
// block of the caller. This returns false if it is not possible to inline this
// call. The program is still in a well defined state if this occurs though.
@@ -364,23 +336,6 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD,
ValueMap[I] = ActualArg;
}
- // Adjust llvm.dbg.region.end. If the CalledFunc has region end
- // marker then clone that marker after next stop point at the
- // call site. The function body cloner does not clone original
- // region end marker from the CalledFunc. This will ensure that
- // inlined function's scope ends at the right place.
- if (const DbgRegionEndInst *DREI = findFnRegionEndMarker(CalledFunc)) {
- for (BasicBlock::iterator BI = TheCall, BE = TheCall->getParent()->end();
- BI != BE; ++BI) {
- if (DbgStopPointInst *DSPI = dyn_cast<DbgStopPointInst>(BI)) {
- if (DbgRegionEndInst *NewDREI =
- dyn_cast<DbgRegionEndInst>(DREI->clone()))
- NewDREI->insertAfter(DSPI);
- break;
- }
- }
- }
-
// We want the inliner to prune the code as it copies. We would LOVE to
// have no dead or constant instructions leftover after inlining occurs
// (which can happen, e.g., because an argument was constant), but we'll be
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index d7ca45e6e9..70e4b39a8d 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1658,13 +1658,6 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
Instruction *NewRet = RI->clone();
Pred->getInstList().push_back(NewRet);
- BasicBlock::iterator BBI = RI;
- if (BBI != BB->begin()) {
- // Move region end info into the predecessor.
- if (DbgRegionEndInst *DREI = dyn_cast<DbgRegionEndInst>(--BBI))
- DREI->moveBefore(NewRet);
- }
-
// If the return instruction returns a value, and if the value was a
// PHI node in "BB", propagate the right value into the return.
for (User::op_iterator i = NewRet->op_begin(), e = NewRet->op_end();