Don't create two DEF UsePos

This commit is contained in:
Dmitry Stogov 2023-03-29 17:22:49 +03:00
parent d79bd88f6f
commit ee827ee983
10 changed files with 40 additions and 42 deletions

View File

@ -578,12 +578,10 @@ int ir_compute_live_ranges(ir_ctx *ctx)
IR_DEF_LIVE_POS_FROM_REF(ref), def_pos);
}
} else if (def_flags & IR_DEF_REUSES_OP1_REG) {
/* We add two uses to emulate move from op1 to res */
ir_add_use(ctx, ctx->vregs[ref], 0, IR_DEF_LIVE_POS_FROM_REF(ref), reg, def_flags, 0);
def_pos = IR_LOAD_LIVE_POS_FROM_REF(ref);
if (!IR_IS_CONST_REF(insn->op1) && ctx->vregs[insn->op1]) {
hint_ref = insn->op1;
}
def_pos = IR_LOAD_LIVE_POS_FROM_REF(ref);
} else if (def_flags & IR_DEF_CONFLICTS_WITH_INPUT_REGS) {
def_pos = IR_LOAD_LIVE_POS_FROM_REF(ref);
} else {

View File

@ -64,10 +64,10 @@ TMP
[%xmm0]: [13.2-13.3)
R1 (d_4) [%xmm0]: [3.0-10.1), DEF(4.2), USE(9.1/2), USE(10.1/2)
R2 (d_5, d_9) [SPILL=0x0]
[%xmm1]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, DEF(9.2)!, USE(10.0/1, hint=%xmm1, hint=R3)!
[%xmm1]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, USE(10.0/1, hint=%xmm1, hint=R3)!
: [10.0-14.0), PHI_USE(13.2, phi=d_5/3)
R3 (d_10) [SPILL=0x8]
[%xmm1]: [10.0-11.0), DEF(10.0, hint=R2)!, DEF(10.2)!, USE(11.0/4, hint=%xmm1)
[%xmm1]: [10.0-11.0), DEF(10.0, hint=R2)!, USE(11.0/4, hint=%xmm1)
: [11.0-14.0), PHI_USE(13.2, phi=d_4/3)
[%rax] : [15.0-15.1)
[%rcx] : [11.0-11.1)

View File

@ -65,10 +65,10 @@ TMP
[%xmm0]: [15.2-15.3)
R1 (d_4) [%xmm0]: [3.0-10.1), DEF(4.2), USE(9.1/2), USE(10.1/2)
R2 (d_5, d_9) [SPILL=0x0]
[%xmm1]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, DEF(9.2)!, USE(10.0/1, hint=%xmm1, hint=R3)!
[%xmm1]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, USE(10.0/1, hint=%xmm1, hint=R3)!
: [10.0-16.0), PHI_USE(15.2, phi=d_5/3)
R3 (d_10) [SPILL=0x8]
[%xmm1]: [10.0-11.0), DEF(10.0, hint=R2)!, DEF(10.2)!, USE(11.0/4, hint=%xmm1)
[%xmm1]: [10.0-11.0), DEF(10.0, hint=R2)!, USE(11.0/4, hint=%xmm1)
: [11.0-16.0), USE(13.0/4, hint=%xmm1), PHI_USE(15.2, phi=d_4/3)
[%rax] : [17.0-17.1)
[%rcx] : [11.0-11.1), [13.0-13.1)

View File

@ -112,28 +112,28 @@ R1 (d_2) [SPILL=0x0]
: [36.0-38.0), USE(36.1/2)
R2 (d_3) [%xmm1]: [3.3-5.0), DEF(3.3, hint=%xmm1), USE(5.0/1, hint=R3)!
R3 (d_5) [SPILL=0x8]
[%xmm1]: [5.0-10.2), DEF(5.0, hint=R2)!, DEF(5.2)!
[%xmm1]: [5.0-10.2), DEF(5.0, hint=R2)!
: [10.2-24.0), [26.0-29.0), [31.0-34.0)
: [34.0-38.0), USE(34.1/2)
R4 (d_12, d_36) [%xmm1]: [11.0-24.0), [26.0-29.0), [31.0-32.0), [36.0-38.0), DEF(12.2), USE(20.0/1, hint=R8)!, USE(20.0/2), USE(32.0/1)!, DEF(36.0, hint=R12)!, DEF(36.2)!, PHI_USE(37.2, phi=d_12/3)
R4 (d_12, d_36) [%xmm1]: [11.0-24.0), [26.0-29.0), [31.0-32.0), [36.0-38.0), DEF(12.2), USE(20.0/1, hint=R8)!, USE(20.0/2), USE(32.0/1)!, DEF(36.0, hint=R12)!, PHI_USE(37.2, phi=d_12/3)
R5 (d_13, d_34) [SPILL=0x10]
[%xmm0]: [11.0-18.0), DEF(13.2), USE(18.0/1, hint=R7)!, USE(18.0/2)
: [18.0-24.0), [26.0-29.0), [31.0-32.0)
[%xmm0]: [32.0-32.1), [34.0-38.0), USE(32.1/2, hint=R10), DEF(34.0, hint=R11)!, DEF(34.2)!, PHI_USE(37.2, phi=d_13/3)
[%xmm0]: [32.0-32.1), [34.0-38.0), USE(32.1/2, hint=R10), DEF(34.0, hint=R11)!, PHI_USE(37.2, phi=d_13/3)
R6 (d_14, d_15) [%eax]: [11.0-15.1), [15.2-25.0), [26.0-29.0), [31.0-38.0), DEF(14.2), USE(15.1/1)!, DEF(15.2)!, USE(25.0/2, hint=%eax), USE(27.1/1), PHI_USE(37.2, phi=d_14/3)
R7 (d_18) [SPILL=0x18]
[%xmm0]: [18.0-20.0), DEF(18.0, hint=R5)!, DEF(18.2)!
[%xmm0]: [18.0-20.0), DEF(18.0, hint=R5)!
: [20.0-21.0)
: [21.0-24.0), [26.0-29.0), [31.0-32.3), USE(21.1/2)
[%xmm0]: [32.3-33.0), USE(33.0/1, hint=R11)!
R8 (d_20) [SPILL=0x20]
[%xmm0]: [20.0-21.0), DEF(20.0, hint=R4)!, DEF(20.2)!, USE(21.0/1, hint=R9)!
[%xmm0]: [20.0-21.0), DEF(20.0, hint=R4)!, USE(21.0/1, hint=R9)!
: [21.0-24.0), [26.0-29.0), [31.0-33.0)
: [33.0-33.1), USE(33.1/2)
R9 (d_21) [%xmm0]: [21.0-22.1), DEF(21.0, hint=R8)!, DEF(21.2)!, USE(22.1/1)!
R10 (d_32) [%xmm1]: [32.0-35.0), DEF(32.0, hint=R4)!, DEF(32.2)!, USE(35.0/1, hint=R12)!, USE(35.0/2)
R11 (d_33) [%xmm0]: [33.0-34.0), DEF(33.0, hint=R7)!, DEF(33.2)!, USE(34.0/1, hint=R5)!
R12 (d_35) [%xmm1]: [35.0-36.0), DEF(35.0, hint=R10)!, DEF(35.2)!, USE(36.0/1, hint=R4)!
R9 (d_21) [%xmm0]: [21.0-22.1), DEF(21.0, hint=R8)!, USE(22.1/1)!
R10 (d_32) [%xmm1]: [32.0-35.0), DEF(32.0, hint=R4)!, USE(35.0/1, hint=R12)!, USE(35.0/2)
R11 (d_33) [%xmm0]: [33.0-34.0), DEF(33.0, hint=R7)!, USE(34.0/1, hint=R5)!
R12 (d_35) [%xmm1]: [35.0-36.0), DEF(35.0, hint=R10)!, USE(36.0/1, hint=R4)!
[%rax] : [25.0-25.1), [30.0-30.1)
[%xmm0] : [1.0-2.3)
[%xmm1] : [1.0-3.3)

View File

@ -64,10 +64,10 @@ TMP
[%xmm0]: [13.2-13.3)
R1 (d_4) [%xmm1]: [3.0-10.1), DEF(4.2), USE(9.1/2), USE(10.1/2)
R2 (d_5, d_9) [SPILL=0x0]
[%xmm0]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, DEF(9.2)!, USE(10.0/1, hint=R3)!
[%xmm0]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, USE(10.0/1, hint=R3)!
: [10.0-14.0), PHI_USE(13.2, phi=d_5/3)
R3 (d_10) [SPILL=0x8]
[%xmm0]: [10.0-11.1), DEF(10.0, hint=R2)!, DEF(10.2)!, USE(11.1/4)
[%xmm0]: [10.0-11.1), DEF(10.0, hint=R2)!, USE(11.1/4)
: [11.1-14.0), PHI_USE(13.2, phi=d_4/3)
[%eax] : [15.0-15.1)
[%SCRATCH] : [11.1-11.2)

View File

@ -65,10 +65,10 @@ TMP
[%xmm0]: [15.2-15.3)
R1 (d_4) [%xmm1]: [3.0-10.1), DEF(4.2), USE(9.1/2), USE(10.1/2)
R2 (d_5, d_9) [SPILL=0x0]
[%xmm0]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, DEF(9.2)!, USE(10.0/1, hint=R3)!
[%xmm0]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, USE(10.0/1, hint=R3)!
: [10.0-16.0), PHI_USE(15.2, phi=d_5/3)
R3 (d_10) [SPILL=0x8]
[%xmm0]: [10.0-11.1), DEF(10.0, hint=R2)!, DEF(10.2)!, USE(11.1/4)
[%xmm0]: [10.0-11.1), DEF(10.0, hint=R2)!, USE(11.1/4)
: [11.1-16.0), USE(13.1/4), PHI_USE(15.2, phi=d_4/3)
[%eax] : [17.0-17.1)
[%SCRATCH] : [11.1-11.2), [13.1-13.2)

View File

@ -112,28 +112,28 @@ R1 (d_2)
: [36.0-38.0), USE(36.1/2)
R2 (d_3) [%xmm1]: [3.2-5.0), DEF(3.2)!, USE(5.0/1, hint=R3)!
R3 (d_5) [SPILL=0x0]
[%xmm1]: [5.0-10.2), DEF(5.0, hint=R2)!, DEF(5.2)!
[%xmm1]: [5.0-10.2), DEF(5.0, hint=R2)!
: [10.2-24.0), [26.0-29.0), [31.0-34.0)
: [34.0-38.0), USE(34.1/2)
R4 (d_12, d_36) [%xmm1]: [11.0-24.0), [26.0-29.0), [31.0-32.0), [36.0-38.0), DEF(12.2), USE(20.0/1, hint=R8)!, USE(20.0/2), USE(32.0/1)!, DEF(36.0, hint=R12)!, DEF(36.2)!, PHI_USE(37.2, phi=d_12/3)
R4 (d_12, d_36) [%xmm1]: [11.0-24.0), [26.0-29.0), [31.0-32.0), [36.0-38.0), DEF(12.2), USE(20.0/1, hint=R8)!, USE(20.0/2), USE(32.0/1)!, DEF(36.0, hint=R12)!, PHI_USE(37.2, phi=d_12/3)
R5 (d_13, d_34) [SPILL=0x8]
[%xmm0]: [11.0-18.0), DEF(13.2), USE(18.0/1, hint=R7)!, USE(18.0/2)
: [18.0-24.0), [26.0-29.0), [31.0-32.0)
[%xmm0]: [32.0-32.1), [34.0-38.0), USE(32.1/2, hint=R10), DEF(34.0, hint=R11)!, DEF(34.2)!, PHI_USE(37.2, phi=d_13/3)
[%xmm0]: [32.0-32.1), [34.0-38.0), USE(32.1/2, hint=R10), DEF(34.0, hint=R11)!, PHI_USE(37.2, phi=d_13/3)
R6 (d_14, d_15) [%eax]: [11.0-15.1), [15.2-25.0), [26.0-29.0), [31.0-38.0), DEF(14.2), USE(15.1/1)!, DEF(15.2)!, USE(25.0/2, hint=%eax), USE(27.1/1), PHI_USE(37.2, phi=d_14/3)
R7 (d_18) [SPILL=0x10]
[%xmm0]: [18.0-20.0), DEF(18.0, hint=R5)!, DEF(18.2)!
[%xmm0]: [18.0-20.0), DEF(18.0, hint=R5)!
: [20.0-21.0)
: [21.0-24.0), [26.0-29.0), [31.0-32.3), USE(21.1/2)
[%xmm0]: [32.3-33.0), USE(33.0/1, hint=R11)!
R8 (d_20) [SPILL=0x18]
[%xmm0]: [20.0-21.0), DEF(20.0, hint=R4)!, DEF(20.2)!, USE(21.0/1, hint=R9)!
[%xmm0]: [20.0-21.0), DEF(20.0, hint=R4)!, USE(21.0/1, hint=R9)!
: [21.0-24.0), [26.0-29.0), [31.0-33.0)
: [33.0-33.1), USE(33.1/2)
R9 (d_21) [%xmm0]: [21.0-22.1), DEF(21.0, hint=R8)!, DEF(21.2)!, USE(22.1/1)!
R10 (d_32) [%xmm1]: [32.0-35.0), DEF(32.0, hint=R4)!, DEF(32.2)!, USE(35.0/1, hint=R12)!, USE(35.0/2)
R11 (d_33) [%xmm0]: [33.0-34.0), DEF(33.0, hint=R7)!, DEF(33.2)!, USE(34.0/1, hint=R5)!
R12 (d_35) [%xmm1]: [35.0-36.0), DEF(35.0, hint=R10)!, DEF(35.2)!, USE(36.0/1, hint=R4)!
R9 (d_21) [%xmm0]: [21.0-22.1), DEF(21.0, hint=R8)!, USE(22.1/1)!
R10 (d_32) [%xmm1]: [32.0-35.0), DEF(32.0, hint=R4)!, USE(35.0/1, hint=R12)!, USE(35.0/2)
R11 (d_33) [%xmm0]: [33.0-34.0), DEF(33.0, hint=R7)!, USE(34.0/1, hint=R5)!
R12 (d_35) [%xmm1]: [35.0-36.0), DEF(35.0, hint=R10)!, USE(36.0/1, hint=R4)!
[%eax] : [25.0-25.1), [30.0-30.1)
}
test:

