<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/92190>92190</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] avoid padding for struct type
</td>
</tr>
<tr>
<th>Labels</th>
<td>
HLSL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
python3kgae
</td>
</tr>
</table>
<pre>
Compile with
clang.exe -cc1 -triple dxil-unknown-shadermodel6.3-library -emit-llvm -disable-llvm-passes -fnative-half-type -finclude-default-header -o - -x hlsl
```
struct S0
{
double2 B5;
float B6;
half3 B7;
half3 B8;
};
S0 s;
float foo() {
return s.B7.y;
}
```
will get type %struct.S0 = type <{ <2 x double>, float, [4 x i8], <3 x half>, <3 x half>, [8 x i8] }>.
The expected type should be <{ <2 x double>, float, [4 x i8], <3 x half>, <3 x half> }> without the [8 x i8] padding.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0k8FuozwUhZ_GbK6MiB2DWbAoSaN_0V3-FzD4Ap46GGHTkrcf4dBpO-p2JGT7HuGj71j3Ku9NPyJWRNREnBO1hMHN1XQPgxv5a68waZy-Vyd3m4xFeDdhAJKdSfbUWjX2Ka4ItG0PQMNsJougV2PpMr6O7n2kflAa55vTaPOUU2uaWc13oHgzgVr7dgOqjVeNxVjRSXmPHmg3qmDekA7KdjTcJwTambG1i0aqsVOLDXTAzRuoAwp0hcF6-wDb1zzbv1j6MC9tgOtekqJ-HAAAtFsaiwxqQfgXubNOBajzb-JGxKEufhLlH5EU589zXK8Z-L-kh3_nHGGSsBK-MM0YlnkEn9ZFev_m-lO2d2Mt9BggvhRh4hE2vWZA-HlX-YkU9bYxWPfEhD8Tdnrk3A5E1EdYwUgizrHmJw5rTLf_-oMiavlxB2Ls5_RryP8HBFwnbAPqB4kf3GI1NP-GaWeIjeqWAGHA74yT0tqM_Q6Z6IrrkpcqwepQHETBclHwZKi0LCVmjHdtyVC3eSZLpbRmUkqZl6xJTMUydszE4cjYkQme5uKgZCcPXEjVaJmRY4Y3ZWy6dXbq5j4x3i9YlexQZolVDVofx46x_16uL4SxbQDnKg5Cs_SeHDNrfPCfBsEEG0c1XhBnUG_O6I9I0LkZ9j7fXjpZZlsNIUye8CfCLoRdehOGpUlbdyPsstnuG51m9wvbQNglQnrCLpHzdwAAAP__83EyGA">