[Matrix] Use LLVM_DEBUG for a debug flag
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 25 May 2021 19:07:14 +0000 (21:07 +0200)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 25 May 2021 19:10:19 +0000 (21:10 +0200)
dump() doesn't exist in release builds.

ld.lld: error: undefined symbol: llvm::Value::dump() const
>>> referenced by LowerMatrixIntrinsics.cpp
>>>               LowerMatrixIntrinsics.o:((anonymous namespace)::LowerMatrixIntrinsics::Visit())

llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp

index c7ad5d1..8a9a819 100644 (file)
@@ -80,9 +80,6 @@ static cl::opt<MatrixLayoutTy> MatrixLayout(
                clEnumValN(MatrixLayoutTy::RowMajor, "row-major",
                           "Use row-major layout")));
 
-static cl::opt<bool> PrintAfterTransposeOpt("matrix-print-after-transpose-opt",
-                                            cl::init(false));
-
 /// Helper function to either return Scope, if it is a subprogram or the
 /// attached subprogram for a local scope.
 static DISubprogram *getSubprogram(DIScope *Scope) {
@@ -813,10 +810,10 @@ public:
 
     if (!isMinimal()) {
       optimizeTransposes();
-      if (PrintAfterTransposeOpt) {
+      LLVM_DEBUG({
         dbgs() << "Dump after matrix transpose optimization:\n";
         Func.dump();
-      }
+      });
     }
 
     bool Changed = false;