This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][AArch64][IRGen] Add scalable->fixed as a special case in CreateCoercedStore.
AbandonedPublic

Authored by craig.topper on Jul 13 2023, 11:00 AM.

Details

Summary

This improves the codegen for calling a function that returns a
VLST type. Previously we stored to an alloca using the scalable
type, but loaded it using the fixed vector type. The middle end is
unable to optimize away that store/load pair. With this patch we now
store using the fixed vector type which matches the load.

I have not added predicate types because I haven't supported
those on RISC-V yet so I haven't seen a problem yet.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 13 2023, 11:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 11:00 AM
craig.topper requested review of this revision.Jul 13 2023, 11:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 11:00 AM
c-rhodes accepted this revision.Jul 17 2023, 12:41 AM

LGTM cheers

This revision is now accepted and ready to land.Jul 17 2023, 12:41 AM

It's been a while since I've looked at this code, what about this wouldnt work for predicates? I seem to recall fixed predicates using i8 vs i1 for scalable, is that issue? Happy with this regardless, just curious.

It's been a while since I've looked at this code, what about this wouldnt work for predicates? I seem to recall fixed predicates using i8 vs i1 for scalable, is that issue? Happy with this regardless, just curious.

It probably would. I just have no experience with predicates yet.

I wonder if we should do something earlier CodeGenFunction::EmitCall before the call to CreateCoerecedStore and not go through memory at all?

craig.topper abandoned this revision.Jul 18 2023, 9:52 AM

Abandoning in favor of D155495