[PATCH] D25152: [RFC/WIP] CodeGen: Initial support for references to absolute symbols in immediate operands.
Chandler Carruth via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 23:38:49 PDT 2016
chandlerc added a comment.
I'm *really* excited to see this fixed. Our handling of these references has been a source of a lot of frustration.
A small comment on the overall design:
> This patch implements part of this change. Rather than introducing the
> "absolute" flag, it just checks for !range metadata on GlobalObjects
> (switching to the correct representation is a TODO).
So you're still planning on adding the `absolute` bit here? What will that gain us over the range metadata?
> At the SDAG level,
> if a global reference has !range metadata and the target/object format
> supports the required relocations (ELF only for now), we combine it into a
> special ConstantSDNode which holds a reference to the symbol. Like any other
> ConstantSDNode, this ConstantSDNode can appear as an immediate operand. This
> means that we now have ConstantSDNodes which are not in fact constant integers,
> but to a certain extent this seems like the least worst approach.
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.
In some ways, modeling relocation constants as "target constants" makes a lot of sense...
https://reviews.llvm.org/D25152
More information about the llvm-commits
mailing list