Skip to content
  1. Mar 24, 2021
  2. Mar 23, 2021
  3. Mar 22, 2021
    • Chris Lattner's avatar
      [PatternMatching] Add convenience insert method to OwningRewritePatternList. NFC. · 68747266
      Chris Lattner authored
      This allows adding a C function pointer as a matchAndRewrite style pattern, which
      is a very common case.  This adopts it in ExpandTanh to show how it reduces a level
      of nesting.
      
      We could allow C++ lambdas here, but that doesn't work as well with type inference
      in the common case.  Instead of:
      
        patterns.insert(convertTanhOp);
      
      you need to specify:
      
        patterns.insert<math::TanhOp>(convertTanhOp);
      
      which is boilerplate'y.  Capturing state like this is very uncommon, so we choose
      to require clients to define their own structs and use the non-convenience method
      when they need to do so.
      
      Differential Revision: https://reviews.llvm.org/D99039
      68747266
    • Chia-hung Duan's avatar
      Fix the order of directives and the target string · cec24435
      Chia-hung Duan authored
      In the original structure, it will try to match CHECK-LABEL first then see if
      the subsequent doesn't have the target strings. This is not what we are
      expected. We are expecting the two functions which will be deleted should be
      matched before CHECK-LABEL. Also fixed the function names.
      
      Reviewed By: jpienaar
      
      Differential Revision: https://reviews.llvm.org/D99060
      cec24435
Loading