[llvm-dev] [RFC] Intrinsic naming convention (words with dots)
John Criswell via llvm-dev
llvm-dev at lists.llvm.org
Wed Dec 2 17:35:27 PST 2015
The current rule for an intrinsic, IIRC, is llvm.<str> where <str> is
some arbitrary name that is allowed within an LLVM function name.
While I can understand the desire for consistency, I think what you
suggest is a purely aesthetic change with no real value. If you want to
spend your time on aesthetics, that's fine with me, but you're
introducing changes to the LLVM assembler, disassembler, and
documentation to do it. It may also cause issues with in-tree and
out-of-tree test suites that grep for intrinsic names in LLVM assembly
output (not sure how many tests do that, but it's possible).
Personally, I wouldn't spend my time on it, but that's just me.
On 12/1/15 5:26 AM, Hal Finkel via llvm-dev 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?
> Although this is somewhat subjective, here's our current set of intrinsics with multiple words (or acronyms) by these categories. I'm excluding here externally-defined terms (e.g. llvm.va_start):
> No separators (except for the initial namespace prefix):
> Words with dots:
> Words with underscores (except for the initial namespace prefix):
> Thanks again,
Department of Computer Science, University of Rochester
More information about the llvm-dev