[LLVMdev] Q about instruction pattern matching

Andreas Fredriksson deplinenoise at gmail.com
Mon Oct 1 00:09:20 PDT 2007


On 10/1/07, Evan Cheng <evan.cheng at apple.com> wrote:

> > If I lower the calling convention stuff manually rather than relying
> > on the generated CC analyzer, how do I determine that a formal
> > argument I'm about to receive or pack together is supposed to be used
> > as a pointer so I can stick it in an address register?
>
> I'd suggest custom lowering for now. Again use data registers during
> lowering and fix them during the isel post pass if the parameters are
> used as pointers. Do you think that would work?

I guess in a regparm ABI like the one I'm targeting, LLVM will produce
"live ins" for the registers that are used in the ABI in the entry
basic block of all functions? I've seen "Live ins: D0" appear for an
int (int)-type signature, so that seems right.

I'd like to arrange for e.g. a void foo(char*p) signature so see a
"live in A0", but can I custom lower to that immediately given that
I'm going to do a tapdance with the instruction selections later on?
If not, how do I distinguish these arguments from the data argument
later on?

Thanks,
Andreas



More information about the llvm-dev mailing list