8249165: Remove unneeded nops introduced by 8234160 changes
Check for branch instruction at the end of code block Reviewed-by: vlivanov
This commit is contained in:
parent
7436ef236e
commit
c4f835b3a7
@ -45,11 +45,11 @@ bool IntelJccErratum::is_crossing_or_ending_at_32_byte_boundary(uintptr_t start_
|
|||||||
return boundary(start_pc) != boundary(end_pc);
|
return boundary(start_pc) != boundary(end_pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IntelJccErratum::is_jcc_erratum_branch(const Block* block, const MachNode* node, uint node_index) {
|
bool IntelJccErratum::is_jcc_erratum_branch(const MachNode* node) {
|
||||||
if (node->is_MachCall() && !node->is_MachCallJava()) {
|
if (node->is_MachCall() && !node->is_MachCallJava()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return node_index == (block->number_of_nodes() - 1);
|
return node->is_MachBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
int IntelJccErratum::jcc_erratum_taint_node(MachNode* node, PhaseRegAlloc* regalloc) {
|
int IntelJccErratum::jcc_erratum_taint_node(MachNode* node, PhaseRegAlloc* regalloc) {
|
||||||
@ -70,7 +70,7 @@ int IntelJccErratum::tag_affected_machnodes(Compile* C, PhaseCFG* cfg, PhaseRegA
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
MachNode* m = node->as_Mach();
|
MachNode* m = node->as_Mach();
|
||||||
if (is_jcc_erratum_branch(block, m, j)) {
|
if (is_jcc_erratum_branch(m)) {
|
||||||
// Found a root jcc erratum branch, flag it as problematic
|
// Found a root jcc erratum branch, flag it as problematic
|
||||||
nop_size += jcc_erratum_taint_node(m, regalloc);
|
nop_size += jcc_erratum_taint_node(m, regalloc);
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static bool is_crossing_or_ending_at_32_byte_boundary(uintptr_t start_pc, uintptr_t end_pc);
|
static bool is_crossing_or_ending_at_32_byte_boundary(uintptr_t start_pc, uintptr_t end_pc);
|
||||||
static bool is_jcc_erratum_branch(const Block* block, const MachNode* node, uint node_index);
|
static bool is_jcc_erratum_branch(const MachNode* node);
|
||||||
// Analyze JCC erratum branches. Affected nodes get tagged with Flag_intel_jcc_erratum.
|
// Analyze JCC erratum branches. Affected nodes get tagged with Flag_intel_jcc_erratum.
|
||||||
// The function returns a conservative estimate of all required nops on all mach nodes.
|
// The function returns a conservative estimate of all required nops on all mach nodes.
|
||||||
static int tag_affected_machnodes(Compile* C, PhaseCFG* cfg, PhaseRegAlloc* regalloc);
|
static int tag_affected_machnodes(Compile* C, PhaseCFG* cfg, PhaseRegAlloc* regalloc);
|
||||||
|
@ -1188,10 +1188,7 @@ void PhaseOutput::pd_perform_mach_node_analysis() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int MachNode::pd_alignment_required() const {
|
int MachNode::pd_alignment_required() const {
|
||||||
PhaseOutput* output = Compile::current()->output();
|
if (VM_Version::has_intel_jcc_erratum() && IntelJccErratum::is_jcc_erratum_branch(this)) {
|
||||||
Block* block = output->block();
|
|
||||||
int index = output->index();
|
|
||||||
if (VM_Version::has_intel_jcc_erratum() && IntelJccErratum::is_jcc_erratum_branch(block, this, index)) {
|
|
||||||
// Conservatively add worst case padding. We assume that relocInfo::addr_unit() is 1 on x86.
|
// Conservatively add worst case padding. We assume that relocInfo::addr_unit() is 1 on x86.
|
||||||
return IntelJccErratum::largest_jcc_size() + 1;
|
return IntelJccErratum::largest_jcc_size() + 1;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user