2008/3/1 Andrew Hutchinson <[EMAIL PROTECTED]>: > I'm am still struggling with a good solution that avoids unneeded saves > of parameter registers. > > To solve problem all I need to know are the registers actually used for > parameters. Since the caller assumes all of these are clobbered by > callee - they should never need to be saved.
I'm totally confused what is the problem here. I thought you were seeing extra callee-save register save/restore in prologue, but now it sounds like you're seeing extra caller-save register save/restore. Which one are you trying to solve, and what kind of target is this ? > DF_REG_DEF_COUNT is showing 1 artificial def for all POTENTIAL parameter > registers - not just the ones that are really used (since it uses target > FUNCTION_ARG_REGNO_P to get parameter registers) You said you wanted to know if there's a def of a register within a function. For an incoming parameter, there will be one artificial def, and if there's no other def, it means there's no real def of the register within the function. > So the DF artificial defs are useless in trying to find real parameter > registers. I don't understand what you mean by this. What do you mean by "real parameter register" ? > That seem to require going over all DF chains to work out which > registers are externally defined. DF does not solve problem for me. What do you mean by "externally defined" ? DF may not solve the problem for you, but now I'm completely lost on what your problem is. > There has got to be an easier way of finding parameter registers used by > function. If you want to find all the uses (use as in reading a register but not writing to it), you should look at USE chain, not DEF chain, naturally. Seongbae