forked from OSchip/llvm-project
Fix Regression/Transforms/Reassociate/2005-08-24-Crash.ll
llvm-svn: 23019
This commit is contained in:
parent
347f5cb985
commit
8ca5b2a6d2
|
@ -496,9 +496,15 @@ void Reassociate::OptimizeExpression(unsigned Opcode,
|
||||||
++NumAnnihil;
|
++NumAnnihil;
|
||||||
} else {
|
} else {
|
||||||
assert(Opcode == Instruction::Xor);
|
assert(Opcode == Instruction::Xor);
|
||||||
|
if (e == 2) {
|
||||||
|
Ops[0].Op = Constant::getNullValue(Ops[0].Op->getType());
|
||||||
|
Ops.erase(Ops.begin()+1, Ops.end());
|
||||||
|
++NumAnnihil;
|
||||||
|
return;
|
||||||
|
}
|
||||||
// ... X^X -> ...
|
// ... X^X -> ...
|
||||||
Ops.erase(Ops.begin()+i, Ops.begin()+i+2);
|
Ops.erase(Ops.begin()+i, Ops.begin()+i+2);
|
||||||
i -= 2; e -= 2;
|
i -= 1; e -= 2;
|
||||||
IterateOptimization = true;
|
IterateOptimization = true;
|
||||||
++NumAnnihil;
|
++NumAnnihil;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue