forked from OSchip/llvm-project
				
			Skip debug info one more place. (This one gets
called from llc, not opt, but it's an IR level optimization nevertheless.) llvm-svn: 67724
This commit is contained in:
		
							parent
							
								
									dfbbdf6fd5
								
							
						
					
					
						commit
						db90560c1c
					
				| 
						 | 
					@ -20,6 +20,7 @@
 | 
				
			||||||
#include "llvm/Function.h"
 | 
					#include "llvm/Function.h"
 | 
				
			||||||
#include "llvm/InlineAsm.h"
 | 
					#include "llvm/InlineAsm.h"
 | 
				
			||||||
#include "llvm/Instructions.h"
 | 
					#include "llvm/Instructions.h"
 | 
				
			||||||
 | 
					#include "llvm/IntrinsicInst.h"
 | 
				
			||||||
#include "llvm/Pass.h"
 | 
					#include "llvm/Pass.h"
 | 
				
			||||||
#include "llvm/Target/TargetAsmInfo.h"
 | 
					#include "llvm/Target/TargetAsmInfo.h"
 | 
				
			||||||
#include "llvm/Target/TargetData.h"
 | 
					#include "llvm/Target/TargetData.h"
 | 
				
			||||||
| 
						 | 
					@ -350,15 +351,20 @@ static void SplitEdgeNicely(TerminatorInst *TI, unsigned SuccNum,
 | 
				
			||||||
      BasicBlock *Pred = *PI;
 | 
					      BasicBlock *Pred = *PI;
 | 
				
			||||||
      // To be usable, the pred has to end with an uncond branch to the dest.
 | 
					      // To be usable, the pred has to end with an uncond branch to the dest.
 | 
				
			||||||
      BranchInst *PredBr = dyn_cast<BranchInst>(Pred->getTerminator());
 | 
					      BranchInst *PredBr = dyn_cast<BranchInst>(Pred->getTerminator());
 | 
				
			||||||
      if (!PredBr || !PredBr->isUnconditional() ||
 | 
					      if (!PredBr || !PredBr->isUnconditional())
 | 
				
			||||||
          // Must be empty other than the branch.
 | 
					        continue;
 | 
				
			||||||
          &Pred->front() != PredBr ||
 | 
					      // Must be empty other than the branch and debug info.
 | 
				
			||||||
 | 
					      BasicBlock::iterator I = Pred->begin();
 | 
				
			||||||
 | 
					      while (isa<DbgInfoIntrinsic>(I))
 | 
				
			||||||
 | 
					        I++;
 | 
				
			||||||
 | 
					      if (dyn_cast<Instruction>(I) != PredBr)
 | 
				
			||||||
 | 
					        continue;
 | 
				
			||||||
      // Cannot be the entry block; its label does not get emitted.
 | 
					      // Cannot be the entry block; its label does not get emitted.
 | 
				
			||||||
          Pred == &(Dest->getParent()->getEntryBlock()))
 | 
					      if (Pred == &(Dest->getParent()->getEntryBlock()))
 | 
				
			||||||
        continue;
 | 
					        continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // Finally, since we know that Dest has phi nodes in it, we have to make
 | 
					      // Finally, since we know that Dest has phi nodes in it, we have to make
 | 
				
			||||||
      // sure that jumping to Pred will have the same affect as going to Dest in
 | 
					      // sure that jumping to Pred will have the same effect as going to Dest in
 | 
				
			||||||
      // terms of PHI values.
 | 
					      // terms of PHI values.
 | 
				
			||||||
      PHINode *PN;
 | 
					      PHINode *PN;
 | 
				
			||||||
      unsigned PHINo = 0;
 | 
					      unsigned PHINo = 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue