[LLVMdev] Metadata for Argument, BasicBlock
Ralf Karrenberg
Chareos at gmx.de
Tue May 15 09:29:31 PDT 2012
So, is there any chance that metadata for basic blocks is considered a
useful feature?
There is a patch ready and on the commits-list, it compiles, passes all
tests, has a test case of its own, and (as far as I can tell) does not
interfere with anything.
Cheers,
Ralf
On 5/7/12 4:21 PM, Ralf Karrenberg wrote:
> Hi Duncan,
>
> On 5/6/12 6:12 PM, Duncan Sands wrote:
>> Hi Ralf,
>>
>>> Is there a clean way to attach metadata nodes to Arguments and/or
>>> BasicBlocks?
>>
>> not at the moment. Feel free to work on adding this functionality!
>
> I am looking into that now.
> I decided to temporarily go for the following syntax for BasicBlock
> metadata (subject to discussion):
>
> entry:
> !property_1 !0, !property_2 !1
> %x = fadd float %a, %b
>
> It seems that I have to touch lots of files for this:
> BasicBlock.h/.cpp, Metadata.cpp, LLParser.cpp, AsmParser, AsmWriter,
> BitcodeReader.cpp, BitcodeWriter.cpp so far.
> I basically went and duplicated code that handles metadata attached to
> instructions.
>
> Concerning Argument metadata, I am unsure of how to best represent this
> in LLVM IR. The following seems to be better than putting the metadata
> somewhere before the first block or anywhere else, but the space in the
> parameter list looks a bit crowded...
>
> declare void test(i32 %param1 !property1 !0, !property2 !1,
> float* %param2 readonly !property2 !1)
>
> Cheers,
> Ralf
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
More information about the llvm-dev
mailing list