[LLVMdev] Could metadata ever be mandatory for correctness in LLVM IR?

Stephen Cross scross at scross.co.uk
Fri Jun 19 15:19:33 PDT 2015


Hi everyone,

Currently it looks like metadata is used in LLVM IR essentially as an
'optional extra', in that any pass is allowed to remove metadata
(though preserving metadata is useful) and the program should remain
valid. In other words the metadata only communicates information about
code quality or associated information rather than issues relevant to
correctness.

First question: Is this is a long term design intention OR something
that just currently happens to be true?

The context for this is that I'm considering how to represent ABI
information in a language-agnostic way in LLVM IR. I've seen/heard
some suggestions about using metadata to represent ABI information
(e.g. to say this 'i32' is actually an 'int'), but it does seem like
metadata is not intended for this kind of use case since removing the
metadata would affect the correctness of the lowering in the backend.

Second question: Given that context, would it be reasonable to say
that metadata would not be considered an appropriate mechanism for
communicating ABI information?

Thanks,
Stephen



More information about the llvm-dev mailing list