[PATCH] D19999: [X86] Teach X86FixupBWInsts to promote MOV8rr/MOV16rr to MOV32rr.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 10:40:59 PDT 2016


ab marked 2 inline comments as done.

================
Comment at: lib/Target/X86/X86FixupBWInsts.cpp:96
@@ -95,1 +95,3 @@
 
+  /// Change the MachineInstr \p MI into the equivalent 32-bit copy if it is
+  /// safe to do so.  Return the replacement instruction if OK, otherwise return
----------------
Heh, I didn't even notice it! r268754

================
Comment at: lib/Target/X86/X86FixupBWInsts.cpp:247
@@ +246,3 @@
+  // Don't set src flags, as we don't know if we're also killing the superreg.
+  MachineInstrBuilder MIB =
+      BuildMI(*MF, MI->getDebugLoc(), TII->get(X86::MOV32rr), NewDestReg)
----------------
I usually copy whole operands when possible, to preserve flags; here the only one that matters is kill, and I think it's incorrect to set it on the destination.

So: addReg() indeed!


http://reviews.llvm.org/D19999





More information about the llvm-commits mailing list