Skip to content

Commit 9f0f558

Browse files
committed
Revert "[AArch64] Codegen support for FEAT_PAuthLR"
This reverts commit 5992ce9. Builtbot failures with expensive checks enabled.
1 parent 8866558 commit 9f0f558

File tree

21 files changed

+25
-752
lines changed

21 files changed

+25
-752
lines changed

clang/include/clang/Basic/LangOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ ENUM_LANGOPT(SignReturnAddressScope, SignReturnAddressScopeKind, 2, SignReturnAd
456456
ENUM_LANGOPT(SignReturnAddressKey, SignReturnAddressKeyKind, 1, SignReturnAddressKeyKind::AKey,
457457
"Key used for return address signing")
458458
LANGOPT(BranchTargetEnforcement, 1, 0, "Branch-target enforcement enabled")
459-
LANGOPT(BranchProtectionPAuthLR, 1, 0, "Use PC as a diversifier using PAuthLR NOP instructions.")
460459

461460
LANGOPT(SpeculativeLoadHardening, 1, 0, "Speculative load hardening enabled")
462461

clang/include/clang/Basic/TargetInfo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,6 @@ class TargetInfo : public TransferrableTargetInfo,
13721372
LangOptions::SignReturnAddressKeyKind SignKey =
13731373
LangOptions::SignReturnAddressKeyKind::AKey;
13741374
bool BranchTargetEnforcement = false;
1375-
bool BranchProtectionPAuthLR = false;
13761375
};
13771376

13781377
/// Determine if the Architecture in this TargetInfo supports branch

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7000,8 +7000,6 @@ def msign_return_address_key_EQ : Joined<["-"], "msign-return-address-key=">,
70007000
Values<"a_key,b_key">;
70017001
def mbranch_target_enforce : Flag<["-"], "mbranch-target-enforce">,
70027002
MarshallingInfoFlag<LangOpts<"BranchTargetEnforcement">>;
7003-
def mbranch_protection_pauth_lr : Flag<["-"], "mbranch-protection-pauth-lr">,
7004-
MarshallingInfoFlag<LangOpts<"BranchProtectionPAuthLR">>;
70057003
def fno_dllexport_inlines : Flag<["-"], "fno-dllexport-inlines">,
70067004
MarshallingInfoNegativeFlag<LangOpts<"DllExportInlines">>;
70077005
def cfguard_no_checks : Flag<["-"], "cfguard-no-checks">,

clang/lib/Basic/Targets/AArch64.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ bool AArch64TargetInfo::validateBranchProtection(StringRef Spec, StringRef,
225225
BPI.SignKey = LangOptions::SignReturnAddressKeyKind::BKey;
226226

227227
BPI.BranchTargetEnforcement = PBP.BranchTargetEnforcement;
228-
BPI.BranchProtectionPAuthLR = PBP.BranchProtectionPAuthLR;
229228
return true;
230229
}
231230

