[LLVMdev] Alternative to Adding New Intrinsics for Code-Generation?

Dan Bailey drb at dneg.com
Thu Mar 10 10:43:41 PST 2011


Hi,

I've written an IR->IR translation as part of a high-level language I've 
designed. It replaces my own specific functions in LLVM passes with 
custom logic.

As part of the process, it needs to perform constant propagation and 
inlining prior to doing any translation. Initially I just used simple 
function declarations to define these specific functions, but the 
verification pass requires that each function declaration also has a 
definition. Without wanting to create dummy function definitions, I 
found I had to introduce new intrinsics, which does what I want but is 
obviously not desired.

How can I do this without using intrinsics? I looked for function 
attributes to see if I can flag a function as not requiring a 
definition, but there doesn't seem to be any. It would be useful to 
ignore a function as if it was an intrinsic during this prior stage of 
passes. Any suggestions would be welcome?

Thanks,
Dan



More information about the llvm-dev mailing list