[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-26 Thread via cfe-commits
pcc wrote: https://discourse.llvm.org/t/functions-generated-by-function-createwithdefaultattr-should-respect-target-features/79838 https://github.com/llvm/llvm-project/pull/96721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I don't think I like this approach: - This seems like an easy way to unintentionally pass state between different compilations. - It seems very easy to try to use this API during LTO, and have it do nothing. - I'm pretty sure this breaks existing workflows involving AMDGPU

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread via cfe-commits
https://github.com/pcc closed https://github.com/llvm/llvm-project/pull/96721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread via cfe-commits
@@ -327,6 +327,26 @@ class LLVMContext { [[deprecated("Always returns false")]] bool supportsTypedPointers() const; + /// Get the current "default" target CPU (target-cpu function attribute). The + /// intent is that compiler frontends will set this to a value that refle

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang -S -emit-llvm --coverage --target=aarch64-linux-android30 -fsanitize=hwaddress %s -o %t pcc wrote: Done https://github.com/llvm/llvm-project/pull/96721 ___ cfe-commits mailing list cfe

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread via cfe-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/96721 >From 14e72c19daefd09b6cfe7e99865b89afa8c5a4d8 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 25 Jun 2024 19:16:01 -0700 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread Fangrui Song via cfe-commits
@@ -327,6 +327,26 @@ class LLVMContext { [[deprecated("Always returns false")]] bool supportsTypedPointers() const; + /// Get the current "default" target CPU (target-cpu function attribute). The + /// intent is that compiler frontends will set this to a value that refle

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/96721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/96721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang -S -emit-llvm --coverage --target=aarch64-linux-android30 -fsanitize=hwaddress %s -o %t MaskRay wrote: Prefer %clang_cc1 in non-driver tests https://github.com/llvm/llvm-project/pull/96721 ___

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir Author: None (pcc) Changes Functions created with createWithDefaultAttr() need to have the correct target-{cpu,features} attributes to avoid miscompilations such as using the wrong relocation type to access globals (missing tagged-globals feature

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (pcc) Changes Functions created with createWithDefaultAttr() need to have the correct target-{cpu,features} attributes to avoid miscompilations such as using the wrong relocation type to access globals (missing tagged-globals feature),

[clang] [llvm] CodeGen, IR: Add target-{cpu,features} attributes to functions created via createWithDefaultAttr(). (PR #96721)

2024-06-25 Thread via cfe-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/96721 Functions created with createWithDefaultAttr() need to have the correct target-{cpu,features} attributes to avoid miscompilations such as using the wrong relocation type to access globals (missing tagged-globals featur