mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
fix PR8895: metadata operands don't have a strong use of their
nested values, so they can change and drop to null, which can change the hash and cause havok. It turns out that it isn't a good idea to value number stuff with metadata operands anyway, so... don't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122758 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
18d4987753
commit
a12ba39a1d
@ -145,9 +145,15 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool canHandle(Instruction *Inst) {
|
static bool canHandle(Instruction *Inst) {
|
||||||
if (CallInst *CI = dyn_cast<CallInst>(Inst))
|
CallInst *CI = dyn_cast<CallInst>(Inst);
|
||||||
return CI->onlyReadsMemory();
|
if (CI == 0 || !CI->onlyReadsMemory())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Check that there are no metadata operands.
|
||||||
|
for (unsigned i = 0, e = CI->getNumOperands(); i != e; ++i)
|
||||||
|
if (CI->getOperand(i)->getType()->isMetadataTy())
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -407,7 +413,7 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
|
|||||||
if (LastStore &&
|
if (LastStore &&
|
||||||
LastStore->getPointerOperand() == SI->getPointerOperand()) {
|
LastStore->getPointerOperand() == SI->getPointerOperand()) {
|
||||||
DEBUG(dbgs() << "EarlyCSE DEAD STORE: " << *LastStore << " due to: "
|
DEBUG(dbgs() << "EarlyCSE DEAD STORE: " << *LastStore << " due to: "
|
||||||
<< *Inst << '\n');
|
<< *Inst << '\n');
|
||||||
LastStore->eraseFromParent();
|
LastStore->eraseFromParent();
|
||||||
Changed = true;
|
Changed = true;
|
||||||
++NumDSE;
|
++NumDSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user