This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Add isel support for global values in the large code model
ClosedPublic

Authored by aemerson on Jan 17 2018, 6:17 AM.

Details

Summary

The large code model isn't properly handled for global values, for which we need to use the MOVZ/MOVK sequence of instructions to materialize the address with appropriate relocs on ELF, rather than the ADRP+ADD pair used for the small code model.

Fixes PR35958.

Diff Detail

Repository
rL LLVM

Event Timeline

aemerson created this revision.Jan 17 2018, 6:17 AM
aemerson added a reviewer: ab.Jan 17 2018, 9:38 AM

@kristof.beyls @rogfer01 Could someone from ARM do a quick test of this? I don't have an ELF target handy to test it myself and I'd like to get this fixed in the release branch.

rogfer01 accepted this revision.Jan 18 2018, 10:52 AM

Hi @aemerson thanks a lot for the prompt fix.

I've run the internal tests that flagged this issue with a patched toolchain and they pass after this.

This change LGTM except for a minor issue with C++. No need to re-review.

lib/Target/AArch64/AArch64InstructionSelector.cpp
885

C++11 compilers in pedantic mode will diagnose this default argument so perhaps you want to remove it, however this is valid C++14.

This revision is now accepted and ready to land.Jan 18 2018, 10:52 AM
This revision was automatically updated to reflect the committed changes.