This is an archive of the discontinued LLVM Phabricator instance.

[mips] Mark aggregates returned in registers with the 'inreg' attribute.
ClosedPublic

Authored by dsanders on Aug 21 2014, 6:32 AM.

Details

Summary

This allows us to easily find them in the backend after the aggregates have
been lowered to other types. This is important on big-endian targets using
the N32/N64 ABI's since these ABI's must shift small structures into the
upper bits of the register.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 12764.Aug 21 2014, 6:32 AM
dsanders retitled this revision from to [mips] Mark aggregates returned in registers with the 'inreg' attribute..
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a reviewer: atanasyan.
dsanders added a subscriber: Unknown Object (MLST).
atanasyan accepted this revision.Aug 22 2014, 1:14 AM
atanasyan edited edge metadata.

LGTM

lib/CodeGen/TargetInfo.cpp
5535

Does it have a sense to join two if conditions below into the single one?

if (!IsO32 || (RetTy->isVectorType() && !RetTy->hasFloatingRepresentation())) {
  ABIArgInfo ArgInfo = ABIArgInfo::getDirect(returnAggregateInRegs(RetTy, Size));
  ArgInfo.setInReg(true);
  return ArgInfo;
}
This revision is now accepted and ready to land.Aug 22 2014, 1:14 AM

Thanks

lib/CodeGen/TargetInfo.cpp
5535

Yes, with an extra comment mentioning the N32/N64. It looked a bit misleading merging the if-statements while only mentioning the O32 case in the comment.

I'll make this change before committing.

dsanders closed this revision.Sep 4 2014, 8:15 AM