Search in sources :

Example 1 with TriState

use of jdk.vm.ci.meta.TriState in project graal by oracle.

the class InstanceOfNode method virtualize.

@Override
public void virtualize(VirtualizerTool tool) {
    ValueNode alias = tool.getAlias(getValue());
    TriState fold = tryFold(alias.stamp(NodeView.DEFAULT));
    if (fold != TriState.UNKNOWN) {
        tool.replaceWithValue(LogicConstantNode.forBoolean(fold.isTrue(), graph()));
    }
}
Also used : ValueNode(org.graalvm.compiler.nodes.ValueNode) TriState(jdk.vm.ci.meta.TriState)

Example 2 with TriState

use of jdk.vm.ci.meta.TriState in project graal by oracle.

the class IsNullNode method virtualize.

@Override
public void virtualize(VirtualizerTool tool) {
    ValueNode alias = tool.getAlias(getValue());
    TriState fold = tryFold(alias.stamp(NodeView.DEFAULT));
    if (fold != TriState.UNKNOWN) {
        tool.replaceWithValue(LogicConstantNode.forBoolean(fold.isTrue(), graph()));
    }
}
Also used : ValueNode(org.graalvm.compiler.nodes.ValueNode) TriState(jdk.vm.ci.meta.TriState)

Example 3 with TriState

use of jdk.vm.ci.meta.TriState in project graal by oracle.

the class LoopFragment method markFloating.

private static void markFloating(Deque<WorkListEntry> workList, Node start, NodeBitMap loopNodes, NodeBitMap nonLoopNodes) {
    if (isLoopNode(start, loopNodes, nonLoopNodes).isKnown()) {
        return;
    }
    pushWorkList(workList, start, loopNodes);
    while (!workList.isEmpty()) {
        WorkListEntry currentEntry = workList.peek();
        if (currentEntry.usages.hasNext()) {
            Node current = currentEntry.usages.next();
            TriState result = isLoopNode(current, loopNodes, nonLoopNodes);
            if (result.isKnown()) {
                if (result.toBoolean()) {
                    currentEntry.isLoopNode = true;
                }
            } else {
                pushWorkList(workList, current, loopNodes);
            }
        } else {
            workList.pop();
            boolean isLoopNode = currentEntry.isLoopNode;
            Node current = currentEntry.n;
            if (!isLoopNode && current instanceof GuardNode) {
                /*
                     * (gd) this is only OK if we are not going to make loop transforms based on
                     * this
                     */
                assert !((GuardNode) current).graph().hasValueProxies();
                isLoopNode = true;
            }
            if (isLoopNode) {
                loopNodes.mark(current);
                for (WorkListEntry e : workList) {
                    e.isLoopNode = true;
                }
            } else {
                nonLoopNodes.mark(current);
            }
        }
    }
}
Also used : GuardNode(org.graalvm.compiler.nodes.GuardNode) ValuePhiNode(org.graalvm.compiler.nodes.ValuePhiNode) GuardProxyNode(org.graalvm.compiler.nodes.GuardProxyNode) AbstractMergeNode(org.graalvm.compiler.nodes.AbstractMergeNode) MergeNode(org.graalvm.compiler.nodes.MergeNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) VirtualObjectNode(org.graalvm.compiler.nodes.virtual.VirtualObjectNode) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) ValueProxyNode(org.graalvm.compiler.nodes.ValueProxyNode) GuardPhiNode(org.graalvm.compiler.nodes.GuardPhiNode) LoopExitNode(org.graalvm.compiler.nodes.LoopExitNode) MonitorEnterNode(org.graalvm.compiler.nodes.java.MonitorEnterNode) Node(org.graalvm.compiler.graph.Node) EndNode(org.graalvm.compiler.nodes.EndNode) PhiNode(org.graalvm.compiler.nodes.PhiNode) ProxyNode(org.graalvm.compiler.nodes.ProxyNode) GuardNode(org.graalvm.compiler.nodes.GuardNode) TriState(jdk.vm.ci.meta.TriState)

Aggregations

TriState (jdk.vm.ci.meta.TriState)3 ValueNode (org.graalvm.compiler.nodes.ValueNode)3 Node (org.graalvm.compiler.graph.Node)1 AbstractBeginNode (org.graalvm.compiler.nodes.AbstractBeginNode)1 AbstractMergeNode (org.graalvm.compiler.nodes.AbstractMergeNode)1 EndNode (org.graalvm.compiler.nodes.EndNode)1 FixedNode (org.graalvm.compiler.nodes.FixedNode)1 GuardNode (org.graalvm.compiler.nodes.GuardNode)1 GuardPhiNode (org.graalvm.compiler.nodes.GuardPhiNode)1 GuardProxyNode (org.graalvm.compiler.nodes.GuardProxyNode)1 LoopExitNode (org.graalvm.compiler.nodes.LoopExitNode)1 MergeNode (org.graalvm.compiler.nodes.MergeNode)1 PhiNode (org.graalvm.compiler.nodes.PhiNode)1 ProxyNode (org.graalvm.compiler.nodes.ProxyNode)1 ValuePhiNode (org.graalvm.compiler.nodes.ValuePhiNode)1 ValueProxyNode (org.graalvm.compiler.nodes.ValueProxyNode)1 MonitorEnterNode (org.graalvm.compiler.nodes.java.MonitorEnterNode)1 CommitAllocationNode (org.graalvm.compiler.nodes.virtual.CommitAllocationNode)1 VirtualObjectNode (org.graalvm.compiler.nodes.virtual.VirtualObjectNode)1