OSDN Git Service

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)
commitb29976c54b1945bca2651aa07d27fc504a74d2e9
tree58135739e9d71ba38b4fb64265d31d1d02a84a7d
parent4d6c7e915f2197d52eb6c1748c9c477a6e3003ce
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289087 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
docs/LangRef.rst
include/llvm/IR/GlobalValue.h
include/llvm/IR/LLVMContext.h
lib/Analysis/ValueTracking.cpp
lib/IR/Globals.cpp
lib/IR/LLVMContext.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86InstrShiftRotate.td
lib/Target/X86/X86Subtarget.cpp
test/CodeGen/X86/absolute-bit-mask.ll [new file with mode: 0644]
test/CodeGen/X86/absolute-bt.ll [new file with mode: 0644]
test/CodeGen/X86/absolute-constant.ll [new file with mode: 0644]
test/CodeGen/X86/absolute-rotate.ll [new file with mode: 0644]
test/Transforms/FunctionAttrs/nonnull-global.ll [new file with mode: 0644]