[llvm] r359170 - [X86] Remove part of an if condition that should always be true.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 23:08:02 PDT 2019


Author: ctopper
Date: Wed Apr 24 23:08:02 2019
New Revision: 359170

URL: http://llvm.org/viewvc/llvm-project?rev=359170&view=rev
Log:
[X86] Remove part of an if condition that should always be true.

The IndexReg will always be non-null at this point. Earlier in the function, if
IndexReg was null we set it to CurDAG->getRegister(0, VT) which made it
non-null.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=359170&r1=359169&r2=359170&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Apr 24 23:08:02 2019
@@ -2293,7 +2293,7 @@ bool X86DAGToDAGISel::selectLEAAddr(SDVa
       Complexity += 2;
   }
 
-  if (AM.Disp && (AM.Base_Reg.getNode() || AM.IndexReg.getNode()))
+  if (AM.Disp)
     Complexity++;
 
   // If it isn't worth using an LEA, reject it.




More information about the llvm-commits mailing list