Richard Pennington
2009-Aug-08 18:48 UTC
[LLVMdev] Initial cut at a instruction raising patch
Chris Lattner wrote:> On Aug 8, 2009, at 8:37 AM, Richard Pennington wrote: > >> Hi, >> >> This patch raises selected instructions to function calls. I've dome >> some preliminary testing and I works: > > Out of curiosity, why do you want this? >I do bitcode linking of a whole program, including the soft-float and other support routines that a processor needs. During IPO, the unused support functions are removed and are gone by the time code generation happens. I'd like to run this pass to insure that the functions are referenced properly. Ideally I'd like to run this pass after inlining and folding, etc. But it seems to work OK if I run it about the same time internalize is run. -Rich
On Aug 8, 2009, at 11:48 AM, Richard Pennington wrote:> Chris Lattner wrote: >> On Aug 8, 2009, at 8:37 AM, Richard Pennington wrote: >> >>> Hi, >>> >>> This patch raises selected instructions to function calls. I've dome >>> some preliminary testing and I works: >> >> Out of curiosity, why do you want this? >> > > I do bitcode linking of a whole program, including the soft-float and > other support routines that a processor needs. During IPO, the unused > support functions are removed and are gone by the time code generation > happens. > > I'd like to run this pass to insure that the functions are referenced > properly. > > Ideally I'd like to run this pass after inlining and folding, etc. But > it seems to work OK if I run it about the same time internalize is > run.How do you plan to handle things like arbitrary precision integers, etc? It seems like you'll end up duplicating a ton of codegen logic to handle this. -Chris
Richard Pennington
2009-Aug-08 20:37 UTC
[LLVMdev] Initial cut at a instruction raising patch
Chris Lattner wrote:> How do you plan to handle things like arbitrary precision integers, > etc? It seems like you'll end up duplicating a ton of codegen logic > to handle this.Maybe I'm not being very clear. I want this replacement to be done at the very last minute (before unreferenced functions are removed, of course). I only want to catch libgcc-ish functions. For example on the x86 (32) a function containing prinf() only needs __divdi3 and __moddi3. I'd like the code generator to do its magic until there is no more magic to do, and then replace any 64 bit divides with the function call, for example. Make sense? -Rich
Possibly Parallel Threads
- [LLVMdev] Initial cut at a instruction raising patch
- [LLVMdev] Initial cut at a instruction raising patch
- [LLVMdev] Initial cut at a instruction raising patch
- [LLVMdev] Initial cut at a instruction raising patch
- [LLVMdev] Initial cut at a instruction raising patch