IR, X86: Understand !absolute_symbol metadata on global variables.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 8 Dec 2016 19:01:00 +0000 (19:01 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 8 Dec 2016 19:01:00 +0000 (19:01 +0000)
commit235c275b20d44e3aeb8bfe98dc34b2ead704bf32
tree538eadab86e6bfd2ee1a401abcfe3c67355524ae
parentaa4f4450af0b6e5406189679713b61f225d0ab1b
IR, X86: Understand !absolute_symbol metadata on global variables.

Summary:
Attaching !absolute_symbol to a global variable does two things:
1) Marks it as an absolute symbol reference.
2) Specifies the value range of that symbol's address.
Teach the X86 backend to allow absolute symbols to appear in place of
immediates by extending the relocImm and mov64imm32 matchers. Start using
relocImm in more places where it is legal.

As previously proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105800.html

Differential Revision: https://reviews.llvm.org/D25878

llvm-svn: 289087
17 files changed:
llvm/docs/LangRef.rst
llvm/include/llvm/IR/GlobalValue.h
llvm/include/llvm/IR/LLVMContext.h
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/IR/Globals.cpp
llvm/lib/IR/LLVMContext.cpp
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h
llvm/lib/Target/X86/X86InstrInfo.td
llvm/lib/Target/X86/X86InstrShiftRotate.td
llvm/lib/Target/X86/X86Subtarget.cpp
llvm/test/CodeGen/X86/absolute-bit-mask.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/absolute-bt.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/absolute-constant.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/absolute-rotate.ll [new file with mode: 0644]
llvm/test/Transforms/FunctionAttrs/nonnull-global.ll [new file with mode: 0644]