[PATCH] D22466: Avoid false dependencies of undef machine operands

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 09:57:57 PDT 2016


mkuper added inline comments.

================
Comment at: lib/CodeGen/ExecutionDepsFix.cpp:492
@@ +491,3 @@
+
+  const TargetRegisterClass* OpRC = MI->getRegClassConstraint(OpIdx, TII, TRI);
+
----------------
myatsina wrote:
> mkuper wrote:
> > myatsina wrote:
> > > This is a bug fixed exposed by Craig Topper's commit #276393. 
> > > Now using the register class of the actual machine instruction operand I want to replace.
> > This looks a bit weird.
> > It would probably be better to use MRI->getRegClass(OriginalReg). 
> > (We already query MachineRegisterInfo in runOnFunction, you can convert that to a member)
> MRI->getRegClass() receives a virtual reg, but I do not have access to virtual regs in this pass.
> How about "TII->getRegClass(MI->getDesc(), OpIdx, TRI, *MF)"?
> This seems to work as well.
> 
Gah, you're right, sorry.
Anyway, yes, I think I'd prefer TII->getRegClass.


Repository:
  rL LLVM

https://reviews.llvm.org/D22466





More information about the llvm-commits mailing list