On Tue, Nov 07, 2017 at 09:40:31AM +0100, Uros Bizjak wrote: > > - a1 (r93,l0) best MASK_EVEX_REGS, allocno MASK_EVEX_REGS > > + a1 (r93,l0) best GENERAL_REGS, allocno GENERAL_REGS > > > > - a1(r93,l0) costs: AREG:2000,2000 DREG:2000,2000 CREG:2000,2000 > > BREG:2000,2000 SIREG:2000,2000 DIREG:2000,2000 AD_REGS:2000,2000 > > CLOBBERED_REGS:2000,2000 Q_REGS:2000,2000 NON_Q_REGS:2000,2000 > > TLS_GOTBASE_REGS:2000,2000 GENERAL_REGS:2000,2000 MASK_EVEX_REGS:0,0 > > MASK_REGS:2000,2000 ALL_REGS:420000,420000 MEM:10000,10000 > > + a1(r93,l0) costs: AREG:2000,2000 DREG:2000,2000 CREG:2000,2000 > > BREG:2000,2000 SIREG:2000,2000 DIREG:2000,2000 AD_REGS:2000,2000 > > CLOBBERED_REGS:2000,2000 Q_REGS:2000,2000 NON_Q_REGS:2000,2000 > > TLS_GOTBASE_REGS:2000,2000 GENERAL_REGS:2000,2000 MASK_EVEX_REGS:2000,2000 > > MASK_REGS:4000,4000 ALL_REGS:420000,420000 MEM:10000,10000 > > > > - r93: preferred MASK_EVEX_REGS, alternative GENERAL_REGS, allocno > > ALL_REGS > > + r93: preferred GENERAL_REGS, alternative NO_REGS, allocno GENERAL_REGS > > > > - a1(r93,l0) costs: AREG:4000,4000 DREG:4000,4000 CREG:4000,4000 > > BREG:4000,4000 SIREG:4000,4000 DIREG:4000,4000 AD_REGS:4000,4000 > > CLOBBERED_REGS:4000,4000 Q_REGS:4000,4000 NON_Q_REGS:4000,4000 > > TLS_GOTBASE_REGS:4000,4000 GENERAL_REGS:4000,4000 MASK_EVEX_REGS:0,0 > > MASK_REGS:2000,2000 ALL_REGS:420000,420000 MEM:10000,10000 > > - a2(r97,l0) costs: SSE_FIRST_REG:6000,6000 NO_REX_SSE_REGS:6000,6000 > > SSE_REGS:6000,6000 EVEX_SSE_REGS:6000,6000 ALL_SSE_REGS:6000,6000 > > MEM:25000,25000 > > - a3(r98,l0) costs: SSE_FIRST_REG:0,0 NO_REX_SSE_REGS:0,0 SSE_REGS:0,0 > > EVEX_SSE_REGS:0,0 ALL_SSE_REGS:0,0 MEM:19000,19000 > > + a1(r93,l0) costs: GENERAL_REGS:4000,4000 MASK_EVEX_REGS:4000,4000 > > MASK_REGS:6000,6000 ALL_REGS:422000,422000 MEM:12000,12000 > > + a2(r97,l0) costs: SSE_FIRST_REG:8000,8000 NO_REX_SSE_REGS:8000,8000 > > SSE_REGS:8000,8000 EVEX_SSE_REGS:8000,8000 ALL_SSE_REGS:8000,8000 > > MEM:27000,27000 > > + a3(r98,l0) costs: SSE_FIRST_REG:2000,2000 NO_REX_SSE_REGS:2000,2000 > > SSE_REGS:2000,2000 EVEX_SSE_REGS:2000,2000 ALL_SSE_REGS:2000,2000 > > MEM:21000,21000 > > > > Isn't it sufficient that moves disparage slightly the k alternatives? > > Or are you worried about the case where the pseudo would need to be spilled > > and LRA would choose to reload it into a %kN register? > > The later... Perhaps it is possible to prevent unwanted reloads with > ?k (or even ??k, we already have ?m<r>, IDK). I have used *k in > zero-extend patterns to prevent unwanted reloads, which is perhaps too > strong, but we have ree pass that eliminates unwanted moves in this > case (*k in move patterns is handled by other regmove elimination > passes).
?k gives the same IRA decisions as *k, in both cases it considers GENERAL_REGS as expensive as MASK_EVEX_REGS and picks up GENERAL_REGS rather than MASK_EVEX_REGS for the pseudo, which results in kmovb %k1, %eax; test. Jakub