[PATCH] D84988: WIP [Coverage] Add empty line regions to SkippedRegions

Zequan Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 15:53:02 PDT 2020


zequanwu created this revision.
zequanwu added a reviewer: vsk.
Herald added subscribers: llvm-commits, cfe-commits, hiraditya.
Herald added projects: clang, LLVM.
zequanwu requested review of this revision.

Add a hook to track empty line regions when lexing.

But the performance is slowed down by around 17%-18% in various metrics, when building clang in stage 2.

Before:

   Performance counter stats for 'ninja':
  
      311,209,849.81 msec task-clock:u              #   67.409 CPUs utilized
                   0      context-switches:u        #    0.000 K/sec
                   0      cpu-migrations:u          #    0.000 K/sec
         281,387,702      page-faults:u             #    0.904 K/sec
  1,017,711,372,555,936      cycles:u                  #    3.270 GHz
  946,375,750,355,261      instructions:u            #    0.93  insn per cycle
  177,175,273,188,835      branches:u                #  569.311 M/sec
     669,996,596,816      branch-misses:u           #    0.38% of all branches
  
      4616.756864564 seconds time elapsed
  
    309134.522799000 seconds user
      2085.393017000 seconds sys

After:

   Performance counter stats for 'ninja':
  
      366,995,591.49 msec task-clock:u              #   66.122 CPUs utilized
                   0      context-switches:u        #    0.000 K/sec
                   0      cpu-migrations:u          #    0.000 K/sec
         277,237,414      page-faults:u             #    0.755 K/sec
  1,195,848,140,356,295      cycles:u                  #    3.258 GHz
  1,196,705,529,208,597      instructions:u            #    1.00  insn per cycle
  223,288,886,752,605      branches:u                #  608.424 M/sec
     701,642,510,605      branch-misses:u           #    0.31% of all branches
  
      5550.251663887 seconds time elapsed
  
    364880.132207000 seconds user
      2127.891642000 seconds sys

Might need to a more efficient approach.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84988

Files:
  clang/include/clang/Lex/Lexer.h
  clang/include/clang/Lex/Preprocessor.h
  clang/lib/CodeGen/CoverageMappingGen.cpp
  clang/lib/CodeGen/CoverageMappingGen.h
  clang/lib/Lex/Lexer.cpp
  clang/lib/Lex/Preprocessor.cpp
  llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84988.282070.patch
Type: text/x-patch
Size: 9586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200730/662548a6/attachment.bin>


More information about the llvm-commits mailing list