[X86FastISel] Fix MO_GOTPCREL GlobalValue reference in static relocation model
authorFangrui Song <i@maskray.me>
Sun, 6 Dec 2020 07:13:28 +0000 (23:13 -0800)
committerFangrui Song <i@maskray.me>
Sun, 6 Dec 2020 07:13:28 +0000 (23:13 -0800)
commit687b83ceabafe81970cd4639e7f0c89036402081
treee2cbca4ba1c8d8e6b6096093b918fd581afefd23
parenta4cadc2df92bb1b6c5d6c0d20ebadbc0fa74189b
[X86FastISel] Fix MO_GOTPCREL GlobalValue reference in static relocation model

This fixes the bug referenced by 5582a7987662a92eda5d883b88fc4586e755acf5
which was exposed by 961f31d8ad14c66829991522d73e14b5a96ff6d4.

With this change, `movq src@GOTPCREL, %rcx` => `movq src@GOTPCREL(%rip), %rcx`
llvm/lib/Target/X86/X86FastISel.cpp
llvm/test/CodeGen/X86/fast-isel-mem.ll