[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Joseph Huber via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

jhuber6 wrote:

Done in https://github.com/llvm/llvm-project/pull/88779

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Artem Belevich via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

Artem-B wrote:

SGTM. Thank you for taking care of this issue.

On a side note, do we know if there's a way to file a bug for AIX? They should 
not be setting macros with names that could conceivably be defined by a user. 
In theory. I think normally they should be double-underscore-prefixed.

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Joseph Huber via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

jhuber6 wrote:

Good point, totally forgot that `_` was reserved (Would've been nice 
if the AIX headers followed that rule).

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Aaron Ballman via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

AaronBallman wrote:

`_SM_32` is a reserved identifier so we should not use that as a name.

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Joseph Huber via cfe-commits

https://github.com/jhuber6 edited 
https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Joseph Huber via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

jhuber6 wrote:

Just naming it like `_SM_32` works for me, with a note that they'll get removed 
in the future.

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Artem Belevich via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

Artem-B wrote:

Deprecating and removing support for old GPUs needs to be done, but it's not 
going to happen here and now, so we still need a better short-term fix. 

Undefining a macro set by external headers is not it.


https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Joseph Huber via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

jhuber6 wrote:

I mean, modern CUDA installations don't even allow you to build for anything 
older than `sm_52` now. We could also just delete those enums entirely.

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Artem Belevich via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

Artem-B wrote:

> We could always just make all of these lower case instead?

That would be odd. LLVM style wants them to be CamelCased.
This enum is rarely used, so renaming them to something more CUDA/NVPTXspecific 
would be best, IMO.
E.g `NVSM_32` 

Or we could rename only `SM_32`. The constant is rather inconsequential and is 
used in a few places only. Renaming it to `_SM_32` with a comment that AIX 
headers have `SM_32` defined.





https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Joseph Huber via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

jhuber6 wrote:

We could always just make all of these lower case instead?

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Joseph Huber via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

jhuber6 wrote:

We already do that, the problem is that `CudaArch::SM_32` will still invoke the 
preprocessorr, see https://godbolt.org/z/84xKej5K9. We can't do this from a 
header level, we'd need to do it around every single use as far as I know, 
which might be doable?

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Artem Belevich via cfe-commits

https://github.com/Artem-B edited 
https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-15 Thread Artem Belevich via cfe-commits


@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif

Artem-B wrote:

Ugh. What could possibly go wrong, if someone who needed the original 
definition of SM_32 ends up transitively including this header and losing the 
macro definition?

A beeter way to handle it as a workaround would be to push the macro 
definition, undef it, and then pop it back at the end of the header.

Even better would be to add prefixes to the macros and/or the enum here to 
disambiguate them

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-14 Thread Vlad Serebrennikov via cfe-commits

https://github.com/Endilll closed 
https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-14 Thread Joseph Huber via cfe-commits

jhuber6 wrote:

I can't really think of anything more clever here unfortunately and we should 
probably unbreak the bot. Maybe someone more familiar with PowerPC knows if 
it's possible to simply not include this header somewhere.

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-14 Thread Joseph Huber via cfe-commits

https://github.com/jhuber6 approved this pull request.


https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-14 Thread Joseph Huber via cfe-commits


@@ -50,6 +50,11 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef _AIX
+#undef SM_32
+#endif
+

jhuber6 wrote:

```suggestion
// We have a name conflict with sys/mac.h on AIX
#ifdef SM_32
#undef SM_32
#endif
```

https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-14 Thread Vlad Serebrennikov via cfe-commits

https://github.com/Endilll updated 
https://github.com/llvm/llvm-project/pull/88644

>From 9d46b1ed31d2acbb772f9bb4b139fa1ec36a65ab Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov 
Date: Sun, 14 Apr 2024 08:46:27 +0300
Subject: [PATCH] [clang] Fix name conflict with `sys/mac.h` on AIX

Fixes clang-ppc64-aix bot failure after #88559 
(0a6f6df5b0c3d0f2a42f013bf5cafb9b5020dcac) 
https://lab.llvm.org/buildbot/#/builders/214/builds/11887
---
 clang/include/clang/Basic/Cuda.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h
index acc6bb6581d857..3908e10bc61061 100644
--- a/clang/include/clang/Basic/Cuda.h
+++ b/clang/include/clang/Basic/Cuda.h
@@ -50,6 +50,11 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef _AIX
+#undef SM_32
+#endif
+
 enum class CudaArch {
   UNUSED,
   UNKNOWN,

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-13 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Vlad Serebrennikov (Endilll)


Changes

Fixes clang-ppc64-aix bot failure after #88559 
(0a6f6df5b0c3d0f2a42f013bf5cafb9b5020dcac) 
https://lab.llvm.org/buildbot/#/builders/214/builds/11887

---
Full diff: https://github.com/llvm/llvm-project/pull/88644.diff


1 Files Affected:

- (modified) clang/include/clang/Basic/Cuda.h (+5) 


``diff
diff --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h
index acc6bb6581d857..3908e10bc61061 100644
--- a/clang/include/clang/Basic/Cuda.h
+++ b/clang/include/clang/Basic/Cuda.h
@@ -50,6 +50,11 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef _AIX
+#undef SM_32
+#endif
+
 enum class CudaArch {
   UNUSED,
   UNKNOWN,

``




https://github.com/llvm/llvm-project/pull/88644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits

https://github.com/Endilll created 
https://github.com/llvm/llvm-project/pull/88644

Fixes clang-ppc64-aix bot failure after #88559 
(0a6f6df5b0c3d0f2a42f013bf5cafb9b5020dcac) 
https://lab.llvm.org/buildbot/#/builders/214/builds/11887

>From 9d46b1ed31d2acbb772f9bb4b139fa1ec36a65ab Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov 
Date: Sun, 14 Apr 2024 08:46:27 +0300
Subject: [PATCH] [clang] Fix name conflict with `sys/mac.h` on AIX

Fixes clang-ppc64-aix bot failure after #88559 
(0a6f6df5b0c3d0f2a42f013bf5cafb9b5020dcac) 
https://lab.llvm.org/buildbot/#/builders/214/builds/11887
---
 clang/include/clang/Basic/Cuda.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h
index acc6bb6581d857..3908e10bc61061 100644
--- a/clang/include/clang/Basic/Cuda.h
+++ b/clang/include/clang/Basic/Cuda.h
@@ -50,6 +50,11 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine );
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef _AIX
+#undef SM_32
+#endif
+
 enum class CudaArch {
   UNUSED,
   UNKNOWN,

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits