Do not count kill, implicit_def instructions as printed instructions.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 27 Apr 2010 19:38:45 +0000 (19:38 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 27 Apr 2010 19:38:45 +0000 (19:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102453 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll

index f000a7063d567c067e774912b4527e4aea16ef02..2e407531dc9ea08ce0ac1a35f00b128ea6884987 100644 (file)
@@ -531,11 +531,11 @@ void AsmPrinter::EmitFunctionBody() {
     for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
          II != IE; ++II) {
       // Print the assembly for the instruction.
-      if (!II->isLabel())
+      if (!II->isLabel() && !II->isImplicitDef() && !II->isKill()) {
         HasAnyRealCode = true;
-      
-      ++EmittedInsts;
-      
+        ++EmittedInsts;
+      }
+
       if (ShouldPrintDebugScopes) {
        if (TimePassesIsEnabled) {
          NamedRegionTimer T(DbgTimerName, DWARFGroupName);
index 8e38fe309f7c5e0b1a57c9f67eb5f9b4d01980e4..17cb2b3057215d00c1d3e684e94ecfee7e2ba3f1 100644 (file)
@@ -1,5 +1,5 @@
 ; RUN: llc < %s -march=x86-64 -o %t -stats -info-output-file - | \
-; RUN:   grep {asm-printer} | grep {Number of machine instrs printed} | grep 10
+; RUN:   grep {asm-printer} | grep {Number of machine instrs printed} | grep 9
 ; RUN: grep {leal      1(\%rsi),} %t
 
 define fastcc zeroext i8 @fullGtU(i32 %i1, i32 %i2, i8* %ptr) nounwind optsize {