[LLVMdev] MachineConstantPoolValue

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Dec 6 13:49:31 PST 2006


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>


More information about the llvm-dev mailing list