[LLVMdev] reg_iterator Caveats
David Greene
dag at cray.com
Tue Apr 1 08:47:38 PDT 2008
On Monday 31 March 2008 18:55, Chris Lattner wrote:
> On Mon, 31 Mar 2008, Evan Cheng wrote:
> >> I just discovered that def_itterator (and presumably, reg_iterator)
> >> doesn't
> >> include implicit defs, for example at function calls for caller-save
> >> physical
> >> registers. Guh. I'm not sure if it should or not, but it's certainly
> >> necessary information in some cases. Is this expected behavior, or an
> >> oversight?
>
> reg iterators will return everything that is in the function. If the
> implicit operands haven't been added to the machieninstrs yet, then they
> won't be returned.
Hmm...this is definitely NOT true in my copy. During register allocation
these implicit defs are not returned. By then the instructions are most
definitely fully constructed. :)
We have a very old copy of llvm. Is it possible they got added sometime
after reg_iterators were created?
Also, just as a point of information, where would I go to find out if a
physical register is a caller-save or callee-save register? The closest
thing I can find is in the .td files but no interface is generated (as far
as I can tell) to categorize physical registers according to calling
convention.
-Dave
More information about the llvm-dev
mailing list