mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
The fixme is irrelevant: if that happens, the LLVM bytecode is malformed.
This fixes testcase: SimplifyCFG/2003-08-17-BranchFold.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7919 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -61,12 +61,7 @@ bool ConstantFoldTerminator(BasicBlock *BB) {
|
|||||||
// unconditional branch.
|
// unconditional branch.
|
||||||
BI->setUnconditionalDest(Destination);
|
BI->setUnconditionalDest(Destination);
|
||||||
return true;
|
return true;
|
||||||
}
|
} else if (Dest2 == Dest1) { // Conditional branch to same location?
|
||||||
#if 0
|
|
||||||
// FIXME: TODO: This doesn't work if the destination has PHI nodes with
|
|
||||||
// different incoming values on each branch!
|
|
||||||
//
|
|
||||||
else if (Dest2 == Dest1) { // Conditional branch to same location?
|
|
||||||
// This branch matches something like this:
|
// This branch matches something like this:
|
||||||
// br bool %cond, label %Dest, label %Dest
|
// br bool %cond, label %Dest, label %Dest
|
||||||
// and changes it into: br label %Dest
|
// and changes it into: br label %Dest
|
||||||
@@ -79,7 +74,6 @@ bool ConstantFoldTerminator(BasicBlock *BB) {
|
|||||||
BI->setUnconditionalDest(Dest1);
|
BI->setUnconditionalDest(Dest1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user