Page MenuHomePhabricator

[SVE] Make CompositeType not inherit from Type

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



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, .

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