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

    <tr>
        <th>Summary</th>
        <td>
            Execution engine - no way to obtain aggregate value
        </td>
    </tr>

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

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

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

<pre>
    In compiler of my programming language i use ExecutionEngine for tests, because it is a way faster to use it rather then compile all tests into machine code and run it.

However, ExecutionEngine has some limitations (bugs?), such limitations are painful for me. One of this limitation - lack of possibility of working with aggregate values.

I can't perform `load`/`store` operations on aggregate types (structs, vectors) because of error [_Cannot load value of type_ ...](https://github.com/llvm/llvm-project/blob/main/llvm/lib/ExecutionEngine/ExecutionEngine.cpp#L1127) .
It seems like `load/store` support is just not implemented for aggregates, even if internal structures contains data for aggregate values elements.

Also, i can't obtain value of aggregate type with `insertvalue` instruction. `insertvalue` instruction support in ExecutionEngine seems to be working. However, i can't obtain initial value for aggregate type. If i use zero value (`zeroinitializer`) i get error [_Constant unimplemented for type_ ...](https://github.com/llvm/llvm-project/blob/main/llvm/lib/ExecutionEngine/ExecutionEngine.cpp#L1011). `undef` value as initial value seems to be working. However, array aggregates are not supported [(only structs)](https://github.com/llvm/llvm-project/blob/main/llvm/lib/ExecutionEngine/ExecutionEngine.cpp#L600), initialization code of `AggregateVal` for array types is missing. And i am not sure i can use `undef` value without any consequences.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVc1u4zYQfhr6MoggUY5sHXTIbtZogALtqdfFSBpJ3FCkSo7sOk9fkFIc2wFa9NS9JDBJDb-_GaL3qjdElXj8Ih6fNzjzYF31O5o3cr4ZHL1uatueqxcDjR0npcmB7WA8w-Rs73AclelBo-ln7AkUzJ7g21_UzKys-WZ6ZQg664DJsxfyK9TUYDikGJQHh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