[PATCH] D90304: [GlobalISel] Introduce optimal variant of regbankselect

Gabriel Hjort Ã…kerlund via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 23:06:21 PDT 2020


ehjogab marked 9 inline comments as not done.
ehjogab added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp:1051-1053
+bool isMachineOperandWithVirtualReg(MachineOperand MO) {
+  return MO.isReg() && Register::isVirtualRegister(MO.getReg());
+}
----------------
ehjogab wrote:
> ehjogab wrote:
> > arsenm wrote:
> > > arsenm wrote:
> > > > Can do just .getReg().isVirtual()
> > > This name is a bit obnoxious. If it's really necessary, I would rather just add this helper directly to MachineOperand
> > I agree, it's not a good name. I'll see if I can either get rid of this function, or else put it directly in MachineOperand.
> You mean this works even if MO is not actually a register? I just assumed that you're not allowed to invoke getReg() unless you are certain that MO is really a register.
Just checked MachineOperand.h, and there's an assert that will fail if getReg() is invoked and isReg() does not hold.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90304



More information about the llvm-commits mailing list