<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59652>59652</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLVM IR: struct alignment is wrong
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jitao21432060
      </td>
    </tr>
</table>

<pre>
    I'm new to llvm framework and using llvm to generate jit code. But the code generated about struct is a bit problematic:
```
source_filename = "test1"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-macosx12.0.0"

%Coordinate = type { i32, i32 }

define i32 @main() {
entry:
  %0 = call %Coordinate @PSnative_create_coordinate(i32 5, i32 6)
  %coordinate1 = alloca %Coordinate, align 8
  ...
```


I think the struct alignment of alloc should be 4, but here is 8.

Thanks。


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU9GOozgQ_Brz0goyDSbwwENmc5FG2pNOt6d7HRnogGeMHdnNzs3fn0yy2ezcSQjLrq6qVrusYzSTI-qEehLqmOmVZx-6V8PaY1GVKGuZ9X786J4F7hdw9A7swdrvC5yDXujdhzfQboQ1GjddAfYwkaOgmeDVMAx-pByeVgaeadvd8RF071eGyGEdGEwEDb1huATfW1o0m0GUByGPQh5ELW_fto1-DQO9nI0lpxcCUR5BIDJFLgTitYh1mIhh1Kyt_khOtzLaLaI8-J2pK1Ee6mpnCmxEeSiw2bkSr2ff0tknKQ7mYu9uOix1tdOXi6Xdogcf_ykwl7m8s25_VF-8D6NxaSaJyx8XArF_AlOiwC9pAbE_PpJGOhtHV6SSizZOpHbaRLtWkOPwcZ8PgEAlN_VBWwufTCv5xzen2XynlyGQZnoZ7qjAJtmoH53UAtsH0Z-FxSavrfWD_tUgUbU1k4PmBzPP8_-9ucf_M_Bs3NuWjFsINpWFHIM_X60gzn61I_QEVfLpV4aZAqW8NPmj3F-zdm9R_FaKRormlzvIxq4c27LVGXVFvS_qRrUlZnN3rqq-knvVKqVabFFpNbZNux9rhe25GTPToUQsEFGqAgvMi1pTVatGq31fq2EUlaRFG5un-Oc-TJmJcaVOtbXCzOqebNxeGGJ6QBuYEqKOWegSZ9evUxSVtCZy_KnChi11X7_-_Ts8_ynKw38nZCK8B--mbA22m5kvMcUBTwJPk-F57fPBLwJPSfK27C7Bv9LAAk9bI1HgaWv03wAAAP__0yY0NQ">