View File

@ -64,10 +64,10 @@ TMP
[%xmm0]: [13.2-13.3)
R1 (d_4) [%xmm1]: [3.0-10.1), DEF(4.2), USE(9.1/2), USE(10.1/2)
R2 (d_5, d_9) [SPILL=0x0]
[%xmm0]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, DEF(9.2)!, USE(10.0/1, hint=%xmm0, hint=R3)!
[%xmm0]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, USE(10.0/1, hint=%xmm0, hint=R3)!
: [10.0-14.0), PHI_USE(13.2, phi=d_5/3)
R3 (d_10) [SPILL=0x8]
[%xmm0]: [10.0-11.0), DEF(10.0, hint=R2)!, DEF(10.2)!, USE(11.0/4, hint=%xmm0)
[%xmm0]: [10.0-11.0), DEF(10.0, hint=R2)!, USE(11.0/4, hint=%xmm0)
: [11.0-14.0), PHI_USE(13.2, phi=d_4/3)
[%rax] : [15.0-15.1)
[%rdi] : [11.0-11.1)

View File

@ -65,10 +65,10 @@ TMP
[%xmm0]: [15.2-15.3)
R1 (d_4) [%xmm1]: [3.0-10.1), DEF(4.2), USE(9.1/2), USE(10.1/2)
R2 (d_5, d_9) [SPILL=0x0]
[%xmm0]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, DEF(9.2)!, USE(10.0/1, hint=%xmm0, hint=R3)!
[%xmm0]: [3.0-10.0), DEF(5.2), USE(6.1/1)!, USE(9.0/1)!, DEF(9.0)!, USE(10.0/1, hint=%xmm0, hint=R3)!
: [10.0-16.0), PHI_USE(15.2, phi=d_5/3)
R3 (d_10) [SPILL=0x8]
[%xmm0]: [10.0-11.0), DEF(10.0, hint=R2)!, DEF(10.2)!, USE(11.0/4, hint=%xmm0)
[%xmm0]: [10.0-11.0), DEF(10.0, hint=R2)!, USE(11.0/4, hint=%xmm0)
: [11.0-16.0), USE(13.0/4, hint=%xmm0), PHI_USE(15.2, phi=d_4/3)
[%rax] : [17.0-17.1)
[%rdi] : [11.0-11.1), [13.0-13.1)

