<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/143140>143140</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[X86] lowerBuildVectorAsBroadcast - remove constant handling
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:X86
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
RKSimon
</td>
</tr>
</table>
<pre>
Prematurely converting uniform constants to constant pool VBROADCAST_LOAD nodes can prevent further optimizations, but also results in codegen problems such as immediately spilling broadcasted constants (#30679).
X86FixupVectorConstants can handle converting constant loads to broadcasts and other datasize saving formats, including if they are load-folded into a AVX512 instruction.
But without lowerBuildVectorAsBroadcast we are missing OptSize handling - we need some way to unfold constant pool loads that X86FixupVectorConstants would be able to handle if it would reduce total data/code size - this could possibly be performed by MachineLICM which already does similar unfolds.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8k8-O2zYQxp-GvgxsSJQtWQcd7F0YKJpgi2yxyK2gxLE1LUUKnKFd5-kLqs5mUaA5CSLnz_f7hmOY6eIRO7U7qt3zyiQZQ-y-_PpKU_CrPth791vEyUiK6O4wBH_FKOQvkDydQ5zyEYvxwiDh_QfmEBy8Hb-8HJ6fDq-___Hp5fAMPlhkGIyHOeIVvcA5RRkxQpiFJvpmhIJnpZ-gTwLGcYCInJwwkIchWLxgTg69w4mB0zCCYaBpQktGskKeybmsr4_B2MGwoP2gUem90lVV1E2rdLtRxUEVh6_7-kR_p_kNBwnx6T04Kx2Ntw4_gr8zumDsQv3eisF4C2FBskYM0zcENtecls0yssCRH1yy-ZDOICPewURcyq3PwVm0QF4CGDi8fd2VGsizxDRkcx6Kj0ngRjKGlGXcMB4TOfuv_gMfv-uBGy6lJ2LO7V5mec2SFqh8sM4RHtEChwnhZu6ZJ_ks4z_DfNCORuD__LqF5Cz0CKZ3mAs9zKMzkDxuI9o05EsxbvFI6VMeLCxerUFGYhiW0DkwU-_uueKMMRuIFvo7fDbDSB4__fL0GW4j5UfgIhp7BxuQgWkiZ-IDgzcr21W2rVqzwq5stq0uG13sV2PXtKWtinpf9_uy3tdtj7jd73a2bM6t3p5xRZ0u9K6oi7qstkXRbOqyKM32XJmibRocGrUtcDLkNs5dp02IlxUxJ-zKbVVui5UzPTpelkvr3gx_obeqyu9NaZ33LXY5cd2nC6tt4YiFf5QSErdsZo7fPf900GuIOIUr_hja9xmvUnTdKDKzqg5Kn5Q-XUjG1G-GMCl9yu0en_Ucw584iNKnBYOVPj1Irp3-JwAA___0LXQ1">