2010/10/29 Ian Lance Taylor <i...@google.com>: > roy rosen <roy.1ro...@gmail.com> writes: > >> I am trying to use define_split, but it seems to me that I don't >> understand how it is used. >> It says in the gccint.pdf (which I use as my tutorial (is there >> anything better or more up to date?)) > > Assuming you built gccint.pdf from the gcc sources that you are using > for development, then, no, there is nothing better. > >> that the combiner only uses the >> define_split if it doesn't find any define_insn to match. This is not >> clear to me: If there is no define_insn to match a pattern in the >> combine stage, then how is this pattern there in the first place? The >> only way I can think for it to happen is that such a pattern was >> created by the combiner itself (but it seems unreasonable to me that >> we now want to split what the combiner just combined). Can someone >> please explain this to me? > > The combiner works by combining existing insns into new patterns, and > then attempting to recognize the new patterns (that is why it is called > the combiner--becuse it combines patterns). The combiner combines insns > by, essentially, looking for cases like > (set (reg N) (AAA)) > (... (reg N) ...) > and turning them into > (... (AAA) ...) > Actually it's a lot more complicated but that's the basic idea. > > So the combiner uses splits by constructing large complex patterns and > then seeing if it can split them. If you know that certain code > sequences are likely to fit together in some complex way, then you can > write a define_split to split that complex pattern into a pair of > insns. > > That said, this is not a very interesting use of splits these days and > it could probably be removed without doing any noticeable harm. These > days most people just write the complex pattern using define_insn, and > then write a define_split (or a define_insn_and_split) which splits up > the insn just before register allocation or just before instruction > scheduling. > Now I am confused, How are they split before register allocation or scheduling. We've said that in any case only the combiner does the splitting. And another thing: gccint says that the define_split is used only if there is no define_insn that matches - but you say now that 'people just write the complex pattern using define_insn, and then write a define_split (or a define_insn_and_split) which splits up the insn' so I don't understand: if they write a define_insn then the pattern matches and the split would not be used. I am confused...
Also, how do I build gccint from the current sources. Currently I just use something I found in the internet. Thanks, Roy. > Ian >