mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Assert that dominates is not given a multiple edge. Finding out if we have
multiple edges between two blocks is linear. If the caller is iterating all edges leaving a BB that would be a square time algorithm. It is more efficient to have the callers handle that case. Currently the only callers are: * GVN: already avoids the multiple edge case. * Verifier: could only hit this assert when looking at an invalid invoke. Since it already rejects the invoke, just avoid computing the dominance for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162113 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1575,6 +1575,13 @@ void Verifier::visitLandingPadInst(LandingPadInst &LPI) {
|
||||
|
||||
void Verifier::verifyDominatesUse(Instruction &I, unsigned i) {
|
||||
Instruction *Op = cast<Instruction>(I.getOperand(i));
|
||||
// If the we have an invalid invoke, don't try to compute the dominance.
|
||||
// We already reject it in the invoke specific checks and the dominance
|
||||
// computation doesn't handle multiple edges.
|
||||
if (InvokeInst *II = dyn_cast<InvokeInst>(Op)) {
|
||||
if (II->getNormalDest() == II->getUnwindDest())
|
||||
return;
|
||||
}
|
||||
|
||||
const Use &U = I.getOperandUse(i);
|
||||
Assert2(InstsInThisBlock.count(Op) || DT->dominates(Op, U),
|
||||
|
Reference in New Issue
Block a user