[PATCH] D87936: [GISel] Add new combines for G_ADD
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 18 15:16:26 PDT 2022
arsenm added a comment.
I do think the add -> or has some value, but it should be separate with the helper function
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:5633-5638
+ Register CstSrc = MI.getOperand(2).getReg();
+ MachineInstr *MaybeCst = MRI.getVRegDef(CstSrc);
+
+ if (MaybeCst->getOpcode() != TargetOpcode::G_CONSTANT)
+ return false;
+ Cst = MaybeCst->getOperand(1).getCImm()->getValue();
----------------
Probably should use m_match here (maybe even have a negative constant matcher)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87936/new/
https://reviews.llvm.org/D87936
More information about the llvm-commits
mailing list