diff options
Diffstat (limited to 'mlir/test/lib/IR/TestMatchers.cpp')
-rw-r--r-- | mlir/test/lib/IR/TestMatchers.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mlir/test/lib/IR/TestMatchers.cpp b/mlir/test/lib/IR/TestMatchers.cpp index b62daa8437c..6061b251d72 100644 --- a/mlir/test/lib/IR/TestMatchers.cpp +++ b/mlir/test/lib/IR/TestMatchers.cpp @@ -126,12 +126,15 @@ void test2(FuncOp f) { auto a = m_Val(f.getArgument(0)); FloatAttr floatAttr; auto p = m_Op<MulFOp>(a, m_Op<AddFOp>(a, m_Constant(&floatAttr))); + auto p1 = m_Op<MulFOp>(a, m_Op<AddFOp>(a, m_Constant())); // Last operation that is not the terminator. Operation *lastOp = f.getBody().front().back().getPrevNode(); if (p.match(lastOp)) llvm::outs() << "Pattern add(add(a, constant), a) matched and bound constant to: " << floatAttr.getValueAsDouble() << "\n"; + if (p1.match(lastOp)) + llvm::outs() << "Pattern add(add(a, constant), a) matched\n"; } void TestMatchers::runOnFunction() { |