clang/lib/Basic/Targets/ARM.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ bool ARMTargetInfo::validateBranchProtection(StringRef Spec, StringRef Arch,
419419
BPI.SignKey = LangOptions::SignReturnAddressKeyKind::AKey;
420420

421421
BPI.BranchTargetEnforcement = PBP.BranchTargetEnforcement;
422-
BPI.BranchProtectionPAuthLR = PBP.BranchProtectionPAuthLR;
423422
return true;
424423
}
425424

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,9 +1106,6 @@ void CodeGenModule::Release() {
11061106
if (LangOpts.BranchTargetEnforcement)
11071107
getModule().addModuleFlag(llvm::Module::Min, "branch-target-enforcement",
11081108
1);
1109-
if (LangOpts.BranchProtectionPAuthLR)
1110-
getModule().addModuleFlag(llvm::Module::Min, "branch-protection-pauth-lr",
1111-
1);
11121109
if (LangOpts.hasSignReturnAddress())
11131110
getModule().addModuleFlag(llvm::Module::Min, "sign-return-address", 1);
11141111
if (LangOpts.isSignReturnAddressScopeAll())

clang/lib/CodeGen/Targets/AArch64.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ class AArch64TargetCodeGenInfo : public TargetCodeGenInfo {
136136

137137
Fn->addFnAttr("branch-target-enforcement",
138138
BPI.BranchTargetEnforcement ? "true" : "false");
139-
Fn->addFnAttr("branch-protection-pauth-lr",
140-
BPI.BranchProtectionPAuthLR ? "true" : "false");
141139
}
142140

143141
bool isScalarizableAsmOperand(CodeGen::CodeGenFunction &CGF,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,7 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args,
14971497
<< Triple.getArchName();
14981498

14991499
StringRef Scope, Key;
1500-
bool IndirectBranches, BranchProtectionPAuthLR;
1500+
bool IndirectBranches;
15011501

15021502
if (A->getOption().matches(options::OPT_msign_return_address_EQ)) {
15031503
Scope = A->getValue();
@@ -1506,7 +1506,6 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args,
15061506
<< A->getSpelling() << Scope;
15071507
Key = "a_key";
15081508
IndirectBranches = false;
1509-
BranchProtectionPAuthLR = false;
15101509
} else {
15111510
StringRef DiagMsg;
15121511
llvm::ARM::ParsedBranchProtection PBP;
@@ -1518,7 +1517,6 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args,
15181517
<< "b-key" << A->getAsString(Args);
15191518
Scope = PBP.Scope;
15201519
Key = PBP.Key;
1521-
BranchProtectionPAuthLR = PBP.BranchProtectionPAuthLR;
15221520
IndirectBranches = PBP.BranchTargetEnforcement;
15231521
}
15241522

@@ -1527,9 +1525,6 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args,
15271525
if (!Scope.equals("none"))
15281526
CmdArgs.push_back(
15291527
Args.MakeArgString(Twine("-msign-return-address-key=") + Key));
1530-
if (BranchProtectionPAuthLR)
1531-
CmdArgs.push_back(
1532-
Args.MakeArgString(Twine("-mbranch-protection-pauth-lr")));
15331528
if (IndirectBranches)
15341529
CmdArgs.push_back("-mbranch-target-enforce");
15351530
}

clang/test/CodeGen/aarch64-branch-protection-attr.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,6 @@ __attribute__ ((target("branch-protection=pac-ret+leaf+bti")))
4646
void btileaf() {}
4747
// CHECK: define{{.*}} void @btileaf() #[[#BTIPACLEAF:]]
4848

49-
50-
__attribute__ ((target("branch-protection=pac-ret+pc")))
51-
void pauthlr() {}
52-
// CHECK: define{{.*}} void @pauthlr() #[[#PAUTHLR:]]
53-
54-
__attribute__ ((target("branch-protection=pac-ret+pc+b-key")))
55-
void pauthlr_bkey() {}
56-
// CHECK: define{{.*}} void @pauthlr_bkey() #[[#PAUTHLR_BKEY:]]
57-
58-
__attribute__ ((target("branch-protection=pac-ret+pc+leaf")))
59-
void pauthlr_leaf() {}
60-
// CHECK: define{{.*}} void @pauthlr_leaf() #[[#PAUTHLR_LEAF:]]
61-
62-
__attribute__ ((target("branch-protection=pac-ret+pc+bti")))
63-
void pauthlr_bti() {}
64-
// CHECK: define{{.*}} void @pauthlr_bti() #[[#PAUTHLR_BTI:]]
65-
66-
6749
// CHECK-DAG: attributes #[[#NONE]] = { {{.*}} "branch-target-enforcement"="false" {{.*}} "sign-return-address"="none"
6850

6951
// CHECK-DAG: attributes #[[#STD]] = { {{.*}} "branch-target-enforcement"="true" {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="a_key"
@@ -79,13 +61,3 @@ void pauthlr_bti() {}
7961
// CHECK-DAG: attributes #[[#PACBKEYLEAF]] = { {{.*}} "branch-target-enforcement"="false" {{.*}}"sign-return-address"="all" "sign-return-address-key"="b_key"
8062

8163
// CHECK-DAG: attributes #[[#BTIPACLEAF]] = { {{.*}}"branch-target-enforcement"="true" {{.*}} "sign-return-address"="all" "sign-return-address-key"="a_key"
82-
83-
84-
// CHECK-DAG: attributes #[[#PAUTHLR]] = { {{.*}}"branch-protection-pauth-lr"="true" {{.*}}"branch-target-enforcement"="false" {{.*}}"sign-return-address"="non-leaf" "sign-return-address-key"="a_key"
85-
86-
// CHECK-DAG: attributes #[[#PAUTHLR_BKEY]] = { {{.*}}"branch-protection-pauth-lr"="true" {{.*}}"branch-target-enforcement"="false" {{.*}}"sign-return-address"="non-leaf" "sign-return-address-key"="b_key"
87-
88-
// CHECK-DAG: attributes #[[#PAUTHLR_LEAF]] = { {{.*}}"branch-protection-pauth-lr"="true" {{.*}}"branch-target-enforcement"="false" {{.*}}"sign-return-address"="all" "sign-return-address-key"="a_key"
89-
90-
// CHECK-DAG: attributes #[[#PAUTHLR_BTI]] = { {{.*}}"branch-protection-pauth-lr"="true" {{.*}}"branch-target-enforcement"="true" {{.*}}"sign-return-address"="non-leaf" "sign-return-address-key"="a_key"
91-

clang/test/Driver/aarch64-pauth-lr.c

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)