From: "Peryt, Sebastian" <sebastian.peryt@intel.com>
To: Peter Bergner <bergner@linux.ibm.com>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
"Peryt, Sebastian" <sebastian.peryt@intel.com>
Subject: RE: Question regarding preventing optimizing out of register in expansion
Date: Tue, 26 Jun 2018 19:46:00 -0000 [thread overview]
Message-ID: <17623B198193D741876BD81A6E3AE5AD3C7BE705@irsmsx111.ger.corp.intel.com> (raw)
In-Reply-To: <d5d10371-b0c2-1f2f-c1c1-e9a3aa5c8487@linux.ibm.com>
> 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
>
next prev parent reply other threads:[~2018-06-26 19:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-21 11:42 Peryt, Sebastian
2018-06-21 13:12 ` Nathan Sidwell
2018-06-21 14:06 ` Peryt, Sebastian
2018-06-26 9:26 ` Peryt, Sebastian
2018-06-26 19:20 ` Peter Bergner
2018-06-26 19:46 ` Peryt, Sebastian [this message]
2018-06-27 10:26 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17623B198193D741876BD81A6E3AE5AD3C7BE705@irsmsx111.ger.corp.intel.com \
--to=sebastian.peryt@intel.com \
--cc=bergner@linux.ibm.com \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).