This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][AArch64][IRGen] Add a special case to CodeGenFunction::EmitCall for scalable vector return being coerced to fixed vector.
ClosedPublic

Authored by craig.topper on Jul 17 2023, 10:25 AM.

Details

Summary

Before falling back to CreateCoercedStore, detect a scalable vector
return being coerced to fixed vector. Handle it using a vector.extract
intrinsic without going through memory.

This is an alternative to D155222.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 17 2023, 10:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2023, 10:25 AM
craig.topper requested review of this revision.Jul 17 2023, 10:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2023, 10:25 AM
c-rhodes accepted this revision.Jul 18 2023, 1:19 AM

Thanks Craig this is a better solution, LLVM cleans up the store/load coercion nicely but better not to create them in the first place if possible. LGTM cheers

clang/lib/CodeGen/CGCall.cpp
5749

nit: RetIRTy

This revision is now accepted and ready to land.Jul 18 2023, 1:19 AM
This revision was landed with ongoing or failed builds.Jul 18 2023, 10:04 AM
This revision was automatically updated to reflect the committed changes.