Skip to content

Commit

Permalink
Add AlwaysMergeDMB option
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaiwei committed Jan 24, 2024
1 parent e4081bc commit 056c185
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/hotspot/cpu/aarch64/globals_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ define_pd_global(intx, InlineSmallCode, 1000);
range(1, 99) \
product(ccstr, UseBranchProtection, "none", \
"Branch Protection to use: none, standard, pac-ret") \
product(bool, AlwaysMergeDMB, false, \
"Always merge DMB instructions in code emission") \

// end of ARCH_FLAGS

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2067,9 +2067,9 @@ void MacroAssembler::membar(Membar_mask_bits order_constraint) {
if (last != nullptr && nativeInstruction_at(last)->is_Membar() && prev == last) {
NativeMembar *bar = NativeMembar_at(prev);
// Don't promote DMB ST|DMB LD to DMB (a full barrier) because
// doing so would introduce a StoreLoad which the caller did not
// doing so would introduce a StoreLoad which the caller did not
// intend
if (bar->get_kind() == order_constraint
if (AlwaysMergeDMB || bar->get_kind() == order_constraint
|| bar->get_kind() == AnyAny
|| order_constraint == AnyAny) {
// We are merging two memory barrier instructions. On AArch64 we
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ void VM_Version::initialize() {
if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) {
FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true);
}
if (FLAG_IS_DEFAULT(AlwaysMergeDMB)) {
FLAG_SET_DEFAULT(AlwaysMergeDMB, true);
}
}

// Cortex A53
Expand Down

0 comments on commit 056c185

Please sign in to comment.