This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/37364] [4.4 Regression] IRA generates inefficient code
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Sep 2008 19:45:20 -0000
- Subject: [Bug middle-end/37364] [4.4 Regression] IRA generates inefficient code
- References: <bug-37364-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from hjl dot tools at gmail dot com 2008-09-04 19:45 -------
(In reply to comment #6)
> First of all, I've check the generated code on Core2 and I found it is not
> slower than using movd.
I think MMX may be slow anyway.
> The reason for this is in insn
>
> (insn:HI 14 8 20 2
> /home/cygnus/vmakarov/build/ira-merge-branch/gcc/gcc/testsuite/gcc.target/i386/pr34256.c:12
> (set (reg/i:DI 0 ax)
> (subreg:DI (reg:V2SI 61) 0)) 89 {*movdi_1_rex64} (expr_list:REG_DEAD
> (reg:V2SI 61)
> (nil)))
>
> which has the following description
>
> (define_insn "*movdi_1_rex64"
> [(set (match_operand:DI 0 "nonimmediate_operand"
> "=r,r ,r,m ,!m,*y,*y,?r ,m ,?*Ym,?*y,*x,*x,?r ,m,?*Yi,*x,?*x,?*Ym")
> (match_operand:DI 1 "general_operand"
> "Z ,rem,i,re,n ,C ,*y,*Ym,*y,r ,m ,C ,*x,*Yi,*x,r ,m ,*Ym,*x"))]
> "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
>
> Please, look at the 8th alternatives ?r *Ym which corresponds to GENERAL_REGS
> MMX_REGS. ? makes the alternative expensive. * is even worse because it
> excludes the alternative from register cost calculation.
You are right.
> The old register allocator would behave the same way if regmove did not
> coalesced r61 with another pseudo and the result pseudo had not MMX cost
> cheaper than memory.
>
> There are several ways to fix the problem:
>
> o ignore * and ? in the cost calculation
> o fix the pattern
> o run regmove as the old RA
> o make failure expected
>
> So I'd prefer the last solution.
I agree, given that it only affects MMX. Uros, what do you think?
Should we mark gcc.target/i386/pr34256.c as XFAIL?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37364