mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
theoretically the negate we find could be in a different function, check
for this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92425 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -415,6 +415,10 @@ static Value *NegateValue(Value *V, Instruction *BI) {
|
|||||||
// be zapped by reassociate later, so we don't need much finesse here.
|
// be zapped by reassociate later, so we don't need much finesse here.
|
||||||
BinaryOperator *TheNeg = cast<BinaryOperator>(*UI);
|
BinaryOperator *TheNeg = cast<BinaryOperator>(*UI);
|
||||||
|
|
||||||
|
// Verify that the negate is in this function, V might be a constant expr.
|
||||||
|
if (TheNeg->getParent()->getParent() != BI->getParent()->getParent())
|
||||||
|
continue;
|
||||||
|
|
||||||
BasicBlock::iterator InsertPt;
|
BasicBlock::iterator InsertPt;
|
||||||
if (Instruction *InstInput = dyn_cast<Instruction>(V)) {
|
if (Instruction *InstInput = dyn_cast<Instruction>(V)) {
|
||||||
if (InvokeInst *II = dyn_cast<InvokeInst>(InstInput)) {
|
if (InvokeInst *II = dyn_cast<InvokeInst>(InstInput)) {
|
||||||
|
Reference in New Issue
Block a user