[PATCH] D15549: [X86] Use push-pop for materializing small constants under 'minsize'

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 11:54:58 PST 2015


hans added inline comments.

================
Comment at: lib/Target/X86/X86InstrInfo.cpp:5310
@@ +5309,3 @@
+  switch (MIB->getOpcode()) {
+  case X86::MOV32ImmSExti8:
+    if (Subtarget.is64Bit()) {
----------------
DavidKreitzer wrote:
> This looks correct, but you could write it more simply by unifying 5311-5318 & 5327-5330. They are the same except for the lines that change the result register. You could use getX86SubSuperRegister(MIB->getOperand(0).getReg(), MVT::i64), which will work regardless of whether the original register is 32 or 64 bits.
> 
I hadn't seen getX86SubSuperRegister() before, that seems very handy. Thanks!


http://reviews.llvm.org/D15549





More information about the llvm-commits mailing list