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
On Aug 8, 2009, at 1:37 PM, Richard Pennington wrote:> 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).The last possible minute, right before isel, still has arbitrary precision integers. The right place to do something like this is in the code generator, which is where it happens. -Chris> > 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 > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Richard Pennington
2009-Aug-08 22:23 UTC
[LLVMdev] Initial cut at a instruction raising patch
Chris Lattner wrote:> On Aug 8, 2009, at 1:37 PM, Richard Pennington wrote: > >> 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). > > The last possible minute, right before isel, still has arbitrary > precision integers. The right place to do something like this is in > the code generator, which is where it happens. > > -ChrisThanks Chris, my dimly lit bulb has just flickered a little brighter. I understand the problem a little more clearly now. I'll pull my pass (or at least keep it out of the LLVM tree), since it is of limited general utility. At least I got a chance to try writing a pass. Cool stuff. -Rich
Maybe Matching 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