This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Split ValueHandler into assignment and emission classes
ClosedPublic

Authored by arsenm on May 5 2021, 2:19 PM.

Details

Summary

Currently the ValueHandler handles both selecting the type and
location for arguments, as well as inserting instructions needed to
handle them. Split this so that the determination of the argument
handling is independent of the function state. Currently the checks
for tail call compatibility do not follow the full assignment logic,
so it misses cases where arguments require nontrivial legalization.

This should help avoid targets ending up in a buggy state where the
argument evaluation may change in different contexts.

Diff Detail

Event Timeline

arsenm created this revision.May 5 2021, 2:19 PM
arsenm requested review of this revision.May 5 2021, 2:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2021, 2:19 PM
Herald added a subscriber: wdng. · View Herald Transcript
aemerson accepted this revision.May 11 2021, 12:50 PM

@paquette See any issues with this?

llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
219

Can make this const.

This revision is now accepted and ready to land.May 11 2021, 12:50 PM
paquette accepted this revision.May 11 2021, 1:04 PM

Seems fine to me.

kschwarz added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
1053

Conceptually, this should be an IncomingValueAssigner, no?
It doesn't make a huge difference for most targets at the moment though, as the assigner doesn't differ too much between incoming and outgoing operands.

arsenm added inline comments.May 25 2021, 1:22 PM
llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
1053

Yes