[llvm-dev] Compile time constants in the IR?

Nicholas Wilson via llvm-dev llvm-dev at lists.llvm.org
Sun Oct 7 22:46:22 PDT 2018


This would be useful for SpecConstants for SPIR-V (should it get upstreamed).

Nic

On 8 Oct 2018, at 1:39 pm, Gaier, Bjoern via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:

Hello everyone,

this might seem like a silly question, but I really wanted to ask it.

So I was thinking about compile time constants (constexpr) - you set them once, compile the code and they will be hard coded. Now I wonder, is there something like that for the IR language too?

The use-case I think off is, that the runtime, which will jit the IR, can set compile time constant values for the modules, because the runtime may decide that certain values will be constant for the module and isn't jit a form of compiling?
But when I think about it, how would I declare such a value with clang? I really don't think that "extern constexpr" are a thing...

I just wondered...

Kind greetings
Björn
_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181008/508bab66/attachment-0001.html>


More information about the llvm-dev mailing list