[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-03-07 Thread Nick Sarnie via cfe-commits
sarnex wrote: So far RFC is going towards changing `__has_builtin` to respect the current target. If anyone has any comments please add them to the RFC [here](https://discourse.llvm.org/t/rfc-has-builtin-behavior-on-offloading-targets/84964). https://github.com/llvm/llvm-project/pull/126324 __

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-21 Thread Nick Sarnie via cfe-commits
sarnex wrote: PR for ARM CUDA https://github.com/llvm/llvm-project/pull/128222 https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-21 Thread Artem Belevich via cfe-commits
Artem-B wrote: > > I'd vote for fixing the CUDA on Arm case that failed in the meantime, then > > make a decision as to whether or not we should go back to `__has_builtin` > > only returning the current compilation target once that's gone. > > +1, if we can get away with it. +1 to that. http

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-21 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > As for next steps, I think we need a broader community discussion on this, so > I would recommend an RFC proposing an approach. I don't know whether that's > changing the behavior of `__has_builtin`, proposing `__can_use_builtin` and > deprecating `__has_builtin`, or something

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman What do you recommend for next steps here? Should we wait until > GCC makes a decision in [this > issue](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118882)? I don't think we need to wait for GCC to make a decision, but we can wait for a bit for them to co

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-20 Thread Nick Sarnie via cfe-commits
@@ -1819,8 +1822,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // usual allocation and deallocation functions. Required by libc++ return 201802; default: + // __has_target_builtin should return false for aux buil

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-20 Thread Erich Keane via cfe-commits
@@ -1819,8 +1822,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // usual allocation and deallocation functions. Required by libc++ return 201802; default: + // __has_target_builtin should return false for aux buil

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-20 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 01/10] [Clang] Add __has_target_builtin macro Signed-off-by: Sarn

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-20 Thread Nick Sarnie via cfe-commits
@@ -1819,8 +1822,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // usual allocation and deallocation functions. Required by libc++ return 201802; default: + // __has_target_builtin should return false for aux buil

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-20 Thread Nick Sarnie via cfe-commits
@@ -1819,8 +1822,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // usual allocation and deallocation functions. Required by libc++ return 201802; default: + // __has_target_builtin should return false for aux buil

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-20 Thread Nick Sarnie via cfe-commits
sarnex wrote: @AaronBallman What do you recommend for next steps here? Should we wait until GCC makes a decision in [this issue](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118882)? https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits ma

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-20 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I'd vote for fixing the CUDA on Arm case that failed in the meantime, then make a decision as to whether or not we should go back to `__has_builtin` only returning the current compilation target once that's gone. https://github.com/llvm/llvm-project/pull/126324 _

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-19 Thread Erich Keane via cfe-commits
@@ -1819,8 +1822,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // usual allocation and deallocation functions. Required by libc++ return 201802; default: + // __has_target_builtin should return false for aux buil

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-14 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > why there's a __has_builtin that's different from __can_use_builtin (or > > whatever we name it), and I don't know that any of us have an answer for > > that > > my $.02 IMO it's a side effect of heterogeneous compilation, where compiler > has to parse source code for multi

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-14 Thread Artem Belevich via cfe-commits
Artem-B wrote: > why there's a __has_builtin that's different from __can_use_builtin (or > whatever we name it), and I don't know that any of us have an answer for that my $.02 IMO it's a side effect of heterogeneous compilation, where compiler has to parse source code for multiple targets (an

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-14 Thread Andrew Pinski via cfe-commits
pinskia wrote: I submitted https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118882 to ask the other GCC folks about what they think is a good idea because I have no other thoughts on this; I just think something needs to be done. https://github.com/llvm/llvm-project/pull/126324 ___

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Maybe the problem with the name I am having is the word `has`. Maybe > `__can_use_builtin` seems like a better name. And that seems like would be a > good context sensative clue. That's actually a really good idea, thank you! But I think users will still have the very re

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-13 Thread Andrew Pinski via cfe-commits
pinskia wrote: Maybe the problem with the name I am having is the word `has`. Maybe `__can_use_builtin` seems like a better name. And that seems like would be a good context sensative clue. https://github.com/llvm/llvm-project/pull/126324 ___ cfe-com

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-13 Thread Andrew Pinski via cfe-commits
pinskia wrote: What is the definition of current target? Is it the current subtarget? Or is it returning true even when NOT using `#pragma GCC target` (or the target attribute) even if the builtin is not work for the subtarget? This is unrelated to offloading but is similar issue. With respect

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-13 Thread Nick Sarnie via cfe-commits
sarnex wrote: > GCC has __has_builtin, so how do they handle offloading targets? Do they have > the same odd behavior where __has_builtin returns true for builtins it cannot > actually emit code for? Setting up offloading for GCC was a nightmare, but it looks like the behavior is the same as

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-13 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > CC @jdoerfert (we don't have a CUDA maintainer, so I'm not certain who else > to tag) Closest is @Artem-B, there's also a few NVIDIA people floating around like @gonzalobg. https://github.com/llvm/llvm-project/pull/126324 ___ cfe-co

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > That's what the initial proposal / patch was, but that got reverted > > > because it broke some CUDA on Arm sources. See #121839. > > > > > > Yeah, but I'm suggesting that seems like a bug with CUDA on Arm sources. > > (But it also depends on how GCC behaves with off

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > That's what the initial proposal / patch was, but that got reverted because > > it broke some CUDA on Arm sources. See #121839. > > Yeah, but I'm suggesting that seems like a bug with CUDA on Arm sources. (But > it also depends on how GCC behaves with offload targets; if the

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > That's what the initial proposal / patch was, but that got reverted because > it broke some CUDA on Arm sources. See #121839. Yeah, but I'm suggesting that seems like a bug with CUDA on Arm sources. (But it also depends on how GCC behaves with offload targets; if they hav

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Marking as requesting changes so we don't accidentally land, because I've got > questions about whether we want to go down this route. > > 1. GCC has `__has_builtin`, so how do they handle offloading targets? Do > they have the same odd behavior where `__has_builtin` retur

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman requested changes to this pull request. Marking as requesting changes so we don't accidentally land, because I've got questions about whether we want to go down this route. 1) GCC has `__has_builtin`, so how do they handle offloading targets? Do they have the sa

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Aaron Ballman via cfe-commits
@@ -96,6 +100,55 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/9] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Artem Belevich via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Aaron Ballman via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Aaron Ballman via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Artem Belevich via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Yaxun Liu via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Joseph Huber via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Aaron Ballman via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Joseph Huber via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. LGMT with a nit. https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -fopenmp -triple=spirv64 -fopenmp-is-target-device \ +// RUN: -aux-triple x86_64-linux-unknown -E %s | FileCheck -implicit-check-not="{{BAD|DOESNT}}" %s + +// RUN: %clang_cc1 -fopenmp -triple=nvptx64 -fopenmp-is-target-device \ +// RUN: -aux-t

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -1797,16 +1803,18 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { + } else if (

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -fopenmp -triple=spirv64 -fopenmp-is-target-device \ +// RUN: -aux-triple x86_64-linux-unknown -E %s | FileCheck -implicit-check-not="{{BAD|DOESNT}}" %s + +// RUN: %clang_cc1 -fopenmp -triple=nvptx64 -fopenmp-is-target-device \ +// RUN: -aux-t

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/8] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -1797,16 +1803,18 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { + } else if (

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Aaron Ballman via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Aaron Ballman via cfe-commits
@@ -1797,16 +1803,18 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { + } else if (

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -fopenmp -triple=spirv64 -fopenmp-is-target-device \ +// RUN: -aux-triple x86_64-linux-unknown -E %s | FileCheck -implicit-check-not="{{BAD|DOESNT}}" %s + +// RUN: %clang_cc1 -fopenmp -triple=nvptx64 -fopenmp-is-target-device \ +// RUN: -aux-t

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Aaron Ballman via cfe-commits
@@ -1797,16 +1803,18 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { + } else if (

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -fopenmp -triple=spirv64 -fopenmp-is-target-device \ +// RUN: -aux-triple x86_64-linux-unknown -E %s | FileCheck -implicit-check-not="{{BAD|DOESNT}}" %s + +// RUN: %clang_cc1 -fopenmp -triple=nvptx64 -fopenmp-is-target-device \ +// RUN: -aux-t

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Only some tiny nits from me https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Joseph Huber via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Artem Belevich via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/7] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/6] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/5] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/4] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/3] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Artem Belevich via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Joseph Huber via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Joseph Huber via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Joseph Huber via cfe-commits
@@ -96,6 +101,37 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/2] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Aaron Ballman via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Aaron Ballman via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Yaxun Liu via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: need release note https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Joseph Huber via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Yaxun Liu via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Yaxun Liu via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nick Sarnie (sarnex) Changes As a follow-up to https://github.com/llvm/llvm-project/pull/121839, where we wanted to make `__has_builtin` return false for aux builtins, but that broke existing code. Instead, introduce a new macro `__has_t

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-07 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From fe555ce59762edf71f43d0cd61978d60f5f949ef Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/3] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-07 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From fe555ce59762edf71f43d0cd61978d60f5f949ef Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/2] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-07 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 4df287a171b63514a5028b85272fcc1b89555ee4 fe555ce59762edf71f43d0cd61978d60f5f949ef --e

  1   2   >