forked from OSchip/llvm-project
The hasConstantReferences predicate always returns false.
llvm-svn: 11301
This commit is contained in:
parent
0606da9572
commit
838b845781
|
@ -105,9 +105,9 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||
assert(BB->getTerminator() && "Degenerate basic block encountered!");
|
||||
assert(&BB->getParent()->front() != BB && "Can't Simplify entry block!");
|
||||
|
||||
// Check to see if the first instruction in this block is just an
|
||||
// 'llvm.unwind'. If so, replace any invoke instructions which use this as an
|
||||
// exception destination with call instructions.
|
||||
// Check to see if the first instruction in this block is just an unwind. If
|
||||
// so, replace any invoke instructions which use this as an exception
|
||||
// destination with call instructions.
|
||||
//
|
||||
if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator()))
|
||||
if (BB->begin() == BasicBlock::iterator(UI)) { // Empty block?
|
||||
|
@ -136,8 +136,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||
}
|
||||
|
||||
// Remove basic blocks that have no predecessors... which are unreachable.
|
||||
if (pred_begin(BB) == pred_end(BB) &&
|
||||
!BB->hasConstantReferences()) {
|
||||
if (pred_begin(BB) == pred_end(BB)) {
|
||||
//cerr << "Removing BB: \n" << BB;
|
||||
|
||||
// Loop through all of our successors and make sure they know that one
|
||||
|
@ -237,7 +236,6 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||
// pred, and if there is only one distinct successor of the predecessor, and
|
||||
// if there are no PHI nodes.
|
||||
//
|
||||
if (!BB->hasConstantReferences()) {
|
||||
pred_iterator PI(pred_begin(BB)), PE(pred_end(BB));
|
||||
BasicBlock *OnlyPred = *PI++;
|
||||
for (; PI != PE; ++PI) // Search all predecessors, see if they are all same
|
||||
|
@ -295,7 +293,6 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return Changed;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue