How to reliably pin a node in CFG?
Vladimir Kozlov
Vladimir.Kozlov at oracle.com
Thu Nov 15 12:24:27 PST 2012
PhaseIdealLoop::dominated_by() and IfNode::dominated_by() are correct in
general case. The problem is value of depends_only_on_test(). This load
is from RAW memory and we should not hoist it. See comment in LoadPNode
class declaration. So we can widen the case to all loads - we have to
confirm this with John.
An other simple way to fix it is to add membar before load since it is
volatile field:
insert_mem_bar(Op_MemBarCPUOrder);
Vladimir K.
On 11/15/12 07:57, Vladimir Ivanov wrote:
> Hi,
>
> I'm looking at 8003135 [1] and the problem is that during null check
> (#132) hoisting, the load (#172) is also hoisted [2] [3]. LoadI node is
> constructed in LibraryCallKit::inline_native_isInterrupted
> and is pinned to IfTrue projection (#133) of #132, but it doesn't help.
>
> I'm not sure how to avoid the hoisting of the load.
>
> Should the load be pinned to corresponding Region/Loop node instead of
> If node?
>
> Is the logic in PhaseIdealLoop::dominated_by which updates
> control-dependent nodes (:242-:255)is correct?
>
> Best regards,
> Vladimir Ivanov
>
> [1] https://jbs.oracle.com/bugs/browse/JDK-8003135
> "HotSpot inlines and hoists the Thread.currentThread().isInterrupted()
> out of the loop"
>
> [2]
> http://cr.openjdk.java.net/~vlivanov/8003135/graphs/loop_invariant_hoisting_132_before.png
>
>
> [3]
> http://cr.openjdk.java.net/~vlivanov/8003135/graphs/loop_invariant_hoisting_132_after.png
>
More information about the hotspot-compiler-dev
mailing list