This is the mail archive of the gcc@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]

Combine on IA-64


Hi!

With the visibility patch I've noticed IA-64 generates
pretty inefficient code like:
        addl r15 = @gprel(l#), gp
        addl r16 = @gprel(m#), gp
        ;;
        .mii
        // cycle 1
        adds r15 = 10, r15
        adds r16 = 10, r16

instead of:
	addl r15 = @gprel(l#+10), gp
	addl r16 = @gprel(m#+10), gp

I've tried to fix this using peephole2, but that doesn't work too well,
since the two instructions aren't usually adjacent.
Now, as I understand, symbolic_operand accepts
(const (plus:DI (symbol_ref:DI ("@foo")) (const_int )))
just fine, so this looks like combiner inefficiency.
try_combine for:

i2:
(insn 9 18 12 (parallel[
            (set (reg/f:DI 340)
                (symbol_ref:DI ("@l")))
            (clobber (reg:DI 341))
            (use (reg:DI 1 r1))
        ] ) 5 {movdi_symbolic} (nil)
    (expr_list:REG_UNUSED (reg:DI 341)
        (expr_list:REG_EQUAL (symbol_ref:DI ("@l"))
            (nil))))

i3:
(insn 12 9 14 (set (reg/f:DI 343)
        (plus:DI (reg/f:DI 340)
            (const_int 10 [0xa]))) 90 {adddi3} (insn_list 9 (nil))
    (expr_list:REG_DEAD (reg/f:DI 340)
        (expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("@l"))
                    (const_int 10 [0xa])))
            (nil))))

only attempts to recognize:

(set (reg/f:DI 343)
     (const (plus:DI (symbol_ref:DI ("@l"))
		     (const_int 10 [0xa]))))

and not

(parallel[
	(set (reg/f:DI 343)
	     (const (plus:DI (symbol_ref:DI ("@l"))
			     (const_int 10 [0xa]))))
	(clobber (reg:DI 341))
	(use (reg:DI 1 r1))
	] )

Cannot this be special cased in try_combine (there is already some other
similar special case which fails because i3's SET_SRC is not
register but PLUS) provided the clobbers aren't mentioned between i2 and i3
and uses are not modified in between?

	Jakub


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