[PATCH] [x32] Fix FrameIndex check in SelectLEA64_32Addr

Derek Schuff dschuff at google.com
Fri Aug 15 11:24:43 PDT 2014


================
Comment at: lib/Target/X86/X86RegisterInfo.cpp:495
@@ +494,3 @@
+  // 32-bits. It saves one byte per lea in code since 0x67 prefix is avoided.
+  if (Opc == X86::LEA64_32r && X86::GR32RegClass.contains(BasePtr))
+    BasePtr = getX86SubSuperRegister(BasePtr, MVT::i64, false);
----------------
should this just be added to the if-else chain above?

================
Comment at: test/CodeGen/X86/lea-5.ll:1
@@ +1,2 @@
+; RUN: llc < %s -mtriple=x86_64-linux -O2        | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-linux-gnux32 -O2 | FileCheck %s -check-prefix=X32
----------------
can this test be simplified at all? it should have some comments about what it's testing for, and what e.g. the control flow is for.

http://reviews.llvm.org/D4929






More information about the llvm-commits mailing list