This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Rest of Intel Atom optimization


H.J. Lu wrote:
On Mon, Apr 6, 2009 at 11:14 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
Can extract_insn_cached help here?
You can look at ix86_attr_length_address_default, there is
get_attr_type, used to detect TYPE_LEA.


Here is the rest of Intel Atom optimization. OK for trunk?

+static int
+distance_non_agu_define (rtx op1, rtx op2, rtx insn)
+{
+  unsigned int regno1 = REGNO (op1);
+  unsigned int regno2 = REG_P (op2) ? REGNO (op2) : (unsigned int) -1;

Hm, not true_regnum in the lines above?


(BTW: You can use INVALID_REGNUM for invalid regnumbers).

+  basic_block bb = BLOCK_FOR_INSN (insn);
+  int distance = 0;
+  df_ref *def_rec;

...


+		  {
+		    insn_type = get_attr_type (prev);
+		    if (insn_type != TYPE_LEA)
+		      goto done;
+		  }

...


+done:
+  /* Restore recog_data which may be modified by get_attr_type.  */
+  extract_insn_cached (insn);
+  return distance;


This can't be right. You are restoring recog data on a different insn that was processed by get_attr_type. I think that extract_insn_cached should immediately follow get_attr_type in order to restore recog data.

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]