Skip to content

Commit

Permalink
JIT: don't create vector constants from relocatable constants (#107491)
Browse files Browse the repository at this point in the history
We can't represent relocations in data currently.

Fixes #107396.
  • Loading branch information
AndyAyersMS authored Sep 7, 2024
1 parent 5c4686f commit c4792a2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8962,12 +8962,22 @@ void Lowering::LowerStoreIndirCoalescing(GenTreeIndir* ind)
assert(prevData.IsStore());
assert(currData.IsStore());

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

if (prevData.value->IsCnsIntOrI() && prevData.value->AsIntCon()->ImmedValNeedsReloc(comp))
{
return;
}

if (currData.value->IsCnsIntOrI() && currData.value->AsIntCon()->ImmedValNeedsReloc(comp))
{
return;
}

// Otherwise, the difference between two offsets has to match the size of the type.
// We don't support overlapping stores.
if (abs(prevData.offset - currData.offset) != (int)genTypeSize(prevData.targetType))
Expand Down

0 comments on commit c4792a2

Please sign in to comment.