[llvm] r314202 - Tidyup P->getComplexPatternInfo call by moving it inside if( != NULL) test. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 05:59:01 PDT 2017


Author: rksimon
Date: Tue Sep 26 05:59:01 2017
New Revision: 314202

URL: http://llvm.org/viewvc/llvm-project?rev=314202&view=rev
Log:
Tidyup P->getComplexPatternInfo call by moving it inside if( != NULL) test. NFCI.

Modified:
    llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp

Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=314202&r1=314201&r2=314202&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Tue Sep 26 05:59:01 2017
@@ -920,10 +920,8 @@ static unsigned getPatternSize(const Tre
   if (P->isLeaf() && isa<IntInit>(P->getLeafValue()))
     Size += 2;
 
-  const ComplexPattern *AM = P->getComplexPatternInfo(CGP);
-  if (AM) {
+  if (const ComplexPattern *AM = P->getComplexPatternInfo(CGP)) {
     Size += AM->getComplexity();
-
     // We don't want to count any children twice, so return early.
     return Size;
   }




More information about the llvm-commits mailing list