Skip to content

Commit 850d96e

Browse files
[ObjC] Also enable ARC attachedcall operand bundle for arm64_32. (#138677)
It was enabled for "aarch64", which covers arm64e but not arm64_32. Co-authored-by: Ahmed Bougacha <[email protected]>
1 parent 155bf37 commit 850d96e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

clang/lib/CodeGen/CGObjC.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,8 @@ static llvm::Value *emitOptimizedARCReturnCall(llvm::Value *value,
23862386
// FIXME: Do this on all targets and at -O0 too. This can be enabled only if
23872387
// the target backend knows how to handle the operand bundle.
23882388
if (CGF.CGM.getCodeGenOpts().OptimizationLevel > 0 &&
2389-
(Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::x86_64)) {
2389+
(Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::aarch64_32 ||
2390+
Arch == llvm::Triple::x86_64)) {
23902391
llvm::Value *bundleArgs[] = {EP};
23912392
llvm::OperandBundleDef OB("clang.arc.attachedcall", bundleArgs);
23922393
auto *oldCall = cast<llvm::CallBase>(value);

clang/test/CodeGenObjCXX/arc-rv-attr.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// RUN: %clang_cc1 -triple arm64-apple-ios9 -fobjc-runtime=ios-9.0 -fobjc-arc -std=c++11 -O -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK
2+
// RUN: %clang_cc1 -triple arm64e-apple-ios15 -fobjc-runtime=ios-9.0 -fobjc-arc -std=c++11 -O -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK
3+
// RUN: %clang_cc1 -triple arm64_32-apple-watchos7 -fobjc-runtime=watchos-7.0 -fobjc-arc -std=c++11 -O -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK
24

35
id foo(void);
46

0 commit comments

Comments
 (0)