LLVM features that ought to be surfaced in a higher-level language?

I’ve been out of touch with the LLVM community for a few years, and so I haven’t kept up on all of the changes and improvements that have been added lately. I’ve been wondering if someone on this list would care to summarize what features of LLVM would be appropriate to expose as features of languages built on top of LLVM. In other words, if you were building a new LLVM-based language for general programming, how your language’s feature set be affected by the capabilities already in LLVM? I’m focusing on language, and not compiler, features - so for example “faster code” is a compiler feature which doesn’t usually affect the design of the language.

Some things come to mind:

  • the patchpoint and stackmap intrinsics used by WebKit

  • I added ‘musttail’, which can now be combined with varargs to implement a perfectly forwarding function that can modify some prefix of the arguments

  • comdat groups are now explicit in the IR, so if you have mergeable C++ template-like constructs you can now group related things together

Hi Talin,

What specifically are you asking about here? Are you asking what LLVM features (e.g. arbitrary sized integers) would be interesting to expose in source languages?

With Swift as an example, we weren’t constrained by LLVM, we just nudged LLVM and its infrastructure in the right direction over time. As one dumb example, Swift is why llvm::SourceMgr supports caret diagnostics, ranges and fixit hints.


I missed this when it went in. Does it rely on the target having the same calling convention for variadic and non-variadic functions?


Yes. And of course not long after implementing this for x86, I discovered this was not the case for Darwin arm64. =P

My goal was to use this for variadic virtual method adjustor thunks.