This is an archive of the discontinued LLVM Phabricator instance.

[ARM] create new psuedo t2LDRLIT_ga_pcrel for stack guards
ClosedPublic

Authored by nickdesaulniers on Nov 29 2021, 5:39 PM.

Details

Summary

We can't use the existing psuedo ARM::tLDRLIT_ga_pcrel for loading the
stack guard for PIC code that references the GOT, since arm-pseudo may
expand this to the narrow tLDRpci rather than the wider t2LDRpci.

Create a new pseudo, t2LDRLIT_ga_pcrel, and expand it to t2LDRpci.

Fixes: https://bugs.chromium.org/p/chromium/issues/detail?id=1270361

Diff Detail

Event Timeline

nickdesaulniers requested review of this revision.Nov 29 2021, 5:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2021, 5:39 PM
ardb accepted this revision.Nov 29 2021, 11:30 PM
ardb added inline comments.
llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
263

We should probably check !SubTarget.useMovT() here as well, so the literal pool entry will be used even for non-PIC/non-GOT code

This revision is now accepted and ready to land.Nov 29 2021, 11:30 PM
This revision was automatically updated to reflect the committed changes.
hans added a comment.Nov 30 2021, 9:07 AM

Thanks for the fast fix!