This is an archive of the discontinued LLVM Phabricator instance.

Modify verifier checks to support musttail + preallocated
ClosedPublic

Authored by aeubanks on May 26 2020, 12:46 PM.

Details

Summary

preallocated and musttail can work together, but we don't want to call
@llvm.call.preallocated.setup() to modify the stack in musttail calls.
So we shouldn't have the "preallocated" operand bundle when a
preallocated call is musttail.

Also disallow use of preallocated on calls without preallocated.

Codegen not yet implemented.

Diff Detail

Event Timeline

aeubanks created this revision.May 26 2020, 12:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2020, 12:46 PM

Should the verifier check that the preallocated argument to the call actually refers to the corresponding "preallocated" argument in the caller?

On a loosely related note, should we require that the argument to llvm.call.preallocated.setup is non-zero?

llvm/docs/LangRef.rst
1079

"although it is"

aeubanks updated this revision to Diff 266351.May 26 2020, 3:24 PM
aeubanks marked an inline comment as done.

Address code review comments

Should the verifier check that the preallocated argument to the call actually refers to the corresponding "preallocated" argument in the caller?

Reid has mentioned that it should be ok, if not weird, for IR to for example store then load the pointer.

On a loosely related note, should we require that the argument to llvm.call.preallocated.setup is non-zero?

Done

aeubanks edited the summary of this revision. (Show Details)May 26 2020, 3:25 PM
efriedma accepted this revision.May 26 2020, 4:00 PM

LGTM

Reid has mentioned that it should be ok, if not weird, for IR to for example store then load the pointer.

Okay, I guess it's fine if a mismatch is always just undefined behavior, not invalid IR.

This revision is now accepted and ready to land.May 26 2020, 4:00 PM
This revision was automatically updated to reflect the committed changes.