mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Don't perform an expensive check if it's not necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
910b4b8479
commit
60e174495a
@ -329,7 +329,12 @@ void GVNPRE::clean(std::set<Value*, ExprLT>& set) {
|
||||
lhsValid = true;
|
||||
break;
|
||||
}
|
||||
lhsValid &= !dependsOnInvoke(BO->getOperand(0));
|
||||
|
||||
// Check for dependency on invoke insts
|
||||
// NOTE: This check is expensive, so don't do it if we
|
||||
// don't have to
|
||||
if (lhsValid)
|
||||
lhsValid = !dependsOnInvoke(BO->getOperand(0));
|
||||
|
||||
bool rhsValid = !isa<Instruction>(BO->getOperand(1));
|
||||
if (!rhsValid)
|
||||
@ -339,7 +344,12 @@ void GVNPRE::clean(std::set<Value*, ExprLT>& set) {
|
||||
rhsValid = true;
|
||||
break;
|
||||
}
|
||||
rhsValid &= !dependsOnInvoke(BO->getOperand(1));
|
||||
|
||||
// Check for dependency on invoke insts
|
||||
// NOTE: This check is expensive, so don't do it if we
|
||||
// don't have to
|
||||
if (rhsValid)
|
||||
rhsValid = !dependsOnInvoke(BO->getOperand(1));
|
||||
|
||||
if (!lhsValid || !rhsValid)
|
||||
set.erase(BO);
|
||||
|
Loading…
Reference in New Issue
Block a user