Search in sources :

Example 16 with LIR

use of org.graalvm.compiler.lir.LIR in project graal by oracle.

the class TraceGlobalMoveResolutionPhase method resolveGlobalDataFlow.

@SuppressWarnings("try")
private static void resolveGlobalDataFlow(TraceBuilderResult resultTraces, LIRGenerationResult lirGenRes, MoveFactory spillMoveFactory, Architecture arch, GlobalLivenessInfo livenessInfo, RegisterAllocationConfig registerAllocationConfig) {
    LIR lir = lirGenRes.getLIR();
    /* Resolve trace global data-flow mismatch. */
    TraceGlobalMoveResolver moveResolver = new TraceGlobalMoveResolver(lirGenRes, spillMoveFactory, registerAllocationConfig, arch);
    DebugContext debug = lir.getDebug();
    try (Indent indent = debug.logAndIndent("Trace global move resolution")) {
        for (Trace trace : resultTraces.getTraces()) {
            resolveTrace(resultTraces, livenessInfo, lir, moveResolver, trace);
        }
    }
}
Also used : Trace(org.graalvm.compiler.core.common.alloc.Trace) Indent(org.graalvm.compiler.debug.Indent) LIR(org.graalvm.compiler.lir.LIR) DebugContext(org.graalvm.compiler.debug.DebugContext)

Example 17 with LIR

use of org.graalvm.compiler.lir.LIR in project graal by oracle.

the class SaveCalleeSaveRegisters method run.

@Override
protected void run(TargetDescription target, LIRGenerationResult lirGenRes, PreAllocationOptimizationContext context) {
    RegisterArray calleeSaveRegisters = lirGenRes.getRegisterConfig().getCalleeSaveRegisters();
    if (calleeSaveRegisters == null || calleeSaveRegisters.size() == 0) {
        return;
    }
    LIR lir = lirGenRes.getLIR();
    RegisterMap<Variable> savedRegisters = saveAtEntry(lir, context.lirGen, lirGenRes, calleeSaveRegisters, target.arch);
    for (AbstractBlockBase<?> block : lir.codeEmittingOrder()) {
        if (block == null) {
            continue;
        }
        if (block.getSuccessorCount() == 0) {
            restoreAtExit(lir, context.lirGen.getSpillMoveFactory(), lirGenRes, savedRegisters, block);
        }
    }
}
Also used : Variable(org.graalvm.compiler.lir.Variable) LIR(org.graalvm.compiler.lir.LIR) RegisterArray(jdk.vm.ci.code.RegisterArray)

Example 18 with LIR

use of org.graalvm.compiler.lir.LIR in project graal by oracle.

the class StackMoveOptimizationPhase method run.

@Override
protected void run(TargetDescription target, LIRGenerationResult lirGenRes, PostAllocationOptimizationContext context) {
    LIR lir = lirGenRes.getLIR();
    DebugContext debug = lir.getDebug();
    for (AbstractBlockBase<?> block : lir.getControlFlowGraph().getBlocks()) {
        ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(block);
        new Closure().process(debug, instructions);
    }
}
Also used : LIR(org.graalvm.compiler.lir.LIR) LIRInstruction(org.graalvm.compiler.lir.LIRInstruction) DebugContext(org.graalvm.compiler.debug.DebugContext)

Example 19 with LIR

use of org.graalvm.compiler.lir.LIR in project graal by oracle.

the class SPARCLIRGenerator method beforeRegisterAllocation.

@Override
public void beforeRegisterAllocation() {
    LIR lir = getResult().getLIR();
    loadConstantTableBaseOp.setAlive(lir, constantTableBaseProvider.useConstantTableBase);
}
Also used : LIR(org.graalvm.compiler.lir.LIR)

Example 20 with LIR

use of org.graalvm.compiler.lir.LIR in project graal by oracle.

the class TrivialTraceAllocator method run.

@Override
protected void run(TargetDescription target, LIRGenerationResult lirGenRes, Trace trace, TraceAllocationContext context) {
    LIR lir = lirGenRes.getLIR();
    assert isTrivialTrace(lir, trace) : "Not a trivial trace! " + trace;
    AbstractBlockBase<?> block = trace.getBlocks()[0];
    assert TraceAssertions.singleHeadPredecessor(trace) : "Trace head with more than one predecessor?!" + trace;
    AbstractBlockBase<?> pred = block.getPredecessors()[0];
    GlobalLivenessInfo livenessInfo = context.livenessInfo;
    allocate(block, pred, livenessInfo, SSAUtil.phiOutOrNull(lir, block));
}
Also used : LIR(org.graalvm.compiler.lir.LIR)

Aggregations

LIR (org.graalvm.compiler.lir.LIR)22 DebugContext (org.graalvm.compiler.debug.DebugContext)11 LIRInstruction (org.graalvm.compiler.lir.LIRInstruction)6 Assembler (org.graalvm.compiler.asm.Assembler)4 Trace (org.graalvm.compiler.core.common.alloc.Trace)4 HotSpotLIRGenerationResult (org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult)4 Stub (org.graalvm.compiler.hotspot.stubs.Stub)4 CompilationResultBuilder (org.graalvm.compiler.lir.asm.CompilationResultBuilder)4 DataBuilder (org.graalvm.compiler.lir.asm.DataBuilder)4 OptionValues (org.graalvm.compiler.options.OptionValues)4 Register (jdk.vm.ci.code.Register)3 StackSlot (jdk.vm.ci.code.StackSlot)3 ValueUtil.asRegister (jdk.vm.ci.code.ValueUtil.asRegister)3 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)3 TraceBuilderResult (org.graalvm.compiler.core.common.alloc.TraceBuilderResult)3 AbstractBlockBase (org.graalvm.compiler.core.common.cfg.AbstractBlockBase)3 HotSpotDataBuilder (org.graalvm.compiler.hotspot.HotSpotDataBuilder)3 AMD64MacroAssembler (org.graalvm.compiler.asm.amd64.AMD64MacroAssembler)2 Indent (org.graalvm.compiler.debug.Indent)2 FrameMapBuilder (org.graalvm.compiler.lir.framemap.FrameMapBuilder)2