8282555: Missing memory edge when spilling MoveF2I, MoveD2L etc

Reviewed-by: kvn, thartmann, jbhateja
This commit is contained in:
Emanuel Peter 2022-05-05 08:15:53 +00:00 committed by Tobias Hartmann
parent 1bb4de2e28
commit 4a5e7a1ada
2 changed files with 23 additions and 0 deletions
src/hotspot/share/opto
test/hotspot/jtreg/compiler/intrinsics/unsafe

@ -1727,6 +1727,14 @@ void PhaseChaitin::fixup_spills() {
if( cisc->oper_input_base() > 1 && mach->oper_input_base() <= 1 ) {
assert( cisc->oper_input_base() == 2, "Only adding one edge");
cisc->ins_req(1,src); // Requires a memory edge
} else {
// There is no space reserved for a memory edge before the inputs for
// instructions which have "stackSlotX" parameter instead of "memory".
// For example, "MoveF2I_stack_reg". We always need a memory edge from
// src to cisc, else we might schedule cisc before src, loading from a
// spill location before storing the spill.
assert(cisc->memory_operand() == nullptr, "no memory operand, only stack");
cisc->add_prec(src);
}
block->map_node(cisc, j); // Insert into basic block
n->subsume_by(cisc, C); // Correct graph

@ -35,6 +35,21 @@
* HeapByteBufferTest
*/
/**
* @test
* @bug 8282555
* @summary intermittent, check that spilling MoveF2I etc produce memory edge
* @modules java.base/jdk.internal.misc
* @library /test/lib
*
* @run main/othervm -Djdk.test.lib.random.seed=42
* -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+OptoScheduling
* HeapByteBufferTest
* @run main/othervm
* -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+OptoScheduling
* HeapByteBufferTest
*/
public class HeapByteBufferTest extends ByteBufferTest {
public HeapByteBufferTest(long iterations, boolean direct) {