-
Notifications
You must be signed in to change notification settings - Fork 14.4k
DRAFT: [bolt][aarch64] Add load-acquire & store-release instructions #146035
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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-bolt Author: Alexey Moksyakov (yavtuk) ChangesThis patch adds checking for the load-acquire & store-release instructions since a operand can be SP register. Full diff: https://github.com/llvm/llvm-project/pull/146035.diff 1 Files Affected:
diff --git a/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp b/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
index 612c1304efd60..491311716450b 100644
--- a/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+++ b/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
@@ -661,6 +661,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
case AArch64::LDTRBi:
case AArch64::LDTRSBWi:
case AArch64::LDTRSBXi:
+ case AArch64::LDARB:
return true;
default:
break;
@@ -699,6 +700,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
case AArch64::LDTRHi:
case AArch64::LDTRSHWi:
case AArch64::LDTRSHXi:
+ case AArch64::LDARH:
return true;
default:
break;
@@ -733,6 +735,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
case AArch64::LDPSWpost:
case AArch64::LDPSWpre:
case AArch64::LDNPWi:
+ case AArch64::LDARW:
return true;
default:
break;
@@ -756,6 +759,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
case AArch64::LDPXi:
case AArch64::LDPXpost:
case AArch64::LDPXpre:
+ case AArch64::LDARX:
return true;
default:
break;
@@ -1926,9 +1930,23 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
return false;
};
+ auto isStoreRelease = [&]() {
+ switch (opcode) {
+ case AArch64::STLRB:
+ case AArch64::STLRH:
+ case AArch64::STLRW:
+ case AArch64::STLRX:
+ return true;
+ default:
+ break;
+ }
+
+ return false;
+ };
+
return isStoreRegUnscaleImm() || isStoreRegScaledImm() ||
isStoreRegImmPreIndexed() || isStoreRegImmPostIndexed() ||
- isStoreRegUnscaleUnpriv() || isStoreRegTrunc();
+ isStoreRegUnscaleUnpriv() || isStoreRegTrunc() || isStoreRelease();
}
bool mayStore(const MCInst &Inst) const override {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for the addition Alexei.
Do you have a small lit test to accompany the patch?
For additions like this, unittests might be easy to add; not sure what others think?
I can try to add if you think it will be helpful |
Hi, maybe add ldaex/stlex too? |
Let me check, why not, thanks |
This patch adds checking for the load-acquire & store-release instructions since a operand can be SP register.
c51d08a
to
7980b9c
Compare
This patch adds checking for the load-acquire & store-release instructions since a operand can be SP register.