[PATCH] D153583: [ThinLTO][Matrix] Forward -enable-matrix flag to the LTO plugin

wael yehia via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 31 20:19:10 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG534e23e47b03: [ThinLTO][Matrix] Forward -enable-matrix flag to the LTO plugin (authored by w2yehia).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D153583?vs=549038&id=555242#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153583/new/

https://reviews.llvm.org/D153583

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/Driver/matrix.c


Index: clang/test/Driver/matrix.c
===================================================================
--- /dev/null
+++ clang/test/Driver/matrix.c
@@ -0,0 +1,8 @@
+// RUN: touch %t.o
+// RUN: %clang -flto=thin -fenable-matrix %t.o -### --target=powerpc64-ibm-aix-xcoff 2>&1 \
+// RUN:     | FileCheck %s -check-prefix=CHECK-THINLTO-MATRIX-AIX
+// CHECK-THINLTO-MATRIX-AIX: "-bplugin_opt:-enable-matrix"
+
+// RUN: %clang -flto=thin -fenable-matrix %t.o -### --target=x86_64-unknown-linux 2>&1 \
+// RUN:     | FileCheck %s -check-prefix=CHECK-THINLTO-MATRIX
+// CHECK-THINLTO-MATRIX: "-plugin-opt=-enable-matrix"
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -680,6 +680,12 @@
   else if (IsThinLTO && IsOSAIX)
     CmdArgs.push_back(Args.MakeArgString(Twine("-bdbg:thinlto")));
 
+  // Matrix intrinsic lowering happens at link time with ThinLTO. Enable
+  // LowerMatrixIntrinsicsPass, which is transitively called by
+  // buildThinLTODefaultPipeline under EnableMatrix.
+  if (IsThinLTO && Args.hasArg(options::OPT_fenable_matrix))
+    CmdArgs.push_back(
+        Args.MakeArgString(Twine(PluginOptPrefix) + "-enable-matrix"));
 
   StringRef Parallelism = getLTOParallelism(Args, D);
   if (!Parallelism.empty())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153583.555242.patch
Type: text/x-patch
Size: 1388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230901/70007d72/attachment.bin>


More information about the cfe-commits mailing list