From 0c1b254be9ddd3883313f80b61229eacf09aa862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lund=C3=A9n?= Date: Mon, 25 Mar 2024 12:04:44 +0000 Subject: [PATCH] 8326438: C2: assert(ld->in(1)->Opcode() == Op_LoadN) failed: Assumption invalid: input to DecodeN is not LoadN Reviewed-by: kvn, rcastanedalo, thartmann --- src/hotspot/share/opto/graphKit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/opto/graphKit.cpp b/src/hotspot/share/opto/graphKit.cpp index 0c35b2145aa..65d3a1e011a 100644 --- a/src/hotspot/share/opto/graphKit.cpp +++ b/src/hotspot/share/opto/graphKit.cpp @@ -1563,8 +1563,10 @@ Node* GraphKit::make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, // Improve graph before escape analysis and boxing elimination. record_for_igvn(ld); if (ld->is_DecodeN()) { - // Also record the actual load (LoadN) in case ld is DecodeN - assert(ld->in(1)->Opcode() == Op_LoadN, "Assumption invalid: input to DecodeN is not LoadN"); + // Also record the actual load (LoadN) in case ld is DecodeN. In some + // rare corner cases, ld->in(1) can be something other than LoadN (e.g., + // a Phi). Recording such cases is still perfectly sound, but may be + // unnecessary and result in some minor IGVN overhead. record_for_igvn(ld->in(1)); } }