Skip to content

Commit

Permalink
8298189: Regression in SPECjvm2008-MonteCarlo for pre-Cascade Lake In…
Browse files Browse the repository at this point in the history
…tel processors

Co-authored-by: Quan Anh Mai <qamai@openjdk.org>
Reviewed-by: shade, thartmann, kvn
  • Loading branch information
robcasloz and Quan Anh Mai committed Apr 26, 2023
1 parent 44d9f55 commit 8d89992
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/hotspot/cpu/x86/vm_version_x86.cpp
Expand Up @@ -2079,11 +2079,14 @@ bool VM_Version::is_default_intel_cascade_lake() {
return FLAG_IS_DEFAULT(UseAVX) &&
FLAG_IS_DEFAULT(MaxVectorSize) &&
UseAVX > 2 &&
is_intel_skylake() &&
_stepping >= 5;
is_intel_cascade_lake();
}
#endif

bool VM_Version::is_intel_cascade_lake() {
return is_intel_skylake() && _stepping >= 5;
}

// avx3_threshold() sets the threshold at which 64-byte instructions are used
// for implementing the array copy and clear operations.
// The Intel platforms that supports the serialize instruction
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/cpu/x86/vm_version_x86.hpp
Expand Up @@ -716,6 +716,8 @@ class VM_Version : public Abstract_VM_Version {
static bool is_default_intel_cascade_lake();
#endif

static bool is_intel_cascade_lake();

static int avx3_threshold();

static bool is_intel_tsc_synched_at_init();
Expand Down
19 changes: 15 additions & 4 deletions src/hotspot/cpu/x86/x86_64.ad
Expand Up @@ -13732,6 +13732,13 @@ instruct leaL_rReg_immI2_peep(rRegL dst, rRegL src, immI2 shift)
ins_pipe(ialu_reg_reg);
%}

// These peephole rules replace mov + I pairs (where I is one of {add, inc, dec,
// sal}) with lea instructions. The {add, sal} rules are beneficial in
// processors with at least partial ALU support for lea
// (supports_fast_2op_lea()), whereas the {inc, dec} rules are only generally
// beneficial for processors with full ALU support
// (VM_Version::supports_fast_3op_lea()) and Intel Cascade Lake.

peephole
%{
peeppredicate(VM_Version::supports_fast_2op_lea());
Expand All @@ -13750,15 +13757,17 @@ peephole

peephole
%{
peeppredicate(VM_Version::supports_fast_2op_lea());
peeppredicate(VM_Version::supports_fast_3op_lea() ||
VM_Version::is_intel_cascade_lake());
peepmatch (incI_rReg);
peepprocedure (lea_coalesce_imm);
peepreplace (leaI_rReg_immI_peep());
%}

peephole
%{
peeppredicate(VM_Version::supports_fast_2op_lea());
peeppredicate(VM_Version::supports_fast_3op_lea() ||
VM_Version::is_intel_cascade_lake());
peepmatch (decI_rReg);
peepprocedure (lea_coalesce_imm);
peepreplace (leaI_rReg_immI_peep());
Expand Down Expand Up @@ -13790,15 +13799,17 @@ peephole

peephole
%{
peeppredicate(VM_Version::supports_fast_2op_lea());
peeppredicate(VM_Version::supports_fast_3op_lea() ||
VM_Version::is_intel_cascade_lake());
peepmatch (incL_rReg);
peepprocedure (lea_coalesce_imm);
peepreplace (leaL_rReg_immL32_peep());
%}

peephole
%{
peeppredicate(VM_Version::supports_fast_2op_lea());
peeppredicate(VM_Version::supports_fast_3op_lea() ||
VM_Version::is_intel_cascade_lake());
peepmatch (decL_rReg);
peepprocedure (lea_coalesce_imm);
peepreplace (leaL_rReg_immL32_peep());
Expand Down

1 comment on commit 8d89992

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.