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]

Re: schedule_block


Jeffrey A Law writes:
 > There is no way to do it, nor should there be a need.
 > 
 > If the copy out of the arg register is on the critical path, then it should
 > issue as early as possible because the copy will have a high priority.


Here's a typical example that I've been having problems with.

The meat of this function is insn 34 which requires pseudo 41 to be
allocated to either hard register r2 or r3.

The scheduler ends up moving insn 15, which zeroes pseudo 41, to be the
first insn in the function.  Since r2 and r3 are used for function
arguments, there is no way that the register allocator can then
allocate either r2 or r3 to pseudo 41.

Michael.

;; Function fdot1

Starting forward pass...
Starting backward pass...
Starting backward pass...
Starting backward pass...
(note 2 0 4 "" NOTE_INSN_DELETED)

;; Start of basic block 0, registers live: 2 [r2] 3 [r3] 10 [ar2] 11 [ar3] 20 [sp]
(insn 4 2 6 (set (reg/v:QI 37)
        (reg:QI 10 ar2)) 5 {movqi_noclobber} (nil)
    (expr_list:REG_DEAD (reg:QI 10 ar2)
        (nil)))

(insn 6 4 8 (set (reg/v:QI 38)
        (reg:QI 2 r2)) 5 {movqi_noclobber} (nil)
    (expr_list:REG_DEAD (reg:QI 2 r2)
        (nil)))

(note 8 6 9 "" NOTE_INSN_DELETED)

(note 9 8 10 "" NOTE_INSN_FUNCTION_BEG)

(note 10 9 12 "" NOTE_INSN_DELETED)

(note 12 10 15 0 NOTE_INSN_BLOCK_BEG)

(insn 15 12 18 (set (reg/v:QF 41)
        (const_double:QF (cc0) 0 -2147483648)) 108 {*movqf_noclobber} (nil)
    (expr_list:REG_EQUAL (const_double:QF (cc0) 0 -2147483648)
        (nil)))

(note 18 15 58 "" NOTE_INSN_DELETED)

(insn 58 18 59 (parallel[ 
            (set (reg:CC 21 st)
                (compare:CC (reg:QI 3 r3)
                    (const_int 0)))
            (set (reg/v:QI 39)
                (reg:QI 3 r3))
        ] ) 7 {*movqi_set} (nil)
    (expr_list:REG_DEAD (reg:QI 3 r3)
        (nil)))

(jump_insn 59 58 70 (set (pc)
        (if_then_else (le (reg:CC 21 st)
                (const_int 0))
            (label_ref 46)
            (pc))) 198 {*b} (insn_list 58 (insn_list 58 (nil)))
    (expr_list:REG_DEAD (reg:CC 21 st)
        (nil)))
;; End of basic block 0

;; Start of basic block 1, registers live: 11 [ar3] 20 [sp] 37 38 39 41
(insn 70 59 76 (set (reg:QI 47)
        (reg/v:QI 38)) 5 {movqi_noclobber} (nil)
    (expr_list:REG_DEAD (reg/v:QI 38)
        (nil)))

(insn 76 70 78 (set (reg:QI 48)
        (reg/v:QI 37)) 5 {movqi_noclobber} (nil)
    (expr_list:REG_DEAD (reg/v:QI 37)
        (nil)))

(note 78 76 87 "" NOTE_INSN_DELETED)

(note 87 78 90 "" NOTE_INSN_DELETED)

(note 90 87 93 "" NOTE_INSN_DELETED)

(insn 93 90 98 (parallel[ 
            (set (reg:QI 50)
                (plus:QI (reg/v:QI 39)
                    (const_int -2)))
            (clobber (reg:CC_NOOV 21 st))
        ] ) 33 {*addqi3_clobber} (nil)
    (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
        (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
            (expr_list:REG_DEAD (reg/v:QI 39)
                (nil)))))

(insn 98 93 100 (parallel[ 
            (set (reg:QF 44)
                (mult:QF (mem/s:QF (post_inc:QI (reg:QI 48)) 4)
                    (mem/s:QF (post_inc:QI (reg:QI 47)) 4)))
            (clobber (reg:CC_NOOV 21 st))
        ] ) 147 {*mulqf3_clobber} (insn_list 70 (insn_list 76 (nil)))
    (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
        (expr_list:REG_INC (reg:QI 48)
            (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
                (expr_list:REG_INC (reg:QI 47)
                    (nil))))))

