[llvm] r252414 - Make bugpoint ehpad/token friendly
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 7 20:16:12 PST 2015
Author: majnemer
Date: Sat Nov 7 22:16:12 2015
New Revision: 252414
URL: http://llvm.org/viewvc/llvm-project?rev=252414&view=rev
Log:
Make bugpoint ehpad/token friendly
Tokens shouldn't be blindly replaced with undef/null. Also, don't try
to remove EH pad instructions from the top of basic blocks.
Modified:
llvm/trunk/tools/bugpoint/CrashDebugger.cpp
Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=252414&r1=252413&r2=252414&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original)
+++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Sat Nov 7 22:16:12 2015
@@ -373,8 +373,9 @@ bool ReduceCrashingBlocks::TestBlocks(st
(*SI)->removePredecessor(&*BB);
TerminatorInst *BBTerm = BB->getTerminator();
-
- if (!BB->getTerminator()->getType()->isVoidTy())
+ if (BBTerm->isEHPad())
+ continue;
+ if (!BBTerm->getType()->isVoidTy() && !BBTerm->getType()->isTokenTy())
BBTerm->replaceAllUsesWith(Constant::getNullValue(BBTerm->getType()));
// Replace the old terminator instruction.
@@ -476,7 +477,7 @@ bool ReduceCrashingInstructions::TestIns
Instruction *Inst = &*I++;
if (!Instructions.count(Inst) && !isa<TerminatorInst>(Inst) &&
!Inst->isEHPad()) {
- if (!Inst->getType()->isVoidTy())
+ if (!Inst->getType()->isVoidTy() && !Inst->getType()->isTokenTy())
Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
Inst->eraseFromParent();
}
@@ -785,7 +786,7 @@ static bool DebugACrash(BugDriver &BD,
} else {
if (BugpointIsInterrupted) goto ExitLoops;
- if (isa<LandingPadInst>(I))
+ if (I->isEHPad() || I->getType()->isTokenTy())
continue;
outs() << "Checking instruction: " << *I;
More information about the llvm-commits
mailing list