diff --git a/src/hotspot/cpu/x86/peephole_x86_64.cpp b/src/hotspot/cpu/x86/peephole_x86_64.cpp index 5fc39e163e1..9dccea8515e 100644 --- a/src/hotspot/cpu/x86/peephole_x86_64.cpp +++ b/src/hotspot/cpu/x86/peephole_x86_64.cpp @@ -25,6 +25,7 @@ #ifdef COMPILER2 #include "opto/addnode.hpp" +#include "opto/compile.hpp" #include "peephole_x86_64.hpp" #include "adfiles/ad_x86.hpp" @@ -343,10 +344,15 @@ bool Peephole::lea_remove_redundant(Block* block, int block_index, PhaseCFG* cfg cfg_->map_node_to_block(proj, nullptr); // Rewire the base of all leas currently depending on the decode we are removing. + // Use top() rather than a real value: leaP* emission does not consult Base, and the + // unused MachProj of decode confirms the derived oops produced by these leaP*s are + // not consumed by any OopMap. Avoiding a real input here also avoids creating a + // register conflict that would later be flagged by verify_good_schedule. + Node* top = Compile::current()->top(); for (DUIterator_Fast imax, i = decode->fast_outs(imax); i < imax; i++) { Node* dependant_lea = decode->fast_out(i); if (dependant_lea->is_Mach() && dependant_lea->as_Mach()->ideal_Opcode() == Op_AddP) { - dependant_lea->set_req(AddPNode::Base, lea_derived_oop->in(AddPNode::Address)); + dependant_lea->set_req(AddPNode::Base, top); // This deleted something in the out array, hence adjust i, imax. --i; --imax;