[PATCH] D25152: [RFC/WIP] CodeGen: Initial support for references to absolute symbols in immediate operands.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 12:39:35 PDT 2016


pcc added a comment.

> So you're still planning on adding the absolute bit here? What will that gain us over the range metadata?

After thinking about this a little more, I think we don't need the absolute bit if we just define !range to mean "the address of this symbol is fixed at link time, and this is its range". That would seem to be the correct definition -- it would override any assumptions about the symbol value that may be derived from the relocation model, code model and symbol visibility rather than being a strict limitation (e.g. consider non-PIC code compiled with the medium code model -- this would be equivalent to a !range of [0..2^32) on every global but the metadata could in principle provide a wider range on 64-bit targets).

> Oof. I see your explanation of why, but this does seem painful. We have both "target" and "opaque" constants already though (although i have *no* idea what "opaque" constants really are), so this doesn't really seem to make things much worse.

Agreed, though this has become more painful as I've been extending this patch to handle globals in more places. One possibility for lessening the pain may be to introduce derived classes of ConstantSDNode (one for ConstantInt and another for globals). I'll continue experimenting to see if I can find the best approach.


https://reviews.llvm.org/D25152





More information about the llvm-commits mailing list