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

Marina Yatsina via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 02:20:48 PDT 2016


myatsina added inline comments.

================
Comment at: lib/CodeGen/ExecutionDepsFix.cpp:492
@@ +491,3 @@
+
+  const TargetRegisterClass* OpRC = MI->getRegClassConstraint(OpIdx, TII, TRI);
+
----------------
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.



Repository:
  rL LLVM

https://reviews.llvm.org/D22466





More information about the llvm-commits mailing list