This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Make CompositeType not inherit from Type
AbandonedPublic

Authored by ctetreau on Mar 2 2020, 3:16 PM.

Details

Reviewers
efriedma
Summary

This patch is a work in progress

Make CompositeType not inherit from Type. Instead, Vecotr, Array, and
Struct Types directly inherit from Type. This is in preparation for the
introduction of distinct Fixed and Scalable Vector Types

Diff Detail

Event Timeline

ctetreau created this revision.Mar 2 2020, 3:16 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
ctetreau updated this revision to Diff 248050.Mar 3 2020, 3:01 PM

Cleaned up code, resolved clang-format lints

It's possible to mess with the way "cast<>" actually casts values by specializing the function template in question. That, plus an appropriate classof implementations, should allow you to avoid the whole CompositeType::get thing. See, for example, https://github.com/llvm/llvm-project/blob/8cf76e913b867a98a9843aa1b3d782632ed5d930/clang/include/clang/AST/DeclBase.h#L2490 .

That said, both CompositeType and SequentialType are pretty useless. CompositeType especially: really, code dealing with it wants to answer one of two question: "is it legal to GEP index into this type", or "is it legal to extractvalue index into this type". I tried to quickly throw together a patch to get rid of CompositeType, and it was roughly 100 lines changed. I'll post something soon.

ctetreau abandoned this revision.Apr 8 2020, 3:45 PM