This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] More bits for calling convention
AcceptedPublic

Authored by Xinglong on Aug 5 2021, 2:47 AM.

Details

Reviewers
rjmccall
rsmith
Summary

According to https://reveiws.llvm.org/D13826, bitcode use 10 bits to represent calling convention ID, but for clang codegen, we only have 8 bits. so if we use a calling convention ID greater than 255, clang will truncate it, and bitcode will get an error calling convention ID. Single 32-bit unit is broken, so here we use 16 bits.

Diff Detail

Event Timeline

Xinglong requested review of this revision.Aug 5 2021, 2:47 AM
Xinglong created this revision.
rjmccall added inline comments.Aug 23 2021, 8:44 PM
clang/include/clang/CodeGen/CGFunctionInfo.h
562

At some point, these bit-fields fit into a single 32-bit unit. There's currently 33 bits, so that hasn't been true for a while, and we might as well make all three of these fields 16 bits.

It doesn't look like there's a good opportunity to pack the struct because we're at an odd number of 32-bit chunks overall, so that'll do for now.

Xinglong updated this revision to Diff 370177.Sep 2 2021, 12:47 AM
Xinglong retitled this revision from [CodeGen] Align calling convention bit-width to bitcode to [CodeGen] More bits for calling convention.
Xinglong edited the summary of this revision. (Show Details)

Some patch broken the single 32-bit unit, so here use 16 bits is better.

Xinglong marked an inline comment as done.Sep 2 2021, 12:51 AM
Xinglong added inline comments.
clang/include/clang/CodeGen/CGFunctionInfo.h
562

Yes, 32-bit unit is broken, here use 16 bits is better and llvm backend need a patch to align to 16 bits.

Xinglong updated this revision to Diff 370185.Sep 2 2021, 1:17 AM
Xinglong marked an inline comment as done.

rebase

This revision is now accepted and ready to land.Sep 2 2021, 11:13 AM
rudkx removed a reviewer: rudkx.Nov 11 2022, 12:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2022, 12:14 PM