(insn 100 98 101 (set (reg:CC 21 st)
        (compare:CC (reg:QI 50)
            (const_int 0))) 89 {*cmpqi_test} (insn_list 93 (nil))
    (nil))

(jump_insn 101 100 96 (set (pc)
        (if_then_else (lt (reg:CC 21 st)
                (const_int 0))
            (label_ref 102)
            (pc))) 198 {*b} (insn_list 100 (nil))
    (expr_list:REG_DEAD (reg:CC 21 st)
        (nil)))
;; End of basic block 1

;; Start of basic block 2, registers live: 11 [ar3] 20 [sp] 41 44 47 48 50
(insn 96 101 19 (parallel[ 
            (unspec[ 
                    (reg:QI 50)
                ]  22)
            (use (const_int 0))
            (clobber (reg:QI 25 rs))
            (clobber (reg:QI 26 re))
        ] ) 231 {*rptb_init} (insn_list 93 (nil))
    (nil))
;; End of basic block 2

(note 19 96 88 "" NOTE_INSN_LOOP_BEG)

;; Start of basic block 3, registers live: 11 [ar3] 20 [sp] 25 [rs] 26 [re] 41 44 47 48 50
(code_label 88 19 28 8 "")

(note 28 88 73 "" NOTE_INSN_DELETED)

(note 73 28 30 "" NOTE_INSN_DELETED)

(note 30 73 67 "" NOTE_INSN_DELETED)

(note 67 30 32 "" NOTE_INSN_DELETED)

(note 32 67 34 "" NOTE_INSN_DELETED)

(insn 34 32 36 (parallel[ 
            (set (reg:QF 44)
                (mult:QF (mem/s:QF (post_inc:QI (reg:QI 48)) 4)
                    (mem/s:QF (post_inc:QI (reg:QI 47)) 4)))
            (set (reg/v:QF 41)
                (plus:QF (reg/v:QF 41)
                    (reg:QF 44)))
            (clobber (reg:CC 21 st))
        ] ) 178 {*mulqf3_addqf3_clobber} (insn_list 32 (nil))
    (expr_list:REG_UNUSED (reg:CC 21 st)
        (expr_list:REG_INC (reg:QI 48)
            (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
                (expr_list:REG_INC (reg:QI 47)
                    (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
                        (nil)))))))

(note 36 34 81 "" NOTE_INSN_LOOP_CONT)

(note 81 36 62 "" NOTE_INSN_DELETED)

(note 62 81 82 "" NOTE_INSN_LOOP_VTOP)

(note 82 62 97 "" NOTE_INSN_DELETED)

(jump_insn 97 82 45 (parallel[ 
            (set (pc)
                (if_then_else (ge (reg:QI 50)
                        (const_int 0))
                    (label_ref 88)
                    (pc)))
            (set (reg:QI 50)
                (plus:QI (reg:QI 50)
                    (const_int -1)))
            (use (const_int 0))
            (use (reg:QI 25 rs))
            (use (reg:QI 26 re))
            (clobber (reg:CC_NOOV 21 st))
        ] ) 233 {rptb_end} (nil)
    (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
        (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
            (expr_list:REG_NONNEG (nil)
                (nil)))))
;; End of basic block 3

(note 45 97 102 "" NOTE_INSN_LOOP_END)

;; Start of basic block 4, registers live: 11 [ar3] 20 [sp] 41 44
(code_label 102 45 99 9 "")

(insn 99 102 46 (parallel[ 
            (set (reg/v:QF 41)
                (plus:QF (reg/v:QF 41)
                    (reg:QF 44)))
            (clobber (reg:CC_NOOV 21 st))
        ] ) 139 {*addqf3_clobber} (nil)
    (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
        (expr_list:REG_UNUSED (reg:CC_NOOV 21 st)
            (expr_list:REG_DEAD (reg:QF 44)
                (nil)))))
;; End of basic block 4

;; Start of basic block 5, registers live: 11 [ar3] 20 [sp] 41
(code_label 46 99 49 4 "")

(insn 49 46 50 (set (reg/i:QF 0 r0)
        (reg/v:QF 41)) 108 {*movqf_noclobber} (nil)
    (expr_list:REG_DEAD (reg/v:QF 41)
        (nil)))

(insn 50 49 54 (use (reg/i:QF 0 r0)) -1 (insn_list 49 (insn_list 49 (nil)))
    (expr_list:REG_DEAD (reg/i:QF 0 r0)
        (nil)))
;; End of basic block 5

(note 54 50 0 0 NOTE_INSN_BLOCK_END)




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