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] Fix ppc LTU/GTU sCC splitters (PR target/20196)


On Thu, Feb 24, 2005 at 12:56:59PM -0500, David Edelsohn wrote:
> 	I removed the early clobbers because the split instructions allow
> GCC to see the dependencies of the individual instructions and I assumed
> that it would allocate the registers appropriately to avoid overlap.  Is
> GCC performing the register allocation on the original pattern and not the
> split instructions?

If the split happens before reload, as has been happening on this testcase,
then register allocation happens on the split instructions.
But because the pattern before splitting was:
(insn:HI 118 117 82 8 (set (reg/v:SI 121 [ i ])
        (plus:SI (ltu:SI (reg/v:SI 123 [ g ])
                (reg:SI 125 [ f.3 ]))
            (reg/v:SI 121 [ i ]))) 420 {*rs6000.md:12672} (nil)
    (nil))
(which is not wrong, as if it was not split, the (missing) earlyclobber
would ensure that the out reg is reloaded into a different reg and then
copied to the right one afterwards), the splitter just follows the
instructions in the splitter and this results into:
(insn 131 117 132 8 (set (reg/v:SI 121 [ i ])
        (neg:SI (ltu:SI (reg/v:SI 123 [ g ])
                (reg:SI 125 [ f.3 ])))) 424 {*rs6000.md:12765} (nil)
    (nil))

(insn 132 131 82 8 (set (reg/v:SI 121 [ i ])
        (minus:SI (reg/v:SI 121 [ i ])
            (reg/v:SI 121 [ i ]))) 55 {*rs6000.md:1174} (insn_list:REG_DEP_TRUE 131 (nil))
    (nil))
which is wrong (insn 132 is a fancy (set (reg/v:SI 121) (const_int 0))).
Splitting doesn't involve any dependency analysis on the new instructions,
GCC simply creates the new instructions using the given operands and recog's
them.

	Jakub


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