[PATCH] D37874: [TwoAddressInstructionPass] When prepending COPYs when processing tied operands, take the register class constraint from the instruction operands not the register we're copying.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 16:36:25 PDT 2017


arsenm added inline comments.


================
Comment at: lib/CodeGen/TwoAddressInstructionPass.cpp:1521-1522
     MIB.addReg(RegB, 0, SubRegB);
-    const TargetRegisterClass *RC = MRI->getRegClass(RegB);
+    const TargetRegisterClass *RC = TII->getRegClass(MI->getDesc(), SrcIdx, TRI,
+                                                     *MF);
     if (SubRegB) {
----------------
Can't this now fail if the instruction uses an unknown register class operand?


https://reviews.llvm.org/D37874





More information about the llvm-commits mailing list