[PATCH] D90050: AMDGPU/GlobalISel: Add integer med3 combines

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 31 10:46:33 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h:27-29
+template <typename Pattern> bool mi_match(MachineInstr *MI, Pattern &&P) {
+  return P.match(MI->getMF()->getRegInfo(), MI);
+}
----------------
I'd rather just have to pass MRI consistently


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h:264-275
+  AnyBinaryOp_match(const LHS_P &LHS, const RHS_P &RHS) : L(LHS), R(RHS) {}
+  template <typename OpTy>
+  bool match(const MachineRegisterInfo &MRI, OpTy &&Op) {
+    MachineInstr *TmpMI;
+    if (mi_match(Op, MRI, m_MInstr(TmpMI))) {
+      if (TmpMI->getNumOperands() == 3) {
+        return matchOperands(MRI, TmpMI->getOperand(1).getReg(),
----------------
Probably should split the new MIPatternMtach changes into a separate patch


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

https://reviews.llvm.org/D90050



More information about the llvm-commits mailing list