Skip to content

Commit

Permalink
JIT: Fix invalid memory barrier removal optimization
Browse files Browse the repository at this point in the history
The ARM32/ARM64 backends have an optimization where they optimize out
the latter of two subsequent memory barriers if no memory store/load has
been seen between them. This optimization should not be allowed to
remove memory barriers when a call has been seen.

Fix dotnet#91732
  • Loading branch information
jakobbotsch committed Sep 8, 2023
1 parent e0a8170 commit a79d111
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/coreclr/jit/emitarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4848,6 +4848,7 @@ void emitter::emitIns_Call(EmitCallType callType,

dispIns(id);
appendToCurIG(id);
emitLastMemBarrier = nullptr; // Cannot optimize away future memory barriers
}

/*****************************************************************************
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/emitarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8908,6 +8908,7 @@ void emitter::emitIns_Call(EmitCallType callType,

dispIns(id);
appendToCurIG(id);
emitLastMemBarrier = nullptr; // Cannot optimize away future memory barriers
}

/*****************************************************************************
Expand Down

0 comments on commit a79d111

Please sign in to comment.