[PATCH] D87901: [Driver] Filter out <libdir>/gcc and <libdir>/gcc-cross if they do not exists

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 26 16:59:53 PDT 2020


MaskRay added a comment.

  Without the patch
  
  % strace -fc -e file /tmp/RelA/bin/clang '-###' a.cc
  ...
  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
   74.57    0.002809           8       331       312 openat
   13.83    0.000521           5        91        46 stat
   10.01    0.000377           6        58        47 access
    0.96    0.000036           7         5           readlink
    0.50    0.000019          19         1           unlink
    0.13    0.000005           1         5           lstat
    0.00    0.000000           0         1           execve
  ------ ----------- ----------- --------- --------- ----------------
  100.00    0.003767                   492       405 total
  
  With the patch
  
  % strace -fc -e file /tmp/RelA/bin/clang '-###' a.cc
  ...
  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
   59.13    0.002345           9       239       220 openat
   21.66    0.000859           8        97        50 stat
   15.08    0.000598          10        58        47 access
    1.82    0.000072          14         5           readlink
    1.08    0.000043          43         1           execve
    0.73    0.000029          29         1           unlink
    0.50    0.000020           4         5           lstat
  ------ ----------- ----------- --------- --------- ----------------
  100.00    0.003966                   406       317 total

A cross compile gets improved, too (`strace -fc -e file /tmp/RelA/bin/clang++ -target powerpc64le-linux-gnu -isystem /usr/powerpc64le-linux-gnu/include/c++/9/powerpc64le-linux-gnu/ a.cc`): 438 openat calls -> 414.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87901/new/

https://reviews.llvm.org/D87901



More information about the cfe-commits mailing list