This is an archive of the discontinued LLVM Phabricator instance.

[X86][ArgumentPromotion] Allow Argument Promotion if caller and callee disagree on 512-bit vectors support if the arguments are scalar.
ClosedPublic

Authored by craig.topper on Apr 23 2020, 4:17 PM.

Details

Summary

If one of caller/callee has disabled ZMM registers due to
prefer-vector-width=256, we were previously
disabling argument promotion as the ABI might be incompatible since
one side will split 512-bit vectors in this case.

But if we can see that the types are all scalar this shouldn't be
a problem.

This patch assumes that pointer element type reflects the type that
the argument will be promoted to.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 23 2020, 4:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2020, 4:17 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
efriedma accepted this revision.Apr 24 2020, 2:05 PM

LGTM

Generally, I'm a little concerned about continuing to extend this approach. In particular, the IR doesn't make it obvious which attributes are supposed to affect the ABI, and the check in X86TTIImpl::areFunctionArgsABICompatible() seems overly specific. But I guess this particular patch doesn't really make that problem any worse.

This revision is now accepted and ready to land.Apr 24 2020, 2:05 PM
This revision was automatically updated to reflect the committed changes.