[PATCH] D99736: [MIPatternMatch]: Add matchers for binary instructions

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 05:47:53 PDT 2021


Petar.Avramovic updated this revision to Diff 340489.
Petar.Avramovic edited the summary of this revision.
Petar.Avramovic added a comment.

Removed matchers that don't check opcode.
My guess is that this was originally done as a equivalent of IR/PatternMatch.h.
Thus i also added AnyBinaryOp_match alongside with the version that checks opcode which i originally wanted(named BinaryOpc_match here).
I thought that AnyBinaryOp_match would be useful when we know opcode already so we avoid checking it again, but turns out that at the moment this is not that useful.
I would prefer to leave existing code with opcodes as template arguments like in IR/PatternMatch.h and add new matcher that has opcode as an regular argument instead. m_Add ect. are meant to have templated opcode and changing it to regular opcode argument almost guaranteed results in a same thing but brings no improvement.


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

https://reviews.llvm.org/D99736

Files:
  llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
  llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99736.340489.patch
Type: text/x-patch
Size: 4166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210426/d6bf6aaa/attachment.bin>


More information about the llvm-commits mailing list