[GR-18266] Add UseKill annotation to replace the Use+Temp trick.#13162
Open
graalvmbot wants to merge 1 commit intomasterfrom
Open
[GR-18266] Add UseKill annotation to replace the Use+Temp trick.#13162graalvmbot wants to merge 1 commit intomasterfrom
graalvmbot wants to merge 1 commit intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the new
@UseKilloperand annotation to the LIR and Graal compiler codebase, replacing the previous practice of using@Use+@Temp(the "Use+Temp trick") for denoting operands that are both read and then killed (i.e., whose register may be reused after the instruction). The change improves register allocation logic by making operand liveness semantics explicit and easier to reason about, and extends support throughout register allocation, stack slot allocation, verification, and various architecture-specific LIR instructions.Key Changes:
@UseKillannotation andOperandMode.USE_KILLtoLIRInstruction, including new API methods (forEachUseKill,visitEachUseKill) and related wiring inLIRInstructionClass.UseKillMoveInjectionPhase, a pre-allocation LIR phase that lowers@UseKilloperands on variables to explicit moves, ensuring correct semantics for variables marked as killed.@Use+@Tempwith the new@UseKill, including in key LIR instructions such asAMD64ArrayEqualsOp,AMD64VectorizedMismatchOp, andAMD64ArrayRegionCompareToOp.LinearScanLifetimeAnalysisPhase,LinearScanAssignLocationsPhase,RegisterVerifier), stack slot allocation (LSStackSlotAllocator,SimpleStackSlotAllocator,FixPointIntervalBuilder), economy and full pre-allocation LIR phases to include the new lowering phase.SSAVerifier,LocationMarker,HotSpotZapRegistersPhase, etc.) to consistently handleUSE_KILLwherever operand modes are enumerated.SimpleVirtualStackSlotAlias) withUSE_KILLmode checks.visitEachUseKillandforEachUseKill.