This is an archive of the discontinued LLVM Phabricator instance.

[AST] Allow VectorTypes of 1-256 elements, and powers of two up to 2**31.
AbandonedPublic

Authored by sammccall on Apr 2 2020, 8:26 AM.

Details

Summary

This used to be 1-2043 elements, and recently regressed to a limit of 1023.
The new behavior is an almost-superset of GCC, which accepts powers of two up
to 2**62.

This change frees one further bit in VectorType in case Type grows again.

Diff Detail

Event Timeline

sammccall created this revision.Apr 2 2020, 8:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2020, 8:26 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I think I would rather just pay the extra 8 bytes per VectorType, and expand this to support all vector types supported by LLVM. It's not like we allocate enough VectorTypes for it to matter, anyway.

I think I would rather just pay the extra 8 bytes per VectorType, and expand this to support all vector types supported by LLVM. It's not like we allocate enough VectorTypes for it to matter, anyway.

llvm::VectorType seems to accept arbitrary unsigned size, so IIUC you'd suggest putting just putting unsigned NumElements in VectorType, which would cost 4 bytes and another 4 in padding.
Sounds reasonable to me, I'll try that.

I think I would rather just pay the extra 8 bytes per VectorType, and expand this to support all vector types supported by LLVM. It's not like we allocate enough VectorTypes for it to matter, anyway.

Sounds reasonable to me, I'll try that.

This alternative is in D77335, which is much simpler.

sammccall abandoned this revision.May 28 2020, 4:29 AM