Skip to content

[InstrRef] Preserve debug instr num in aarch64-cond-br-tuning. #10315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rastogishubham
Copy link

The aarch64-cond-br-tuning pass transforms a CBZX instruction into a conditional branch (B.cond). One of the by products of the transformation is that the source instruction of the CBZX, which is an ANDXri instruction, gets transformed into a ANDSXri instruction, however this transformation doesn't preserve it's debug instruction number.

This patch fixes that issue.

(cherry-picked from f5f6af8)

(cherry-picked from cc86d7c)

The call to the initializeAArch64CondBrTuningPass function is missing in
the AArch64TargetMachine LLVMInitializeAArch64Target function.

This means that the pass is not in the pass registry and options such as
-run-pass=aarch64-cond-br-tuning and
-stop-after=aarch64-cond-br-tuning cannot be used. This patch fixes that
issue.

(cherry picked from commit cc86d7c)
…132081)

The aarch64-cond-br-tuning pass transforms a CBZX instruction into a
conditional branch (B.cond). One of the by products of the
transformation is that the source instruction of the CBZX, which is an
ANDXri instruction, gets transformed into a ANDSXri instruction, however
this transformation doesn't preserve it's debug instruction number.

This patch fixes that issue.

(cherry picked from commit f5f6af8)
@rastogishubham rastogishubham requested a review from a team as a code owner March 21, 2025 15:11
@rastogishubham
Copy link
Author

@swift-ci please test Linux

@rastogishubham
Copy link
Author

@swift-ci please test macOS

1 similar comment
@rastogishubham
Copy link
Author

@swift-ci please test macOS

@rastogishubham rastogishubham merged commit b35cd55 into swiftlang:stable/20240723 Mar 22, 2025
2 checks passed
@rastogishubham rastogishubham deleted the CondBrTuningStable branch March 22, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant