In the ARM backend, functions (and other 32 bit constants) are placed in a pool and loaded when needed. A problem with this is that ".weak" directives must be printed in the pool. This is not supported in the standard printer, so I think that I have found the first use for MachineConstantPoolValue :-) Creating the constant is easy, but I have two problems: 1) what are the methods getExistingMachineCPValue and AddSelectionDAGCSEId supposed to do? 2) printing is hard because we are outside the AsmPrinter. In my current hack I am printing from ARMAsmPrinter::EmitMachineConstantPoolValue :-( Since this problem might also be significant to x86 (see my previous email), maybe we should just teach the pool printer to emit ".weak" directives... Best Regards, Rafael P.S.: rest assured that what is attached is just a demo hack and will not be committed :-) -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-pool-hack.patch Type: text/x-patch Size: 4362 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20061206/b87d2062/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: ARMAsmPrinter.h Type: text/x-chdr Size: 547 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20061206/b87d2062/attachment.h>
On Wed, 6 Dec 2006, [UTF-8] Rafael Esp?ndola wrote:> In the ARM backend, functions (and other 32 bit constants) are placed > in a pool and loaded when needed.Has this approach been replaced with your later constant pool patch? -Chris> A problem with this is that ".weak" directives must be printed in the > pool. This is not supported in the standard printer, so I think that I > have found the first use for MachineConstantPoolValue :-) > > Creating the constant is easy, but I have two problems: > > 1) what are the methods getExistingMachineCPValue and > AddSelectionDAGCSEId supposed to do? > > 2) printing is hard because we are outside the AsmPrinter. > > In my current hack I am printing from > ARMAsmPrinter::EmitMachineConstantPoolValue :-( > > Since this problem might also be significant to x86 (see my previous > email), maybe we should just teach the pool printer to emit ".weak" > directives... > > Best Regards, > Rafael > > P.S.: rest assured that what is attached is just a demo hack and will > not be committed :-) > >-Chris -- http://nondot.org/sabre/ http://llvm.org/
On 12/8/06, Chris Lattner <sabre at nondot.org> wrote:> On Wed, 6 Dec 2006, [UTF-8] Rafael Esp?ndola wrote: > > In the ARM backend, functions (and other 32 bit constants) are placed > > in a pool and loaded when needed. > > Has this approach been replaced with your later constant pool patch?Yes. The constant pool patch solves the problem in a much simpler way. Best Regards, Rafael
Seemingly Similar Threads
- [LLVMdev] MachineConstantPoolValue
- [LLVMdev] jump table x constant pool
- [LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
- [LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
- [LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation