<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87775>87775</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Arbitrary Constant Operands vs. 0
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:globalisel
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tschuett
</td>
</tr>
</table>
<pre>
According to the Mir pattern guide immediates can be a named constant, i.e., 0 or 1. We cannot express that an immediate is constant without committing to the value.
```
def extract_vector_element_shuffle_vector : GICombineRule<
(defs root:$root, build_fn_matchinfo:$matchinfo),
(match (G_SHUFFLE_VECTOR $src, $src1, $src2, $mask),
(G_EXTRACT_VECTOR_ELT $root, $src, $idx),
[{ return Helper.matchExtractVectorElementWithShuffleVector(${root}, ${matchinfo}); }]),
(apply [{ Helper.applyBuildFnMO(${root}, ${matchinfo}); }])>;
```
This combine can only succeed, if `$idx` is constant.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU8GOozgQ_RpzKQ0CAyE5cEjSSc9KM2qpJzuzN2TsInjX2Mguerv_foVJb3pGe1oJ4eeyefX0eCVC0FeL2LDqwKqHRMw0ON9QkMOMREnn1Fuzl9J5pe0VyAENCF-1h0kQobdwnbVC0OOISgvCAFJY6BAEWDGiAulsIGGJ8SPoFNNlzcB5yFP4gctt6wjwdfIYAtAgCIS984EO_1LA35oGNxNIN46a6IOiF2FmTFn2wLL97b3Jbk_cKuwBX8kLSe0LSnK-RYMjWmrDMPe9wVsZWLGHx9-Obuy0xefZICuOKwcAML5V2AfwzhEr9oyXEfEjdLM2qu1tOwqSg7a9W8_vW75j_J2J8W08WMBj--3z7-fzl1P7_XS8PD0D42XwciFdUX6H_AZHEf76lfCxPf1xed4fLzee9vTlAh8U_kSr1etP3wMsCagP4JFmb-Ezmgl9GkWeVt--R39Oq2s_NA3fVuPWOuNbxktWH2K7-uHWh9WHuwNLdceKAyyoevhVAN-KaTJv70puEmLtsLh7tl-f_meb4sSKw38G4zLEhMW_HbPrrHmDMEuJqGJoe1gur5ZtMviYyDRRTaF2xU4k2OR1zgueV2WdDE1e13VVotwUWY2d6vNaYVX2m7KWXG37KtENz3iZlVmV84rzOu1ELvLNRuRSbXcct6zMcBTapMa8jKnz10SHMGOzXZgTIzo0IY4t58sNVuyvxnXC6ICGcb5Ms2-Wk0_dfA2szIwOFO5spMlgs_edJi_8Gxzfp-xpQi-sCvASUsiS2ZtmIJpCzPOZ8fNV0zB3qXQj4-fYe10-Td79iZIYP0epgfFzVPtPAAAA__8iJlw1">