https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/207691
>From 32a58fe51c9e5dab08267289022c294d7830981d Mon Sep 17 00:00:00 2001 From: Nikita Popov <[email protected]> Date: Mon, 6 Jul 2026 10:29:41 +0200 Subject: [PATCH 1/2] Revert "[Clang] Require X86 backend for some coroutine tests (#207681)" This reverts commit bf74249b5ecd651ca99043bea11a8b64301557d3. --- clang/test/CodeGenCoroutines/coro-elide.cpp | 3 --- clang/test/CodeGenCoroutines/coro-halo.cpp | 3 --- clang/test/CodeGenCoroutines/pr65018.cpp | 3 --- 3 files changed, 9 deletions(-) diff --git a/clang/test/CodeGenCoroutines/coro-elide.cpp b/clang/test/CodeGenCoroutines/coro-elide.cpp index 3bff2a29c6e07..1902dd64b5e5a 100644 --- a/clang/test/CodeGenCoroutines/coro-elide.cpp +++ b/clang/test/CodeGenCoroutines/coro-elide.cpp @@ -1,8 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -O2 -emit-llvm %s -o - | FileCheck %s -// FIXME: Generate wrappers with correct target features. -// REQUIRES: x86-registered-target - #include "Inputs/coroutine.h" namespace { diff --git a/clang/test/CodeGenCoroutines/coro-halo.cpp b/clang/test/CodeGenCoroutines/coro-halo.cpp index 6dd785f5c1f8e..e75bedaf81fa2 100644 --- a/clang/test/CodeGenCoroutines/coro-halo.cpp +++ b/clang/test/CodeGenCoroutines/coro-halo.cpp @@ -3,9 +3,6 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -O2 -emit-llvm %s \ // RUN: -fcxx-exceptions -fexceptions -o - | FileCheck %s -// FIXME: Generate wrappers with correct target features. -// REQUIRES: x86-registered-target - #include "Inputs/coroutine.h" #include "Inputs/numeric.h" diff --git a/clang/test/CodeGenCoroutines/pr65018.cpp b/clang/test/CodeGenCoroutines/pr65018.cpp index f3b903dc0b396..f1cde461cabc2 100644 --- a/clang/test/CodeGenCoroutines/pr65018.cpp +++ b/clang/test/CodeGenCoroutines/pr65018.cpp @@ -1,9 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 \ // RUN: -O1 -emit-llvm %s -o - | FileCheck %s -// FIXME: Generate wrappers with correct target features. -// REQUIRES: x86-registered-target - #include "Inputs/coroutine.h" // A simple awaiter type with an await_suspend method that can't be >From 90f14b6a5c3fe26590c6666bf5800fe5ced20170 Mon Sep 17 00:00:00 2001 From: Nikita Popov <[email protected]> Date: Mon, 6 Jul 2026 11:07:14 +0200 Subject: [PATCH 2/2] Set target features in StartFunction --- clang/lib/CodeGen/CodeGenFunction.cpp | 4 ++++ clang/lib/CodeGen/CodeGenModule.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index b920266b59808..7fcbcbed8efeb 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -1124,6 +1124,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, getLLVMContext(), VScaleRange->first, VScaleRange->second)); } + llvm::AttrBuilder Attrs(getLLVMContext()); + CGM.GetCPUAndFeaturesAttributes(GD, Attrs); + Fn->addFnAttrs(Attrs); + llvm::BasicBlock *EntryBB = createBasicBlock("entry", CurFn); // Create a marker to make it easy to insert allocas into the entryblock diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index b1e70a7c347db..9fbf8d1690c69 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1992,9 +1992,12 @@ class CodeGenModule : public CodeGenTypeCache { void UpdateMultiVersionNames(GlobalDecl GD, const FunctionDecl *FD, StringRef &CurName); +public: bool GetCPUAndFeaturesAttributes(GlobalDecl GD, llvm::AttrBuilder &AttrBuilder, bool SetTargetFeatures = true); + +private: void setNonAliasAttributes(GlobalDecl GD, llvm::GlobalObject *GO); /// Set function attributes for a function declaration. _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
