Solved... kind of.
*ldsi is one of the patterns movsi is expanded to and as the name
suggests it only handles register loads. I know that at some
stages memory references will pass the register_operand predicate
so I changed the predicate for operand 0 and added an alternative
to *ldsi that could store to memory and the problem went away.
What is interesting is that when LRA is disabled this case was
handled fine by the old reload pass, suggesting that the new LRA
pass handles this situation differently - or not at all ?
BTW. Can someone tell me whether I should be top or bottom posting ?
Cheers, Paul.
On 16/04/14 16:38, pshor...@dataworx.com.au wrote:
I've got a small test case there the ira pass produces this ...
(insn 35 38 36 5 (set (reg/v:SI 29 [orig:17 _b ] [17])
(reg/v:SI 17 [ _b ])) 48 {*ldsi}
(expr_list:REG_DEAD (reg/v:SI 17 [ _b ])
(nil)))
and the LRA processes it as follows ...
Spilling non-eliminable hard regs: 6
0 Non input pseudo reload: reject++
alt=0,overall=607,losers=1,rld_nregs=2
0 Non input pseudo reload: reject++
1 Spill pseudo into memory: reject+=3
alt=1,overall=616,losers=2,rld_nregs=2
0 Non input pseudo reload: reject++
alt=2: Bad operand -- refuse
Choosing alt 0 in insn 35: (0) =r (1) r {*ldsi}
Creating newreg=34 from oldreg=29, assigning class
GENERAL_REGS to r34
35: r34:SI=r17:SI
REG_DEAD r17:SI
Inserting insn reload after:
45: r29:SI=r34:SI
0 Non input pseudo reload: reject++
1 Non pseudo reload: reject++
alt=0,overall=608,losers=1,rld_nregs=2
0 Non input pseudo reload: reject++
alt=1,overall=613,losers=2,rld_nregs=2
0 Non input pseudo reload: reject++
alt=2: Bad operand -- refuse
Choosing alt 0 in insn 45: (0) =r (1) r {*ldsi}
Creating newreg=35 from oldreg=29, assigning class
GENERAL_REGS to r35
45: r35:SI=r34:SI
Inserting insn reload after:
46: r29:SI=r35:SI
so, it is stuck in a loop (continues on for 90 attempts then
aborts) but I can't see what is causing it. The pattern (below)
shouldn't require a reload so I can't see why it would be doing
this
(define_insn "*ldsi"
[(set (match_operand:SI 0 "register_operand" "=r,r,r")
(match_operand:SI 1 "general_operand" "r,m,i"))
]
""
Can anyone shed any light on this behaviour ?
Thanks, Paul.