[llvm-dev] RFC: Absolute or "fixed address" symbols as immediate operands

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 26 09:14:51 PDT 2016


On Tue, Oct 25, 2016 at 6:52 PM, Peter Collingbourne <peter at pcc.me.uk>
wrote:

> So, to summarise the overall consensus on this thread:
> - We should introduce a GlobalConstant class which supports definitions
> and declarations
> - It should derive from GlobalValue
> - No type changes for GlobalValue (i.e. still required to be pointer type)
> - To communicate the range we should use !range metadata and support it on
> GlobalConstant as well as GlobalVariable
>
> Although I am not convinced that this is the right representation I appear
> to be in the minority here, so if this seems reasonable to folks I will go
> ahead and implement it.
>

I could go either way on GlobalConstant being a pointer or not. Keeping the
"globals are points" invariant is nice, but making LLVM IR more accurately
model object file formats is also good.

If I had to choose, I think I would make GlobalConstant a pointer. I don't
think there are many interesting mid-level optimizations that this prevents.

One change I would make is to push the !range metadata into the
GlobalConstant object. The range information is what really unlocks the
interesting ISel optimizations.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161026/6e2f352c/attachment.html>


More information about the llvm-dev mailing list