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
Diff Detail
Event Timeline
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. |
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. |
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.