# HG changeset patch # User Doug Simon # Date 1380840799 -7200 # Node ID 4ac39f060a9df5255359e7372c58ff475fb7439b # Parent 7b50d3841398d99fcde16a3b05cd77c4e278bcef added block ids to Labels Contributed-by: Eric Caspole diff -r 7b50d3841398 -r 4ac39f060a9d graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/AbstractHSAILAssembler.java --- 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); } } diff -r 7b50d3841398 -r 4ac39f060a9d graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Label.java --- 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. * diff -r 7b50d3841398 -r 4ac39f060a9d graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- 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()); - 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());