This is an archive of the discontinued LLVM Phabricator instance.

[ASan] Changed intrisic implemenation to use PLT safe registers.
ClosedPublic

Authored by kstoimenov on Dec 2 2021, 3:00 PM.

Details

Summary

Changed registers to R10 and R11 because PLT resolution clobbers them. Also changed the implementation to use R11 instead of RCX, which saves a push/pop.

Diff Detail

Event Timeline

kstoimenov created this revision.Dec 2 2021, 3:00 PM
kstoimenov requested review of this revision.Dec 2 2021, 3:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 3:00 PM
kstoimenov edited the summary of this revision. (Show Details)Dec 2 2021, 3:02 PM
kstoimenov added reviewers: vitalybuka, morehouse.
kstoimenov added inline comments.Dec 2 2021, 3:04 PM
llvm/test/CodeGen/X86/musttail-varargs.ll
85

For some reason adding a new class changed the instruction order. What would be the best way to verify that this is not breaking functionality?

kstoimenov updated this revision to Diff 391483.Dec 2 2021, 3:33 PM

Removed push/pop from tests.

vitalybuka accepted this revision.Dec 2 2021, 5:07 PM
vitalybuka added inline comments.
llvm/test/CodeGen/X86/musttail-varargs.ll
85

not sure. does check-all pass?

This revision is now accepted and ready to land.Dec 2 2021, 5:07 PM
kstoimenov added inline comments.Dec 2 2021, 8:04 PM
llvm/test/CodeGen/X86/musttail-varargs.ll
85

Yes.

This revision was landed with ongoing or failed builds.Dec 2 2021, 8:07 PM
This revision was automatically updated to reflect the committed changes.
morehouse added inline comments.Dec 3 2021, 6:40 AM
llvm/lib/Target/X86/X86RegisterInfo.td
437

Why is RSP gone now?

kstoimenov added inline comments.Dec 3 2021, 9:08 AM
llvm/lib/Target/X86/X86RegisterInfo.td
437

One reason is that it was never generated. The second reason is that it was hard to write a test for it D114558, because to write a test I would have to clobber RSP. If you have an idea how to write a test for RSP in D114558 I would be happy to bring it back, but I don't think it is worth it.