Skip to content

Commit c4792a2

Browse files
authored
JIT: don't create vector constants from relocatable constants (#107491)
We can't represent relocations in data currently. Fixes #107396.
1 parent 5c4686f commit c4792a2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/coreclr/jit/lower.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8962,12 +8962,22 @@ void Lowering::LowerStoreIndirCoalescing(GenTreeIndir* ind)
89628962
assert(prevData.IsStore());
89638963
assert(currData.IsStore());
89648964

8965-
// For now, only constants are supported for data.
8965+
// For now, only non-relocatable constants are supported for data.
89668966
if (!prevData.value->OperIsConst() || !currData.value->OperIsConst())
89678967
{
89688968
return;
89698969
}
89708970

8971+
if (prevData.value->IsCnsIntOrI() && prevData.value->AsIntCon()->ImmedValNeedsReloc(comp))
8972+
{
8973+
return;
8974+
}
8975+
8976+
if (currData.value->IsCnsIntOrI() && currData.value->AsIntCon()->ImmedValNeedsReloc(comp))
8977+
{
8978+
return;
8979+
}
8980+
89718981
// Otherwise, the difference between two offsets has to match the size of the type.
89728982
// We don't support overlapping stores.
89738983
if (abs(prevData.offset - currData.offset) != (int)genTypeSize(prevData.targetType))

0 commit comments

Comments
 (0)