[LLVMdev] embedded metadata

Nick Lewycky nicholas at mxc.ca
Sun Nov 22 13:58:34 PST 2009


I have a quick question about embedded metadata. I've lost track of 
exactly what we want to support.

What about making MDNodes that refer to Instructions? Is that desired 
any more, or is that obsolete? I had a patch to do this locally and I 
either want to fix it up and commit it or discard it.

The relevant section of my locally modified 
test/Feature/embeddedmetadata.ll reads:

define void @foo() {
   ;; Intrinsic using MDNode and MDString
   %x = call i8 @llvm.something(metadata !21, i32 42, metadata !"bar")
   %y = call i8 @llvm.something(
       metadata !{i8 %x, i8 %y, i32 %z, metadata* @llvm.foo, null,
       i32* null, metadata undef, metadata !{i8 %y, metadata !"foo"}, 
metadata !"foo"})
   %z = add i32 1, 1
   ret void
}

where %y is a new instruction demonstrating the MDNode's ability to 
refer to other instructions.

Nick



More information about the llvm-dev mailing list