IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    My involvement with LLVM 17

    MaskRay发表于 2023-08-20 08:13:54
    love 0

    LLVM 17 will soon be relased. This post provides a summary of mycontributions in this release cycle to record my learning progress.

    • Ported -fsanitize=function to non-x86 architectures andthe C language.
    • lld maintenance. See lld 17 ELF changes
    • LLVM binary utility maintenance, e.g.
      • adopted llvm-readobjstyle ObjectFile specific dumpers
      • [llvm-objdump][X86] Add @plt symbols for .plt.got
      • [llvm-readobj] Print <null> for relocation target with an empty name
    • compiler-rt maintenance, e.g.
      • changed lsan to work with high-entropy ASLR for x86-64 Linux
      • removed crypt and crypt_rinterceptors to work with glibc
    • Fixed ~20 places where the iteration order of MapVectoror SetVector was relied on. Proposed moreLLVM_ENABLE_REVERSE_ITERATION=on coverage
    • Fixed longstanding brittle assembler support for RISC-V linkerrelaxation
    • adapted a simplified 64-bit xxh3 from Cyan4973/xxHash
      • as efficient as the reference implementation for lld's purpose
      • migrated various xxhash64 uses in the repository
    • XRay maintenance, e.g.
      • Implemented__xray_customevent/__xray_typedevent forAArch64
      • Changed codegen to work with Mach-O. Though the runtime partrequires some CMake (which I lack) expertise to move more progress
      • Fixed semantics of some obscure driver options
    • Helped fixing metadata section usage for featuress like-fexperimental-sanitize-metadata= and-fpseudo-probe-for-profiling

    MC

    • Removed many obsoleted workarounds from the integratedassembler
    • Fixed placement of function entry comments
    • Re-architectured a substantial part of the integrated assembler thatis used by RISC-V linker relaxation, fixing some longstanding bugs. SeeThedark side of RISC-V linker relaxation for detail.

    clangDriver

    • Made output files more meaningful when combining compilation andlinking phases for certain options: -gsplit-dwarf,-ftime-trace, --coverage. See Compiler output filesfor detail
    • made target-specific option report an error when used with adifferent target. Previously Clang merely issued warnings likewarning: argument unused during compilation: '-msse' [-Wunused-command-line-argument]
    • -fdebug-prefix-map=: made the last win when multipleprefixes match
    • added-mllvm= as an alias for -mllvm

    Learning plan

    I shall learn more about LLVM code generation.

    Code review

    At the present, LLVM uses a self-hosted Phabricator for code review.I have accepted or rejected 381 Phabricator Differentials (patches)during the 181 days. (I will mention how I get this number later.) Ihope that the number is fabulous, considering so many other tasks I haveto do at work for bread and butter. Here is an incomplete list:

    • unified LTO(clang -funified-lto)
    • fat LTO(clang -ffat-lto-objects) (pulled out from the 17.x releaseto avoid an incomplete state)
    • many lldfeatures
    • revamp of sanitizer interceptors
    • Windows -gsplit-dwarf
    • RISC-V-fsanitize=kcfi.
    • RISC-V patches related to assembler, linker, and psABI
    • LLVMSupport patches
    • Mips and LoongArch patches

    In June 2023, a fulldisk issue occurred with the server, which led to the rejection ofnew patch uploads. To address this problem, I expanded the database disksize from 500GB to 600GB, helping to mitigate the issue.

    Phabricator is gradually winding down. Maintaining a website withover 600K lines of PHP code is not sustainable. As a result, ourcommunity is in need of a suitable replacement. GitHub's pull requestsystem have been selected as the alternative. I belong to the group thatshares concerns regarding the quality of GitHub's pull request system.My primary worries include:

    • Efficient subscription: how do contributors effectively subscribe topatches they are interested in?
    • Review time for less prepared patches: will these patches consumemore time from established reviewers?
    • Rubber stamping: will we witness an increase in rubber stamping, orwill many patches be approved that would have otherwise been rejected byexperienced reviewers for valid technical reasons?

    Moreover, the GitHub Pull Request system utilizes a model that someconsider flawed. It represents a patch as a difference between commits,rather than using plus/minus hunks. Unfortunately, this flaw has causedworkflow friction, leading to concerns like the belief that "forcepushing on the patch branch" should be avoided.

    Ultimately, the individuals investing their efforts will have asignificant say in determining the replacement. We that are concerned ofGitHub pull will aceept the result, but I hope that the level of harmcaused by the less-capable system is deemed acceptable.

    Appendix:the number of accepted/rejected patches by username for this releasecycle

    I did a SQL query to find the numbers of accepted/rejected patches byPhabricator username between the two tags llvmorg-17-initand llvmorg-18-init(181 days), which roughly corresponds to the LLVM 17.x releasecycle.

    1
    select u.username, count(distinct r.lastActionDIffPHID) from differential_reviewer r join phabricator_user.user u where r.reviewerStatus in ('accepted','rejected') and 1674629847<=r.dateCreated and r.dateCreated<1674634847 and r.reviewerPHID=u.phid group by r.reviewerPHID;
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    +-----------------------------+--------------------------------------+
    | username | count(distinct r.lastActionDIffPHID) |
    +-----------------------------+--------------------------------------+
    | nikic | 490 |
    | MaskRay | 381 |
    | arsenm | 367 |
    | ldionne | 361 |
    | craig.topper | 357 |
    | aaron.ballman | 283 |
    | jeanPerier | 206 |
    | nicolasvasilache | 201 |
    | RKSimon | 188 |
    | Mordante | 188 |
    | JDevlieghere | 186 |
    | philnik | 176 |
    | vitalybuka | 172 |
    | sivachandra | 172 |
    | foad | 171 |
    | aartbik | 163 |
    | ftynse | 162 |
    | PeteSteinfeld | 161 |
    | rriddle | 157 |
    | aprantl | 140 |
    | clementval | 139 |
    | mehdi_amini | 136 |
    | asb | 134 |
    | erichkeane | 131 |
    | vzakhari | 128 |
    | phosek | 121 |
    | gysit | 115 |
    | reames | 110 |
    | efriedma | 108 |
    | razvanlupusoru | 107 |
    | fhahn | 99 |
    | pengfei | 98 |
    | kiranchandramohan | 98 |
    | lntue | 97 |
    | jpienaar | 94 |
    | jdoerfert | 94 |
    | springerm | 93 |
    | bulbazord | 92 |
    | jhuber6 | 91 |
    | dmgreen | 91 |
    | dcaballe | 88 |
    | xazax.hun | 88 |
    | kadircet | 84 |
    | PiotrZSL | 82 |
    | mib | 79 |
    | MyDeveloperDay | 75 |
    | HazardyKnusperkeks | 73 |
    | tblah | 71 |
    | rafauler | 69 |
    | jhenderson | 69 |
    | aeubanks | 67 |
    | vdonaldson | 67 |
    | dblaikie | 64 |
    | tra | 62 |
    | mkazantsev | 62 |
    | ABataev | 62 |
    | ChuanqiXu | 62 |
    | cferris | 61 |
    | cor3ntin | 60 |
    | gribozavr2 | 60 |
    | michaelrj | 59 |
    | shafik | 58 |
    | awarzynski | 58 |
    | ThomasRaoux | 56 |
    | antiagainst | 56 |
    | Peiming | 55 |
    | JonChesterfield | 55 |
    | SixWeining | 54 |
    | kuhar | 53 |
    | klausler | 53 |
    | kito-cheng | 53 |
    | hokein | 52 |
    | sammccall | 51 |
    | paulwalker-arm | 51 |
    | rampitec | 50 |
    | mstorsjo | 50 |
    | Dinistro | 50 |
    | carlosgalvezp | 48 |
    | ymandel | 48 |
    | tianshilei1992 | 48 |
    | Mogball | 47 |
    | skan | 46 |
    | owenpan | 46 |
    | xen0n | 45 |
    | hans | 44 |
    | maksfb | 43 |
    | Amir | 43 |
    | goldstein.w.n | 43 |
    | qcolombet | 42 |
    | Ayal | 42 |
    | gkistanova | 42 |
    | sdesmalen | 40 |
    | jmorse | 39 |
    | lhames | 39 |
    | wenlei | 38 |
    | courbet | 38 |
    | DavidSpickett | 38 |
    | jasonmolenda | 37 |
    | tejohnson | 36 |
    | benlangmuir | 36 |
    | yaxunl | 35 |
    | hanchung | 35 |
    | tahonermann | 34 |
    | peter.smith | 34 |
    | dschuff | 33 |
    | NoQ | 33 |
    | steakhal | 33 |
    | EricWF | 32 |
    | dvyukov | 31 |
    | snehasish | 30 |
    | david-arm | 30 |
    | Chia-hungDuan | 30 |
    | rsuderman | 29 |
    | fdeazeve | 29 |
    | luke | 29 |
    | eric-k256 | 28 |
    | aemerson | 28 |
    | nickdesaulniers | 28 |
    | LuoYuanke | 27 |
    | jlebar | 26 |
    | mcgrathr | 26 |
    | nemanjai | 26 |
    | spatel | 25 |
    | barannikov88 | 25 |
    | clayborg | 24 |
    | rnk | 24 |
    | tstellar | 23 |
    | samtebbs | 23 |
    | zero9178 | 22 |
    | thieta | 22 |
    | jrtc27 | 21 |
    | skatkov | 21 |
    | lattner | 21 |
    | wangpc | 21 |
    | jingham | 21 |
    | thurston | 21 |
    | c-rhodes | 21 |
    | myhsu | 21 |
    | michaelmaitland | 21 |
    | mravishankar | 21 |
    | zixuan-wu | 21 |
    | K-Wu | 21 |
    | nlopes | 20 |
    | StephenTozer | 20 |
    | rsmith | 20 |
    | Joe_Nash | 20 |
    ...

    We have reviewers who are diligent in accepting/rejecting patches,and others who prefer to provide comments rather than changing the stateto accepted/blocked. In any case, a big thanks to all those who reviewcode as well as the contributors!



沪ICP备19023445号-2号
友情链接