Skip to content
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

[AArch64] Add FeatureFuseAddSub2RegAndConstOne for Ampere1A #81295

Conversation

ptomsich
Copy link
Contributor

@ptomsich ptomsich commented Feb 9, 2024

Ampere1A introduced the Fusion for A+B+1/A-B-1.
However, the Feature flag to enable that fusion-case never was added to TuneAmpere1A.
This commit corrects that omission.

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 9, 2024

@llvm/pr-subscribers-backend-aarch64

Author: Philipp Tomsich (ptomsich)

Changes

Ampere1A introduced the Fusion for A+B+1/A-B-1.
However, the Feature flag to enable that fusion-case never was added to TuneAmpere1A.
This commit corrects that omission.


Full diff: https://github.com/llvm/llvm-project/pull/81295.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AArch64/AArch64.td (+1)
diff --git a/llvm/lib/Target/AArch64/AArch64.td b/llvm/lib/Target/AArch64/AArch64.td
index 02fb01caf7e801..ea0c498263411d 100644
--- a/llvm/lib/Target/AArch64/AArch64.td
+++ b/llvm/lib/Target/AArch64/AArch64.td
@@ -1372,6 +1372,7 @@ def TuneAmpere1A : SubtargetFeature<"ampere1a", "ARMProcFamily", "Ampere1A",
                                     FeatureFuseAddress,
                                     FeatureFuseLiterals,
                                     FeatureFuseLiterals,
+                                    FeatureFuseAddSub2RegAndConstOne,
                                     FeatureStorePairSuppress,
                                     FeatureLdpAlignedOnly,
                                     FeatureStpAlignedOnly]>;

Copy link
Contributor

@jthackray jthackray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ptomsich ptomsich merged commit 7b2eff6 into llvm:main Feb 9, 2024
5 of 6 checks passed
@ptomsich ptomsich deleted the ptomsich/main/pull-requests/ampere-1a/FeatureFuseAddSub2RegAndConstOne branch February 9, 2024 23:31
@davemgreen
Copy link
Collaborator

Changes like this should ideally have a test-case. Hopefully that is as simple as adding a new check line to one of the existing tests like llvm/test/CodeGen/AArch64/macro-fusion-addsub-2reg-const1.mir?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants