> Subject: Re: Question regarding preventing optimizing out of register in > expansion > > On 6/26/18 4:05 AM, Peryt, Sebastian wrote: > > With some changes simplified implementation of my expansion is as follows: > > tmp_op0 = gen_reg_rtx (mode); > > emit_move_insn (tmp_op0, op0); > > You set tmp_op0 here, and then.... > > > > emit_insn (gen_rtx_SET (tmp_op0, reg)); > > You set it again here without ever using it above, so it's dead code, which > explains why it's removed.
Oh.... My bad - I oversimplified my code. Now I can see it. This should be more appropriate: tmp_op0 = gen_reg_rtx (mode); emit_move_insn (tmp_op0, op0); tmp_op1 = gen_reg_rtx (mode); emit_move_insn (tmp_op1, op1); // This is important part reg = gen_rtx_REG(wide_mode, XMM2_REG); op3 = gen_rtx_PLUS (mode, tmp_op1, GEN_INT (128)); emit_insn (gen_rtx_SET (reg, op3)); emit_insn (gen_myinsn(op2, reg)); op3 = gen_rtx_PLUS (mode, tmp_op0, GEN_INT (128)); emit_insn (gen_rtx_SET (op3, reg)); //// Also I'd like to one more time point out that without additional -mavx or -mavx2 I'm getting expected register moves before and after my instr. With those options only *after*. This is the part that I don't get especially - why. > > Peter >