Skip to content

Commit ced69c7

Browse files
committed
[CGObjC] Allow clang.arc.attachedcall on -O0 on AArch64
It is supported in GlobalISel there. It is not supported on X86 GlobalISel.
1 parent 0198e8f commit ced69c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/CodeGen/CGObjC.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,7 @@ static llvm::Value *emitOptimizedARCReturnCall(llvm::Value *value,
24172417
// Add operand bundle "clang.arc.attachedcall" to the call instead of emitting
24182418
// retainRV or claimRV calls in the IR. We currently do this only when the
24192419
// optimization level isn't -O0 since global-isel, which is currently run at
2420-
// -O0, doesn't know about the operand bundle.
2420+
// -O0, doesn't know about the operand bundle on x86_64.
24212421
ObjCEntrypoints &EPs = CGF.CGM.getObjCEntrypoints();
24222422
llvm::Function *&EP = IsRetainRV
24232423
? EPs.objc_retainAutoreleasedReturnValue
@@ -2431,9 +2431,9 @@ static llvm::Value *emitOptimizedARCReturnCall(llvm::Value *value,
24312431

24322432
// FIXME: Do this on all targets and at -O0 too. This can be enabled only if
24332433
// the target backend knows how to handle the operand bundle.
2434-
if (CGF.CGM.getCodeGenOpts().OptimizationLevel > 0 &&
2435-
(Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::aarch64_32 ||
2436-
Arch == llvm::Triple::x86_64)) {
2434+
if ((CGF.CGM.getCodeGenOpts().OptimizationLevel > 0 &&
2435+
Arch == llvm::Triple::x86_64) ||
2436+
(Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::aarch64_32)) {
24372437
llvm::Value *bundleArgs[] = {EP};
24382438
llvm::OperandBundleDef OB("clang.arc.attachedcall", bundleArgs);
24392439
auto *oldCall = cast<llvm::CallBase>(value);

0 commit comments

Comments
 (0)