001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.jikesrvm.compilers.opt.hir2lir;
014    
015    import org.jikesrvm.compilers.opt.depgraph.DepGraphStats;
016    import org.jikesrvm.compilers.opt.driver.CompilerPhase;
017    import org.jikesrvm.compilers.opt.ir.IR;
018    import org.jikesrvm.compilers.opt.ir.LIRInfo;
019    
020    /**
021     * Convert an IR object from HIR to LIR
022     */
023    public final class ConvertHIRtoLIR extends CompilerPhase {
024    
025      public String getName() {
026        return "HIR Operator Expansion";
027      }
028    
029      public CompilerPhase newExecution(IR ir) {
030        return this;
031      }
032    
033      public void perform(IR ir) {
034        if (IR.SANITY_CHECK) {
035          ir.verify("before conversion to LIR", true);
036        }
037        if (ir.options.PRINT_STATIC_STATS) {
038          // Print summary statistics (critpath, etc.) for all basic blocks
039          DepGraphStats.printBasicBlockStatistics(ir);
040        }
041        // Do the conversion from HIR to LIR.
042        ir.IRStage = IR.LIR;
043        ir.LIRInfo = new LIRInfo(ir);
044        ConvertToLowLevelIR.convert(ir, ir.options);
045      }
046    }