This is an archive of the discontinued LLVM Phabricator instance.

[IR] Add memory attributes for init.trampoline
ClosedPublic

Authored by nikic on Dec 22 2021, 2:39 AM.

Details

Summary

Based on my reading of https://llvm.org/docs/LangRef.html#llvm-init-trampoline-intrinsic, init.trampoline writes to the first argument, while the other two are readnone. These two arguments are only captured and written into the trampoline memory. This also matches what I see in the X86TargetLowering::LowerINIT_TRAMPOLINE() implementation.

Unfortunately the person who originally worked on trampolines doesn't seem to be active anymore, so adding some general memory attribute reviewers... I hope that with this change we can remove special intrinsic handling in MemoryLocation::getForDest().

Diff Detail

Unit TestsFailed

Event Timeline

nikic created this revision.Dec 22 2021, 2:39 AM
nikic requested review of this revision.Dec 22 2021, 2:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2021, 2:39 AM
jdoerfert accepted this revision.Dec 22 2021, 2:09 PM

No trampoline knowledge but from the description this seems to make sense. Let's go with it and if it causes problems we update the lang ref accordingly.

This revision is now accepted and ready to land.Dec 22 2021, 2:09 PM
This revision was landed with ongoing or failed builds.Dec 23 2021, 12:02 AM
This revision was automatically updated to reflect the committed changes.