[PATCH] D27437: [TargetInstrInfo] replace redundant expression in getMemOpBaseRegImmOfs

Michael LeMay via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 17:31:07 PST 2016


mlemay-intel created this revision.
mlemay-intel added a reviewer: sanjoy.
mlemay-intel added a subscriber: llvm-commits.

The expression for computing the return value of getMemOpBaseRegImmOfs has only
one possible value. The other value would result in a return earlier in the
function. This patch replaces the expression with its only possible value.


https://reviews.llvm.org/D27437

Files:
  lib/Target/X86/X86InstrInfo.cpp


Index: lib/Target/X86/X86InstrInfo.cpp
===================================================================
--- lib/Target/X86/X86InstrInfo.cpp
+++ lib/Target/X86/X86InstrInfo.cpp
@@ -5855,8 +5855,7 @@
 
   Offset = DispMO.getImm();
 
-  return MemOp.getOperand(MemRefBegin + X86::AddrIndexReg).getReg() ==
-         X86::NoRegister;
+  return true;
 }
 
 static unsigned getStoreRegOpcode(unsigned SrcReg,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27437.80353.patch
Type: text/x-patch
Size: 406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161206/515e8dcd/attachment.bin>


More information about the llvm-commits mailing list