aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2020-05-11 17:45:51 +0100
committerFlorian Hahn <flo@fhahn.com>2020-05-11 18:55:45 +0100
commit10658691951f7e3ffd257f24e29e81a101daa204 (patch)
tree9da6e0a3d07d7c6871f633780e63355e50853df3 /clang/lib/Frontend/CompilerInvocation.cpp
parentb51df268eb7e61bde28bd4c09618045b6b221b56 (diff)
downloadllvm-10658691951f7e3ffd257f24e29e81a101daa204.zip
llvm-10658691951f7e3ffd257f24e29e81a101daa204.tar.gz
llvm-10658691951f7e3ffd257f24e29e81a101daa204.tar.bz2
[Matrix] Add matrix type to Clang.
This patch adds a matrix type to Clang as described in the draft specification in clang/docs/MatrixSupport.rst. It introduces a new option -fenable-matrix, which can be used to enable the matrix support. The patch adds new MatrixType and DependentSizedMatrixType types along with the plumbing required. Loads of and stores to pointers to matrix values are lowered to memory operations on 1-D IR arrays. After loading, the loaded values are cast to a vector. This ensures matrix values use the alignment of the element type, instead of LLVM's large vector alignment. The operators and builtins described in the draft spec will will be added in follow-up patches. Reviewers: martong, rsmith, Bigcheese, anemet, dexonsmith, rjmccall, aaron.ballman Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D72281
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index c5166ad..ec41547 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3337,6 +3337,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Opts.CompleteMemberPointers = Args.hasArg(OPT_fcomplete_member_pointers);
Opts.BuildingPCHWithObjectFile = Args.hasArg(OPT_building_pch_with_obj);
+ Opts.MatrixTypes = Args.hasArg(OPT_fenable_matrix);
+
Opts.MaxTokens = getLastArgIntValue(Args, OPT_fmax_tokens_EQ, 0, Diags);
if (Arg *A = Args.getLastArg(OPT_msign_return_address_EQ)) {