[LLVMdev] giving metadata a function parameter as an operand

Hal Finkel hfinkel at anl.gov
Tue Feb 12 08:11:21 PST 2013


----- Original Message -----
> From: "Anat Shemer" <anat.shemer at intel.com>
> To: llvmdev at cs.uiuc.edu
> Sent: Tuesday, February 12, 2013 6:33:41 AM
> Subject: [LLVMdev]  giving metadata a function parameter as an operand
> 
> 
> 
> Hi,
> 
> Is it possible to give an instruction metadata that accepts function
> argument as operand? The 2 functions are in the same module so the
> metadata operand can be resolved. Here is how I imagine it should
> look like:
> 
> define i32 @f(i32 %v) {
> %v0 = call i32 @f1 (i32 %v, metadata !0) ; this ok
> ret i32 %v0
> }
> 
> define i32 @f1 (i32 %v, metadata %md) { ; and this is ok too
> %t0 = add i32 %v, 1, !md !%md
> ; ^ here it says it expects an integer
> ret i32 %t0
> }
> 
> !0 = metadata !{i32 4}

Can you explain your motivation for wanting this?

 -Hal

> 
> Thanks, Anat
> 
> 
> 
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
> 
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
> _______________________________________________
> 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