pythonic
pythonic

Reputation: 21615

Does LLVM IR contains code for the built-in functions

For built-in functions such as many math functions and llvm.memset and llvm.memcpy for example, Does LLVM IR contains the definition somewhere? Or they are just called and not defined in LLVM IR?

Upvotes: 3

Views: 948

Answers (1)

James
James

Reputation: 1371

Those functions are defined in libc which is typically provided by your OS. Calls can be generated by LLVM (such as memcpy when doing a structure assignment).

Some math functions (abs) are defined. There is also a bunch of glue math (float-int conversion) which is called by llvm but defined in libcompiler_rt (which is a replacement for libgcc).

Other built-ins are defined in llvm such as __builtin_clz().

Upvotes: 4

Related Questions