[MIPatternMatch]: Add mi_match for MachineInstr
authorPetar Avramovic <Petar.Avramovic@amd.com>
Tue, 27 Apr 2021 09:08:16 +0000 (11:08 +0200)
committerPetar Avramovic <Petar.Avramovic@amd.com>
Tue, 27 Apr 2021 09:08:16 +0000 (11:08 +0200)
commit39662abf720fc195b549246f32719d313f05a67f
tree9957737b0aa0f3c4201fba6d5acd03a11e43fac2
parentebe408ad8003c946ef871b955ab18e64e82697cb
[MIPatternMatch]: Add mi_match for MachineInstr

This utility allows more efficient start of pattern match.
Often MachineInstr(MI) is available and instead of using
mi_match(MI.getOperand(0).getReg(), MRI, ...) followed by
MRI.getVRegDef(Reg) that gives back MI we now use
mi_match(MI, MRI, ...).

Differential Revision: https://reviews.llvm.org/D99735
llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp