This is an archive of the discontinued LLVM Phabricator instance.

[PoC][Clang][CodeGen] Do not use getelementptr for scalable struct.
AbandonedPublic

Authored by HsiangKai on Mar 28 2021, 9:17 PM.

Details

Summary

We do not support getelementptr for scalable struct. Avoid using getelementptr when dealing with scalable struct arguments.

Use multiple insertvalue and store the whole scalable struct at the end.

Diff Detail

Event Timeline

HsiangKai created this revision.Mar 28 2021, 9:17 PM
HsiangKai requested review of this revision.Mar 28 2021, 9:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2021, 9:17 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
HsiangKai updated this revision to Diff 334145.Mar 30 2021, 6:52 AM
HsiangKai edited the summary of this revision. (Show Details)

Are there any tests for this?

clang/lib/CodeGen/CGCall.cpp
1298–1299

This comment might need to be sunk as it doesn't apply to structs containing scalable vectors?

Are there any tests for this?

The only scalable struct types are Zvlsseg types in Clang. We have use cases in D99593. I have no separate test cases in this commit.

HsiangKai updated this revision to Diff 334578.Mar 31 2021, 7:53 PM

Address comments.

HsiangKai abandoned this revision.Jun 2 2021, 7:44 AM