[llvm-dev] [RFC] Intrinsic naming convention (words with dots)

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 1 21:16:21 PST 2015


> On Dec 1, 2015, at 2:26 AM, Hal Finkel via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi everyone,
> 
> We seem to have allowed our documented target-independent intrinsics to acquire a somewhat-haphazard naming system, and I think we should standardize on one convention. All of the intrinsics have 'llvm.' as a prefix, and some also have some additional prefix 'llvm.dbg.', 'llvm.eh.', 'llvm.experimental.', etc., but after that we lose consistency. When there is just a single word (or acronym) everything is fine, but the way we join multiple words (or acronyms) falls into three categories:
> 
> 1. No separator (e.g. @llvm.readcyclecounter)
> 2. Using '.' as a separator (e.g. @llvm.sadd.with.overflow)
> 3. Using '_' as a separator (e.g. @llvm.read_register)
> 
> I propose that we standardize on (2) -- words with dots -- as it seems to have a plurality of more-recent intrinsics (and I think it is easy to read, as is (3)). Thoughts?

I’m fine with “words with dots” or “dots are namespaces and underscores separate parts of words”.  If you’re really on board with doing the autoupgrade logic from the old names, then I slightly prefer dots for namespaces.

-Chris


More information about the llvm-dev mailing list