-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds a 'scalable' flag to VectorType * Adds an 'ElementCount' class to VectorType to pass (possibly scalable) vector lengths, with overloaded operators. * Modifies existing helper functions to use ElementCount * Adds support for serializing/deserializing to/from both textual and bitcode IR formats * Extends the verifier to reject global variables of scalable types * Updates documentation See the latest version of the RFC here: http://lists.llvm.org/pipermail/llvm-dev/2018-July/124396.html Reviewers: rengolin, lattner, echristo, chandlerc, hfinkel, rkruppe, samparker, SjoerdMeijer, greened, sebpop Reviewed By: hfinkel, sebpop Differential Revision: https://reviews.llvm.org/D32530 llvm-svn: 361953
- Loading branch information
1 parent
4c5a0d1
commit f4fc01f
Showing
19 changed files
with
479 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| //===- ScalableSize.h - Scalable vector size info ---------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // This file provides a struct that can be used to query the size of IR types | ||
| // which may be scalable vectors. It provides convenience operators so that | ||
| // it can be used in much the same way as a single scalar value. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_SUPPORT_SCALABLESIZE_H | ||
| #define LLVM_SUPPORT_SCALABLESIZE_H | ||
|
|
||
| namespace llvm { | ||
|
|
||
| class ElementCount { | ||
| public: | ||
| unsigned Min; // Minimum number of vector elements. | ||
| bool Scalable; // If true, NumElements is a multiple of 'Min' determined | ||
| // at runtime rather than compile time. | ||
|
|
||
| ElementCount(unsigned Min, bool Scalable) | ||
| : Min(Min), Scalable(Scalable) {} | ||
|
|
||
| ElementCount operator*(unsigned RHS) { | ||
| return { Min * RHS, Scalable }; | ||
| } | ||
| ElementCount operator/(unsigned RHS) { | ||
| return { Min / RHS, Scalable }; | ||
| } | ||
|
|
||
| bool operator==(const ElementCount& RHS) const { | ||
| return Min == RHS.Min && Scalable == RHS.Scalable; | ||
| } | ||
| }; | ||
|
|
||
| } // end namespace llvm | ||
|
|
||
| #endif // LLVM_SUPPORT_SCALABLESIZE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ enum Kind { | |
| bar, // | | ||
| colon, // : | ||
|
|
||
| kw_vscale, | ||
| kw_x, | ||
| kw_true, | ||
| kw_false, | ||
|
|
||
Oops, something went wrong.