[X86] Encode global address in small code model
authorWei Wang <apollo.mobility@gmail.com>
Fri, 23 Oct 2020 05:54:16 +0000 (22:54 -0700)
committerWei Wang <apollo.mobility@gmail.com>
Tue, 27 Oct 2020 06:14:06 +0000 (23:14 -0700)
commitd602e79a81adceca3ecc0259d6eda305fe9c86c0
tree80e8ba394a92b2c2f2d172a07a8ace9564edfd45
parente851e566d4aee6770ac4f347b80373492d46e674
[X86] Encode global address in small code model

In small code model, program and its symbols are linked in the lower 2 GB of
the address space. Try encoding global address even when the range is unknown
in such case.

Differential Revision: https://reviews.llvm.org/D89341
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/br-fold.ll
llvm/test/CodeGen/X86/critical-edge-split-2.ll
llvm/test/CodeGen/X86/pr33290.ll
llvm/test/CodeGen/X86/relocimm-small-model.ll [new file with mode: 0644]