mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Conservatively, clear optional flags, such as nsw, when performing
reassociation. No testcase, because I wasn't able to create a testcase which actually demonstrates a problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124713 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
46985a1440
commit
5195b71941
@ -157,6 +157,9 @@ bool InstCombiner::SimplifyAssociativeOrCommutative(BinaryOperator &I) {
|
|||||||
// It simplifies to V. Form "A op V".
|
// It simplifies to V. Form "A op V".
|
||||||
I.setOperand(0, A);
|
I.setOperand(0, A);
|
||||||
I.setOperand(1, V);
|
I.setOperand(1, V);
|
||||||
|
// Conservatively clear the optional flags, since they may not be
|
||||||
|
// preserved by the reassociation.
|
||||||
|
I.clearSubclassOptionalData();
|
||||||
Changed = true;
|
Changed = true;
|
||||||
++NumReassoc;
|
++NumReassoc;
|
||||||
continue;
|
continue;
|
||||||
@ -174,6 +177,9 @@ bool InstCombiner::SimplifyAssociativeOrCommutative(BinaryOperator &I) {
|
|||||||
// It simplifies to V. Form "V op C".
|
// It simplifies to V. Form "V op C".
|
||||||
I.setOperand(0, V);
|
I.setOperand(0, V);
|
||||||
I.setOperand(1, C);
|
I.setOperand(1, C);
|
||||||
|
// Conservatively clear the optional flags, since they may not be
|
||||||
|
// preserved by the reassociation.
|
||||||
|
I.clearSubclassOptionalData();
|
||||||
Changed = true;
|
Changed = true;
|
||||||
++NumReassoc;
|
++NumReassoc;
|
||||||
continue;
|
continue;
|
||||||
@ -193,6 +199,9 @@ bool InstCombiner::SimplifyAssociativeOrCommutative(BinaryOperator &I) {
|
|||||||
// It simplifies to V. Form "V op B".
|
// It simplifies to V. Form "V op B".
|
||||||
I.setOperand(0, V);
|
I.setOperand(0, V);
|
||||||
I.setOperand(1, B);
|
I.setOperand(1, B);
|
||||||
|
// Conservatively clear the optional flags, since they may not be
|
||||||
|
// preserved by the reassociation.
|
||||||
|
I.clearSubclassOptionalData();
|
||||||
Changed = true;
|
Changed = true;
|
||||||
++NumReassoc;
|
++NumReassoc;
|
||||||
continue;
|
continue;
|
||||||
@ -210,6 +219,9 @@ bool InstCombiner::SimplifyAssociativeOrCommutative(BinaryOperator &I) {
|
|||||||
// It simplifies to V. Form "B op V".
|
// It simplifies to V. Form "B op V".
|
||||||
I.setOperand(0, B);
|
I.setOperand(0, B);
|
||||||
I.setOperand(1, V);
|
I.setOperand(1, V);
|
||||||
|
// Conservatively clear the optional flags, since they may not be
|
||||||
|
// preserved by the reassociation.
|
||||||
|
I.clearSubclassOptionalData();
|
||||||
Changed = true;
|
Changed = true;
|
||||||
++NumReassoc;
|
++NumReassoc;
|
||||||
continue;
|
continue;
|
||||||
@ -234,6 +246,9 @@ bool InstCombiner::SimplifyAssociativeOrCommutative(BinaryOperator &I) {
|
|||||||
Worklist.Add(New);
|
Worklist.Add(New);
|
||||||
I.setOperand(0, New);
|
I.setOperand(0, New);
|
||||||
I.setOperand(1, Folded);
|
I.setOperand(1, Folded);
|
||||||
|
// Conservatively clear the optional flags, since they may not be
|
||||||
|
// preserved by the reassociation.
|
||||||
|
I.clearSubclassOptionalData();
|
||||||
Changed = true;
|
Changed = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user