[PATCH] D134441: [ObjC][ARC] Don't use operand bundle "clang.arc.attachedcall" in codegen for Windows

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 07:42:23 PDT 2022


sgraenitz created this revision.
sgraenitz added reviewers: ahatanak, rjmccall, theraven, rnk.
Herald added a subscriber: pengfei.
Herald added a project: All.
sgraenitz requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch is an attempt to fix regression https://github.com/llvm/llvm-project/issues/56952 for Clang 
CodeGen on Windows. It appears that the operand bundle `clang.arc.attachedcall` is not fully supported
in the x86_64 backend for Windows. This patch prevents Clang from emitting it in the first place.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134441

Files:
  clang/lib/CodeGen/CGObjC.cpp


Index: clang/lib/CodeGen/CGObjC.cpp
===================================================================
--- clang/lib/CodeGen/CGObjC.cpp
+++ clang/lib/CodeGen/CGObjC.cpp
@@ -2359,7 +2359,8 @@
   // FIXME: Do this on all targets and at -O0 too. This can be enabled only if
   // the target backend knows how to handle the operand bundle.
   if (CGF.CGM.getCodeGenOpts().OptimizationLevel > 0 &&
-      (Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::x86_64)) {
+      (Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::x86_64) &&
+      !CGF.CGM.getTarget().getTriple().isOSWindows()) {
     llvm::Value *bundleArgs[] = {EP};
     llvm::OperandBundleDef OB("clang.arc.attachedcall", bundleArgs);
     auto *oldCall = cast<llvm::CallBase>(value);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134441.462175.patch
Type: text/x-patch
Size: 758 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220922/e5feb96f/attachment.bin>


More information about the llvm-commits mailing list