This is an archive of the discontinued LLVM Phabricator instance.

[Sparc] Get sret arg size from CallLoweringInfo.getArgs()
ClosedPublic

Authored by dcederman on Jun 13 2018, 1:20 AM.

Details

Summary

Looking at the callee argument list, as is done now, might not work if the function has been typecasted into one that is expected to return a struct. This change also simplifies the code.

The isFP128ABICall() function can be removed as it is no longer needed. The test in fp128.ll has been updated to verify this.

Diff Detail

Repository
rL LLVM

Event Timeline

dcederman created this revision.Jun 13 2018, 1:20 AM

Nice simplification.

lib/Target/Sparc/SparcISelLowering.cpp
828 ↗(On Diff #151110)

Please change this to cast instead of dyn_cast, since we can't handle a NULL return value anyhow.

I suspect this probably should be getArgs()[Outs[realArgIdx].OrigArgIndex] instead of [i]?

dcederman updated this revision to Diff 160339.Aug 13 2018, 6:13 AM

Changed dyn_cast to cast. SRet is only allowed on the first argument, checked by LowerFormalArguments_32 at line 406, so I replaced [i] with [0].

jyknight accepted this revision.Aug 16 2018, 8:32 AM
This revision is now accepted and ready to land.Aug 16 2018, 8:32 AM
This revision was automatically updated to reflect the committed changes.