Skip to content

Commit

Permalink
Avoid adding (AArch64|AMD64)SaveRegistersOp twice to basic block
Browse files Browse the repository at this point in the history
PullRequest: graal/18928
  • Loading branch information
tkrodriguez committed Oct 1, 2024
2 parents 7cc26dd + f0ed502 commit ebd9cd6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ protected void emitPrologue(StructuredGraph graph) {
assert stub.getLinkage().getDescriptor().getTransition() != HotSpotForeignCallDescriptor.Transition.SAFEPOINT : stub;
Register[] savedRegisters = getGen().getRegisterConfig().getAllocatableRegisters().toArray();
AArch64SaveRegistersOp saveOp = getGen().emitSaveAllRegisters(savedRegisters);
append(saveOp);
result.setSaveOnEntry(saveOp);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ protected void emitPrologue(StructuredGraph graph) {
if (stub != null && stub.getLinkage().getEffect() == HotSpotForeignCallLinkage.RegisterEffect.KILLS_NO_REGISTERS) {
assert stub.getLinkage().getDescriptor().getTransition() != HotSpotForeignCallDescriptor.Transition.SAFEPOINT : stub;
AMD64SaveRegistersOp saveOp = getGen().emitSaveAllRegisters(false);
append(saveOp);
result.setSaveOnEntry(saveOp);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ public <I extends LIRInstruction> I append(I op) {
assert verify(op);
ArrayList<LIRInstruction> lirForBlock = lir.getLIRforBlock(getCurrentBlock());
op.setPosition(currentPosition);

assert !lirForBlock.contains(op) : "added " + op + " twice";
lirForBlock.add(op);
return op;
}
Expand Down

0 comments on commit ebd9cd6

Please sign in to comment.