Search in sources :

Example 1 with MoveFactory

use of org.graalvm.compiler.lir.gen.LIRGeneratorTool.MoveFactory in project graal by oracle.

the class LinearScanPhase method run.

@Override
protected void run(TargetDescription target, LIRGenerationResult lirGenRes, AllocationContext context) {
    MoveFactory spillMoveFactory = context.spillMoveFactory;
    RegisterAllocationConfig registerAllocationConfig = context.registerAllocationConfig;
    final LinearScan allocator = new SSALinearScan(target, lirGenRes, spillMoveFactory, registerAllocationConfig, lirGenRes.getLIR().linearScanOrder(), neverSpillConstants);
    allocator.allocate(target, lirGenRes, context);
}
Also used : SSALinearScan(org.graalvm.compiler.lir.alloc.lsra.ssa.SSALinearScan) RegisterAllocationConfig(org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig) SSALinearScan(org.graalvm.compiler.lir.alloc.lsra.ssa.SSALinearScan) MoveFactory(org.graalvm.compiler.lir.gen.LIRGeneratorTool.MoveFactory)

Example 2 with MoveFactory

use of org.graalvm.compiler.lir.gen.LIRGeneratorTool.MoveFactory in project graal by oracle.

the class TraceGlobalMoveResolutionPhase method resolve.

public static void resolve(TargetDescription target, LIRGenerationResult lirGenRes, TraceAllocationContext context) {
    LIR lir = lirGenRes.getLIR();
    DebugContext debug = lir.getDebug();
    debug.dump(DebugContext.VERBOSE_LEVEL, lir, "Before TraceGlobalMoveResultion");
    MoveFactory spillMoveFactory = context.spillMoveFactory;
    resolveGlobalDataFlow(context.resultTraces, lirGenRes, spillMoveFactory, target.arch, context.livenessInfo, context.registerAllocationConfig);
}
Also used : LIR(org.graalvm.compiler.lir.LIR) DebugContext(org.graalvm.compiler.debug.DebugContext) MoveFactory(org.graalvm.compiler.lir.gen.LIRGeneratorTool.MoveFactory)

Example 3 with MoveFactory

use of org.graalvm.compiler.lir.gen.LIRGeneratorTool.MoveFactory in project graal by oracle.

the class TraceRegisterAllocationPhase method run.

@Override
@SuppressWarnings("try")
protected void run(TargetDescription target, LIRGenerationResult lirGenRes, AllocationContext context) {
    MoveFactory spillMoveFactory = context.spillMoveFactory;
    RegisterAllocationConfig registerAllocationConfig = context.registerAllocationConfig;
    LIR lir = lirGenRes.getLIR();
    DebugContext debug = lir.getDebug();
    TraceBuilderResult resultTraces = context.contextLookup(TraceBuilderResult.class);
    GlobalLivenessInfo livenessInfo = context.contextLookup(GlobalLivenessInfo.class);
    assert livenessInfo != null;
    TraceAllocationContext traceContext = new TraceAllocationContext(spillMoveFactory, registerAllocationConfig, resultTraces, livenessInfo);
    AllocatableValue[] cachedStackSlots = Options.TraceRACacheStackSlots.getValue(lir.getOptions()) ? new AllocatableValue[lir.numVariables()] : null;
    // currently this is not supported
    boolean neverSpillConstant = false;
    final TraceRegisterAllocationPolicy plan = DefaultTraceRegisterAllocationPolicy.allocationPolicy(target, lirGenRes, spillMoveFactory, registerAllocationConfig, cachedStackSlots, resultTraces, neverSpillConstant, livenessInfo, lir.getOptions());
    try (DebugContext.Scope s0 = debug.scope("AllocateTraces", resultTraces, livenessInfo)) {
        for (Trace trace : resultTraces.getTraces()) {
            tracesCounter.increment(debug);
            TraceAllocationPhase<TraceAllocationContext> allocator = plan.selectStrategy(trace);
            try (Indent i = debug.logAndIndent("Allocating Trace%d: %s (%s)", trace.getId(), trace, allocator);
                DebugContext.Scope s = debug.scope("AllocateTrace", trace)) {
                allocator.apply(target, lirGenRes, trace, traceContext);
            }
        }
    } catch (Throwable e) {
        throw debug.handle(e);
    }
    TraceGlobalMoveResolutionPhase.resolve(target, lirGenRes, traceContext);
    deconstructSSAForm(lir);
}
Also used : Indent(org.graalvm.compiler.debug.Indent) DebugContext(org.graalvm.compiler.debug.DebugContext) TraceAllocationContext(org.graalvm.compiler.lir.alloc.trace.TraceAllocationPhase.TraceAllocationContext) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) Trace(org.graalvm.compiler.core.common.alloc.Trace) LIR(org.graalvm.compiler.lir.LIR) RegisterAllocationConfig(org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig) TraceBuilderResult(org.graalvm.compiler.core.common.alloc.TraceBuilderResult) MoveFactory(org.graalvm.compiler.lir.gen.LIRGeneratorTool.MoveFactory)

Aggregations

MoveFactory (org.graalvm.compiler.lir.gen.LIRGeneratorTool.MoveFactory)3 RegisterAllocationConfig (org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig)2 DebugContext (org.graalvm.compiler.debug.DebugContext)2 LIR (org.graalvm.compiler.lir.LIR)2 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)1 Trace (org.graalvm.compiler.core.common.alloc.Trace)1 TraceBuilderResult (org.graalvm.compiler.core.common.alloc.TraceBuilderResult)1 Indent (org.graalvm.compiler.debug.Indent)1 SSALinearScan (org.graalvm.compiler.lir.alloc.lsra.ssa.SSALinearScan)1 TraceAllocationContext (org.graalvm.compiler.lir.alloc.trace.TraceAllocationPhase.TraceAllocationContext)1