View File

@ -112,28 +112,28 @@ R1 (d_2) [SPILL=0x0]
: [36.0-38.0), USE(36.1/2)
R2 (d_3) [%xmm1]: [3.3-5.0), DEF(3.3, hint=%xmm1), USE(5.0/1, hint=R3)!
R3 (d_5) [SPILL=0x8]
[%xmm1]: [5.0-10.2), DEF(5.0, hint=R2)!, DEF(5.2)!
[%xmm1]: [5.0-10.2), DEF(5.0, hint=R2)!
: [10.2-24.0), [26.0-29.0), [31.0-34.0)
: [34.0-38.0), USE(34.1/2)
R4 (d_12, d_36) [%xmm1]: [11.0-24.0), [26.0-29.0), [31.0-32.0), [36.0-38.0), DEF(12.2), USE(20.0/1, hint=R8)!, USE(20.0/2), USE(32.0/1)!, DEF(36.0, hint=R12)!, DEF(36.2)!, PHI_USE(37.2, phi=d_12/3)
R4 (d_12, d_36) [%xmm1]: [11.0-24.0), [26.0-29.0), [31.0-32.0), [36.0-38.0), DEF(12.2), USE(20.0/1, hint=R8)!, USE(20.0/2), USE(32.0/1)!, DEF(36.0, hint=R12)!, PHI_USE(37.2, phi=d_12/3)
R5 (d_13, d_34) [SPILL=0x10]
[%xmm0]: [11.0-18.0), DEF(13.2), USE(18.0/1, hint=R7)!, USE(18.0/2)
: [18.0-24.0), [26.0-29.0), [31.0-32.0)
[%xmm0]: [32.0-32.1), [34.0-38.0), USE(32.1/2, hint=R10), DEF(34.0, hint=R11)!, DEF(34.2)!, PHI_USE(37.2, phi=d_13/3)
[%xmm0]: [32.0-32.1), [34.0-38.0), USE(32.1/2, hint=R10), DEF(34.0, hint=R11)!, PHI_USE(37.2, phi=d_13/3)
R6 (d_14, d_15) [%eax]: [11.0-15.1), [15.2-25.0), [26.0-29.0), [31.0-38.0), DEF(14.2), USE(15.1/1)!, DEF(15.2)!, USE(25.0/2, hint=%eax), USE(27.1/1), PHI_USE(37.2, phi=d_14/3)
R7 (d_18) [SPILL=0x18]
[%xmm0]: [18.0-20.0), DEF(18.0, hint=R5)!, DEF(18.2)!
[%xmm0]: [18.0-20.0), DEF(18.0, hint=R5)!
: [20.0-21.0)
: [21.0-24.0), [26.0-29.0), [31.0-32.3), USE(21.1/2)
[%xmm0]: [32.3-33.0), USE(33.0/1, hint=R11)!
R8 (d_20) [SPILL=0x20]
[%xmm0]: [20.0-21.0), DEF(20.0, hint=R4)!, DEF(20.2)!, USE(21.0/1, hint=R9)!
[%xmm0]: [20.0-21.0), DEF(20.0, hint=R4)!, USE(21.0/1, hint=R9)!
: [21.0-24.0), [26.0-29.0), [31.0-33.0)
: [33.0-33.1), USE(33.1/2)
R9 (d_21) [%xmm0]: [21.0-22.1), DEF(21.0, hint=R8)!, DEF(21.2)!, USE(22.1/1)!
R10 (d_32) [%xmm1]: [32.0-35.0), DEF(32.0, hint=R4)!, DEF(32.2)!, USE(35.0/1, hint=R12)!, USE(35.0/2)
R11 (d_33) [%xmm0]: [33.0-34.0), DEF(33.0, hint=R7)!, DEF(33.2)!, USE(34.0/1, hint=R5)!
R12 (d_35) [%xmm1]: [35.0-36.0), DEF(35.0, hint=R10)!, DEF(35.2)!, USE(36.0/1, hint=R4)!
R9 (d_21) [%xmm0]: [21.0-22.1), DEF(21.0, hint=R8)!, USE(22.1/1)!
R10 (d_32) [%xmm1]: [32.0-35.0), DEF(32.0, hint=R4)!, USE(35.0/1, hint=R12)!, USE(35.0/2)
R11 (d_33) [%xmm0]: [33.0-34.0), DEF(33.0, hint=R7)!, USE(34.0/1, hint=R5)!
R12 (d_35) [%xmm1]: [35.0-36.0), DEF(35.0, hint=R10)!, USE(36.0/1, hint=R4)!
[%rax] : [25.0-25.1), [30.0-30.1)
[%xmm0] : [1.0-2.3)
[%xmm1] : [1.0-3.3)