[all-commits] [llvm/llvm-project] 91a6ad: [m_Constant] Check #operands/results before hasTra...

Chris Lattner via All-commits all-commits at lists.llvm.org
Sun Mar 14 20:14:39 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 91a6ad5ad887a16e361338303d4ff3d29dba5e10
      https://github.com/llvm/llvm-project/commit/91a6ad5ad887a16e361338303d4ff3d29dba5e10
  Author: Chris Lattner <clattner at nondot.org>
  Date:   2021-03-14 (Sun, 14 Mar 2021)

  Changed paths:
    M mlir/include/mlir/IR/Matchers.h
    M mlir/lib/Transforms/Utils/FoldUtils.cpp

  Log Message:
  -----------
  [m_Constant] Check #operands/results before hasTrait()

We know that all ConstantLike operations have one result and no operands,
so check this first before doing the trait check.  This change speeds up
Canonicalize on a CIRCT testcase by ~5%.

Differential Revision: https://reviews.llvm.org/D98615




More information about the All-commits mailing list