mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Skip over debug info when trying to merge two return BBs.
llvm-svn: 98491
This commit is contained in:
parent
3320ee3d10
commit
0b0be33c46
@ -26,6 +26,7 @@
|
||||
#include "llvm/Transforms/Utils/Local.h"
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/IntrinsicInst.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Attributes.h"
|
||||
#include "llvm/Support/CFG.h"
|
||||
@ -210,9 +211,13 @@ static bool MergeEmptyReturnBlocks(Function &F) {
|
||||
// Check for something else in the block.
|
||||
BasicBlock::iterator I = Ret;
|
||||
--I;
|
||||
if (!isa<PHINode>(I) || I != BB.begin() ||
|
||||
// Skip over debug info.
|
||||
while (isa<DbgInfoIntrinsic>(I) && I != BB.begin())
|
||||
--I;
|
||||
if (!isa<DbgInfoIntrinsic>(I) &&
|
||||
(!isa<PHINode>(I) || I != BB.begin() ||
|
||||
Ret->getNumOperands() == 0 ||
|
||||
Ret->getOperand(0) != I)
|
||||
Ret->getOperand(0) != I))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user