Mercurial > hg > graal-compiler
changeset 11892:4ac39f060a9d
added block ids to Labels
Contributed-by: Eric Caspole <Eric.Caspole@amd.com>
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 04 Oct 2013 00:53:19 +0200 |
parents | 7b50d3841398 |
children | ec267141f753 |
files | graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/AbstractHSAILAssembler.java graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Label.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java |
diffstat | 3 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/AbstractHSAILAssembler.java Thu Oct 03 21:28:21 2013 +0200 +++ b/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/AbstractHSAILAssembler.java Fri Oct 04 00:53:19 2013 +0200 @@ -57,6 +57,7 @@ @Override protected String createLabelName(Label l, int id) { - return "@L" + id; + int blockId = l.getBlockId(); + return "@L" + (blockId == -1 ? id : blockId); } }
--- a/graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Label.java Thu Oct 03 21:28:21 2013 +0200 +++ b/graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Label.java Fri Oct 04 00:53:19 2013 +0200 @@ -30,6 +30,7 @@ public final class Label { private int position = -1; + private int blockId = -1; /** * References to instructions that jump to this unresolved label. These instructions need to be @@ -51,6 +52,14 @@ public Label() { } + public Label(int id) { + blockId = id; + } + + public int getBlockId() { + return blockId; + } + /** * Binds the label to the specified position. *
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu Oct 03 21:28:21 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Fri Oct 04 00:53:19 2013 +0200 @@ -288,7 +288,7 @@ assert lir.lir(block) == null : "LIR list already computed for this block"; lir.setLir(block, new ArrayList<LIRInstruction>()); - append(new LabelOp(new Label(), block.isAligned())); + append(new LabelOp(new Label(block.getId()), block.isAligned())); if (TraceLIRGeneratorLevel.getValue() >= 1) { TTY.println("BEGIN Generating LIR for block B" + block.getId());