Closed
Description
static unsafe void CndSelectEmbeddedOp3LoadTrueMask(int[] array, Vector<int> op1)
{
fixed (int* arr_ptr = array)
{
var result = Sve.ConditionalSelect(Sve.CreateTrueMaskInt32(), op1, Sve.LoadVectorNonFaulting(arr_ptr));
Consume(result);
}
}
Assert failure(PID 1322427 [0x00142dbb], Thread: 1322427 [0x142dbb]): Assertion failed '!node->IsEmbMaskOp()' in 'EmbeddedLoads:CndSelectEmbeddedOp3LoadTrueMask(int[],System.Numerics.Vector`1[int])' during 'Generate code' (IL size 51; hash 0xedf2dbdb; FullOpts)
File: /mnt/sdb/home/alahay01/dotnet/runtime_table/src/coreclr/jit/hwintrinsiccodegenarm64.cpp:1093
Image: /mnt/sdb/home/alahay01/dotnet/runtime_table/artifacts/tests/coreclr/linux.arm64.Checked/Tests/Core_Root/corerun
This is because LIR optimises ConditionalSelect(True, x, EmbeddedConditionalSelect(True, Load(), 0))
to x
. Later the EmbeddedConditionalSelect()
is removed as unused. However, the Load()
is kept because it's a load/store.
The Load()
fails to codegen becuase it is not inside an EmbeddedConditionalSelect()
There are similar tests in HWIntrinsics, but they use Vector<int>.AllBitsSet
instead of truemask, and so the optimisation in lowering never happens