[clang] 5fa21e5 - [NFC][X86][Headers] Fix missing blank line

2024-04-19 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2024-04-19T07:35:55-07:00
New Revision: 5fa21e5fc7384069276e15dbb1c27986a6e86483

URL: 
https://github.com/llvm/llvm-project/commit/5fa21e5fc7384069276e15dbb1c27986a6e86483
DIFF: 
https://github.com/llvm/llvm-project/commit/5fa21e5fc7384069276e15dbb1c27986a6e86483.diff

LOG: [NFC][X86][Headers] Fix missing blank line

It caused the \headerfile directive to be considered as part of
the brief description in some of our tooling.

Added: 


Modified: 
clang/lib/Headers/avxintrin.h

Removed: 




diff  --git a/clang/lib/Headers/avxintrin.h b/clang/lib/Headers/avxintrin.h
index be7a0b247e03d4..4983f331137001 100644
--- a/clang/lib/Headers/avxintrin.h
+++ b/clang/lib/Headers/avxintrin.h
@@ -840,6 +840,7 @@ _mm256_permutevar_pd(__m256d __a, __m256i __c)
 
 /// Copies the values stored in a 128-bit vector of [4 x float] as
 ///specified by the 128-bit integer vector operand.
+///
 /// \headerfile 
 ///
 /// This intrinsic corresponds to the  VPERMILPS  instruction.



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


[clang] 9808279 - [NFC] Bump DIAG_SIZE_FRONTEND (hit the limit downstream as of e05c1b46)

2024-04-03 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2024-04-03T08:12:16-07:00
New Revision: 9808279b0ec3663428fbf6294dfdd1d4f70b1cda

URL: 
https://github.com/llvm/llvm-project/commit/9808279b0ec3663428fbf6294dfdd1d4f70b1cda
DIFF: 
https://github.com/llvm/llvm-project/commit/9808279b0ec3663428fbf6294dfdd1d4f70b1cda.diff

LOG: [NFC] Bump DIAG_SIZE_FRONTEND (hit the limit downstream as of e05c1b46)

Added: 


Modified: 
clang/include/clang/Basic/DiagnosticIDs.h

Removed: 




diff  --git a/clang/include/clang/Basic/DiagnosticIDs.h 
b/clang/include/clang/Basic/DiagnosticIDs.h
index 5ff782c7f8c7e8..bce7605b95ba43 100644
--- a/clang/include/clang/Basic/DiagnosticIDs.h
+++ b/clang/include/clang/Basic/DiagnosticIDs.h
@@ -32,7 +32,7 @@ namespace clang {
 enum {
   DIAG_SIZE_COMMON=  300,
   DIAG_SIZE_DRIVER=  400,
-  DIAG_SIZE_FRONTEND  =  150,
+  DIAG_SIZE_FRONTEND  =  200,
   DIAG_SIZE_SERIALIZATION =  120,
   DIAG_SIZE_LEX   =  400,
   DIAG_SIZE_PARSE =  700,



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


[clang] 04a6e0f - [X86][Headers] change 'yields' to 'returns' in more places

2024-03-22 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2024-03-22T05:36:41-07:00
New Revision: 04a6e0f1634f9a53120c27a30250d26dff4ada1c

URL: 
https://github.com/llvm/llvm-project/commit/04a6e0f1634f9a53120c27a30250d26dff4ada1c
DIFF: 
https://github.com/llvm/llvm-project/commit/04a6e0f1634f9a53120c27a30250d26dff4ada1c.diff

LOG: [X86][Headers] change 'yields' to 'returns' in more places

Added: 


Modified: 
clang/lib/Headers/mmintrin.h
clang/lib/Headers/smmintrin.h
clang/lib/Headers/xmmintrin.h

Removed: 




diff  --git a/clang/lib/Headers/mmintrin.h b/clang/lib/Headers/mmintrin.h
index 962d24738e7aa4..4e154e2d859353 100644
--- a/clang/lib/Headers/mmintrin.h
+++ b/clang/lib/Headers/mmintrin.h
@@ -1141,7 +1141,7 @@ _mm_xor_si64(__m64 __m1, __m64 __m2)
 ///[8 x i8] to determine if the element of the first vector is equal to the
 ///corresponding element of the second vector.
 ///
-///The comparison yields 0 for false, 0xFF for true.
+///Each comparison returns 0 for false, 0xFF for true.
 ///
 /// \headerfile 
 ///
@@ -1163,7 +1163,7 @@ _mm_cmpeq_pi8(__m64 __m1, __m64 __m2)
 ///[4 x i16] to determine if the element of the first vector is equal to 
the
 ///corresponding element of the second vector.
 ///
-///The comparison yields 0 for false, 0x for true.
+///Each comparison returns 0 for false, 0x for true.
 ///
 /// \headerfile 
 ///
@@ -1185,7 +1185,7 @@ _mm_cmpeq_pi16(__m64 __m1, __m64 __m2)
 ///[2 x i32] to determine if the element of the first vector is equal to 
the
 ///corresponding element of the second vector.
 ///
-///The comparison yields 0 for false, 0x for true.
+///Each comparison returns 0 for false, 0x for true.
 ///
 /// \headerfile 
 ///
@@ -1207,7 +1207,7 @@ _mm_cmpeq_pi32(__m64 __m1, __m64 __m2)
 ///[8 x i8] to determine if the element of the first vector is greater than
 ///the corresponding element of the second vector.
 ///
-///The comparison yields 0 for false, 0xFF for true.
+///Each comparison returns 0 for false, 0xFF for true.
 ///
 /// \headerfile 
 ///
@@ -1229,7 +1229,7 @@ _mm_cmpgt_pi8(__m64 __m1, __m64 __m2)
 ///[4 x i16] to determine if the element of the first vector is greater 
than
 ///the corresponding element of the second vector.
 ///
-///The comparison yields 0 for false, 0x for true.
+///Each comparison returns 0 for false, 0x for true.
 ///
 /// \headerfile 
 ///
@@ -1251,7 +1251,7 @@ _mm_cmpgt_pi16(__m64 __m1, __m64 __m2)
 ///[2 x i32] to determine if the element of the first vector is greater 
than
 ///the corresponding element of the second vector.
 ///
-///The comparison yields 0 for false, 0x for true.
+///Each comparison returns 0 for false, 0x for true.
 ///
 /// \headerfile 
 ///

diff  --git a/clang/lib/Headers/smmintrin.h b/clang/lib/Headers/smmintrin.h
index 9fb9cc9b01348c..b3fec474e35a1e 100644
--- a/clang/lib/Headers/smmintrin.h
+++ b/clang/lib/Headers/smmintrin.h
@@ -1188,7 +1188,7 @@ static __inline__ int __DEFAULT_FN_ATTRS 
_mm_testnzc_si128(__m128i __M,
 /// Compares each of the corresponding 64-bit values of the 128-bit
 ///integer vectors for equality.
 ///
-///Each comparison yields 0x0 for false, 0x for true.
+///Each comparison returns 0x0 for false, 0x for true.
 ///
 /// \headerfile 
 ///
@@ -2303,7 +2303,7 @@ static __inline__ __m128i __DEFAULT_FN_ATTRS 
_mm_minpos_epu16(__m128i __V) {
 ///integer vectors to determine if the values in the first operand are
 ///greater than those in the second operand.
 ///
-///Each comparison yields 0x0 for false, 0x for true.
+///Each comparison returns 0x0 for false, 0x for true.
 ///
 /// \headerfile 
 ///

diff  --git a/clang/lib/Headers/xmmintrin.h b/clang/lib/Headers/xmmintrin.h
index 040194786a2799..1ef89de9c9f562 100644
--- a/clang/lib/Headers/xmmintrin.h
+++ b/clang/lib/Headers/xmmintrin.h
@@ -484,7 +484,7 @@ _mm_xor_ps(__m128 __a, __m128 __b)
 /// Compares two 32-bit float values in the low-order bits of both
 ///operands for equality.
 ///
-///The comparison yields 0x0 for false, 0x for true, in the
+///The comparison returns 0x0 for false, 0x for true, in the
 ///low-order bits of a vector [4 x float].
 ///If either value in a comparison is NaN, returns false.
 ///
@@ -509,7 +509,7 @@ _mm_cmpeq_ss(__m128 __a, __m128 __b)
 /// Compares each of the corresponding 32-bit float values of the
 ///128-bit vectors of [4 x float] for equality.
 ///
-///Each comparison yields 0x0 for false, 0x for true.
+///Each comparison returns 0x0 for false, 0x for true.
 ///If either value in a comparison is NaN, returns false.
 ///
 /// \headerfile 
@@ -531,7 +531,7 @@ _mm_cmpeq_ps(__m128 __a, __m128 __b)
 ///operands to determine if the 

[clang] 513b950 - Make -frewrite-includes handle -include correctly

2023-10-24 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-10-24T09:08:31-07:00
New Revision: 513b950a79d0e92af1baa969207dd296068a71b9

URL: 
https://github.com/llvm/llvm-project/commit/513b950a79d0e92af1baa969207dd296068a71b9
DIFF: 
https://github.com/llvm/llvm-project/commit/513b950a79d0e92af1baa969207dd296068a71b9.diff

LOG: Make -frewrite-includes handle -include correctly

The `-include "file"` option implicitly adds a leading #include
to the main source; however, there's no explicit #include, which
left -frewrite-includes emitting an unmatched #endif at the end
of the included text.

This corrects a bug in 4a16b51f.

Added: 


Modified: 
clang/lib/Frontend/Rewrite/InclusionRewriter.cpp
clang/test/Frontend/rewrite-includes-cli-include.c

Removed: 




diff  --git a/clang/lib/Frontend/Rewrite/InclusionRewriter.cpp 
b/clang/lib/Frontend/Rewrite/InclusionRewriter.cpp
index 28f7b0b9edfc5c2..2c3a253a67d5c93 100644
--- a/clang/lib/Frontend/Rewrite/InclusionRewriter.cpp
+++ b/clang/lib/Frontend/Rewrite/InclusionRewriter.cpp
@@ -444,8 +444,11 @@ void InclusionRewriter::Process(FileID FileId,
   if (Mod)
 OS << "#pragma clang module end /*"
<< Mod->getFullModuleName(true) << "*/\n";
-  OS << "#endif /* " << getIncludedFileName(Inc)
- << " expanded by -frewrite-includes */" << LocalEOL;
+  // There's no #include, therefore no #if, for -include files.
+  if (FromFile != PredefinesBuffer) {
+OS << "#endif /* " << getIncludedFileName(Inc)
+   << " expanded by -frewrite-includes */" << LocalEOL;
+  }
 
   // Add line marker to indicate we're returning from an included
   // file.

diff  --git a/clang/test/Frontend/rewrite-includes-cli-include.c 
b/clang/test/Frontend/rewrite-includes-cli-include.c
index 437bc2ffadf1960..d63f966f79ca6af 100644
--- a/clang/test/Frontend/rewrite-includes-cli-include.c
+++ b/clang/test/Frontend/rewrite-includes-cli-include.c
@@ -3,7 +3,6 @@ main_file_line
 // CHECK: {{^}}# 1 ""{{$}}
 // CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|)}}rewrite-includes2.h" 1{{$}}
 // CHECK-NEXT: {{^}}int included_line2;{{$}}
-// CHECK-NEXT: {{^}}#endif /* rewrite-includes2.h expanded by 
-frewrite-includes */{{$}}
 // CHECK-NEXT: {{^}}# 1 "" 2{{$}}
 // CHECK-NEXT: {{^}}# 1 "{{.*}}rewrite-includes-cli-include.c"{{$}}
 // CHECK-NEXT: FileCheck



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


[clang] 71d83bb - Add -fkeep-system-includes modifier for -E

2023-10-06 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-10-06T12:55:48-07:00
New Revision: 71d83bb426104fb77605382c61968aaf55b537b8

URL: 
https://github.com/llvm/llvm-project/commit/71d83bb426104fb77605382c61968aaf55b537b8
DIFF: 
https://github.com/llvm/llvm-project/commit/71d83bb426104fb77605382c61968aaf55b537b8.diff

LOG: Add -fkeep-system-includes modifier for -E

This option will cause -E to preserve the #include directives
for system headers, rather than expanding them into the output.
This can greatly reduce the volume of preprocessed source text
in a test case, making test case reduction simpler.

Note that -fkeep-system-includes is not always appropriate. For
example, if the problem you want to reproduce is induced by a
system header file, it's better to expand those headers fully.
If your source defines symbols that influence the content of a
system header (e.g., _POSIX_SOURCE) then -E will eliminate the
definition, potentially changing the meaning of the preprocessed
source. If you use -isystem to point to non-system headers, for
example to suppress warnings in third-party software, those will
not be expanded and might make the preprocessed source less useful
as a test case.

Added: 
clang/test/Frontend/Inputs/dashE/dashE.h
clang/test/Frontend/Inputs/dashE/sys/a.h
clang/test/Frontend/Inputs/dashE/sys/b.h
clang/test/Frontend/dashE-sysincludes.cpp

Modified: 
clang/docs/CommandGuide/clang.rst
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Driver/Options.td
clang/include/clang/Frontend/PreprocessorOutputOptions.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/PrintPreprocessedOutput.cpp
clang/test/Preprocessor/minimize-whitespace-messages.c

Removed: 




diff  --git a/clang/docs/CommandGuide/clang.rst 
b/clang/docs/CommandGuide/clang.rst
index 139c8f25137d3fb..e1c872cdc55396a 100644
--- a/clang/docs/CommandGuide/clang.rst
+++ b/clang/docs/CommandGuide/clang.rst
@@ -684,6 +684,21 @@ Preprocessor Options
 
   Do not search clang's builtin directory for include files.
 
+.. option:: -fkeep-system-includes
+
+  Usable only with :option:`-E`. Do not copy the preprocessed content of
+  "system" headers to the output; instead, preserve the #include directive.
+  This can greatly reduce the volume of text produced by :option:`-E` which
+  can be helpful when trying to produce a "small" reproduceable test case.
+
+  This option does not guarantee reproduceability, however. If the including
+  source defines preprocessor symbols that influence the behavior of system
+  headers (for example, ``_XOPEN_SOURCE``) the operation of :option:`-E` will
+  remove that definition and thus can change the semantics of the included
+  header. Also, using a 
diff erent version of the system headers (especially a
+  
diff erent version of the STL) may result in 
diff erent behavior. Always verify
+  the preprocessed file by compiling it separately.
+
 
 ENVIRONMENT
 ---

diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 02c07166f89a887..d2a435041a1542f 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -152,6 +152,7 @@ Non-comprehensive list of changes in this release
 
 New Compiler Flags
 --
+
 * ``-fverify-intermediate-code`` and its complement 
``-fno-verify-intermediate-code``.
   Enables or disables verification of the generated LLVM IR.
   Users can pass this to turn on extra verification to catch certain types of
@@ -159,6 +160,10 @@ New Compiler Flags
   Since enabling the verifier adds a non-trivial cost of a few percent impact 
on
   build times, it's disabled by default, unless your LLVM distribution itself 
is
   compiled with runtime checks enabled.
+* ``-fkeep-system-includes`` modifies the behavior of the ``-E`` option,
+  preserving ``#include`` directives for "system" headers instead of copying
+  the preprocessed text to the output. This can greatly reduce the size of the
+  preprocessed output, which can be helpful when trying to reduce a test case.
 
 Deprecated Compiler Flags
 -

diff  --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td 
b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index 91a95def4f80de4..9c00fa50bb95580 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -182,8 +182,8 @@ def err_drv_invalid_Xopenmp_target_with_args : Error<
   "invalid -Xopenmp-target argument: '%0', options requiring arguments are 
unsupported">;
 def err_drv_argument_only_allowed_with : Error<
   "invalid argument '%0' only allowed with '%1'">;
-def err_drv_minws_unsupported_input_type : Error<
-  "'-fminimize-whitespace' invalid for input of type %0">;
+def err_drv_opt_unsupported_input_type : Error<
+  "'%0' invalid for input of type %1">;
 def 

[clang] 9500616 - [NFC] Change a reference member to pointer

2023-10-06 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-10-06T12:55:48-07:00
New Revision: 9500616a049995c0d23e070534a41b2ddbec1495

URL: 
https://github.com/llvm/llvm-project/commit/9500616a049995c0d23e070534a41b2ddbec1495
DIFF: 
https://github.com/llvm/llvm-project/commit/9500616a049995c0d23e070534a41b2ddbec1495.diff

LOG: [NFC] Change a reference member to pointer

This will allow the raw_ostream to be redirected in a subsequent commit.

Added: 


Modified: 
clang/lib/Frontend/PrintPreprocessedOutput.cpp

Removed: 




diff  --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp 
b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
index 1b262d9e6f7cb3b..f86ba08d36223be 100644
--- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -32,42 +32,42 @@ using namespace clang;
 /// PrintMacroDefinition - Print a macro definition in a form that will be
 /// properly accepted back as a definition.
 static void PrintMacroDefinition(const IdentifierInfo , const MacroInfo ,
- Preprocessor , raw_ostream ) {
-  OS << "#define " << II.getName();
+ Preprocessor , raw_ostream *OS) {
+  *OS << "#define " << II.getName();
 
   if (MI.isFunctionLike()) {
-OS << '(';
+*OS << '(';
 if (!MI.param_empty()) {
   MacroInfo::param_iterator AI = MI.param_begin(), E = MI.param_end();
   for (; AI+1 != E; ++AI) {
-OS << (*AI)->getName();
-OS << ',';
+*OS << (*AI)->getName();
+*OS << ',';
   }
 
   // Last argument.
   if ((*AI)->getName() == "__VA_ARGS__")
-OS << "...";
+*OS << "...";
   else
-OS << (*AI)->getName();
+*OS << (*AI)->getName();
 }
 
 if (MI.isGNUVarargs())
-  OS << "...";  // #define foo(x...)
+  *OS << "...";  // #define foo(x...)
 
-OS << ')';
+*OS << ')';
   }
 
   // GCC always emits a space, even if the macro body is empty.  However, do 
not
   // want to emit two spaces if the first token has a leading space.
   if (MI.tokens_empty() || !MI.tokens_begin()->hasLeadingSpace())
-OS << ' ';
+*OS << ' ';
 
   SmallString<128> SpellingBuffer;
   for (const auto  : MI.tokens()) {
 if (T.hasLeadingSpace())
-  OS << ' ';
+  *OS << ' ';
 
-OS << PP.getSpelling(T, SpellingBuffer);
+*OS << PP.getSpelling(T, SpellingBuffer);
   }
 }
 
@@ -81,7 +81,7 @@ class PrintPPOutputPPCallbacks : public PPCallbacks {
   SourceManager 
   TokenConcatenation ConcatInfo;
 public:
-  raw_ostream 
+  raw_ostream *OS;
 private:
   unsigned CurLine;
 
@@ -102,7 +102,7 @@ class PrintPPOutputPPCallbacks : public PPCallbacks {
   Token PrevPrevTok;
 
 public:
-  PrintPPOutputPPCallbacks(Preprocessor , raw_ostream , bool lineMarkers,
+  PrintPPOutputPPCallbacks(Preprocessor , raw_ostream *os, bool lineMarkers,
bool defines, bool DumpIncludeDirectives,
bool UseLineDirectives, bool MinimizeWhitespace,
bool DirectivesOnly)
@@ -235,23 +235,23 @@ void PrintPPOutputPPCallbacks::WriteLineInfo(unsigned 
LineNo,
 
   // Emit #line directives or GNU line markers depending on what mode we're in.
   if (UseLineDirectives) {
-OS << "#line" << ' ' << LineNo << ' ' << '"';
-OS.write_escaped(CurFilename);
-OS << '"';
+*OS << "#line" << ' ' << LineNo << ' ' << '"';
+OS->write_escaped(CurFilename);
+*OS << '"';
   } else {
-OS << '#' << ' ' << LineNo << ' ' << '"';
-OS.write_escaped(CurFilename);
-OS << '"';
+*OS << '#' << ' ' << LineNo << ' ' << '"';
+OS->write_escaped(CurFilename);
+*OS << '"';
 
 if (ExtraLen)
-  OS.write(Extra, ExtraLen);
+  OS->write(Extra, ExtraLen);
 
 if (FileType == SrcMgr::C_System)
-  OS.write(" 3", 2);
+  OS->write(" 3", 2);
 else if (FileType == SrcMgr::C_ExternCSystem)
-  OS.write(" 3 4", 4);
+  OS->write(" 3 4", 4);
   }
-  OS << '\n';
+  *OS << '\n';
 }
 
 /// MoveToLine - Move the output to the source line specified by the location
@@ -266,7 +266,7 @@ bool PrintPPOutputPPCallbacks::MoveToLine(unsigned LineNo,
   bool StartedNewLine = false;
   if ((RequireStartOfLine && EmittedTokensOnThisLine) ||
   EmittedDirectiveOnThisLine) {
-OS << '\n';
+*OS << '\n';
 StartedNewLine = true;
 CurLine += 1;
 EmittedTokensOnThisLine = false;
@@ -283,12 +283,12 @@ bool PrintPPOutputPPCallbacks::MoveToLine(unsigned LineNo,
 // Printing a single line has priority over printing a #line directive, 
even
 // when minimizing whitespace which otherwise would print #line directives
 // for every single line.
-OS << '\n';
+*OS << '\n';
 StartedNewLine = true;
   } else if (!DisableLineMarkers) {
 if (LineNo - CurLine <= 8) {
   const char *NewLines = "\n\n\n\n\n\n\n\n";
-  OS.write(NewLines, LineNo - 

[clang] 0d592c8 - [Driver][PS5] Simplify a condition

2023-08-22 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-08-22T15:01:55-07:00
New Revision: 0d592c8d49bc734e3807bd7093f61e634e8194cf

URL: 
https://github.com/llvm/llvm-project/commit/0d592c8d49bc734e3807bd7093f61e634e8194cf
DIFF: 
https://github.com/llvm/llvm-project/commit/0d592c8d49bc734e3807bd7093f61e634e8194cf.diff

LOG: [Driver][PS5] Simplify a condition

Added: 


Modified: 
clang/lib/Driver/ToolChains/PS4CPU.cpp

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp 
b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index 2f43d33bf0f1c8..33b81d09e8b00e 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -157,14 +157,12 @@ void tools::PScpu::Linker::ConstructJob(Compilation , 
const JobAction ,
   const bool UseJMC =
   Args.hasFlag(options::OPT_fjmc, options::OPT_fno_jmc, false);
   const bool IsPS4 = TC.getTriple().isPS4();
-  const bool IsPS5 = TC.getTriple().isPS5();
-  assert(IsPS4 || IsPS5);
 
   const char *PS4LTOArgs = "";
   auto AddCodeGenFlag = [&](Twine Flag) {
 if (IsPS4)
   PS4LTOArgs = Args.MakeArgString(Twine(PS4LTOArgs) + " " + Flag);
-else if (IsPS5)
+else
   CmdArgs.push_back(Args.MakeArgString(Twine("-plugin-opt=") + Flag));
   };
 



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


[clang] 1fcc2bc - Reapply "[DebugInfo] Alternate (more efficient) MD5 fix"

2023-08-18 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-08-18T09:20:42-07:00
New Revision: 1fcc2bc31bb9352a13445ff4a5cccb0bebb8ea5b

URL: 
https://github.com/llvm/llvm-project/commit/1fcc2bc31bb9352a13445ff4a5cccb0bebb8ea5b
DIFF: 
https://github.com/llvm/llvm-project/commit/1fcc2bc31bb9352a13445ff4a5cccb0bebb8ea5b.diff

LOG: Reapply "[DebugInfo] Alternate (more efficient) MD5 fix"

D155991 changed the file lookup to do a full string compare on the
filename; however, this added ~0.5% to compile time with -g.
Go back to the previous pointer-based lookup, but capture the main
file's checksum as well as its name to use when creating the extra
DIFile entry. This causes all entries to be consistent and also
avoids computing the checksum twice.

This reverts commit 5956648fc3ba11dd6b0d0f2d1d9b923e7f80f247.
There was a string lifetime issue that is now corrected.

Differential Revision: https://reviews.llvm.org/D156571

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/test/CodeGenCXX/debug-info-function-context.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index 54e31bec0cc5bc..36e29285141b59 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -391,12 +391,14 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   SourceManager  = CGM.getContext().getSourceManager();
   StringRef FileName;
   FileID FID;
+  std::optional> CSInfo;
 
   if (Loc.isInvalid()) {
 // The DIFile used by the CU is distinct from the main source file. Call
 // createFile() below for canonicalization if the source file was specified
 // with an absolute path.
 FileName = TheCU->getFile()->getFilename();
+CSInfo = TheCU->getFile()->getChecksum();
   } else {
 PresumedLoc PLoc = SM.getPresumedLoc(Loc);
 FileName = PLoc.getFilename();
@@ -417,13 +419,14 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   return cast(V);
   }
 
+  // Put Checksum at a scope where it will persist past the createFile call.
   SmallString<64> Checksum;
-
-  std::optional CSKind =
+  if (!CSInfo) {
+std::optional CSKind =
   computeChecksum(FID, Checksum);
-  std::optional> CSInfo;
-  if (CSKind)
-CSInfo.emplace(*CSKind, Checksum);
+if (CSKind)
+  CSInfo.emplace(*CSKind, Checksum);
+  }
   return createFile(FileName, CSInfo, getSource(SM, SM.getFileID(Loc)));
 }
 

diff  --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index ec843793deea6c..b47a4934f0b1ba 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -148,7 +148,7 @@ class CGDebugInfo {
   llvm::BumpPtrAllocator DebugInfoNames;
   StringRef CWDName;
 
-  llvm::StringMap DIFileCache;
+  llvm::DenseMap DIFileCache;
   llvm::DenseMap SPCache;
   /// Cache declarations relevant to DW_TAG_imported_declarations (C++
   /// using declarations and global alias variables) that aren't covered

diff  --git a/clang/test/CodeGenCXX/debug-info-function-context.cpp 
b/clang/test/CodeGenCXX/debug-info-function-context.cpp
index 8d3309f42748dc..63fdf877fdb7db 100644
--- a/clang/test/CodeGenCXX/debug-info-function-context.cpp
+++ b/clang/test/CodeGenCXX/debug-info-function-context.cpp
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple 
x86_64-pc-linux-gnu %s \
-// RUN: -dwarf-version=5 -main-file-name %s  -o - | FileCheck %s
+// RUN: -dwarf-version=5 -main-file-name debug-info-function-context.cpp  
-o - | FileCheck %s
 
 struct C {
   void member_function();
@@ -31,8 +31,8 @@ int global_initialized_variable = C::static_member_function();
 
 // The first DIFile is for the CU, the second is what everything else uses.
 // We're using DWARF v5 so both should have MD5 checksums.
-// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5
-// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5
+// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5, 
checksum: [[CKSUM:".*"]]
+// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5, checksum: [[CKSUM]]
 // CHECK: ![[C:[0-9]+]] = distinct !DICompositeType(tag: 
DW_TAG_structure_type, name: "C",
 // CHECK: ![[NS:.*]] = !DINamespace(name: "ns"
 // CHECK: !DISubprogram(name: "member_function",{{.*}} scope: ![[C]],{{.*}} 
DISPFlagDefinition



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


[clang] 5956648 - Revert "Reapply "[DebugInfo] Alternate (more efficient) MD5 fix""

2023-08-18 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-08-18T06:35:34-07:00
New Revision: 5956648fc3ba11dd6b0d0f2d1d9b923e7f80f247

URL: 
https://github.com/llvm/llvm-project/commit/5956648fc3ba11dd6b0d0f2d1d9b923e7f80f247
DIFF: 
https://github.com/llvm/llvm-project/commit/5956648fc3ba11dd6b0d0f2d1d9b923e7f80f247.diff

LOG: Revert "Reapply "[DebugInfo] Alternate (more efficient) MD5 fix""

This reverts commit 2e4d2d800b9ce0924513a2f24e7a1f3d22b52383.

Invalid checksums detected here:
https://lab.llvm.org/buildbot/#/builders/37/builds/24465

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/test/CodeGenCXX/debug-info-function-context.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index e782b7f906e6e6..54e31bec0cc5bc 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -391,14 +391,12 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   SourceManager  = CGM.getContext().getSourceManager();
   StringRef FileName;
   FileID FID;
-  std::optional> CSInfo;
 
   if (Loc.isInvalid()) {
 // The DIFile used by the CU is distinct from the main source file. Call
 // createFile() below for canonicalization if the source file was specified
 // with an absolute path.
 FileName = TheCU->getFile()->getFilename();
-CSInfo = TheCU->getFile()->getChecksum();
   } else {
 PresumedLoc PLoc = SM.getPresumedLoc(Loc);
 FileName = PLoc.getFilename();
@@ -419,13 +417,13 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   return cast(V);
   }
 
-  if (!CSInfo) {
-SmallString<64> Checksum;
-std::optional CSKind =
+  SmallString<64> Checksum;
+
+  std::optional CSKind =
   computeChecksum(FID, Checksum);
-if (CSKind)
-  CSInfo.emplace(*CSKind, Checksum);
-  }
+  std::optional> CSInfo;
+  if (CSKind)
+CSInfo.emplace(*CSKind, Checksum);
   return createFile(FileName, CSInfo, getSource(SM, SM.getFileID(Loc)));
 }
 

diff  --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index b47a4934f0b1ba..ec843793deea6c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -148,7 +148,7 @@ class CGDebugInfo {
   llvm::BumpPtrAllocator DebugInfoNames;
   StringRef CWDName;
 
-  llvm::DenseMap DIFileCache;
+  llvm::StringMap DIFileCache;
   llvm::DenseMap SPCache;
   /// Cache declarations relevant to DW_TAG_imported_declarations (C++
   /// using declarations and global alias variables) that aren't covered

diff  --git a/clang/test/CodeGenCXX/debug-info-function-context.cpp 
b/clang/test/CodeGenCXX/debug-info-function-context.cpp
index 63fdf877fdb7db..8d3309f42748dc 100644
--- a/clang/test/CodeGenCXX/debug-info-function-context.cpp
+++ b/clang/test/CodeGenCXX/debug-info-function-context.cpp
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple 
x86_64-pc-linux-gnu %s \
-// RUN: -dwarf-version=5 -main-file-name debug-info-function-context.cpp  
-o - | FileCheck %s
+// RUN: -dwarf-version=5 -main-file-name %s  -o - | FileCheck %s
 
 struct C {
   void member_function();
@@ -31,8 +31,8 @@ int global_initialized_variable = C::static_member_function();
 
 // The first DIFile is for the CU, the second is what everything else uses.
 // We're using DWARF v5 so both should have MD5 checksums.
-// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5, 
checksum: [[CKSUM:".*"]]
-// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5, checksum: [[CKSUM]]
+// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5
+// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5
 // CHECK: ![[C:[0-9]+]] = distinct !DICompositeType(tag: 
DW_TAG_structure_type, name: "C",
 // CHECK: ![[NS:.*]] = !DINamespace(name: "ns"
 // CHECK: !DISubprogram(name: "member_function",{{.*}} scope: ![[C]],{{.*}} 
DISPFlagDefinition



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


[clang] 2e4d2d8 - Reapply "[DebugInfo] Alternate (more efficient) MD5 fix"

2023-08-18 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-08-18T05:24:00-07:00
New Revision: 2e4d2d800b9ce0924513a2f24e7a1f3d22b52383

URL: 
https://github.com/llvm/llvm-project/commit/2e4d2d800b9ce0924513a2f24e7a1f3d22b52383
DIFF: 
https://github.com/llvm/llvm-project/commit/2e4d2d800b9ce0924513a2f24e7a1f3d22b52383.diff

LOG: Reapply "[DebugInfo] Alternate (more efficient) MD5 fix"

D155991 changed the file lookup to do a full string compare on the
filename; however, this added ~0.5% to compile time with -g.
Go back to the previous pointer-based lookup, but capture the main
file's checksum as well as its name to use when creating the extra
DIFile entry. This causes all entries to be consistent and also
avoids computing the checksum twice.

This reverts commit 21e7f73494663814e0296066895dfacdebfac6d4.
I'm unable to find a reason for the memory management issues
that caused the revert, so trying again.

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/test/CodeGenCXX/debug-info-function-context.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index 54e31bec0cc5bc..e782b7f906e6e6 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -391,12 +391,14 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   SourceManager  = CGM.getContext().getSourceManager();
   StringRef FileName;
   FileID FID;
+  std::optional> CSInfo;
 
   if (Loc.isInvalid()) {
 // The DIFile used by the CU is distinct from the main source file. Call
 // createFile() below for canonicalization if the source file was specified
 // with an absolute path.
 FileName = TheCU->getFile()->getFilename();
+CSInfo = TheCU->getFile()->getChecksum();
   } else {
 PresumedLoc PLoc = SM.getPresumedLoc(Loc);
 FileName = PLoc.getFilename();
@@ -417,13 +419,13 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   return cast(V);
   }
 
-  SmallString<64> Checksum;
-
-  std::optional CSKind =
+  if (!CSInfo) {
+SmallString<64> Checksum;
+std::optional CSKind =
   computeChecksum(FID, Checksum);
-  std::optional> CSInfo;
-  if (CSKind)
-CSInfo.emplace(*CSKind, Checksum);
+if (CSKind)
+  CSInfo.emplace(*CSKind, Checksum);
+  }
   return createFile(FileName, CSInfo, getSource(SM, SM.getFileID(Loc)));
 }
 

diff  --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index ec843793deea6c..b47a4934f0b1ba 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -148,7 +148,7 @@ class CGDebugInfo {
   llvm::BumpPtrAllocator DebugInfoNames;
   StringRef CWDName;
 
-  llvm::StringMap DIFileCache;
+  llvm::DenseMap DIFileCache;
   llvm::DenseMap SPCache;
   /// Cache declarations relevant to DW_TAG_imported_declarations (C++
   /// using declarations and global alias variables) that aren't covered

diff  --git a/clang/test/CodeGenCXX/debug-info-function-context.cpp 
b/clang/test/CodeGenCXX/debug-info-function-context.cpp
index 8d3309f42748dc..63fdf877fdb7db 100644
--- a/clang/test/CodeGenCXX/debug-info-function-context.cpp
+++ b/clang/test/CodeGenCXX/debug-info-function-context.cpp
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple 
x86_64-pc-linux-gnu %s \
-// RUN: -dwarf-version=5 -main-file-name %s  -o - | FileCheck %s
+// RUN: -dwarf-version=5 -main-file-name debug-info-function-context.cpp  
-o - | FileCheck %s
 
 struct C {
   void member_function();
@@ -31,8 +31,8 @@ int global_initialized_variable = C::static_member_function();
 
 // The first DIFile is for the CU, the second is what everything else uses.
 // We're using DWARF v5 so both should have MD5 checksums.
-// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5
-// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5
+// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5, 
checksum: [[CKSUM:".*"]]
+// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5, checksum: [[CKSUM]]
 // CHECK: ![[C:[0-9]+]] = distinct !DICompositeType(tag: 
DW_TAG_structure_type, name: "C",
 // CHECK: ![[NS:.*]] = !DINamespace(name: "ns"
 // CHECK: !DISubprogram(name: "member_function",{{.*}} scope: ![[C]],{{.*}} 
DISPFlagDefinition



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


[clang] 21e7f73 - Revert "[DebugInfo] Alternate (more efficient) MD5 fix"

2023-08-17 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-08-17T11:34:26-07:00
New Revision: 21e7f73494663814e0296066895dfacdebfac6d4

URL: 
https://github.com/llvm/llvm-project/commit/21e7f73494663814e0296066895dfacdebfac6d4
DIFF: 
https://github.com/llvm/llvm-project/commit/21e7f73494663814e0296066895dfacdebfac6d4.diff

LOG: Revert "[DebugInfo] Alternate (more efficient) MD5 fix"

This reverts commit ca1295c5a15f03ede2fe620cc80d6a1e6e6735b8.
It seems to be the culprit for at least some of today's bot failures,
for example https://lab.llvm.org/buildbot/#/builders/238/builds/4952

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/test/CodeGenCXX/debug-info-function-context.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index e782b7f906e6e6..54e31bec0cc5bc 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -391,14 +391,12 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   SourceManager  = CGM.getContext().getSourceManager();
   StringRef FileName;
   FileID FID;
-  std::optional> CSInfo;
 
   if (Loc.isInvalid()) {
 // The DIFile used by the CU is distinct from the main source file. Call
 // createFile() below for canonicalization if the source file was specified
 // with an absolute path.
 FileName = TheCU->getFile()->getFilename();
-CSInfo = TheCU->getFile()->getChecksum();
   } else {
 PresumedLoc PLoc = SM.getPresumedLoc(Loc);
 FileName = PLoc.getFilename();
@@ -419,13 +417,13 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   return cast(V);
   }
 
-  if (!CSInfo) {
-SmallString<64> Checksum;
-std::optional CSKind =
+  SmallString<64> Checksum;
+
+  std::optional CSKind =
   computeChecksum(FID, Checksum);
-if (CSKind)
-  CSInfo.emplace(*CSKind, Checksum);
-  }
+  std::optional> CSInfo;
+  if (CSKind)
+CSInfo.emplace(*CSKind, Checksum);
   return createFile(FileName, CSInfo, getSource(SM, SM.getFileID(Loc)));
 }
 

diff  --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index b47a4934f0b1ba..ec843793deea6c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -148,7 +148,7 @@ class CGDebugInfo {
   llvm::BumpPtrAllocator DebugInfoNames;
   StringRef CWDName;
 
-  llvm::DenseMap DIFileCache;
+  llvm::StringMap DIFileCache;
   llvm::DenseMap SPCache;
   /// Cache declarations relevant to DW_TAG_imported_declarations (C++
   /// using declarations and global alias variables) that aren't covered

diff  --git a/clang/test/CodeGenCXX/debug-info-function-context.cpp 
b/clang/test/CodeGenCXX/debug-info-function-context.cpp
index 63fdf877fdb7db..8d3309f42748dc 100644
--- a/clang/test/CodeGenCXX/debug-info-function-context.cpp
+++ b/clang/test/CodeGenCXX/debug-info-function-context.cpp
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple 
x86_64-pc-linux-gnu %s \
-// RUN: -dwarf-version=5 -main-file-name debug-info-function-context.cpp  
-o - | FileCheck %s
+// RUN: -dwarf-version=5 -main-file-name %s  -o - | FileCheck %s
 
 struct C {
   void member_function();
@@ -31,8 +31,8 @@ int global_initialized_variable = C::static_member_function();
 
 // The first DIFile is for the CU, the second is what everything else uses.
 // We're using DWARF v5 so both should have MD5 checksums.
-// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5, 
checksum: [[CKSUM:".*"]]
-// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5, checksum: [[CKSUM]]
+// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5
+// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5
 // CHECK: ![[C:[0-9]+]] = distinct !DICompositeType(tag: 
DW_TAG_structure_type, name: "C",
 // CHECK: ![[NS:.*]] = !DINamespace(name: "ns"
 // CHECK: !DISubprogram(name: "member_function",{{.*}} scope: ![[C]],{{.*}} 
DISPFlagDefinition



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


[clang] ca1295c - [DebugInfo] Alternate (more efficient) MD5 fix

2023-08-17 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-08-17T07:03:47-07:00
New Revision: ca1295c5a15f03ede2fe620cc80d6a1e6e6735b8

URL: 
https://github.com/llvm/llvm-project/commit/ca1295c5a15f03ede2fe620cc80d6a1e6e6735b8
DIFF: 
https://github.com/llvm/llvm-project/commit/ca1295c5a15f03ede2fe620cc80d6a1e6e6735b8.diff

LOG: [DebugInfo] Alternate (more efficient) MD5 fix

D155991 changed the file lookup to do a full string compare on the
filename; however, this added ~0.5% to compile time with -g.
Go back to the previous pointer-based lookup, but capture the main
file's checksum as well as its name to use when creating the extra
DIFile entry. This causes all entries to be consistent and also
avoids computing the checksum twice.

Differential revision: https://reviews.llvm.org/D156571

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/test/CodeGenCXX/debug-info-function-context.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index 54e31bec0cc5bc..e782b7f906e6e6 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -391,12 +391,14 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   SourceManager  = CGM.getContext().getSourceManager();
   StringRef FileName;
   FileID FID;
+  std::optional> CSInfo;
 
   if (Loc.isInvalid()) {
 // The DIFile used by the CU is distinct from the main source file. Call
 // createFile() below for canonicalization if the source file was specified
 // with an absolute path.
 FileName = TheCU->getFile()->getFilename();
+CSInfo = TheCU->getFile()->getChecksum();
   } else {
 PresumedLoc PLoc = SM.getPresumedLoc(Loc);
 FileName = PLoc.getFilename();
@@ -417,13 +419,13 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation 
Loc) {
   return cast(V);
   }
 
-  SmallString<64> Checksum;
-
-  std::optional CSKind =
+  if (!CSInfo) {
+SmallString<64> Checksum;
+std::optional CSKind =
   computeChecksum(FID, Checksum);
-  std::optional> CSInfo;
-  if (CSKind)
-CSInfo.emplace(*CSKind, Checksum);
+if (CSKind)
+  CSInfo.emplace(*CSKind, Checksum);
+  }
   return createFile(FileName, CSInfo, getSource(SM, SM.getFileID(Loc)));
 }
 

diff  --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index ec843793deea6c..b47a4934f0b1ba 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -148,7 +148,7 @@ class CGDebugInfo {
   llvm::BumpPtrAllocator DebugInfoNames;
   StringRef CWDName;
 
-  llvm::StringMap DIFileCache;
+  llvm::DenseMap DIFileCache;
   llvm::DenseMap SPCache;
   /// Cache declarations relevant to DW_TAG_imported_declarations (C++
   /// using declarations and global alias variables) that aren't covered

diff  --git a/clang/test/CodeGenCXX/debug-info-function-context.cpp 
b/clang/test/CodeGenCXX/debug-info-function-context.cpp
index 8d3309f42748dc..63fdf877fdb7db 100644
--- a/clang/test/CodeGenCXX/debug-info-function-context.cpp
+++ b/clang/test/CodeGenCXX/debug-info-function-context.cpp
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple 
x86_64-pc-linux-gnu %s \
-// RUN: -dwarf-version=5 -main-file-name %s  -o - | FileCheck %s
+// RUN: -dwarf-version=5 -main-file-name debug-info-function-context.cpp  
-o - | FileCheck %s
 
 struct C {
   void member_function();
@@ -31,8 +31,8 @@ int global_initialized_variable = C::static_member_function();
 
 // The first DIFile is for the CU, the second is what everything else uses.
 // We're using DWARF v5 so both should have MD5 checksums.
-// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5
-// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5
+// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5, 
checksum: [[CKSUM:".*"]]
+// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5, checksum: [[CKSUM]]
 // CHECK: ![[C:[0-9]+]] = distinct !DICompositeType(tag: 
DW_TAG_structure_type, name: "C",
 // CHECK: ![[NS:.*]] = !DINamespace(name: "ns"
 // CHECK: !DISubprogram(name: "member_function",{{.*}} scope: ![[C]],{{.*}} 
DISPFlagDefinition



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


[clang] 4e8cae4 - Fix build break on pickier MSVC configurations [NFC]

2023-08-08 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-08-08T12:44:47-04:00
New Revision: 4e8cae4aec6590ca13ec65ed38d6da55c6031755

URL: 
https://github.com/llvm/llvm-project/commit/4e8cae4aec6590ca13ec65ed38d6da55c6031755
DIFF: 
https://github.com/llvm/llvm-project/commit/4e8cae4aec6590ca13ec65ed38d6da55c6031755.diff

LOG: Fix build break on pickier MSVC configurations [NFC]

clang::StreamingDiagnostic doesn't have a uint8_t overload,
which makes MSVC without /permissive- decide it's ambiguous.
Pre-approved in replies to D153276.

Added: 


Modified: 
clang/lib/AST/Interp/Interp.h

Removed: 




diff  --git a/clang/lib/AST/Interp/Interp.h b/clang/lib/AST/Interp/Interp.h
index 4da5985e3b3d6f..22706fc0f64688 100644
--- a/clang/lib/AST/Interp/Interp.h
+++ b/clang/lib/AST/Interp/Interp.h
@@ -1786,7 +1786,7 @@ inline bool Invalid(InterpState , CodePtr OpPC) {
 inline bool InvalidCast(InterpState , CodePtr OpPC, CastKind Kind) {
   const SourceLocation  = S.Current->getLocation(OpPC);
   S.FFDiag(Loc, diag::note_constexpr_invalid_cast)
-  << static_cast(Kind) << S.Current->getRange(OpPC);
+  << static_cast(Kind) << S.Current->getRange(OpPC);
   return false;
 }
 



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


[clang] 1fde372 - [Headers][doc] Add description of _mm256_movemask_epi8

2023-07-25 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-07-25T10:00:13-07:00
New Revision: 1fde372b320015f22e24b67c41c7028974a4a223

URL: 
https://github.com/llvm/llvm-project/commit/1fde372b320015f22e24b67c41c7028974a4a223
DIFF: 
https://github.com/llvm/llvm-project/commit/1fde372b320015f22e24b67c41c7028974a4a223.diff

LOG: [Headers][doc] Add description of _mm256_movemask_epi8

Differential revision: https://reviews.llvm.org/D156248

Added: 


Modified: 
clang/lib/Headers/avx2intrin.h

Removed: 




diff  --git a/clang/lib/Headers/avx2intrin.h b/clang/lib/Headers/avx2intrin.h
index 8f2de05674c891..c45006193eddcc 100644
--- a/clang/lib/Headers/avx2intrin.h
+++ b/clang/lib/Headers/avx2intrin.h
@@ -1307,6 +1307,23 @@ _mm256_min_epu32(__m256i __a, __m256i __b)
   return (__m256i)__builtin_elementwise_min((__v8su)__a, (__v8su)__b);
 }
 
+/// Creates a 32-bit integer mask from the most significant bit of each byte
+///in the 256-bit integer vector in \a __a and returns the result.
+///
+/// \code{.operation}
+/// FOR i := 0 TO 31
+///   j := i*8
+///   result[i] := __a[j+7]
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPMOVMSKB instruction.
+///
+/// \param __a
+///A 256-bit integer vector containing the source bytes.
+/// \returns The 32-bit integer mask.
 static __inline__ int __DEFAULT_FN_ATTRS256
 _mm256_movemask_epi8(__m256i __a)
 {



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


[clang] 7abb5fc - [DWARF] Make sure file entry for artificial functions has an MD5 checksum

2023-07-24 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-07-24T10:53:10-07:00
New Revision: 7abb5fc618cec66841a8280d2a099a4c9c8cb91b

URL: 
https://github.com/llvm/llvm-project/commit/7abb5fc618cec66841a8280d2a099a4c9c8cb91b
DIFF: 
https://github.com/llvm/llvm-project/commit/7abb5fc618cec66841a8280d2a099a4c9c8cb91b.diff

LOG: [DWARF] Make sure file entry for artificial functions has an MD5 checksum

The DIFile cache was keyed on a string pointer instead of string content,
which was causing misses and resulted in an entry without a checksum.
In DWARF v5 if any checksum is missing, we can't write any to the output
file, so this had consequences.

Fixes https://github.com/llvm/llvm-project/issues/63955

Differential revision: https://reviews.llvm.org/D155991

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.h
clang/test/CodeGenCXX/debug-info-function-context.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 58ee6dd64c4fc3..1fd08626358b93 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -148,7 +148,7 @@ class CGDebugInfo {
   llvm::BumpPtrAllocator DebugInfoNames;
   StringRef CWDName;
 
-  llvm::DenseMap DIFileCache;
+  llvm::StringMap DIFileCache;
   llvm::DenseMap SPCache;
   /// Cache declarations relevant to DW_TAG_imported_declarations (C++
   /// using declarations and global alias variables) that aren't covered

diff  --git a/clang/test/CodeGenCXX/debug-info-function-context.cpp 
b/clang/test/CodeGenCXX/debug-info-function-context.cpp
index 40a6643e71f924..8d3309f42748dc 100644
--- a/clang/test/CodeGenCXX/debug-info-function-context.cpp
+++ b/clang/test/CodeGenCXX/debug-info-function-context.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple 
x86_64-pc-linux-gnu %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple 
x86_64-pc-linux-gnu %s \
+// RUN: -dwarf-version=5 -main-file-name %s  -o - | FileCheck %s
 
 struct C {
   void member_function();
@@ -21,11 +22,17 @@ void global_namespace_function() { 
global_variable.member_function(); }
 int global_namespace_variable = 1;
 }
 
+// Generate the artificial global functions to initialize a global.
+int global_initialized_variable = C::static_member_function();
+
 // Check that the functions that belong to C have C as a context and the
 // functions that belong to the namespace have it as a context, and the global
-// function has the file as a context.
+// functions (user-defined and artificial) have the file as a context.
 
-// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",
+// The first DIFile is for the CU, the second is what everything else uses.
+// We're using DWARF v5 so both should have MD5 checksums.
+// CHECK: !DIFile(filename: "{{.*}}context.cpp",{{.*}} checksumkind: CSK_MD5
+// CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp",{{.*}} 
checksumkind: CSK_MD5
 // CHECK: ![[C:[0-9]+]] = distinct !DICompositeType(tag: 
DW_TAG_structure_type, name: "C",
 // CHECK: ![[NS:.*]] = !DINamespace(name: "ns"
 // CHECK: !DISubprogram(name: "member_function",{{.*}} scope: ![[C]],{{.*}} 
DISPFlagDefinition
@@ -35,3 +42,6 @@ int global_namespace_variable = 1;
 // CHECK: !DISubprogram(name: "global_function",{{.*}} scope: ![[FILE]],{{.*}} 
DISPFlagDefinition
 
 // CHECK: !DISubprogram(name: "global_namespace_function",{{.*}} scope: 
![[NS]],{{.*}} DISPFlagDefinition
+
+// CHECK: !DISubprogram(name: "__cxx_global_var_init",{{.*}} scope: 
![[FILE]],{{.*}} DISPFlagDefinition
+// CHECK: !DISubprogram(linkageName: "_GLOBAL__sub_I_{{.*}}",{{.*}} scope: 
![[FILE]],{{.*}} DISPFlagDefinition



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


[clang] 69593aa - [Headers][doc] Add misc non-AVX2 intrinsic descriptions

2023-07-24 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-07-24T10:51:18-07:00
New Revision: 69593aa5c054cec6be6b822c073ccdc63748a68d

URL: 
https://github.com/llvm/llvm-project/commit/69593aa5c054cec6be6b822c073ccdc63748a68d
DIFF: 
https://github.com/llvm/llvm-project/commit/69593aa5c054cec6be6b822c073ccdc63748a68d.diff

LOG: [Headers][doc] Add misc non-AVX2 intrinsic descriptions

Adds descriptions for adxintrin.h, bmi2intrin.h, clflushoptintrin.h,
clzerointrin.h, rdseedintrin.h, and xsavecintrin.h.

Differential revision: https://reviews.llvm.org/D155859

Added: 


Modified: 
clang/lib/Headers/adxintrin.h
clang/lib/Headers/bmi2intrin.h
clang/lib/Headers/clflushoptintrin.h
clang/lib/Headers/clzerointrin.h
clang/lib/Headers/rdseedintrin.h
clang/lib/Headers/xsavecintrin.h

Removed: 




diff  --git a/clang/lib/Headers/adxintrin.h b/clang/lib/Headers/adxintrin.h
index 4382530fa6c04f..20f6211e567b30 100644
--- a/clang/lib/Headers/adxintrin.h
+++ b/clang/lib/Headers/adxintrin.h
@@ -28,7 +28,31 @@
 extern "C" {
 #endif
 
-/* Intrinsics that are available only if __ADX__ defined */
+/* Intrinsics that are available only if __ADX__ is defined. */
+
+/// Adds unsigned 32-bit integers \a __x and \a __y, plus 0 or 1 as indicated
+///by the carry flag \a __cf. Stores the unsigned 32-bit sum in the memory
+///at \a __p, and returns the 8-bit carry-out (carry flag).
+///
+/// \code{.operation}
+/// temp := (__cf == 0) ? 0 : 1
+/// Store32(__p, __x + __y + temp)
+/// result := CF
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c ADCX instruction.
+///
+/// \param __cf
+///The 8-bit unsigned carry flag; any non-zero value indicates carry.
+/// \param __x
+///A 32-bit unsigned addend.
+/// \param __y
+///A 32-bit unsigned addend.
+/// \param __p
+///Pointer to memory for storing the sum.
+/// \returns The 8-bit unsigned carry-out value.
 __INLINE unsigned char
 __attribute__((__always_inline__, __nodebug__, __target__("adx")))
 _addcarryx_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
@@ -37,6 +61,29 @@ __INLINE unsigned char
 }
 
 #ifdef __x86_64__
+/// Adds unsigned 64-bit integers \a __x and \a __y, plus 0 or 1 as indicated
+///by the carry flag \a __cf. Stores the unsigned 64-bit sum in the memory
+///at \a __p, and returns the 8-bit carry-out (carry flag).
+///
+/// \code{.operation}
+/// temp := (__cf == 0) ? 0 : 1
+/// Store64(__p, __x + __y + temp)
+/// result := CF
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c ADCX instruction.
+///
+/// \param __cf
+///The 8-bit unsigned carry flag; any non-zero value indicates carry.
+/// \param __x
+///A 64-bit unsigned addend.
+/// \param __y
+///A 64-bit unsigned addend.
+/// \param __p
+///Pointer to memory for storing the sum.
+/// \returns The 8-bit unsigned carry-out value.
 __INLINE unsigned char
 __attribute__((__always_inline__, __nodebug__, __target__("adx")))
 _addcarryx_u64(unsigned char __cf, unsigned long long __x,
@@ -45,7 +92,31 @@ __INLINE unsigned char
 }
 #endif
 
-/* Intrinsics that are also available if __ADX__ undefined */
+/* Intrinsics that are also available if __ADX__ is undefined. */
+
+/// Adds unsigned 32-bit integers \a __x and \a __y, plus 0 or 1 as indicated
+///by the carry flag \a __cf. Stores the unsigned 32-bit sum in the memory
+///at \a __p, and returns the 8-bit carry-out (carry flag).
+///
+/// \code{.operation}
+/// temp := (__cf == 0) ? 0 : 1
+/// Store32(__p, __x + __y + temp)
+/// result := CF
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c ADC instruction.
+///
+/// \param __cf
+///The 8-bit unsigned carry flag; any non-zero value indicates carry.
+/// \param __x
+///A 32-bit unsigned addend.
+/// \param __y
+///A 32-bit unsigned addend.
+/// \param __p
+///Pointer to memory for storing the sum.
+/// \returns The 8-bit unsigned carry-out value.
 __INLINE unsigned char __DEFAULT_FN_ATTRS _addcarry_u32(unsigned char __cf,
 unsigned int __x,
 unsigned int __y,
@@ -54,6 +125,29 @@ __INLINE unsigned char __DEFAULT_FN_ATTRS 
_addcarry_u32(unsigned char __cf,
 }
 
 #ifdef __x86_64__
+/// Adds unsigned 64-bit integers \a __x and \a __y, plus 0 or 1 as indicated
+///by the carry flag \a __cf. Stores the unsigned 64-bit sum in the memory
+///at \a __p, and returns the 8-bit carry-out (carry flag).
+///
+/// \code{.operation}
+/// temp := (__cf == 0) ? 0 : 1
+/// Store64(__p, __x + __y + temp)
+/// result := CF
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c ADC instruction.
+///
+/// \param __cf
+///The 8-bit unsigned carry flag; any non-zero value indicates carry.
+/// \param __x
+///A 

[clang] 775d6df - [Headers][doc] Add SHA1/SHA256 intrinsic descriptions

2023-07-21 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-07-21T14:26:47-07:00
New Revision: 775d6df6a5f2fbe8d4ad6174badc2ef553ada6e3

URL: 
https://github.com/llvm/llvm-project/commit/775d6df6a5f2fbe8d4ad6174badc2ef553ada6e3
DIFF: 
https://github.com/llvm/llvm-project/commit/775d6df6a5f2fbe8d4ad6174badc2ef553ada6e3.diff

LOG: [Headers][doc] Add SHA1/SHA256 intrinsic descriptions

Differential revision: https://reviews.llvm.org/D155861

Added: 


Modified: 
clang/lib/Headers/shaintrin.h

Removed: 




diff  --git a/clang/lib/Headers/shaintrin.h b/clang/lib/Headers/shaintrin.h
index 08b1fb1dc16a36..232e1fa298230f 100644
--- a/clang/lib/Headers/shaintrin.h
+++ b/clang/lib/Headers/shaintrin.h
@@ -17,39 +17,167 @@
 /* Define the default attributes for the functions in this file. */
 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, 
__target__("sha"), __min_vector_width__(128)))
 
+/// Performs four iterations of the inner loop of the SHA-1 message digest
+///algorithm using the starting SHA-1 state (A, B, C, D) from the 128-bit
+///vector of [4 x i32] in \a V1 and the next four 32-bit elements of the
+///message from the 128-bit vector of [4 x i32] in \a V2. Note that the
+///SHA-1 state variable E must have already been added to \a V2
+///(\c _mm_sha1nexte_epu32() can perform this step). Returns the updated
+///SHA-1 state (A, B, C, D) as a 128-bit vector of [4 x i32].
+///
+///The SHA-1 algorithm has an inner loop of 80 iterations, twenty each
+///with a 
diff erent combining function and rounding constant. This
+///intrinsic performs four iterations using a combining function and
+///rounding constant selected by \a M[1:0].
+///
+/// \headerfile 
+///
+/// \code
+/// __m128i _mm_sha1rnds4_epu32(__m128i V1, __m128i V2, const int M);
+/// \endcode
+///
+/// This intrinsic corresponds to the \c SHA1RNDS4 instruction.
+///
+/// \param V1
+///A 128-bit vector of [4 x i32] containing the initial SHA-1 state.
+/// \param V2
+///A 128-bit vector of [4 x i32] containing the next four elements of
+///the message, plus SHA-1 state variable E.
+/// \param M
+///An immediate value where bits [1:0] select among four possible
+///combining functions and rounding constants (not specified here).
+/// \returns A 128-bit vector of [4 x i32] containing the updated SHA-1 state.
 #define _mm_sha1rnds4_epu32(V1, V2, M) \
   __builtin_ia32_sha1rnds4((__v4si)(__m128i)(V1), (__v4si)(__m128i)(V2), (M))
 
+/// Calculates the SHA-1 state variable E from the SHA-1 state variables in
+///the 128-bit vector of [4 x i32] in \a __X, adds that to the next set of
+///four message elements in the 128-bit vector of [4 x i32] in \a __Y, and
+///returns the result.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c SHA1NEXTE instruction.
+///
+/// \param __X
+///A 128-bit vector of [4 x i32] containing the current SHA-1 state.
+/// \param __Y
+///A 128-bit vector of [4 x i32] containing the next four elements of the
+///message.
+/// \returns A 128-bit vector of [4 x i32] containing the updated SHA-1
+///values.
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_sha1nexte_epu32(__m128i __X, __m128i __Y)
 {
   return (__m128i)__builtin_ia32_sha1nexte((__v4si)__X, (__v4si)__Y);
 }
 
+/// Performs an intermediate calculation for deriving the next four SHA-1
+///message elements using previous message elements from the 128-bit
+///vectors of [4 x i32] in \a __X and \a __Y, and returns the result.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c SHA1MSG1 instruction.
+///
+/// \param __X
+///A 128-bit vector of [4 x i32] containing previous message elements.
+/// \param __Y
+///A 128-bit vector of [4 x i32] containing previous message elements.
+/// \returns A 128-bit vector of [4 x i32] containing the derived SHA-1
+///elements.
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_sha1msg1_epu32(__m128i __X, __m128i __Y)
 {
   return (__m128i)__builtin_ia32_sha1msg1((__v4si)__X, (__v4si)__Y);
 }
 
+/// Performs the final calculation for deriving the next four SHA-1 message
+///elements using previous message elements from the 128-bit vectors of
+///[4 x i32] in \a __X and \a __Y, and returns the result.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c SHA1MSG2 instruction.
+///
+/// \param __X
+///A 128-bit vector of [4 x i32] containing an intermediate result.
+/// \param __Y
+///A 128-bit vector of [4 x i32] containing previous message values.
+/// \returns A 128-bit vector of [4 x i32] containing the updated SHA-1
+///values.
 static __inline__ __m128i __DEFAULT_FN_ATTRS
 _mm_sha1msg2_epu32(__m128i __X, __m128i __Y)
 {
   return (__m128i)__builtin_ia32_sha1msg2((__v4si)__X, (__v4si)__Y);
 }
 
+/// Performs two rounds of SHA-256 operation using the following inputs: a
+/// 

[clang] 6c30b78 - Reland "[PS4/PS5] Tidy up driver warnings finding the SDK"

2023-07-17 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-07-17T13:57:08-07:00
New Revision: 6c30b7886919eb19289f5ed9216e72de9700c9fb

URL: 
https://github.com/llvm/llvm-project/commit/6c30b7886919eb19289f5ed9216e72de9700c9fb
DIFF: 
https://github.com/llvm/llvm-project/commit/6c30b7886919eb19289f5ed9216e72de9700c9fb.diff

LOG: Reland "[PS4/PS5] Tidy up driver warnings finding the SDK"

Instead of warning possibly up to 3 times about the same problem,
warn only about the actual missing directories.

This reverts commit 9b3323d39f635db870de958f067c672f54d7b192.

The warning will stay DefaultIgnore upstream, because a variety of
tests aren't expecting it and updating the tests isn't worth the
effort.

Added: 


Modified: 
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/lib/Driver/ToolChains/PS4CPU.cpp
clang/test/Driver/frame-pointer-elim.c
clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c

Removed: 




diff  --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td 
b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index d10262826bf292..1b69324d073ab5 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -575,17 +575,13 @@ def 
err_drv_unsupported_fpatchable_function_entry_argument : Error<
   "the second argument of '-fpatchable-function-entry' must be smaller than 
the first argument">;
 
 def warn_drv_unable_to_find_directory_expected : Warning<
-  "unable to find %0 directory, expected to be in '%1'">,
+  "unable to find %0 directory, expected to be in '%1' found via %2">,
   InGroup, DefaultIgnore;
 
 def warn_drv_ps_force_pic : Warning<
   "option '%0' was ignored by the %1 toolchain, using '-fPIC'">,
   InGroup;
 
-def warn_drv_ps_sdk_dir : Warning<
-  "environment variable '%0' is set, but points to invalid or nonexistent 
directory '%1'">,
-  InGroup;
-
 def err_drv_defsym_invalid_format : Error<"defsym must be of the form: 
sym=value: %0">;
 def err_drv_defsym_invalid_symval : Error<"value is not an integer: %0">;
 def warn_drv_msvc_not_found : Warning<

diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp 
b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index 37006dc5d7ed8b..2f43d33bf0f1c8 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -256,30 +256,23 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
 D.Diag(clang::diag::err_drv_unsupported_opt_for_target)
 << "-static" << Platform;
 
-  // Determine where to find the PS4/PS5 libraries. We use the EnvVar
-  // if it exists; otherwise use the driver's installation path, which
-  // should be /host_tools/bin.
-
-  SmallString<512> SDKDir;
-  if (const char *EnvValue = getenv(EnvVar)) {
-if (!llvm::sys::fs::exists(EnvValue))
-  D.Diag(clang::diag::warn_drv_ps_sdk_dir) << EnvVar << EnvValue;
-SDKDir = EnvValue;
-  } else {
-SDKDir = D.Dir;
-llvm::sys::path::append(SDKDir, "/../../");
-  }
-
-  // By default, the driver won't report a warning if it can't find the
-  // SDK include or lib directories. This behavior could be changed if
-  // -Weverything or -Winvalid-or-nonexistent-directory options are passed.
+  // Determine where to find the PS4/PS5 libraries.
   // If -isysroot was passed, use that as the SDK base path.
+  // If not, we use the EnvVar if it exists; otherwise use the driver's
+  // installation path, which should be /host_tools/bin.
+  SmallString<80> Whence;
   if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) {
 SDKRootDir = A->getValue();
 if (!llvm::sys::fs::exists(SDKRootDir))
   D.Diag(clang::diag::warn_missing_sysroot) << SDKRootDir;
-  } else
-SDKRootDir = std::string(SDKDir.str());
+Whence = A->getSpelling();
+  } else if (const char *EnvValue = getenv(EnvVar)) {
+SDKRootDir = EnvValue;
+Whence = { "environment variable '", EnvVar, "'" };
+  } else {
+SDKRootDir = D.Dir + "/../../";
+Whence = "compiler's location";
+  }
 
   SmallString<512> SDKIncludeDir(SDKRootDir);
   llvm::sys::path::append(SDKIncludeDir, "target/include");
@@ -289,7 +282,7 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
   !Args.hasArg(options::OPT__sysroot_EQ) &&
   !llvm::sys::fs::exists(SDKIncludeDir)) {
 D.Diag(clang::diag::warn_drv_unable_to_find_directory_expected)
-<< Twine(Platform, " system headers").str() << SDKIncludeDir;
+<< Twine(Platform, " system headers").str() << SDKIncludeDir << Whence;
   }
 
   SmallString<512> SDKLibDir(SDKRootDir);
@@ -301,7 +294,7 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
   !Args.hasArg(options::OPT_emit_ast) &&
   !llvm::sys::fs::exists(SDKLibDir)) {
 D.Diag(clang::diag::warn_drv_unable_to_find_directory_expected)
-<< Twine(Platform, " system libraries").str() << SDKLibDir;
+<< 

[clang] 9b3323d - Revert "[PS4/PS5] Tidy up driver warnings finding the SDK"

2023-07-17 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-07-17T10:30:44-07:00
New Revision: 9b3323d39f635db870de958f067c672f54d7b192

URL: 
https://github.com/llvm/llvm-project/commit/9b3323d39f635db870de958f067c672f54d7b192
DIFF: 
https://github.com/llvm/llvm-project/commit/9b3323d39f635db870de958f067c672f54d7b192.diff

LOG: Revert "[PS4/PS5] Tidy up driver warnings finding the SDK"

This reverts commit ba9a7f73a12e75b005bfec359ddc37999b1d38c0.

Bot failures due to enabling the warning by default.
e.g. https://lab.llvm.org/buildbot/#/builders/139/builds/45263

Added: 


Modified: 
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/lib/Driver/ToolChains/PS4CPU.cpp
clang/test/Driver/frame-pointer-elim.c
clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c

Removed: 




diff  --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td 
b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index c84aa94ddbb44f..d10262826bf292 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -575,13 +575,17 @@ def 
err_drv_unsupported_fpatchable_function_entry_argument : Error<
   "the second argument of '-fpatchable-function-entry' must be smaller than 
the first argument">;
 
 def warn_drv_unable_to_find_directory_expected : Warning<
-  "unable to find %0 directory, expected to be in '%1' found via %2">,
-  InGroup;
+  "unable to find %0 directory, expected to be in '%1'">,
+  InGroup, DefaultIgnore;
 
 def warn_drv_ps_force_pic : Warning<
   "option '%0' was ignored by the %1 toolchain, using '-fPIC'">,
   InGroup;
 
+def warn_drv_ps_sdk_dir : Warning<
+  "environment variable '%0' is set, but points to invalid or nonexistent 
directory '%1'">,
+  InGroup;
+
 def err_drv_defsym_invalid_format : Error<"defsym must be of the form: 
sym=value: %0">;
 def err_drv_defsym_invalid_symval : Error<"value is not an integer: %0">;
 def warn_drv_msvc_not_found : Warning<

diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp 
b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index 2f43d33bf0f1c8..37006dc5d7ed8b 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -256,23 +256,30 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
 D.Diag(clang::diag::err_drv_unsupported_opt_for_target)
 << "-static" << Platform;
 
-  // Determine where to find the PS4/PS5 libraries.
+  // Determine where to find the PS4/PS5 libraries. We use the EnvVar
+  // if it exists; otherwise use the driver's installation path, which
+  // should be /host_tools/bin.
+
+  SmallString<512> SDKDir;
+  if (const char *EnvValue = getenv(EnvVar)) {
+if (!llvm::sys::fs::exists(EnvValue))
+  D.Diag(clang::diag::warn_drv_ps_sdk_dir) << EnvVar << EnvValue;
+SDKDir = EnvValue;
+  } else {
+SDKDir = D.Dir;
+llvm::sys::path::append(SDKDir, "/../../");
+  }
+
+  // By default, the driver won't report a warning if it can't find the
+  // SDK include or lib directories. This behavior could be changed if
+  // -Weverything or -Winvalid-or-nonexistent-directory options are passed.
   // If -isysroot was passed, use that as the SDK base path.
-  // If not, we use the EnvVar if it exists; otherwise use the driver's
-  // installation path, which should be /host_tools/bin.
-  SmallString<80> Whence;
   if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) {
 SDKRootDir = A->getValue();
 if (!llvm::sys::fs::exists(SDKRootDir))
   D.Diag(clang::diag::warn_missing_sysroot) << SDKRootDir;
-Whence = A->getSpelling();
-  } else if (const char *EnvValue = getenv(EnvVar)) {
-SDKRootDir = EnvValue;
-Whence = { "environment variable '", EnvVar, "'" };
-  } else {
-SDKRootDir = D.Dir + "/../../";
-Whence = "compiler's location";
-  }
+  } else
+SDKRootDir = std::string(SDKDir.str());
 
   SmallString<512> SDKIncludeDir(SDKRootDir);
   llvm::sys::path::append(SDKIncludeDir, "target/include");
@@ -282,7 +289,7 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
   !Args.hasArg(options::OPT__sysroot_EQ) &&
   !llvm::sys::fs::exists(SDKIncludeDir)) {
 D.Diag(clang::diag::warn_drv_unable_to_find_directory_expected)
-<< Twine(Platform, " system headers").str() << SDKIncludeDir << Whence;
+<< Twine(Platform, " system headers").str() << SDKIncludeDir;
   }
 
   SmallString<512> SDKLibDir(SDKRootDir);
@@ -294,7 +301,7 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
   !Args.hasArg(options::OPT_emit_ast) &&
   !llvm::sys::fs::exists(SDKLibDir)) {
 D.Diag(clang::diag::warn_drv_unable_to_find_directory_expected)
-<< Twine(Platform, " system libraries").str() << SDKLibDir << Whence;
+<< Twine(Platform, " system libraries").str() << SDKLibDir;
 return;
   }
   

[clang] ba9a7f7 - [PS4/PS5] Tidy up driver warnings finding the SDK

2023-07-17 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-07-17T09:34:15-07:00
New Revision: ba9a7f73a12e75b005bfec359ddc37999b1d38c0

URL: 
https://github.com/llvm/llvm-project/commit/ba9a7f73a12e75b005bfec359ddc37999b1d38c0
DIFF: 
https://github.com/llvm/llvm-project/commit/ba9a7f73a12e75b005bfec359ddc37999b1d38c0.diff

LOG: [PS4/PS5] Tidy up driver warnings finding the SDK

Instead of warning possibly up to 3 times about the same problem,
warn only about the actual missing directories.

Added: 


Modified: 
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/lib/Driver/ToolChains/PS4CPU.cpp
clang/test/Driver/frame-pointer-elim.c
clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c

Removed: 




diff  --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td 
b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index d10262826bf292..c84aa94ddbb44f 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -575,17 +575,13 @@ def 
err_drv_unsupported_fpatchable_function_entry_argument : Error<
   "the second argument of '-fpatchable-function-entry' must be smaller than 
the first argument">;
 
 def warn_drv_unable_to_find_directory_expected : Warning<
-  "unable to find %0 directory, expected to be in '%1'">,
-  InGroup, DefaultIgnore;
+  "unable to find %0 directory, expected to be in '%1' found via %2">,
+  InGroup;
 
 def warn_drv_ps_force_pic : Warning<
   "option '%0' was ignored by the %1 toolchain, using '-fPIC'">,
   InGroup;
 
-def warn_drv_ps_sdk_dir : Warning<
-  "environment variable '%0' is set, but points to invalid or nonexistent 
directory '%1'">,
-  InGroup;
-
 def err_drv_defsym_invalid_format : Error<"defsym must be of the form: 
sym=value: %0">;
 def err_drv_defsym_invalid_symval : Error<"value is not an integer: %0">;
 def warn_drv_msvc_not_found : Warning<

diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp 
b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index 37006dc5d7ed8b..2f43d33bf0f1c8 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -256,30 +256,23 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
 D.Diag(clang::diag::err_drv_unsupported_opt_for_target)
 << "-static" << Platform;
 
-  // Determine where to find the PS4/PS5 libraries. We use the EnvVar
-  // if it exists; otherwise use the driver's installation path, which
-  // should be /host_tools/bin.
-
-  SmallString<512> SDKDir;
-  if (const char *EnvValue = getenv(EnvVar)) {
-if (!llvm::sys::fs::exists(EnvValue))
-  D.Diag(clang::diag::warn_drv_ps_sdk_dir) << EnvVar << EnvValue;
-SDKDir = EnvValue;
-  } else {
-SDKDir = D.Dir;
-llvm::sys::path::append(SDKDir, "/../../");
-  }
-
-  // By default, the driver won't report a warning if it can't find the
-  // SDK include or lib directories. This behavior could be changed if
-  // -Weverything or -Winvalid-or-nonexistent-directory options are passed.
+  // Determine where to find the PS4/PS5 libraries.
   // If -isysroot was passed, use that as the SDK base path.
+  // If not, we use the EnvVar if it exists; otherwise use the driver's
+  // installation path, which should be /host_tools/bin.
+  SmallString<80> Whence;
   if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) {
 SDKRootDir = A->getValue();
 if (!llvm::sys::fs::exists(SDKRootDir))
   D.Diag(clang::diag::warn_missing_sysroot) << SDKRootDir;
-  } else
-SDKRootDir = std::string(SDKDir.str());
+Whence = A->getSpelling();
+  } else if (const char *EnvValue = getenv(EnvVar)) {
+SDKRootDir = EnvValue;
+Whence = { "environment variable '", EnvVar, "'" };
+  } else {
+SDKRootDir = D.Dir + "/../../";
+Whence = "compiler's location";
+  }
 
   SmallString<512> SDKIncludeDir(SDKRootDir);
   llvm::sys::path::append(SDKIncludeDir, "target/include");
@@ -289,7 +282,7 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
   !Args.hasArg(options::OPT__sysroot_EQ) &&
   !llvm::sys::fs::exists(SDKIncludeDir)) {
 D.Diag(clang::diag::warn_drv_unable_to_find_directory_expected)
-<< Twine(Platform, " system headers").str() << SDKIncludeDir;
+<< Twine(Platform, " system headers").str() << SDKIncludeDir << Whence;
   }
 
   SmallString<512> SDKLibDir(SDKRootDir);
@@ -301,7 +294,7 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
   !Args.hasArg(options::OPT_emit_ast) &&
   !llvm::sys::fs::exists(SDKLibDir)) {
 D.Diag(clang::diag::warn_drv_unable_to_find_directory_expected)
-<< Twine(Platform, " system libraries").str() << SDKLibDir;
+<< Twine(Platform, " system libraries").str() << SDKLibDir << Whence;
 return;
   }
   getFilePaths().push_back(std::string(SDKLibDir.str()));

diff  --git a/clang/test/Driver/frame-pointer-elim.c 

[clang] 1461fab - [Headers][doc] Add load/store/cmp/cvt intrinsic descriptions to avx2intrin.h

2023-06-30 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-06-30T08:31:02-07:00
New Revision: 1461fabfb141699cb1b9ffbe37abf73fa3d78b74

URL: 
https://github.com/llvm/llvm-project/commit/1461fabfb141699cb1b9ffbe37abf73fa3d78b74
DIFF: 
https://github.com/llvm/llvm-project/commit/1461fabfb141699cb1b9ffbe37abf73fa3d78b74.diff

LOG: [Headers][doc] Add load/store/cmp/cvt intrinsic descriptions to 
avx2intrin.h

Differential Revision: https://reviews.llvm.org/D153993

Added: 


Modified: 
clang/lib/Headers/avx2intrin.h

Removed: 




diff  --git a/clang/lib/Headers/avx2intrin.h b/clang/lib/Headers/avx2intrin.h
index 737cf9897d826a..8f2de05674c891 100644
--- a/clang/lib/Headers/avx2intrin.h
+++ b/clang/lib/Headers/avx2intrin.h
@@ -600,30 +600,130 @@ _mm256_blendv_epi8(__m256i __V1, __m256i __V2, __m256i 
__M)
   ((__m256i)__builtin_ia32_pblendw256((__v16hi)(__m256i)(V1), \
   (__v16hi)(__m256i)(V2), (int)(M)))
 
+/// Compares corresponding bytes in the 256-bit integer vectors in \a __a and
+///\a __b for equality and returns the outcomes in the corresponding
+///bytes of the 256-bit result.
+///
+/// \code{.operation}
+/// FOR i := 0 TO 31
+///   j := i*8
+///   result[j+7:j] := (__a[j+7:j] == __b[j+7:j]) ? 0xFF : 0
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPCMPEQB instruction.
+///
+/// \param __a
+///A 256-bit integer vector containing one of the inputs.
+/// \param __b
+///A 256-bit integer vector containing one of the inputs.
+/// \returns A 256-bit integer vector containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_cmpeq_epi8(__m256i __a, __m256i __b)
 {
   return (__m256i)((__v32qi)__a == (__v32qi)__b);
 }
 
+/// Compares corresponding elements in the 256-bit vectors of [16 x i16] in
+///\a __a and \a __b for equality and returns the outcomes in the
+///corresponding elements of the 256-bit result.
+///
+/// \code{.operation}
+/// FOR i := 0 TO 15
+///   j := i*16
+///   result[j+15:j] := (__a[j+15:j] == __b[j+15:j]) ? 0x : 0
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPCMPEQW instruction.
+///
+/// \param __a
+///A 256-bit vector of [16 x i16] containing one of the inputs.
+/// \param __b
+///A 256-bit vector of [16 x i16] containing one of the inputs.
+/// \returns A 256-bit vector of [16 x i16] containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_cmpeq_epi16(__m256i __a, __m256i __b)
 {
   return (__m256i)((__v16hi)__a == (__v16hi)__b);
 }
 
+/// Compares corresponding elements in the 256-bit vectors of [8 x i32] in
+///\a __a and \a __b for equality and returns the outcomes in the
+///corresponding elements of the 256-bit result.
+///
+/// \code{.operation}
+/// FOR i := 0 TO 7
+///   j := i*32
+///   result[j+31:j] := (__a[j+31:j] == __b[j+31:j]) ? 0x : 0
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPCMPEQD instruction.
+///
+/// \param __a
+///A 256-bit vector of [8 x i32] containing one of the inputs.
+/// \param __b
+///A 256-bit vector of [8 x i32] containing one of the inputs.
+/// \returns A 256-bit vector of [8 x i32] containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_cmpeq_epi32(__m256i __a, __m256i __b)
 {
   return (__m256i)((__v8si)__a == (__v8si)__b);
 }
 
+/// Compares corresponding elements in the 256-bit vectors of [4 x i64] in
+///\a __a and \a __b for equality and returns the outcomes in the
+///corresponding elements of the 256-bit result.
+///
+/// \code{.operation}
+/// FOR i := 0 TO 3
+///   j := i*64
+///   result[j+63:j] := (__a[j+63:j] == __b[j+63:j]) ? 0x : 0
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPCMPEQQ instruction.
+///
+/// \param __a
+///A 256-bit vector of [4 x i64] containing one of the inputs.
+/// \param __b
+///A 256-bit vector of [4 x i64] containing one of the inputs.
+/// \returns A 256-bit vector of [4 x i64] containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_cmpeq_epi64(__m256i __a, __m256i __b)
 {
   return (__m256i)((__v4di)__a == (__v4di)__b);
 }
 
+/// Compares corresponding signed bytes in the 256-bit integer vectors in
+///\a __a and \a __b for greater-than and returns the outcomes in the
+///corresponding bytes of the 256-bit result.
+///
+/// \code{.operation}
+/// FOR i := 0 TO 31
+///   j := i*8
+///   result[j+7:j] := (__a[j+7:j] > __b[j+7:j]) ? 0xFF : 0
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPCMPGTB instruction.
+///
+/// \param __a
+///A 256-bit integer vector containing one of the inputs.
+/// \param __b
+///A 256-bit integer vector containing one of the inputs.

[clang] 3db8410 - [Headers] Fix up some conditionals

2023-06-22 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-06-22T11:21:16-07:00
New Revision: 3db8410487ce704f02ef8a175e87295d4e86c8df

URL: 
https://github.com/llvm/llvm-project/commit/3db8410487ce704f02ef8a175e87295d4e86c8df
DIFF: 
https://github.com/llvm/llvm-project/commit/3db8410487ce704f02ef8a175e87295d4e86c8df.diff

LOG: [Headers] Fix up some conditionals

Added: 


Modified: 
clang/lib/Headers/bmi2intrin.h
clang/lib/Headers/clzerointrin.h
clang/lib/Headers/rdseedintrin.h

Removed: 




diff  --git a/clang/lib/Headers/bmi2intrin.h b/clang/lib/Headers/bmi2intrin.h
index 0b56aed5f4cb7..0e4dae8b9059a 100644
--- a/clang/lib/Headers/bmi2intrin.h
+++ b/clang/lib/Headers/bmi2intrin.h
@@ -7,8 +7,8 @@
  *===---===
  */
 
-#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
-#error "Never use  directly; include  instead."
+#ifndef __IMMINTRIN_H
+#error "Never use  directly; include  instead."
 #endif
 
 #ifndef __BMI2INTRIN_H
@@ -35,6 +35,14 @@ _pext_u32(unsigned int __X, unsigned int __Y)
   return __builtin_ia32_pext_si(__X, __Y);
 }
 
+static __inline__ unsigned int __DEFAULT_FN_ATTRS
+_mulx_u32(unsigned int __X, unsigned int __Y, unsigned int *__P)
+{
+  unsigned long long __res = (unsigned long long) __X * __Y;
+  *__P = (unsigned int)(__res >> 32);
+  return (unsigned int)__res;
+}
+
 #ifdef  __x86_64__
 
 static __inline__ unsigned long long __DEFAULT_FN_ATTRS
@@ -64,17 +72,7 @@ _mulx_u64 (unsigned long long __X, unsigned long long __Y,
   return (unsigned long long) __res;
 }
 
-#else /* !__x86_64__ */
-
-static __inline__ unsigned int __DEFAULT_FN_ATTRS
-_mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P)
-{
-  unsigned long long __res = (unsigned long long) __X * __Y;
-  *__P = (unsigned int) (__res >> 32);
-  return (unsigned int) __res;
-}
-
-#endif /* !__x86_64__  */
+#endif /* __x86_64__  */
 
 #undef __DEFAULT_FN_ATTRS
 

diff  --git a/clang/lib/Headers/clzerointrin.h 
b/clang/lib/Headers/clzerointrin.h
index a180984a3f285..6ed9c5e9d3d75 100644
--- a/clang/lib/Headers/clzerointrin.h
+++ b/clang/lib/Headers/clzerointrin.h
@@ -6,7 +6,7 @@
  *
  *===---===
  */
-#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
+#ifndef __X86INTRIN_H
 #error "Never use  directly; include  instead."
 #endif
 

diff  --git a/clang/lib/Headers/rdseedintrin.h 
b/clang/lib/Headers/rdseedintrin.h
index 405bc2451eb86..a1f5d7d55f9f4 100644
--- a/clang/lib/Headers/rdseedintrin.h
+++ b/clang/lib/Headers/rdseedintrin.h
@@ -7,8 +7,8 @@
  *===---===
  */
 
-#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
-#error "Never use  directly; include  instead."
+#ifndef __IMMINTRIN_H
+#error "Never use  directly; include  instead."
 #endif
 
 #ifndef __RDSEEDINTRIN_H



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


[clang] bfa467b - [Headers][doc] Add various arith/logical intrinsic descriptions to avx2intrin.h

2023-06-22 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-06-22T06:32:28-07:00
New Revision: bfa467bdc0e900dbd44e2b896678d6fb77daacf4

URL: 
https://github.com/llvm/llvm-project/commit/bfa467bdc0e900dbd44e2b896678d6fb77daacf4
DIFF: 
https://github.com/llvm/llvm-project/commit/bfa467bdc0e900dbd44e2b896678d6fb77daacf4.diff

LOG: [Headers][doc] Add various arith/logical intrinsic descriptions to 
avx2intrin.h

Differential Revision: https://reviews.llvm.org/D153462

Added: 


Modified: 
clang/lib/Headers/avx2intrin.h

Removed: 




diff  --git a/clang/lib/Headers/avx2intrin.h b/clang/lib/Headers/avx2intrin.h
index 5346a0209928e..737cf9897d826 100644
--- a/clang/lib/Headers/avx2intrin.h
+++ b/clang/lib/Headers/avx2intrin.h
@@ -19,22 +19,112 @@
 #define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, 
__target__("avx2"), __min_vector_width__(128)))
 
 /* SSE4 Multiple Packed Sums of Absolute Difference.  */
+/// Computes sixteen sum of absolute 
diff erence (SAD) operations on sets of
+///four unsigned 8-bit integers from the 256-bit integer vectors \a X and
+///\a Y.
+///
+///Eight SAD results are computed using the lower half of the input
+///vectors, and another eight using the upper half. These 16-bit values
+///are returned in the lower and upper halves of the 256-bit result,
+///respectively.
+///
+///A single SAD operation selects four bytes from \a X and four bytes from
+///\a Y as input. It computes the 
diff erences between each \a X byte and
+///the corresponding \a Y byte, takes the absolute value of each
+///
diff erence, and sums these four values to form one 16-bit result. The
+///intrinsic computes 16 of these results with 
diff erent sets of input
+///bytes.
+///
+///For each set of eight results, the SAD operations use the same four
+///bytes from \a Y; the starting bit position for these four bytes is
+///specified by \a M[1:0] times 32. The eight operations use successive
+///sets of four bytes from \a X; the starting bit position for the first
+///set of four bytes is specified by \a M[2] times 32. These bit positions
+///are all relative to the 128-bit lane for each set of eight operations.
+///
+/// \code{.operation}
+/// r := 0
+/// FOR i := 0 TO 1
+///   j := i*3
+///   Ybase := M[j+1:j]*32 + i*128
+///   Xbase := M[j+2]*32 + i*128
+///   FOR k := 0 TO 3
+/// temp0 := ABS(X[Xbase+7:Xbase] - Y[Ybase+7:Ybase])
+/// temp1 := ABS(X[Xbase+15:Xbase+8] - Y[Ybase+15:Ybase+8])
+/// temp2 := ABS(X[Xbase+23:Xbase+16] - Y[Ybase+23:Ybase+16])
+/// temp3 := ABS(X[Xbase+31:Xbase+24] - Y[Ybase+31:Ybase+24])
+/// result[r+15:r] := temp0 + temp1 + temp2 + temp3
+/// Xbase := Xbase + 8
+/// r := r + 16
+///   ENDFOR
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// \code
+/// __m256i _mm256_mpsadbw_epu8(__m256i X, __m256i Y, const int M);
+/// \endcode
+///
+/// This intrinsic corresponds to the \c VMPSADBW instruction.
+///
+/// \param X
+///A 256-bit integer vector containing one of the inputs.
+/// \param Y
+///A 256-bit integer vector containing one of the inputs.
+/// \param M
+/// An unsigned immediate value specifying the starting positions of the
+/// bytes to operate on.
+/// \returns A 256-bit vector of [16 x i16] containing the result.
 #define _mm256_mpsadbw_epu8(X, Y, M) \
   ((__m256i)__builtin_ia32_mpsadbw256((__v32qi)(__m256i)(X), \
   (__v32qi)(__m256i)(Y), (int)(M)))
 
+/// Computes the absolute value of each signed byte in the 256-bit integer
+///vector \a __a and returns each value in the corresponding byte of
+///the result.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPABSB instruction.
+///
+/// \param __a
+///A 256-bit integer vector.
+/// \returns A 256-bit integer vector containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_abs_epi8(__m256i __a)
 {
 return (__m256i)__builtin_elementwise_abs((__v32qs)__a);
 }
 
+/// Computes the absolute value of each signed 16-bit element in the 256-bit
+///vector of [16 x i16] in \a __a and returns each value in the
+///corresponding element of the result.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPABSW instruction.
+///
+/// \param __a
+///A 256-bit vector of [16 x i16].
+/// \returns A 256-bit vector of [16 x i16] containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_abs_epi16(__m256i __a)
 {
 return (__m256i)__builtin_elementwise_abs((__v16hi)__a);
 }
 
+/// Computes the absolute value of each signed 32-bit element in the 256-bit
+///vector of [8 x i32] in \a __a and returns each value in the
+///corresponding element of the result.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPABSD instruction.
+///
+/// \param __a
+///A 

[clang] 5437056 - [Headers][doc] Fix typo in avx2intrin.h doc

2023-05-31 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-05-31T06:43:38-07:00
New Revision: 543705641adb1d3533be141947264ca1b7b04479

URL: 
https://github.com/llvm/llvm-project/commit/543705641adb1d3533be141947264ca1b7b04479
DIFF: 
https://github.com/llvm/llvm-project/commit/543705641adb1d3533be141947264ca1b7b04479.diff

LOG: [Headers][doc] Fix typo in avx2intrin.h doc

Added: 


Modified: 
clang/lib/Headers/avx2intrin.h

Removed: 




diff  --git a/clang/lib/Headers/avx2intrin.h b/clang/lib/Headers/avx2intrin.h
index 409401f46ba9..5346a0209928 100644
--- a/clang/lib/Headers/avx2intrin.h
+++ b/clang/lib/Headers/avx2intrin.h
@@ -1088,7 +1088,7 @@ _mm256_sad_epu8(__m256i __a, __m256i __b)
   return __builtin_ia32_psadbw256((__v32qi)__a, (__v32qi)__b);
 }
 
-/// Shuffles 8-bit integers in the 256-bit integer vector \a __a acccording
+/// Shuffles 8-bit integers in the 256-bit integer vector \a __a according
 ///to control information in the 256-bit integer vector \a __b, and
 ///returns the 256-bit result. In effect there are two separate 128-bit
 ///shuffles in the lower and upper halves.
@@ -1128,7 +1128,7 @@ _mm256_shuffle_epi8(__m256i __a, __m256i __b)
 }
 
 /// Shuffles 32-bit integers from the 256-bit vector of [8 x i32] in \a a
-///acccording to control information in the integer literal \a imm, and
+///according to control information in the integer literal \a imm, and
 ///returns the 256-bit result. In effect there are two parallel 128-bit
 ///shuffles in the lower and upper halves.
 ///
@@ -1161,7 +1161,7 @@ _mm256_shuffle_epi8(__m256i __a, __m256i __b)
   ((__m256i)__builtin_ia32_pshufd256((__v8si)(__m256i)(a), (int)(imm)))
 
 /// Shuffles 16-bit integers from the 256-bit vector of [16 x i16] in \a a
-///acccording to control information in the integer literal \a imm, and
+///according to control information in the integer literal \a imm, and
 ///returns the 256-bit result. The upper 64 bits of each 128-bit half
 ///are shuffled in parallel; the lower 64 bits of each 128-bit half are
 ///copied from \a a unchanged.
@@ -1197,7 +1197,7 @@ _mm256_shuffle_epi8(__m256i __a, __m256i __b)
   ((__m256i)__builtin_ia32_pshufhw256((__v16hi)(__m256i)(a), (int)(imm)))
 
 /// Shuffles 16-bit integers from the 256-bit vector of [16 x i16] \a a
-///acccording to control information in the integer literal \a imm, and
+///according to control information in the integer literal \a imm, and
 ///returns the 256-bit [16 x i16] result. The lower 64 bits of each
 ///128-bit half are shuffled; the upper 64 bits of each 128-bit half are
 ///copied from \a a unchanged.



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


[clang] e5399f1 - [Headers][doc] Add shuffle-like intrinsic descriptions to avx2intrin.h

2023-05-31 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-05-31T06:33:18-07:00
New Revision: e5399f1d7cabfca90030ca03f52818e892aa389f

URL: 
https://github.com/llvm/llvm-project/commit/e5399f1d7cabfca90030ca03f52818e892aa389f
DIFF: 
https://github.com/llvm/llvm-project/commit/e5399f1d7cabfca90030ca03f52818e892aa389f.diff

LOG: [Headers][doc] Add shuffle-like intrinsic descriptions to avx2intrin.h

Differential Revision: https://reviews.llvm.org/D151749

Added: 


Modified: 
clang/lib/Headers/avx2intrin.h

Removed: 




diff  --git a/clang/lib/Headers/avx2intrin.h b/clang/lib/Headers/avx2intrin.h
index be4d30a98195e..409401f46ba9b 100644
--- a/clang/lib/Headers/avx2intrin.h
+++ b/clang/lib/Headers/avx2intrin.h
@@ -41,24 +41,126 @@ _mm256_abs_epi32(__m256i __a)
 return (__m256i)__builtin_elementwise_abs((__v8si)__a);
 }
 
+/// Converts the elements of two 256-bit vectors of [16 x i16] to 8-bit
+///integers using signed saturation, and returns the 256-bit result.
+///
+/// \code{.operation}
+/// FOR i := 0 TO 7
+///   j := i*16
+///   k := i*8
+///   result[7+k:k] := SATURATE8(__a[15+j:j])
+///   result[71+k:64+k] := SATURATE8(__b[15+j:j])
+///   result[135+k:128+k] := SATURATE8(__a[143+j:128+j])
+///   result[199+k:192+k] := SATURATE8(__b[143+j:128+j])
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPACKSSWB instruction.
+///
+/// \param __a
+///A 256-bit vector of [16 x i16] used to generate result[63:0] and
+///result[191:128].
+/// \param __b
+///A 256-bit vector of [16 x i16] used to generate result[127:64] and
+///result[255:192].
+/// \returns A 256-bit integer vector containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_packs_epi16(__m256i __a, __m256i __b)
 {
   return (__m256i)__builtin_ia32_packsswb256((__v16hi)__a, (__v16hi)__b);
 }
 
+/// Converts the elements of two 256-bit vectors of [8 x i32] to 16-bit
+///integers using signed saturation, and returns the resulting 256-bit
+///vector of [16 x i16].
+///
+/// \code{.operation}
+/// FOR i := 0 TO 3
+///   j := i*32
+///   k := i*16
+///   result[15+k:k] := SATURATE16(__a[31+j:j])
+///   result[79+k:64+k] := SATURATE16(__b[31+j:j])
+///   result[143+k:128+k] := SATURATE16(__a[159+j:128+j])
+///   result[207+k:192+k] := SATURATE16(__b[159+j:128+j])
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPACKSSDW instruction.
+///
+/// \param __a
+///A 256-bit vector of [8 x i32] used to generate result[63:0] and
+///result[191:128].
+/// \param __b
+///A 256-bit vector of [8 x i32] used to generate result[127:64] and
+///result[255:192].
+/// \returns A 256-bit vector of [16 x i16] containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_packs_epi32(__m256i __a, __m256i __b)
 {
   return (__m256i)__builtin_ia32_packssdw256((__v8si)__a, (__v8si)__b);
 }
 
+/// Converts elements from two 256-bit vectors of [16 x i16] to 8-bit integers
+///using unsigned saturation, and returns the 256-bit result.
+///
+/// \code{.operation}
+/// FOR i := 0 TO 7
+///   j := i*16
+///   k := i*8
+///   result[7+k:k] := SATURATE8U(__a[15+j:j])
+///   result[71+k:64+k] := SATURATE8U(__b[15+j:j])
+///   result[135+k:128+k] := SATURATE8U(__a[143+j:128+j])
+///   result[199+k:192+k] := SATURATE8U(__b[143+j:128+j])
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPACKUSWB instruction.
+///
+/// \param __a
+///A 256-bit vector of [16 x i16] used to generate result[63:0] and
+///result[191:128].
+/// \param __b
+///A 256-bit vector of [16 x i16] used to generate result[127:64] and
+///result[255:192].
+/// \returns A 256-bit integer vector containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_packus_epi16(__m256i __a, __m256i __b)
 {
   return (__m256i)__builtin_ia32_packuswb256((__v16hi)__a, (__v16hi)__b);
 }
 
+/// Converts elements from two 256-bit vectors of [8 x i32] to 16-bit integers
+///using unsigned saturation, and returns the resulting 256-bit vector of
+///[16 x i16].
+///
+/// \code{.operation}
+/// FOR i := 0 TO 3
+///   j := i*32
+///   k := i*16
+///   result[15+k:k] := SATURATE16U(__V1[31+j:j])
+///   result[79+k:64+k] := SATURATE16U(__V2[31+j:j])
+///   result[143+k:128+k] := SATURATE16U(__V1[159+j:128+j])
+///   result[207+k:192+k] := SATURATE16U(__V2[159+j:128+j])
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPACKUSDW instruction.
+///
+/// \param __V1
+///A 256-bit vector of [8 x i32] used to generate result[63:0] and
+///result[191:128].
+/// \param __V2
+///A 256-bit vector of [8 x i32] used to generate result[127:64] and
+///result[255:192].
+/// \returns A 256-bit vector of [16 x i16] containing the result.
 static __inline__ __m256i 

[clang] d829190 - [Headers][doc] Add add/sub/mul intrinsic descriptions to avx2intrin.h

2023-05-30 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-05-30T10:15:18-07:00
New Revision: d8291908ef49e0d560276c19c552a67d9fb3ef1d

URL: 
https://github.com/llvm/llvm-project/commit/d8291908ef49e0d560276c19c552a67d9fb3ef1d
DIFF: 
https://github.com/llvm/llvm-project/commit/d8291908ef49e0d560276c19c552a67d9fb3ef1d.diff

LOG: [Headers][doc] Add add/sub/mul intrinsic descriptions to avx2intrin.h

Differential Revision: https://reviews.llvm.org/D150114

Added: 


Modified: 
clang/lib/Headers/avx2intrin.h

Removed: 




diff  --git a/clang/lib/Headers/avx2intrin.h b/clang/lib/Headers/avx2intrin.h
index 1fbc4edafbd7f..be4d30a98195e 100644
--- a/clang/lib/Headers/avx2intrin.h
+++ b/clang/lib/Headers/avx2intrin.h
@@ -65,48 +65,150 @@ _mm256_packus_epi32(__m256i __V1, __m256i __V2)
   return (__m256i) __builtin_ia32_packusdw256((__v8si)__V1, (__v8si)__V2);
 }
 
+/// Adds 8-bit integers from corresponding bytes of two 256-bit integer
+///vectors and returns the lower 8 bits of each sum in the corresponding
+///byte of the 256-bit integer vector result (overflow is ignored).
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPADDB instruction.
+///
+/// \param __a
+///A 256-bit integer vector containing one of the source operands.
+/// \param __b
+///A 256-bit integer vector containing one of the source operands.
+/// \returns A 256-bit integer vector containing the sums.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_add_epi8(__m256i __a, __m256i __b)
 {
   return (__m256i)((__v32qu)__a + (__v32qu)__b);
 }
 
+/// Adds 16-bit integers from corresponding elements of two 256-bit vectors of
+///[16 x i16] and returns the lower 16 bits of each sum in the
+///corresponding element of the [16 x i16] result (overflow is ignored).
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPADDW instruction.
+///
+/// \param __a
+///A 256-bit vector of [16 x i16] containing one of the source operands.
+/// \param __b
+///A 256-bit vector of [16 x i16] containing one of the source operands.
+/// \returns A 256-bit vector of [16 x i16] containing the sums.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_add_epi16(__m256i __a, __m256i __b)
 {
   return (__m256i)((__v16hu)__a + (__v16hu)__b);
 }
 
+/// Adds 32-bit integers from corresponding elements of two 256-bit vectors of
+///[8 x i32] and returns the lower 32 bits of each sum in the corresponding
+///element of the [8 x i32] result (overflow is ignored).
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPADDD instruction.
+///
+/// \param __a
+///A 256-bit vector of [8 x i32] containing one of the source operands.
+/// \param __b
+///A 256-bit vector of [8 x i32] containing one of the source operands.
+/// \returns A 256-bit vector of [8 x i32] containing the sums.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_add_epi32(__m256i __a, __m256i __b)
 {
   return (__m256i)((__v8su)__a + (__v8su)__b);
 }
 
+/// Adds 64-bit integers from corresponding elements of two 256-bit vectors of
+///[4 x i64] and returns the lower 64 bits of each sum in the corresponding
+///element of the [4 x i64] result (overflow is ignored).
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPADDQ instruction.
+///
+/// \param __a
+///A 256-bit vector of [4 x i64] containing one of the source operands.
+/// \param __b
+///A 256-bit vector of [4 x i64] containing one of the source operands.
+/// \returns A 256-bit vector of [4 x i64] containing the sums.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_add_epi64(__m256i __a, __m256i __b)
 {
   return (__m256i)((__v4du)__a + (__v4du)__b);
 }
 
+/// Adds 8-bit integers from corresponding bytes of two 256-bit integer
+///vectors using signed saturation, and returns each sum in the
+///corresponding byte of the 256-bit integer vector result.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPADDSB instruction.
+///
+/// \param __a
+///A 256-bit integer vector containing one of the source operands.
+/// \param __b
+///A 256-bit integer vector containing one of the source operands.
+/// \returns A 256-bit integer vector containing the sums.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_adds_epi8(__m256i __a, __m256i __b)
 {
   return (__m256i)__builtin_elementwise_add_sat((__v32qs)__a, (__v32qs)__b);
 }
 
+/// Adds 16-bit integers from corresponding elements of two 256-bit vectors of
+///[16 x i16] using signed saturation, and returns the [16 x i16] result.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPADDSW instruction.
+///
+/// \param __a
+///A 256-bit vector of [16 x i16] containing one of the source operands.
+/// \param __b
+///A 256-bit vector of [16 x i16] containing one of the source operands.
+/// \returns A 256-bit vector 

[clang] 642bd11 - [Headers][doc] Add "shift" intrinsic descriptions to avx2intrin.h

2023-05-10 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-05-10T13:14:41-07:00
New Revision: 642bd1123d05e594cd0ef1527516f421ac07c5a6

URL: 
https://github.com/llvm/llvm-project/commit/642bd1123d05e594cd0ef1527516f421ac07c5a6
DIFF: 
https://github.com/llvm/llvm-project/commit/642bd1123d05e594cd0ef1527516f421ac07c5a6.diff

LOG: [Headers][doc] Add "shift" intrinsic descriptions to avx2intrin.h

Differential Revision: https://reviews.llvm.org/D150278

Added: 


Modified: 
clang/lib/Headers/avx2intrin.h

Removed: 




diff  --git a/clang/lib/Headers/avx2intrin.h b/clang/lib/Headers/avx2intrin.h
index 33f24f2443b3a..1fbc4edafbd7f 100644
--- a/clang/lib/Headers/avx2intrin.h
+++ b/clang/lib/Headers/avx2intrin.h
@@ -493,108 +493,404 @@ _mm256_sign_epi32(__m256i __a, __m256i __b)
 return (__m256i)__builtin_ia32_psignd256((__v8si)__a, (__v8si)__b);
 }
 
+/// Shifts each 128-bit half of the 256-bit integer vector \a a left by
+///\a imm bytes, shifting in zero bytes, and returns the result. If \a imm
+///is greater than 15, the returned result is all zeroes.
+///
+/// \headerfile 
+///
+/// \code
+/// __m256i _mm256_slli_si256(__m256i a, const int imm);
+/// \endcode
+///
+/// This intrinsic corresponds to the \c VPSLLDQ instruction.
+///
+/// \param a
+///A 256-bit integer vector to be shifted.
+/// \param imm
+/// An unsigned immediate value specifying the shift count (in bytes).
+/// \returns A 256-bit integer vector containing the result.
 #define _mm256_slli_si256(a, imm) \
   ((__m256i)__builtin_ia32_pslldqi256_byteshift((__v4di)(__m256i)(a), 
(int)(imm)))
 
+/// Shifts each 128-bit half of the 256-bit integer vector \a a left by
+///\a imm bytes, shifting in zero bytes, and returns the result. If \a imm
+///is greater than 15, the returned result is all zeroes.
+///
+/// \headerfile 
+///
+/// \code
+/// __m256i _mm256_bslli_epi128(__m256i a, const int imm);
+/// \endcode
+///
+/// This intrinsic corresponds to the \c VPSLLDQ instruction.
+///
+/// \param a
+///A 256-bit integer vector to be shifted.
+/// \param imm
+///An unsigned immediate value specifying the shift count (in bytes).
+/// \returns A 256-bit integer vector containing the result.
 #define _mm256_bslli_epi128(a, imm) \
   ((__m256i)__builtin_ia32_pslldqi256_byteshift((__v4di)(__m256i)(a), 
(int)(imm)))
 
+/// Shifts each 16-bit element of the 256-bit vector of [16 x i16] in \a __a
+///left by \a __count bits, shifting in zero bits, and returns the result.
+///If \a __count is greater than 15, the returned result is all zeroes.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPSLLW instruction.
+///
+/// \param __a
+///A 256-bit vector of [16 x i16] to be shifted.
+/// \param __count
+///An unsigned integer value specifying the shift count (in bits).
+/// \returns A 256-bit vector of [16 x i16] containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_slli_epi16(__m256i __a, int __count)
 {
   return (__m256i)__builtin_ia32_psllwi256((__v16hi)__a, __count);
 }
 
+/// Shifts each 16-bit element of the 256-bit vector of [16 x i16] in \a __a
+///left by the number of bits specified by the lower 64 bits of \a __count,
+///shifting in zero bits, and returns the result. If \a __count is greater
+///than 15, the returned result is all zeroes.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPSLLW instruction.
+///
+/// \param __a
+///A 256-bit vector of [16 x i16] to be shifted.
+/// \param __count
+///A 128-bit vector of [2 x i64] whose lower element gives the unsigned
+///shift count (in bits). The upper element is ignored.
+/// \returns A 256-bit vector of [16 x i16] containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_sll_epi16(__m256i __a, __m128i __count)
 {
   return (__m256i)__builtin_ia32_psllw256((__v16hi)__a, (__v8hi)__count);
 }
 
+/// Shifts each 32-bit element of the 256-bit vector of [8 x i32] in \a __a
+///left by \a __count bits, shifting in zero bits, and returns the result.
+///If \a __count is greater than 31, the returned result is all zeroes.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VPSLLD instruction.
+///
+/// \param __a
+///A 256-bit vector of [8 x i32] to be shifted.
+/// \param __count
+///An unsigned integer value specifying the shift count (in bits).
+/// \returns A 256-bit vector of [8 x i32] containing the result.
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_slli_epi32(__m256i __a, int __count)
 {
   return (__m256i)__builtin_ia32_pslldi256((__v8si)__a, __count);
 }
 
+/// Shifts each 32-bit element of the 256-bit vector of [8 x i32] in \a __a
+///left by the number of bits given in the lower 64 bits of \a __count,
+///shifting in zero bits, and returns the result. If \a __count is greater
+///than 31, the returned 

[clang] 22a748a - [Headers] Revise conditional for rdrand64_step

2023-04-26 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-04-26T09:00:29-07:00
New Revision: 22a748a51f2a2644f4dbc5e93615c9f3106e50d5

URL: 
https://github.com/llvm/llvm-project/commit/22a748a51f2a2644f4dbc5e93615c9f3106e50d5
DIFF: 
https://github.com/llvm/llvm-project/commit/22a748a51f2a2644f4dbc5e93615c9f3106e50d5.diff

LOG: [Headers] Revise conditional for rdrand64_step

Downstream doc tooling doesn't like an #if between the doc and the
function prototype. This change also guarantees that the prototype
stays the same for 32/64 bit users.

Added: 


Modified: 
clang/lib/Headers/immintrin.h

Removed: 




diff  --git a/clang/lib/Headers/immintrin.h b/clang/lib/Headers/immintrin.h
index dff4da2465d2..c5f84ae0286b 100644
--- a/clang/lib/Headers/immintrin.h
+++ b/clang/lib/Headers/immintrin.h
@@ -323,18 +323,14 @@ _rdrand32_step(unsigned int *__p)
 /// \param __p
 ///A pointer to a 64-bit memory location to place the random value.
 /// \returns 1 if the value was successfully generated, 0 otherwise.
-#ifdef __x86_64__
 static __inline__ int __attribute__((__always_inline__, __nodebug__, 
__target__("rdrnd")))
 _rdrand64_step(unsigned long long *__p)
 {
+#ifdef __x86_64__
   return (int)__builtin_ia32_rdrand64_step(__p);
-}
 #else
-// We need to emulate the functionality of 64-bit rdrand with 2 32-bit
-// rdrand instructions.
-static __inline__ int __attribute__((__always_inline__, __nodebug__, 
__target__("rdrnd")))
-_rdrand64_step(unsigned long long *__p)
-{
+  // We need to emulate the functionality of 64-bit rdrand with 2 32-bit
+  // rdrand instructions.
   unsigned int __lo, __hi;
   unsigned int __res_lo = __builtin_ia32_rdrand32_step(&__lo);
   unsigned int __res_hi = __builtin_ia32_rdrand32_step(&__hi);
@@ -345,8 +341,8 @@ _rdrand64_step(unsigned long long *__p)
 *__p = 0;
 return 0;
   }
-}
 #endif
+}
 #endif /* __RDRND__ */
 
 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) ||  
\



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


[clang] 039ae62 - [Headers][doc] Add "gather" intrinsic descriptions to avx2intrin.h

2023-04-26 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-04-26T08:04:31-07:00
New Revision: 039ae62405b6ea130b6f84cd54fea1e8599f1634

URL: 
https://github.com/llvm/llvm-project/commit/039ae62405b6ea130b6f84cd54fea1e8599f1634
DIFF: 
https://github.com/llvm/llvm-project/commit/039ae62405b6ea130b6f84cd54fea1e8599f1634.diff

LOG: [Headers][doc] Add "gather" intrinsic descriptions to avx2intrin.h

Differential Revision: https://reviews.llvm.org/D149205

Added: 


Modified: 
clang/lib/Headers/avx2intrin.h

Removed: 




diff  --git a/clang/lib/Headers/avx2intrin.h b/clang/lib/Headers/avx2intrin.h
index f8521e7d72b5e..33f24f2443b3a 100644
--- a/clang/lib/Headers/avx2intrin.h
+++ b/clang/lib/Headers/avx2intrin.h
@@ -935,102 +935,810 @@ _mm_srlv_epi64(__m128i __X, __m128i __Y)
   return (__m128i)__builtin_ia32_psrlv2di((__v2di)__X, (__v2di)__Y);
 }
 
+/// Conditionally gathers two 64-bit floating-point values, either from the
+///128-bit vector of [2 x double] in \a a, or from memory \a m using scaled
+///indexes from the 128-bit vector of [4 x i32] in \a i. The 128-bit vector
+///of [2 x double] in \a mask determines the source for each element.
+///
+/// \code{.operation}
+/// FOR element := 0 to 1
+///   j := element*64
+///   k := element*32
+///   IF mask[j+63] == 0
+/// result[j+63:j] := a[j+63:j]
+///   ELSE
+/// result[j+63:j] := Load64(m + SignExtend(i[k+31:k])*s)
+///   FI
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// \code
+/// __m128d _mm_mask_i32gather_pd(__m128d a, const double *m, __m128i i,
+///   __m128d mask, const int s);
+/// \endcode
+///
+/// This intrinsic corresponds to the \c VGATHERDPD instruction.
+///
+/// \param a
+///A 128-bit vector of [2 x double] used as the source when a mask bit is
+///zero.
+/// \param m
+///A pointer to the memory used for loading values.
+/// \param i
+///A 128-bit vector of [4 x i32] containing signed indexes into \a m. Only
+///the first two elements are used.
+/// \param mask
+///A 128-bit vector of [2 x double] containing the mask. The most
+///significant bit of each element in the mask vector represents the mask
+///bits. If a mask bit is zero, the corresponding value from vector \a a
+///is gathered; otherwise the value is loaded from memory.
+/// \param s
+///A literal constant scale factor for the indexes in \a i. Must be
+///1, 2, 4, or 8.
+/// \returns A 128-bit vector of [2 x double] containing the gathered values.
 #define _mm_mask_i32gather_pd(a, m, i, mask, s) \
   ((__m128d)__builtin_ia32_gatherd_pd((__v2df)(__m128i)(a), \
   (double const *)(m), \
   (__v4si)(__m128i)(i), \
   (__v2df)(__m128d)(mask), (s)))
 
+/// Conditionally gathers four 64-bit floating-point values, either from the
+///256-bit vector of [4 x double] in \a a, or from memory \a m using scaled
+///indexes from the 128-bit vector of [4 x i32] in \a i. The 256-bit vector
+///of [4 x double] in \a mask determines the source for each element.
+///
+/// \code{.operation}
+/// FOR element := 0 to 3
+///   j := element*64
+///   k := element*32
+///   IF mask[j+63] == 0
+/// result[j+63:j] := a[j+63:j]
+///   ELSE
+/// result[j+63:j] := Load64(m + SignExtend(i[k+31:k])*s)
+///   FI
+/// ENDFOR
+/// \endcode
+///
+/// \headerfile 
+///
+/// \code
+/// __m256d _mm256_mask_i32gather_pd(__m256d a, const double *m, __m128i i,
+///  __m256d mask, const int s);
+/// \endcode
+///
+/// This intrinsic corresponds to the \c VGATHERDPD instruction.
+///
+/// \param a
+///A 256-bit vector of [4 x double] used as the source when a mask bit is
+///zero.
+/// \param m
+///A pointer to the memory used for loading values.
+/// \param i
+///A 128-bit vector of [4 x i32] containing signed indexes into \a m.
+/// \param mask
+///A 256-bit vector of [4 x double] containing the mask. The most
+///significant bit of each element in the mask vector represents the mask
+///bits. If a mask bit is zero, the corresponding value from vector \a a
+///is gathered; otherwise the value is loaded from memory.
+/// \param s
+///A literal constant scale factor for the indexes in \a i. Must be
+///1, 2, 4, or 8.
+/// \returns A 256-bit vector of [4 x double] containing the gathered values.
 #define _mm256_mask_i32gather_pd(a, m, i, mask, s) \
   ((__m256d)__builtin_ia32_gatherd_pd256((__v4df)(__m256d)(a), \
  (double const *)(m), \
  (__v4si)(__m128i)(i), \
  (__v4df)(__m256d)(mask), (s)))
 
+/// Conditionally gathers two 64-bit floating-point values, either from the
+///128-bit vector of [2 x double] in \a a, or from memory \a m 

[clang] 1242644 - [Header][doc] Tweak wording for MWAIT[X] intrinsics

2023-04-19 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-04-19T09:57:33-07:00
New Revision: 12426441ea2a9fdfcf6121a0061fa91d6112781d

URL: 
https://github.com/llvm/llvm-project/commit/12426441ea2a9fdfcf6121a0061fa91d6112781d
DIFF: 
https://github.com/llvm/llvm-project/commit/12426441ea2a9fdfcf6121a0061fa91d6112781d.diff

LOG: [Header][doc] Tweak wording for MWAIT[X] intrinsics

Added: 


Modified: 
clang/lib/Headers/mwaitxintrin.h
clang/lib/Headers/pmmintrin.h

Removed: 




diff  --git a/clang/lib/Headers/mwaitxintrin.h 
b/clang/lib/Headers/mwaitxintrin.h
index 4d51892ec234a..65f427105b41b 100644
--- a/clang/lib/Headers/mwaitxintrin.h
+++ b/clang/lib/Headers/mwaitxintrin.h
@@ -40,7 +40,7 @@ _mm_monitorx(void * __p, unsigned __extensions, unsigned 
__hints)
 
 /// Used with the \c MONITORX instruction to wait while the processor is in
 ///the monitor event pending state. Data stored in the monitored address
-///range causes the processor to exit the pending state.
+///range, or an interrupt, causes the processor to exit the pending state.
 ///
 /// \headerfile 
 ///

diff  --git a/clang/lib/Headers/pmmintrin.h b/clang/lib/Headers/pmmintrin.h
index ce06695558e61..203c0aa0f8c67 100644
--- a/clang/lib/Headers/pmmintrin.h
+++ b/clang/lib/Headers/pmmintrin.h
@@ -275,7 +275,7 @@ _mm_monitor(void const *__p, unsigned __extensions, 
unsigned __hints)
 
 /// Used with the \c MONITOR instruction to wait while the processor is in
 ///the monitor event pending state. Data stored in the monitored address
-///range causes the processor to exit the pending state.
+///range, or an interrupt, causes the processor to exit the pending state.
 ///
 /// The \c MWAIT instruction can be used in kernel mode, and in other modes if
 /// MSR  C001_0015h[MonMwaitUserEn]  is set.



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


[clang] 5ddcef2 - [Headers][doc] Add/revise MONITOR/MWAIT descriptions

2023-04-19 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-04-19T09:50:15-07:00
New Revision: 5ddcef2ad3db5aa6e20a2e50e7799816c736e785

URL: 
https://github.com/llvm/llvm-project/commit/5ddcef2ad3db5aa6e20a2e50e7799816c736e785
DIFF: 
https://github.com/llvm/llvm-project/commit/5ddcef2ad3db5aa6e20a2e50e7799816c736e785.diff

LOG: [Headers][doc] Add/revise MONITOR/MWAIT descriptions

Differential Revision: https://reviews.llvm.org/D148653

Added: 


Modified: 
clang/lib/Headers/mwaitxintrin.h
clang/lib/Headers/pmmintrin.h

Removed: 




diff  --git a/clang/lib/Headers/mwaitxintrin.h 
b/clang/lib/Headers/mwaitxintrin.h
index ed485380af795..4d51892ec234a 100644
--- a/clang/lib/Headers/mwaitxintrin.h
+++ b/clang/lib/Headers/mwaitxintrin.h
@@ -16,12 +16,41 @@
 
 /* Define the default attributes for the functions in this file. */
 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__,  
__target__("mwaitx")))
+
+/// Establishes a linear address memory range to be monitored and puts
+///the processor in the monitor event pending state. Data stored in the
+///monitored address range causes the processor to exit the pending state.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c MONITORX instruction.
+///
+/// \param __p
+///The memory range to be monitored. The size of the range is determined by
+///CPUID function _0005h.
+/// \param __extensions
+///Optional extensions for the monitoring state.
+/// \param __hints
+///Optional hints for the monitoring state.
 static __inline__ void __DEFAULT_FN_ATTRS
 _mm_monitorx(void * __p, unsigned __extensions, unsigned __hints)
 {
   __builtin_ia32_monitorx(__p, __extensions, __hints);
 }
 
+/// Used with the \c MONITORX instruction to wait while the processor is in
+///the monitor event pending state. Data stored in the monitored address
+///range causes the processor to exit the pending state.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c MWAITX instruction.
+///
+/// \param __extensions
+///Optional extensions for the monitoring state, which can vary by
+///processor.
+/// \param __hints
+///Optional hints for the monitoring state, which can vary by processor.
 static __inline__ void __DEFAULT_FN_ATTRS
 _mm_mwaitx(unsigned __extensions, unsigned __hints, unsigned __clock)
 {

diff  --git a/clang/lib/Headers/pmmintrin.h b/clang/lib/Headers/pmmintrin.h
index ee660e95d2744..ce06695558e61 100644
--- a/clang/lib/Headers/pmmintrin.h
+++ b/clang/lib/Headers/pmmintrin.h
@@ -253,9 +253,12 @@ _mm_movedup_pd(__m128d __a)
 ///the processor in the monitor event pending state. Data stored in the
 ///monitored address range causes the processor to exit the pending state.
 ///
+/// The \c MONITOR instruction can be used in kernel mode, and in other modes
+/// if MSR  C001_0015h[MonMwaitUserEn]  is set.
+///
 /// \headerfile 
 ///
-/// This intrinsic corresponds to the  MONITOR  instruction.
+/// This intrinsic corresponds to the \c MONITOR instruction.
 ///
 /// \param __p
 ///The memory range to be monitored. The size of the range is determined by
@@ -270,19 +273,22 @@ _mm_monitor(void const *__p, unsigned __extensions, 
unsigned __hints)
   __builtin_ia32_monitor(__p, __extensions, __hints);
 }
 
-/// Used with the MONITOR instruction to wait while the processor is in
+/// Used with the \c MONITOR instruction to wait while the processor is in
 ///the monitor event pending state. Data stored in the monitored address
 ///range causes the processor to exit the pending state.
 ///
+/// The \c MWAIT instruction can be used in kernel mode, and in other modes if
+/// MSR  C001_0015h[MonMwaitUserEn]  is set.
+///
 /// \headerfile 
 ///
-/// This intrinsic corresponds to the  MWAIT  instruction.
+/// This intrinsic corresponds to the \c MWAIT instruction.
 ///
 /// \param __extensions
-///Optional extensions for the monitoring state, which may vary by
+///Optional extensions for the monitoring state, which can vary by
 ///processor.
 /// \param __hints
-///Optional hints for the monitoring state, which may vary by processor.
+///Optional hints for the monitoring state, which can vary by processor.
 static __inline__ void __DEFAULT_FN_ATTRS
 _mm_mwait(unsigned __extensions, unsigned __hints)
 {



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


[clang] 0905c56 - [Headers][doc] Add FMA intrinsic descriptions

2023-04-18 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-04-18T09:31:09-07:00
New Revision: 0905c567f0c7328780c727b470a92cda1ee54697

URL: 
https://github.com/llvm/llvm-project/commit/0905c567f0c7328780c727b470a92cda1ee54697
DIFF: 
https://github.com/llvm/llvm-project/commit/0905c567f0c7328780c727b470a92cda1ee54697.diff

LOG: [Headers][doc] Add FMA intrinsic descriptions

Differential Revision: https://reviews.llvm.org/D148021

Added: 


Modified: 
clang/lib/Headers/fmaintrin.h

Removed: 




diff  --git a/clang/lib/Headers/fmaintrin.h b/clang/lib/Headers/fmaintrin.h
index d889b7c5e2705..ea832fac4f992 100644
--- a/clang/lib/Headers/fmaintrin.h
+++ b/clang/lib/Headers/fmaintrin.h
@@ -18,192 +18,756 @@
 #define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, 
__target__("fma"), __min_vector_width__(128)))
 #define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, 
__target__("fma"), __min_vector_width__(256)))
 
+/// Computes a multiply-add of 128-bit vectors of [4 x float].
+///For each element, computes  (__A * __B) + __C .
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VFMADD213PS instruction.
+///
+/// \param __A
+///A 128-bit vector of [4 x float] containing the multiplicand.
+/// \param __B
+///A 128-bit vector of [4 x float] containing the multiplier.
+/// \param __C
+///A 128-bit vector of [4 x float] containing the addend.
+/// \returns A 128-bit vector of [4 x float] containing the result.
 static __inline__ __m128 __DEFAULT_FN_ATTRS128
 _mm_fmadd_ps(__m128 __A, __m128 __B, __m128 __C)
 {
   return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, 
(__v4sf)__C);
 }
 
+/// Computes a multiply-add of 128-bit vectors of [2 x double].
+///For each element, computes  (__A * __B) + __C .
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VFMADD213PD instruction.
+///
+/// \param __A
+///A 128-bit vector of [2 x double] containing the multiplicand.
+/// \param __B
+///A 128-bit vector of [2 x double] containing the multiplier.
+/// \param __C
+///A 128-bit vector of [2 x double] containing the addend.
+/// \returns A 128-bit [2 x double] vector containing the result.
 static __inline__ __m128d __DEFAULT_FN_ATTRS128
 _mm_fmadd_pd(__m128d __A, __m128d __B, __m128d __C)
 {
   return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, 
(__v2df)__C);
 }
 
+/// Computes a scalar multiply-add of the single-precision values in the
+///low 32 bits of 128-bit vectors of [4 x float].
+/// \code
+/// result[31:0] = (__A[31:0] * __B[31:0]) + __C[31:0]
+/// result[127:32] = __A[127:32]
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VFMADD213SS instruction.
+///
+/// \param __A
+///A 128-bit vector of [4 x float] containing the multiplicand in the low
+///32 bits.
+/// \param __B
+///A 128-bit vector of [4 x float] containing the multiplier in the low
+///32 bits.
+/// \param __C
+///A 128-bit vector of [4 x float] containing the addend in the low
+///32 bits.
+/// \returns A 128-bit vector of [4 x float] containing the result in the low
+///32 bits and a copy of \a __A[127:32] in the upper 96 bits.
 static __inline__ __m128 __DEFAULT_FN_ATTRS128
 _mm_fmadd_ss(__m128 __A, __m128 __B, __m128 __C)
 {
   return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, (__v4sf)__B, 
(__v4sf)__C);
 }
 
+/// Computes a scalar multiply-add of the double-precision values in the
+///low 64 bits of 128-bit vectors of [2 x double].
+/// \code
+/// result[63:0] = (__A[63:0] * __B[63:0]) + __C[63:0]
+/// result[127:64] = __A[127:64]
+/// \endcode
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VFMADD213SD instruction.
+///
+/// \param __A
+///A 128-bit vector of [2 x double] containing the multiplicand in the low
+///64 bits.
+/// \param __B
+///A 128-bit vector of [2 x double] containing the multiplier in the low
+///64 bits.
+/// \param __C
+///A 128-bit vector of [2 x double] containing the addend in the low
+///64 bits.
+/// \returns A 128-bit vector of [2 x double] containing the result in the low
+///64 bits and a copy of \a __A[127:64] in the upper 64 bits.
 static __inline__ __m128d __DEFAULT_FN_ATTRS128
 _mm_fmadd_sd(__m128d __A, __m128d __B, __m128d __C)
 {
   return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, (__v2df)__B, 
(__v2df)__C);
 }
 
+/// Computes a multiply-subtract of 128-bit vectors of [4 x float].
+///For each element, computes  (__A * __B) - __C .
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the \c VFMSUB213PS instruction.
+///
+/// \param __A
+///A 128-bit vector of [4 x float] containing the multiplicand.
+/// \param __B
+///A 128-bit vector of [4 x float] containing the multiplier.
+/// \param __C
+///A 128-bit vector of [4 x float] containing the subtrahend.
+/// 

[clang] a82170f - [Headers] Add some intrinsic function descriptions to immintrin.h.

2023-04-04 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-04-04T06:26:05-07:00
New Revision: a82170fa41ca9756b0f67d0ed015adef325e8921

URL: 
https://github.com/llvm/llvm-project/commit/a82170fa41ca9756b0f67d0ed015adef325e8921
DIFF: 
https://github.com/llvm/llvm-project/commit/a82170fa41ca9756b0f67d0ed015adef325e8921.diff

LOG: [Headers] Add some intrinsic function descriptions to immintrin.h.

Differential Revision: https://reviews.llvm.org/D147461

Added: 


Modified: 
clang/lib/Headers/immintrin.h

Removed: 




diff  --git a/clang/lib/Headers/immintrin.h b/clang/lib/Headers/immintrin.h
index 8e109af0f5817..d382ec88f30f7 100644
--- a/clang/lib/Headers/immintrin.h
+++ b/clang/lib/Headers/immintrin.h
@@ -284,18 +284,45 @@ _rdpid_u32(void) {
 
 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) ||  
\
 defined(__RDRND__)
+/// Returns a 16-bit hardware-generated random value.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  RDRAND  instruction.
+///
+/// \param __p
+///A pointer to a 16-bit memory location to place the random value.
+/// \returns 1 if the value was successfully generated, 0 otherwise.
 static __inline__ int __attribute__((__always_inline__, __nodebug__, 
__target__("rdrnd")))
 _rdrand16_step(unsigned short *__p)
 {
   return (int)__builtin_ia32_rdrand16_step(__p);
 }
 
+/// Returns a 32-bit hardware-generated random value.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  RDRAND  instruction.
+///
+/// \param __p
+///A pointer to a 32-bit memory location to place the random value.
+/// \returns 1 if the value was successfully generated, 0 otherwise.
 static __inline__ int __attribute__((__always_inline__, __nodebug__, 
__target__("rdrnd")))
 _rdrand32_step(unsigned int *__p)
 {
   return (int)__builtin_ia32_rdrand32_step(__p);
 }
 
+/// Returns a 64-bit hardware-generated random value.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  RDRAND  instruction.
+///
+/// \param __p
+///A pointer to a 64-bit memory location to place the random value.
+/// \returns 1 if the value was successfully generated, 0 otherwise.
 #ifdef __x86_64__
 static __inline__ int __attribute__((__always_inline__, __nodebug__, 
__target__("rdrnd")))
 _rdrand64_step(unsigned long long *__p)
@@ -325,48 +352,108 @@ _rdrand64_step(unsigned long long *__p)
 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) ||  
\
 defined(__FSGSBASE__)
 #ifdef __x86_64__
+/// Reads the FS base register.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  RDFSBASE  instruction.
+///
+/// \returns The lower 32 bits of the FS base register.
 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, 
__target__("fsgsbase")))
 _readfsbase_u32(void)
 {
   return __builtin_ia32_rdfsbase32();
 }
 
+/// Reads the FS base register.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  RDFSBASE  instruction.
+///
+/// \returns The contents of the FS base register.
 static __inline__ unsigned long long __attribute__((__always_inline__, 
__nodebug__, __target__("fsgsbase")))
 _readfsbase_u64(void)
 {
   return __builtin_ia32_rdfsbase64();
 }
 
+/// Reads the GS base register.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  RDGSBASE  instruction.
+///
+/// \returns The lower 32 bits of the GS base register.
 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, 
__target__("fsgsbase")))
 _readgsbase_u32(void)
 {
   return __builtin_ia32_rdgsbase32();
 }
 
+/// Reads the GS base register.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  RDGSBASE  instruction.
+///
+/// \returns The contents of the GS base register.
 static __inline__ unsigned long long __attribute__((__always_inline__, 
__nodebug__, __target__("fsgsbase")))
 _readgsbase_u64(void)
 {
   return __builtin_ia32_rdgsbase64();
 }
 
+/// Modifies the FS base register.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  WRFSBASE  instruction.
+///
+/// \param __V
+///Value to use for the lower 32 bits of the FS base register.
 static __inline__ void __attribute__((__always_inline__, __nodebug__, 
__target__("fsgsbase")))
 _writefsbase_u32(unsigned int __V)
 {
   __builtin_ia32_wrfsbase32(__V);
 }
 
+/// Modifies the FS base register.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  WRFSBASE  instruction.
+///
+/// \param __V
+///Value to use for the FS base register.
 static __inline__ void __attribute__((__always_inline__, __nodebug__, 
__target__("fsgsbase")))
 _writefsbase_u64(unsigned long long __V)
 {
   __builtin_ia32_wrfsbase64(__V);
 }
 
+/// Modifies the GS base register.
+///
+/// \headerfile 
+///
+/// This intrinsic corresponds to the  WRGSBASE  instruction.
+///
+/// \param __V
+///Value to use for the lower 32 bits of the GS base 

[clang] 9dcf6b1 - [PS4/PS5] Remove C_INCLUDE_DIRS handling

2023-03-09 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-03-09T09:26:50-08:00
New Revision: 9dcf6b19daf8980a02a5b9206126b3eff7a37e01

URL: 
https://github.com/llvm/llvm-project/commit/9dcf6b19daf8980a02a5b9206126b3eff7a37e01
DIFF: 
https://github.com/llvm/llvm-project/commit/9dcf6b19daf8980a02a5b9206126b3eff7a37e01.diff

LOG: [PS4/PS5] Remove C_INCLUDE_DIRS handling

We don't configure this way and don't intend to.

Added: 


Modified: 
clang/lib/Driver/ToolChains/PS4CPU.cpp

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp 
b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index fc5d46bc25605..b3e14618f307e 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -304,19 +304,6 @@ void toolchains::PS4PS5Base::AddClangSystemIncludeArgs(
   if (DriverArgs.hasArg(options::OPT_nostdlibinc))
 return;
 
-  // Add dirs specified via 'configure --with-c-include-dirs'.
-  StringRef CIncludeDirs(C_INCLUDE_DIRS);
-  if (!CIncludeDirs.empty()) {
-SmallVector dirs;
-CIncludeDirs.split(dirs, ":");
-for (StringRef dir : dirs) {
-  StringRef Prefix =
-llvm::sys::path::is_absolute(dir) ? StringRef(D.SysRoot) : "";
-  addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
-}
-return;
-  }
-
   addExternCSystemInclude(DriverArgs, CC1Args,
   SDKRootDir + "/target/include");
   addExternCSystemInclude(DriverArgs, CC1Args,



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


[clang] 32d441b - [PS4/PS5] Specify no or

2023-02-23 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-02-23T07:09:30-08:00
New Revision: 32d441bfb4f302e02736dc922b0388c7594fd90e

URL: 
https://github.com/llvm/llvm-project/commit/32d441bfb4f302e02736dc922b0388c7594fd90e
DIFF: 
https://github.com/llvm/llvm-project/commit/32d441bfb4f302e02736dc922b0388c7594fd90e.diff

LOG: [PS4/PS5] Specify no  or 

We've never provided these headers so set the preprocessor
toggles to reflect that.

Differential Revision: https://reviews.llvm.org/D144586

Added: 


Modified: 
clang/lib/Basic/Targets/OSTargets.h
clang/test/C/C11/n1460.c

Removed: 




diff  --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index fd372cb12df2b..0280129b3c950 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -535,6 +535,8 @@ class LLVM_LIBRARY_VISIBILITY PSOSTargetInfo : public 
OSTargetInfo {
 DefineStd(Builder, "unix", Opts);
 Builder.defineMacro("__ELF__");
 Builder.defineMacro("__SCE__");
+Builder.defineMacro("__STDC_NO_COMPLEX__");
+Builder.defineMacro("__STDC_NO_THREADS__");
   }
 
 public:

diff  --git a/clang/test/C/C11/n1460.c b/clang/test/C/C11/n1460.c
index c52ea22d99277..388b905a5ed41 100644
--- a/clang/test/C/C11/n1460.c
+++ b/clang/test/C/C11/n1460.c
@@ -7,9 +7,15 @@
 // If we claim to not support the feature then we expect diagnostics when
 // using that feature. Otherwise, we expect no diagnostics.
 #ifdef __STDC_NO_COMPLEX__
-  // We do not have any targets which do not support complex, so we don't
-  // expect to get into this block.
-  #error "it's unexpected that we don't support complex"
+  // PS4/PS5 set this to indicate no  but still support the
+  // _Complex syntax.
+  #ifdef __SCE__
+#define HAS_COMPLEX
+  #else
+// We do not have any other targets which do not support complex, so we
+// don't expect to get into this block.
+#error "it's unexpected that we don't support complex"
+  #endif
   float _Complex fc;
   double _Complex dc;
   long double _Complex ldc;



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


[clang] 17a90f1 - Tighten up a modules test

2023-02-17 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-02-17T06:35:01-08:00
New Revision: 17a90f1196c1a4b48b8d02c055497565ce5c785d

URL: 
https://github.com/llvm/llvm-project/commit/17a90f1196c1a4b48b8d02c055497565ce5c785d
DIFF: 
https://github.com/llvm/llvm-project/commit/17a90f1196c1a4b48b8d02c055497565ce5c785d.diff

LOG: Tighten up a modules test

Differential Revision: https://reviews.llvm.org/D144188

Added: 


Modified: 
clang/test/CXX/module/basic/basic.def.odr/p4.cppm

Removed: 




diff  --git a/clang/test/CXX/module/basic/basic.def.odr/p4.cppm 
b/clang/test/CXX/module/basic/basic.def.odr/p4.cppm
index a07913c1e08e1..b8f24d3ed5c8a 100644
--- a/clang/test/CXX/module/basic/basic.def.odr/p4.cppm
+++ b/clang/test/CXX/module/basic/basic.def.odr/p4.cppm
@@ -2,7 +2,7 @@
 // RUN: mkdir %t
 // RUN: split-file %s %t
 //
-// RUN: %clang_cc1 -std=c++20 %t/Module.cppm -triple %itanium_abi_triple 
-emit-llvm -o - | FileCheck %t/Module.cppm --implicit-check-not unused_inline 
--implicit-check-not unused_stastic_global_module
+// RUN: %clang_cc1 -std=c++20 %t/Module.cppm -triple %itanium_abi_triple 
-emit-llvm -o - | FileCheck %t/Module.cppm --implicit-check-not unused
 //
 // RUN: %clang_cc1 -std=c++20 %t/Module.cppm -triple %itanium_abi_triple 
-emit-module-interface -o %t/Module.pcm
 // RUN: %clang_cc1 -std=c++20 %t/module.cpp -triple %itanium_abi_triple 
-fmodule-file=%t/Module.pcm -emit-llvm -o - | FileCheck %t/module.cpp 
--implicit-check-not=unused --implicit-check-not=global_module
@@ -33,8 +33,6 @@
 // CHECK-DAG: @_ZL24const_var_module_linkage = internal
 //
 // CHECK-DAG: @_ZW6Module25unused_var_module_linkage = {{(dso_local )?}}global 
i32 4
-// CHECK-NOT: @_ZW6Module32unused_static_var_module_linkage =
-// CHECK-NOT: @_ZW6Module31unused_const_var_module_linkage =
 
 module;
 
@@ -85,7 +83,6 @@ export {
   }
 }
 
-// CHECK-NOT: define {{(dso_local )?}}void 
{{.*}}@_ZW6Module28unused_static_module_linkagev
 static void unused_static_module_linkage() {}
 
 static void used_static_module_linkage() {}



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


[clang] ecb3cd0 - [Driver] Move PS4/PS5 header search path management to the driver

2023-02-01 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-02-01T07:40:30-08:00
New Revision: ecb3cd0946a47c419efda7b92cd6f6fcc30b6be9

URL: 
https://github.com/llvm/llvm-project/commit/ecb3cd0946a47c419efda7b92cd6f6fcc30b6be9
DIFF: 
https://github.com/llvm/llvm-project/commit/ecb3cd0946a47c419efda7b92cd6f6fcc30b6be9.diff

LOG: [Driver] Move PS4/PS5 header search path management to the driver

This follows how OpenBSD, FreeBSD, and NetBSD now work. (See
D138183 and D140817 for those cases.)

It also tidies up some code duplication that wasn't exactly right.

Added: 


Modified: 
clang/lib/Driver/ToolChains/PS4CPU.cpp
clang/lib/Driver/ToolChains/PS4CPU.h
clang/lib/Lex/InitHeaderSearch.cpp
clang/test/Driver/ps4-ps5-header-search.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp 
b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index 643f815c5835a..fc5d46bc25605 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -8,6 +8,7 @@
 
 #include "PS4CPU.h"
 #include "CommonArgs.h"
+#include "clang/Config/config.h"
 #include "clang/Driver/Compilation.h"
 #include "clang/Driver/Driver.h"
 #include "clang/Driver/DriverDiagnostic.h"
@@ -253,15 +254,14 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
   // SDK include or lib directories. This behavior could be changed if
   // -Weverything or -Winvalid-or-nonexistent-directory options are passed.
   // If -isysroot was passed, use that as the SDK base path.
-  std::string PrefixDir;
   if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) {
-PrefixDir = A->getValue();
-if (!llvm::sys::fs::exists(PrefixDir))
-  D.Diag(clang::diag::warn_missing_sysroot) << PrefixDir;
+SDKRootDir = A->getValue();
+if (!llvm::sys::fs::exists(SDKRootDir))
+  D.Diag(clang::diag::warn_missing_sysroot) << SDKRootDir;
   } else
-PrefixDir = std::string(SDKDir.str());
+SDKRootDir = std::string(SDKDir.str());
 
-  SmallString<512> SDKIncludeDir(PrefixDir);
+  SmallString<512> SDKIncludeDir(SDKRootDir);
   llvm::sys::path::append(SDKIncludeDir, "target/include");
   if (!Args.hasArg(options::OPT_nostdinc) &&
   !Args.hasArg(options::OPT_nostdlibinc) &&
@@ -272,7 +272,7 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
 << Twine(Platform, " system headers").str() << SDKIncludeDir;
   }
 
-  SmallString<512> SDKLibDir(SDKDir);
+  SmallString<512> SDKLibDir(SDKRootDir);
   llvm::sys::path::append(SDKLibDir, "target/lib");
   if (!Args.hasArg(options::OPT_nostdlib) &&
   !Args.hasArg(options::OPT_nodefaultlibs) &&
@@ -287,6 +287,42 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
   getFilePaths().push_back(std::string(SDKLibDir.str()));
 }
 
+void toolchains::PS4PS5Base::AddClangSystemIncludeArgs(
+const ArgList ,
+ArgStringList ) const {
+  const Driver  = getDriver();
+
+  if (DriverArgs.hasArg(options::OPT_nostdinc))
+return;
+
+  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
+SmallString<128> Dir(D.ResourceDir);
+llvm::sys::path::append(Dir, "include");
+addSystemInclude(DriverArgs, CC1Args, Dir.str());
+  }
+
+  if (DriverArgs.hasArg(options::OPT_nostdlibinc))
+return;
+
+  // Add dirs specified via 'configure --with-c-include-dirs'.
+  StringRef CIncludeDirs(C_INCLUDE_DIRS);
+  if (!CIncludeDirs.empty()) {
+SmallVector dirs;
+CIncludeDirs.split(dirs, ":");
+for (StringRef dir : dirs) {
+  StringRef Prefix =
+llvm::sys::path::is_absolute(dir) ? StringRef(D.SysRoot) : "";
+  addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
+}
+return;
+  }
+
+  addExternCSystemInclude(DriverArgs, CC1Args,
+  SDKRootDir + "/target/include");
+  addExternCSystemInclude(DriverArgs, CC1Args,
+  SDKRootDir + "/target/include_common");
+}
+
 Tool *toolchains::PS4CPU::buildAssembler() const {
   return new tools::PScpu::Assembler(*this);
 }

diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.h 
b/clang/lib/Driver/ToolChains/PS4CPU.h
index 954e7d8d8d684..0866a5daa4cc6 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.h
+++ b/clang/lib/Driver/ToolChains/PS4CPU.h
@@ -63,6 +63,9 @@ class LLVM_LIBRARY_VISIBILITY PS4PS5Base : public Generic_ELF 
{
  const llvm::opt::ArgList , StringRef Platform,
  const char *EnvVar);
 
+  void
+  AddClangSystemIncludeArgs(const llvm::opt::ArgList ,
+llvm::opt::ArgStringList ) const override;
   // No support for finding a C++ standard library yet.
   void addLibCxxIncludePaths(const llvm::opt::ArgList ,
  llvm::opt::ArgStringList ) const override 
{
@@ -111,6 +114,10 @@ class LLVM_LIBRARY_VISIBILITY PS4PS5Base : public 
Generic_ELF {
 
 protected:
   Tool *buildLinker() const override;
+
+private:
+  // We compute the SDK root 

[clang] 787876b - [unittests] Use GTEST_SKIP() instead of return when appropriate

2023-01-26 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-01-26T08:40:38-08:00
New Revision: 787876b0d592a6b4e87d00a0adb89ce87dfc11cd

URL: 
https://github.com/llvm/llvm-project/commit/787876b0d592a6b4e87d00a0adb89ce87dfc11cd
DIFF: 
https://github.com/llvm/llvm-project/commit/787876b0d592a6b4e87d00a0adb89ce87dfc11cd.diff

LOG: [unittests] Use GTEST_SKIP() instead of return when appropriate

Basically NFC: A TEST/TEST_F/etc that bails out early (usually because
setup failed or some other runtime condition wasn't met) generally
should use GTEST_SKIP() to report its status correctly, unless it
takes steps to report another status (e.g., FAIL()).

Added: 


Modified: 
clang/unittests/AST/StructuralEquivalenceTest.cpp
clang/unittests/Driver/ToolChainTest.cpp
clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp

Removed: 




diff  --git a/clang/unittests/AST/StructuralEquivalenceTest.cpp 
b/clang/unittests/AST/StructuralEquivalenceTest.cpp
index 03616d7197ea8..5060301527ac7 100644
--- a/clang/unittests/AST/StructuralEquivalenceTest.cpp
+++ b/clang/unittests/AST/StructuralEquivalenceTest.cpp
@@ -460,7 +460,7 @@ TEST_F(StructuralEquivalenceFunctionTest,
   // These attributes may not be available on certain platforms.
   if (llvm::Triple(llvm::sys::getDefaultTargetTriple()).getArch() !=
   llvm::Triple::x86_64)
-return;
+GTEST_SKIP();
   auto t = makeNamedDecls("__attribute__((preserve_all)) void foo();",
   "__attribute__((ms_abi))   void foo();", Lang_C99);
   EXPECT_FALSE(testStructuralMatch(t));
@@ -469,7 +469,7 @@ TEST_F(StructuralEquivalenceFunctionTest,
 TEST_F(StructuralEquivalenceFunctionTest, FunctionsWithDifferentSavedRegsAttr) 
{
   if (llvm::Triple(llvm::sys::getDefaultTargetTriple()).getArch() !=
   llvm::Triple::x86_64)
-return;
+GTEST_SKIP();
   auto t = makeNamedDecls(
   "__attribute__((no_caller_saved_registers)) void foo();",
   "   void foo();", Lang_C99);

diff  --git a/clang/unittests/Driver/ToolChainTest.cpp 
b/clang/unittests/Driver/ToolChainTest.cpp
index 068c583eb89b5..4ddeadac2103f 100644
--- a/clang/unittests/Driver/ToolChainTest.cpp
+++ b/clang/unittests/Driver/ToolChainTest.cpp
@@ -243,7 +243,7 @@ TEST(ToolChainTest, GetTargetAndMode) {
   llvm::InitializeAllTargets();
   std::string IgnoredError;
   if (!llvm::TargetRegistry::lookupTarget("x86_64", IgnoredError))
-return;
+GTEST_SKIP();
 
   ParsedClangName Res = ToolChain::getTargetAndModeFromProgramName("clang");
   EXPECT_TRUE(Res.TargetPrefix.empty());

diff  --git 
a/clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp 
b/clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp
index f54c65568a66c..6983a532c7315 100644
--- a/clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp
+++ b/clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp
@@ -57,7 +57,7 @@ TEST(InterpreterTest, CatchException) {
   // Using llvm::consumeError will require typeinfo for ErrorInfoBase, we
   // can avoid that by going via the C interface.
   LLVMConsumeError(llvm::wrap(J.takeError()));
-  return;
+  GTEST_SKIP();
 }
   }
 
@@ -102,16 +102,16 @@ extern "C" int throw_exception() {
 
   // AIX is unsupported.
   if (Triple.isOSAIX())
-return;
+GTEST_SKIP();
 
   // FIXME: ARM fails due to `Not implemented relocation type!`
   if (Triple.isARM())
-return;
+GTEST_SKIP();
 
   // FIXME: libunwind on darwin is broken, see PR49692.
   if (Triple.isOSDarwin() && (Triple.getArch() == llvm::Triple::aarch64 ||
   Triple.getArch() == llvm::Triple::aarch64_32))
-return;
+GTEST_SKIP();
 
   llvm::cantFail(Interp->ParseAndExecute(ExceptionCode));
   testing::internal::CaptureStdout();



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


[clang] eae8d22 - [PS4] NFC: rewrite a test to use lit's DEFINE feature

2023-01-17 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-01-17T11:27:51-08:00
New Revision: eae8d22607027ddc9067ca8fa5fea1f1f6a9fb45

URL: 
https://github.com/llvm/llvm-project/commit/eae8d22607027ddc9067ca8fa5fea1f1f6a9fb45
DIFF: 
https://github.com/llvm/llvm-project/commit/eae8d22607027ddc9067ca8fa5fea1f1f6a9fb45.diff

LOG: [PS4] NFC: rewrite a test to use lit's DEFINE feature

Preparatory to running the same test for PS5.

Added: 


Modified: 
clang/test/Driver/ps4-visibility-dllstorageclass.c

Removed: 




diff  --git a/clang/test/Driver/ps4-visibility-dllstorageclass.c 
b/clang/test/Driver/ps4-visibility-dllstorageclass.c
index b314b5d3818a..e7d9b122eed6 100644
--- a/clang/test/Driver/ps4-visibility-dllstorageclass.c
+++ b/clang/test/Driver/ps4-visibility-dllstorageclass.c
@@ -1,24 +1,31 @@
 // Check behaviour of -fvisibility-from-dllstorageclass options for PS4
 
-// RUN: %clang -### -target x86_64-scei-ps4 %s -Werror -o - 2>&1 | \
-// RUN:   FileCheck %s --check-prefix=DEFAULTS \
-// RUN: --implicit-check-not=-fvisibility-from-dllstorageclass \
-// RUN: --implicit-check-not=-fvisibility-dllexport \
-// RUN: --implicit-check-not=-fvisibility-nodllstorageclass \
-// RUN: --implicit-check-not=-fvisibility-externs-dllimport \
-// RUN: --implicit-check-not=-fvisibility-externs-nodllstorageclass
-
-// RUN: %clang -### -target x86_64-scei-ps4 \
-// RUN: -fno-visibility-from-dllstorageclass \
-// RUN: -fvisibility-from-dllstorageclass \
-// RUN: -Werror \
-// RUN: %s -o - 2>&1 | \
-// RUN:   FileCheck %s --check-prefix=DEFAULTS \
-// RUN: --implicit-check-not=-fvisibility-from-dllstorageclass \
-// RUN: --implicit-check-not=-fvisibility-dllexport \
-// RUN: --implicit-check-not=-fvisibility-nodllstorageclass \
-// RUN: --implicit-check-not=-fvisibility-externs-dllimport \
-// RUN: --implicit-check-not=-fvisibility-externs-nodllstorageclass
+// DEFINE: %{triple} =
+// DEFINE: %{run} = \
+// DEFINE: %clang -### -target %{triple} %s -Werror -o - 2>&1 | \
+// DEFINE:   FileCheck %s --check-prefix=DEFAULTS \
+// DEFINE: --implicit-check-not=-fvisibility-from-dllstorageclass \
+// DEFINE: --implicit-check-not=-fvisibility-dllexport \
+// DEFINE: --implicit-check-not=-fvisibility-nodllstorageclass \
+// DEFINE: --implicit-check-not=-fvisibility-externs-dllimport \
+// DEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass
+// REDEFINE: %{triple} = x86_64-scei-ps4
+// RUN: %{run}
+//
+// REDEFINE: %{run} = \
+// REDEFINE: %clang -### -target %{triple} \
+// REDEFINE: -fno-visibility-from-dllstorageclass \
+// REDEFINE: -fvisibility-from-dllstorageclass \
+// REDEFINE: -Werror \
+// REDEFINE: %s -o - 2>&1 | \
+// REDEFINE:   FileCheck %s --check-prefix=DEFAULTS \
+// REDEFINE: --implicit-check-not=-fvisibility-from-dllstorageclass \
+// REDEFINE: --implicit-check-not=-fvisibility-dllexport \
+// REDEFINE: --implicit-check-not=-fvisibility-nodllstorageclass \
+// REDEFINE: --implicit-check-not=-fvisibility-externs-dllimport \
+// REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass
+// REDEFINE: %{triple} = x86_64-scei-ps4
+// RUN: %{run}
 
 // DEFAULTS:  "-fvisibility-from-dllstorageclass"
 // DEFAULTS-SAME: "-fvisibility-dllexport=protected"
@@ -26,51 +33,60 @@
 // DEFAULTS-SAME: "-fvisibility-externs-dllimport=default"
 // DEFAULTS-SAME: "-fvisibility-externs-nodllstorageclass=default"
 
-// RUN: %clang -### -target x86_64-scei-ps4 \
-// RUN: -fvisibility-from-dllstorageclass \
-// RUN: -fvisibility-dllexport=hidden \
-// RUN: -fvisibility-nodllstorageclass=protected \
-// RUN: -fvisibility-externs-dllimport=hidden \
-// RUN: -fvisibility-externs-nodllstorageclass=protected \
-// RUN: -fno-visibility-from-dllstorageclass \
-// RUN: %s -o - 2>&1 | \
-// RUN:   FileCheck %s -check-prefix=UNUSED \
-// RUN: --implicit-check-not=-fvisibility-from-dllstorageclass \
-// RUN: --implicit-check-not=-fvisibility-dllexport \
-// RUN: --implicit-check-not=-fvisibility-nodllstorageclass \
-// RUN: --implicit-check-not=-fvisibility-externs-dllimport \
-// RUN: --implicit-check-not=-fvisibility-externs-nodllstorageclass \
-// RUN: --implicit-check-not=warning:
+// REDEFINE: %{run} = \
+// REDEFINE: %clang -### -target x86_64-scei-ps4 \
+// REDEFINE: -fvisibility-from-dllstorageclass \
+// REDEFINE: -fvisibility-dllexport=hidden \
+// REDEFINE: -fvisibility-nodllstorageclass=protected \
+// REDEFINE: -fvisibility-externs-dllimport=hidden \
+// REDEFINE: -fvisibility-externs-nodllstorageclass=protected \
+// REDEFINE: -fno-visibility-from-dllstorageclass \
+// REDEFINE: %s -o - 2>&1 | \
+// REDEFINE:   FileCheck %s -check-prefix=UNUSED \
+// REDEFINE: --implicit-check-not=-fvisibility-from-dllstorageclass \
+// REDEFINE: 

[clang] 09e4449 - [PS5] Handle visibility options same as PS4

2023-01-17 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-01-17T11:27:51-08:00
New Revision: 09e4449901d7fc780806778181cf3136c1e08e98

URL: 
https://github.com/llvm/llvm-project/commit/09e4449901d7fc780806778181cf3136c1e08e98
DIFF: 
https://github.com/llvm/llvm-project/commit/09e4449901d7fc780806778181cf3136c1e08e98.diff

LOG: [PS5] Handle visibility options same as PS4

This update was missed in the initial rounds of upstreaming PS5.

Added: 
clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c

Modified: 
clang/lib/Driver/ToolChains/Clang.cpp

Removed: 
clang/test/Driver/ps4-visibility-dllstorageclass.c



diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 5462634aa96da..212b3faa2dc74 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -6033,7 +6033,8 @@ void Clang::ConstructJob(Compilation , const JobAction 
,
 CmdArgs.push_back("-fvisibility=protected");
   }
 
-  if (!RawTriple.isPS4())
+  // PS4/PS5 process these options in addClangTargetOptions.
+  if (!RawTriple.isPS()) {
 if (const Arg *A =
 Args.getLastArg(options::OPT_fvisibility_from_dllstorageclass,
 options::OPT_fno_visibility_from_dllstorageclass)) 
{
@@ -6047,6 +6048,7 @@ void Clang::ConstructJob(Compilation , const JobAction 
,
 options::OPT_fvisibility_externs_nodllstorageclass_EQ);
   }
 }
+  }
 
   if (const Arg *A = Args.getLastArg(options::OPT_mignore_xcoff_visibility)) {
 if (Triple.isOSAIX())

diff  --git a/clang/test/Driver/ps4-visibility-dllstorageclass.c 
b/clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c
similarity index 94%
rename from clang/test/Driver/ps4-visibility-dllstorageclass.c
rename to clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c
index e7d9b122eed6d..1a54990da4764 100644
--- a/clang/test/Driver/ps4-visibility-dllstorageclass.c
+++ b/clang/test/Driver/ps4-ps5-visibility-dllstorageclass.c
@@ -1,4 +1,4 @@
-// Check behaviour of -fvisibility-from-dllstorageclass options for PS4
+// Check behaviour of -fvisibility-from-dllstorageclass options for PS4/PS5.
 
 // DEFINE: %{triple} =
 // DEFINE: %{run} = \
@@ -11,6 +11,8 @@
 // DEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass
 // REDEFINE: %{triple} = x86_64-scei-ps4
 // RUN: %{run}
+// REDEFINE: %{triple} = x86_64-sie-ps5
+// RUN: %{run}
 //
 // REDEFINE: %{run} = \
 // REDEFINE: %clang -### -target %{triple} \
@@ -26,6 +28,8 @@
 // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass
 // REDEFINE: %{triple} = x86_64-scei-ps4
 // RUN: %{run}
+// REDEFINE: %{triple} = x86_64-sie-ps5
+// RUN: %{run}
 
 // DEFAULTS:  "-fvisibility-from-dllstorageclass"
 // DEFAULTS-SAME: "-fvisibility-dllexport=protected"
@@ -51,6 +55,8 @@
 // REDEFINE: --implicit-check-not=warning:
 // REDEFINE: %{triple} = x86_64-scei-ps4
 // RUN: %{run}
+// REDEFINE: %{triple} = x86_64-sie-ps5
+// RUN: %{run}
 
 // UNUSED:  warning: argument unused during compilation: 
'-fvisibility-dllexport=hidden'
 // UNUSED-NEXT: warning: argument unused during compilation: 
'-fvisibility-nodllstorageclass=protected'
@@ -71,6 +77,8 @@
 // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass
 // REDEFINE: %{triple} = x86_64-scei-ps4
 // RUN: %{run}
+// REDEFINE: %{triple} = x86_64-sie-ps5
+// RUN: %{run}
 
 // REDEFINE: %{run} = \
 // REDEFINE: %clang -### -target x86_64-scei-ps4 \
@@ -87,6 +95,8 @@
 // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass
 // REDEFINE: %{triple} = x86_64-scei-ps4
 // RUN: %{run}
+// REDEFINE: %{triple} = x86_64-sie-ps5
+// RUN: %{run}
 
 // SOME:  "-fvisibility-from-dllstorageclass"
 // SOME-SAME: "-fvisibility-dllexport=protected"
@@ -114,6 +124,8 @@
 // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass
 // REDEFINE: %{triple} = x86_64-scei-ps4
 // RUN: %{run}
+// REDEFINE: %{triple} = x86_64-sie-ps5
+// RUN: %{run}
 
 // REDEFINE: %{run} = \
 // REDEFINE: %clang -### -target x86_64-scei-ps4 \
@@ -136,6 +148,8 @@
 // REDEFINE: --implicit-check-not=-fvisibility-externs-nodllstorageclass
 // REDEFINE: %{triple} = x86_64-scei-ps4
 // RUN: %{run}
+// REDEFINE: %{triple} = x86_64-sie-ps5
+// RUN: %{run}
 
 // ALL:  "-fvisibility-from-dllstorageclass"
 // ALL-SAME: "-fvisibility-dllexport=hidden"



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


[clang] a26cbd0 - [Driver] Convert test to check 'target=...'

2023-01-04 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2023-01-04T06:46:00-08:00
New Revision: a26cbd03fe0f6f996d27f793e2107393d1888e40

URL: 
https://github.com/llvm/llvm-project/commit/a26cbd03fe0f6f996d27f793e2107393d1888e40
DIFF: 
https://github.com/llvm/llvm-project/commit/a26cbd03fe0f6f996d27f793e2107393d1888e40.diff

LOG: [Driver] Convert test to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/Driver/fat-archive-unbundle-ext.c

Removed: 




diff  --git a/clang/test/Driver/fat-archive-unbundle-ext.c 
b/clang/test/Driver/fat-archive-unbundle-ext.c
index 09b1ca1782feb..b409aa6313b1e 100644
--- a/clang/test/Driver/fat-archive-unbundle-ext.c
+++ b/clang/test/Driver/fat-archive-unbundle-ext.c
@@ -1,5 +1,5 @@
 // REQUIRES: x86-registered-target
-// UNSUPPORTED: target={{.*-windows.*}}, darwin, target={{.*}}-aix{{.*}}
+// UNSUPPORTED: target={{.*-windows.*}}, target={{.*-darwin.*}}, 
target={{.*}}-aix{{.*}}
 
 // Generate dummy fat object
 // RUN: %clang -O0 -target %itanium_abi_triple %s -c -o %t.host.o



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


[clang] d4959b5 - [Driver] Fix tests not to fail randomly on Windows

2022-12-21 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-21T09:37:12-08:00
New Revision: d4959b5a4bb888789f99a952a1304ce915dfee2f

URL: 
https://github.com/llvm/llvm-project/commit/d4959b5a4bb888789f99a952a1304ce915dfee2f
DIFF: 
https://github.com/llvm/llvm-project/commit/d4959b5a4bb888789f99a952a1304ce915dfee2f.diff

LOG: [Driver] Fix tests not to fail randomly on Windows

These used a regex that didn't guard against backslashes, so
getting "lucky" with a temp dir name could make them fail.

Added: 


Modified: 
clang/test/Driver/freebsd.c
clang/test/Driver/fuchsia.c
clang/test/Driver/netbsd.c
clang/test/Driver/openbsd.c

Removed: 




diff  --git a/clang/test/Driver/freebsd.c b/clang/test/Driver/freebsd.c
index 87ce46d1c1c6e..a9afff22ae848 100644
--- a/clang/test/Driver/freebsd.c
+++ b/clang/test/Driver/freebsd.c
@@ -212,5 +212,5 @@
 // RELOCATABLE: "-r"
 // RELOCATABLE-NOT: "-dynamic-linker"
 // RELOCATABLE-NOT: "-l
-// RELOCATABLE-NOT: crt{{[^./]+}}.o
+// RELOCATABLE-NOT: crt{{[^./\\]+}}.o
 

diff  --git a/clang/test/Driver/fuchsia.c b/clang/test/Driver/fuchsia.c
index 339fd92309796..9c023329edb5f 100644
--- a/clang/test/Driver/fuchsia.c
+++ b/clang/test/Driver/fuchsia.c
@@ -89,7 +89,7 @@
 // CHECK-RELOCATABLE-NOT "-dynamic-linker"
 // CHECK-RELOCATABLE: "-r"
 // CHECK-RELOCATABLE-NOT: "-l
-// CHECK-RELOCATABLE-NOT: crt{{[^./]+}}.o
+// CHECK-RELOCATABLE-NOT: crt{{[^./\\]+}}.o
 
 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nodefaultlibs 
-fuse-ld=lld 2>&1 \
 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \

diff  --git a/clang/test/Driver/netbsd.c b/clang/test/Driver/netbsd.c
index 436772ab99795..52f3a33198059 100644
--- a/clang/test/Driver/netbsd.c
+++ b/clang/test/Driver/netbsd.c
@@ -476,4 +476,4 @@
 // RELOCATABLE-NOT: "-pie"
 // RELOCATABLE-NOT: "-dynamic-linker"
 // RELOCATABLE-NOT: "-l
-// RELOCATABLE-NOT: crt{{[^./]+}}.o
+// RELOCATABLE-NOT: crt{{[^./\\]+}}.o

diff  --git a/clang/test/Driver/openbsd.c b/clang/test/Driver/openbsd.c
index 3ba8a315f6e16..05d290a309c40 100644
--- a/clang/test/Driver/openbsd.c
+++ b/clang/test/Driver/openbsd.c
@@ -39,7 +39,7 @@
 // CHECK-LD-R: "-r"
 // CHECK-LD-R-NOT: "-dynamic-linker"
 // CHECK-LD-R-NOT: "-l
-// CHECK-LD-R-NOT: crt{{[^./]+}}.o
+// CHECK-LD-R-NOT: crt{{[^./\\]+}}.o
 // CHECK-LD-S: "-cc1" "-triple" "i686-pc-openbsd"
 // CHECK-LD-S: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" 
"-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" 
"-L{{.*}}" "-s" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" 
"{{.*}}crtend.o"
 // CHECK-LD-T: "-cc1" "-triple" "i686-pc-openbsd"



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


[clang] 016785d - [clang/xray] Convert tests to check 'target=...'

2022-12-21 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-21T05:19:27-08:00
New Revision: 016785d9316d8c5abc5fdf3cdb86479095bbb677

URL: 
https://github.com/llvm/llvm-project/commit/016785d9316d8c5abc5fdf3cdb86479095bbb677
DIFF: 
https://github.com/llvm/llvm-project/commit/016785d9316d8c5abc5fdf3cdb86479095bbb677.diff

LOG: [clang/xray] Convert tests to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/Driver/XRay/lit.local.cfg
clang/test/Driver/XRay/xray-instrument-cpu.c
clang/test/Driver/XRay/xray-instrument-os.c

Removed: 




diff  --git a/clang/test/Driver/XRay/lit.local.cfg 
b/clang/test/Driver/XRay/lit.local.cfg
index 70f9792ba3db5..1755d9ab5ce9e 100644
--- a/clang/test/Driver/XRay/lit.local.cfg
+++ b/clang/test/Driver/XRay/lit.local.cfg
@@ -1,6 +1,4 @@
 import platform
-target_triple_components = config.target_triple.split('-')
-config.available_features.update(target_triple_components)
 
 # Only run the tests in platforms where XRay instrumentation is supported.
 supported_targets = [
@@ -13,7 +11,7 @@ supported_oses = [
 'Linux', 'FreeBSD', 'Darwin'
 ]
 
-triple_set = set(target_triple_components)
+triple_set = set(config.target_triple.split('-'))
 if len(triple_set.intersection(supported_targets)) == 0:
   config.unsupported = True
 

diff  --git a/clang/test/Driver/XRay/xray-instrument-cpu.c 
b/clang/test/Driver/XRay/xray-instrument-cpu.c
index ee0e0984b36d8..a8bc2a6431335 100644
--- a/clang/test/Driver/XRay/xray-instrument-cpu.c
+++ b/clang/test/Driver/XRay/xray-instrument-cpu.c
@@ -1,4 +1,5 @@
 // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s
-// XFAIL: amd64-, x86_64-, x86_64h-, arm, aarch64, arm64, powerpc64le-, mips, 
mipsel, mips64, mips64el
+// XFAIL: target={{(amd64|x86_64|x86_64h|powerpc64le)-.*}}
+// XFAIL: target={{(arm|aarch64|arm64|mips|mipsel|mips64|mips64el)-.*}}
 // REQUIRES: linux
 typedef int a;

diff  --git a/clang/test/Driver/XRay/xray-instrument-os.c 
b/clang/test/Driver/XRay/xray-instrument-os.c
index 3a0397208326f..7a4f1c13cb0b1 100644
--- a/clang/test/Driver/XRay/xray-instrument-os.c
+++ b/clang/test/Driver/XRay/xray-instrument-os.c
@@ -1,4 +1,4 @@
 // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s
-// XFAIL: -linux-, -freebsd, x86_64-apple-darwin, x86_64-apple-macos
-// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64
+// XFAIL: target={{.*-(linux|freebsd).*}}, 
target=x86_64-apple-{{(darwin|macos).*}}
+// REQUIRES: target={{(amd64|x86_64|x86_64h|arm|aarch64|arm64)-.*}}
 typedef int a;



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


[clang] e0f2150 - [clang] Convert tests to check 'target=...'

2022-12-15 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-15T12:26:33-08:00
New Revision: e0f2150e99e5e429c33047f25e3da2ab146d0f57

URL: 
https://github.com/llvm/llvm-project/commit/e0f2150e99e5e429c33047f25e3da2ab146d0f57
DIFF: 
https://github.com/llvm/llvm-project/commit/e0f2150e99e5e429c33047f25e3da2ab146d0f57.diff

LOG: [clang] Convert tests to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/Analysis/checker-plugins.c
clang/test/CodeGen/c-strings.c
clang/test/PCH/leakfiles.test

Removed: 




diff  --git a/clang/test/Analysis/checker-plugins.c 
b/clang/test/Analysis/checker-plugins.c
index 69fab8fa6eed1..92a48de87f772 100644
--- a/clang/test/Analysis/checker-plugins.c
+++ b/clang/test/Analysis/checker-plugins.c
@@ -2,7 +2,7 @@
 
 // FIXME: This test fails on clang-stage2-cmake-RgSan,
 // see also https://reviews.llvm.org/D62445#1613268
-// UNSUPPORTED: darwin
+// UNSUPPORTED: target={{.*darwin.*}}
 
 // RUN: %clang_analyze_cc1 -verify %s \
 // RUN:   -load %llvmshlibdir/SampleAnalyzerPlugin%pluginext \

diff  --git a/clang/test/CodeGen/c-strings.c b/clang/test/CodeGen/c-strings.c
index 687394168534d..9e1ac0f02b5e9 100644
--- a/clang/test/CodeGen/c-strings.c
+++ b/clang/test/CodeGen/c-strings.c
@@ -1,4 +1,4 @@
-// XFAIL: aarch64-pc-windows-msvc
+// XFAIL: taraget=aarch64-pc-windows-msvc
 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck 
%s --check-prefix=CHECK --check-prefix=ITANIUM
 // RUN: %clang_cc1 -triple %ms_abi_triple -emit-llvm -o - %s | FileCheck %s 
--check-prefix=CHECK --check-prefix=MSABI
 
@@ -21,7 +21,7 @@
 // fails the check for "@f3.x = ... align [ALIGN]", since ALIGN is derived
 // from the alignment of a single i8, which is still 1.
 
-// XFAIL: csky
+// XFAIL: target=csky{{.*}}
 // CSKY aligns arrays of size 4+ bytes to a 32-bit boundary, which
 // fails the check for "@f2.x = ... align [ALIGN]", since ALIGN is derived
 // from the alignment of a single i8, which is still 1.

diff  --git a/clang/test/PCH/leakfiles.test b/clang/test/PCH/leakfiles.test
index 90b279026bc1a..dc4047ac3ff48 100644
--- a/clang/test/PCH/leakfiles.test
+++ b/clang/test/PCH/leakfiles.test
@@ -3,7 +3,7 @@
 //
 // This test requires bash loops and ulimit.
 // REQUIRES: shell
-// UNSUPPORTED: win32
+// UNSUPPORTED: target={{.*win32.*}}
 //
 // Set up source files. lib/lib.h includes lots of lib*.h files in that dir.
 // client.c includes lib/lib.h, and also the individual files directly.



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


[clang-tools-extra] 40cc041 - [clang-tools-extra] Convert tests to check 'target=...'

2022-12-15 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-15T09:51:06-08:00
New Revision: 40cc041d4eec7306a67bfdbfeaa8796b8d856b60

URL: 
https://github.com/llvm/llvm-project/commit/40cc041d4eec7306a67bfdbfeaa8796b8d856b60
DIFF: 
https://github.com/llvm/llvm-project/commit/40cc041d4eec7306a67bfdbfeaa8796b8d856b60.diff

LOG: [clang-tools-extra] Convert tests to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang-tools-extra/clangd/test/dependency-output.test
clang-tools-extra/clangd/test/did-change-configuration-params.test
clang-tools-extra/clangd/test/test-uri-posix.test
clang-tools-extra/clangd/test/test-uri-windows.test
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/test/dependency-output.test 
b/clang-tools-extra/clangd/test/dependency-output.test
index ed289bbcdbe44..32b439e520e5e 100644
--- a/clang-tools-extra/clangd/test/dependency-output.test
+++ b/clang-tools-extra/clangd/test/dependency-output.test
@@ -1,4 +1,4 @@
-# UNSUPPORTED: windows-gnu,windows-msvc
+# UNSUPPORTED: target={{.*-windows-(gnu|msvc)}}
 # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
 
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
 ---

diff  --git 
a/clang-tools-extra/clangd/test/did-change-configuration-params.test 
b/clang-tools-extra/clangd/test/did-change-configuration-params.test
index 29cf1786a835a..fd33f63818a28 100644
--- a/clang-tools-extra/clangd/test/did-change-configuration-params.test
+++ b/clang-tools-extra/clangd/test/did-change-configuration-params.test
@@ -1,6 +1,6 @@
 # RUN: clangd -compile_args_from=lsp -lit-test < %s 2> %t | FileCheck 
-strict-whitespace %s
 # RUN: FileCheck --check-prefix=ERR --input-file=%t %s
-# UNSUPPORTED: windows-gnu,windows-msvc
+# UNSUPPORTED: target={{.*-windows-(gnu|msvc)}}
 
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
 ---
 
{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"compilationDatabaseChanges":{"/clangd-test/foo.c":
 {"workingDirectory":"/clangd-test", "compilationCommand": ["clang", "-c", 
"foo.c"]}

diff  --git a/clang-tools-extra/clangd/test/test-uri-posix.test 
b/clang-tools-extra/clangd/test/test-uri-posix.test
index 2b67fa03e0f09..37d8a3d8e7a63 100644
--- a/clang-tools-extra/clangd/test/test-uri-posix.test
+++ b/clang-tools-extra/clangd/test/test-uri-posix.test
@@ -1,5 +1,5 @@
 # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
-# UNSUPPORTED: windows-gnu,windows-msvc
+# UNSUPPORTED: target={{.*-windows-(gnu|msvc)}}
 # Test authority-less URI
 
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
 ---

diff  --git a/clang-tools-extra/clangd/test/test-uri-windows.test 
b/clang-tools-extra/clangd/test/test-uri-windows.test
index 3f03b2985a70f..8c8d04824538a 100644
--- a/clang-tools-extra/clangd/test/test-uri-windows.test
+++ b/clang-tools-extra/clangd/test/test-uri-windows.test
@@ -1,5 +1,5 @@
 # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
-# UNSUPPORTED: !(windows-gnu || windows-msvc)
+# REQUIRES: target={{.*-windows-(gnu|msvc)}}
 # Test authority-less URI
 
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
 ---

diff  --git 
a/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp 
b/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
index 08287e9b51e41..a6a4f6e84cc90 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
@@ -1,6 +1,6 @@
 // Remove UNSUPPORTED for powerpc64le when the problem introduced by
 // r288563 is resolved.
-// UNSUPPORTED: powerpc64le
+// UNSUPPORTED: target=powerpc64le{{.*}}
 // RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
 // RUN:   -config='{CheckOptions: [ \
 // RUN: {key: readability-identifier-naming.AbstractClassCase, value: 
CamelCase}, \



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


[clang] 948bb35 - [PPC] Convert tests to check 'target='

2022-12-15 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-15T07:01:14-08:00
New Revision: 948bb35d747419651fa5bcf86d5b6563bbb56119

URL: 
https://github.com/llvm/llvm-project/commit/948bb35d747419651fa5bcf86d5b6563bbb56119
DIFF: 
https://github.com/llvm/llvm-project/commit/948bb35d747419651fa5bcf86d5b6563bbb56119.diff

LOG: [PPC] Convert tests to check 'target='

Two tests checked 'ppc64be' which appears not to exist; the tests
pass on clang-ppc64be-linux-multistage so I assume they are fine
and just removed those UNSUPPORTED lines. All others were converted
to the new target= format, and get the same results on ppc bots as
before.

Part of the project to eliminate special handling for triples in lit
expressions.

Differential Revision: https://reviews.llvm.org/D138954

Added: 


Modified: 
clang/test/CodeGen/PowerPC/ppc-mm-malloc-le.c
clang/test/CodeGen/PowerPC/ppc-mm-malloc.c
clang/test/CodeGen/no-builtin.cpp
clang/test/CodeGenCoroutines/pr56329.cpp
clang/test/Sema/no-builtin.cpp
llvm/test/DebugInfo/debuglineinfo-path.ll

Removed: 




diff  --git a/clang/test/CodeGen/PowerPC/ppc-mm-malloc-le.c 
b/clang/test/CodeGen/PowerPC/ppc-mm-malloc-le.c
index 387c0049a461..093f116c8653 100644
--- a/clang/test/CodeGen/PowerPC/ppc-mm-malloc-le.c
+++ b/clang/test/CodeGen/PowerPC/ppc-mm-malloc-le.c
@@ -1,6 +1,5 @@
 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
-// REQUIRES: native, powerpc-registered-target
-// UNSUPPORTED: !powerpc64le-
+// REQUIRES: native, target=powerpc64le-{{.*}}
 // The stdlib.h included in mm_malloc.h references native system header
 // like: bits/libc-header-start.h or features.h, cross-compile it may
 // require installing target headers in build env, otherwise expecting

diff  --git a/clang/test/CodeGen/PowerPC/ppc-mm-malloc.c 
b/clang/test/CodeGen/PowerPC/ppc-mm-malloc.c
index 27b29b658aa7..57cf28f5bccc 100644
--- a/clang/test/CodeGen/PowerPC/ppc-mm-malloc.c
+++ b/clang/test/CodeGen/PowerPC/ppc-mm-malloc.c
@@ -1,6 +1,5 @@
 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
-// REQUIRES: native, powerpc-registered-target
-// UNSUPPORTED: !powerpc64-
+// REQUIRES: native, target=powerpc64-{{.*}}
 // The stdlib.h included in mm_malloc.h references native system header
 // like: bits/libc-header-start.h or features.h, cross-compile it may
 // require installing target headers in build env, otherwise expecting

diff  --git a/clang/test/CodeGen/no-builtin.cpp 
b/clang/test/CodeGen/no-builtin.cpp
index 0dc734580d61..cca13aa486d8 100644
--- a/clang/test/CodeGen/no-builtin.cpp
+++ b/clang/test/CodeGen/no-builtin.cpp
@@ -1,5 +1,4 @@
 // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-linux-gnu -S -emit-llvm 
-o - %s | FileCheck %s
-// UNSUPPORTED: ppc64be
 
 // CHECK-LABEL: define{{.*}} void @foo_no_mempcy() #0
 extern "C" void foo_no_mempcy() __attribute__((no_builtin("memcpy"))) {}

diff  --git a/clang/test/CodeGenCoroutines/pr56329.cpp 
b/clang/test/CodeGenCoroutines/pr56329.cpp
index 855755d05f84..31d4849af4e7 100644
--- a/clang/test/CodeGenCoroutines/pr56329.cpp
+++ b/clang/test/CodeGenCoroutines/pr56329.cpp
@@ -2,7 +2,7 @@
 //
 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %s -O3 -S -emit-llvm 
-o - | FileCheck %s
 // This test is expected to fail on PowerPC.
-// XFAIL: powerpc
+// XFAIL: target=powerpc{{.*}}
 
 #include "Inputs/coroutine.h"
 

diff  --git a/clang/test/Sema/no-builtin.cpp b/clang/test/Sema/no-builtin.cpp
index 392d847f98aa..1312d32e22b0 100644
--- a/clang/test/Sema/no-builtin.cpp
+++ b/clang/test/Sema/no-builtin.cpp
@@ -1,5 +1,4 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s
-// UNSUPPORTED: ppc64be
 
 /// Prevent use of all builtins.
 void valid_attribute_all_1() __attribute__((no_builtin)) {}

diff  --git a/llvm/test/DebugInfo/debuglineinfo-path.ll 
b/llvm/test/DebugInfo/debuglineinfo-path.ll
index affb973bdec7..f6574a2a46f1 100644
--- a/llvm/test/DebugInfo/debuglineinfo-path.ll
+++ b/llvm/test/DebugInfo/debuglineinfo-path.ll
@@ -2,7 +2,7 @@
 
 ; On powerpc llvm-nm describes win_func as a global variable, not a function. 
It breaks the test.
 ; It is not essential to DWARF path handling code we're testing here.
-; UNSUPPORTED: powerpc
+; UNSUPPORTED: target=powerpc{{.*}}
 ; REQUIRES: object-emission
 ; RUN: %llc_dwarf -O0 -filetype=obj -o %t < %s
 ; RUN: llvm-nm --radix=o %t | grep posix_absolute_func > %t.posix_absolute_func



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


[clang] 7793e67 - [ZOS] Convert tests to check 'target={{.*}}-zos{{.*}}'

2022-12-12 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-12T11:25:19-08:00
New Revision: 7793e676514bc102e97a993e90257e8628069a8b

URL: 
https://github.com/llvm/llvm-project/commit/7793e676514bc102e97a993e90257e8628069a8b
DIFF: 
https://github.com/llvm/llvm-project/commit/7793e676514bc102e97a993e90257e8628069a8b.diff

LOG: [ZOS] Convert tests to check 'target={{.*}}-zos{{.*}}'

Also add 'system-zos' as a lit feature and use it where needed.

Part of the project to eliminate special handling for triples in lit
expressions.

Differential Revision: https://reviews.llvm.org/D139444

Added: 


Modified: 
clang/test/Analysis/cfref_PR2519.c
clang/test/CodeGen/cfstring2.c
clang/test/Driver/as-version.s
clang/test/Import/forward-declared-objc-class/test.m
clang/test/Import/objc-arc/test-cleanup-object.m
clang/test/Import/objc-autoreleasepool/test.m
clang/test/Import/objc-definitions-in-expression/test.m
clang/test/Import/objc-method/test.m
clang/test/Import/objc-param-decl/test.m
clang/test/Import/objc-try-catch/test.m
clang/test/Modules/DebugInfoNamespace.cpp
clang/test/Modules/DebugInfoTransitiveImport.m
clang/test/Modules/ExtDebugInfo.cpp
clang/test/Modules/ExtDebugInfo.m
clang/test/Modules/ModuleDebugInfo.cpp
clang/test/Modules/ModuleDebugInfo.m
clang/test/Modules/ModuleDebugInfoDwoId.cpp
clang/test/Modules/ModuleModuleDebugInfo.cpp
clang/test/Modules/autolink.m
clang/test/Modules/autolinkTBD.m
clang/test/Modules/builtins.m
clang/test/Modules/clang_module_file_info.m
clang/test/Modules/cxx-irgen.cpp
clang/test/Modules/debug-info-moduleimport-in-module.m
clang/test/Modules/debug-info-moduleimport.m
clang/test/Modules/direct-module-import.m
clang/test/Modules/merge-anon-record-definition-in-objc.m
clang/test/Modules/merge-extension-ivars.m
clang/test/Modules/merge-objc-interface-visibility.m
clang/test/Modules/merge-objc-interface.m
clang/test/Modules/merge-record-definition-nonmodular.m
clang/test/Modules/merge-record-definition-visibility.m
clang/test/Modules/merge-record-definition.m
clang/test/Modules/module-debuginfo-prefix.m
clang/test/Modules/module-file-home-is-cwd.m
clang/test/Modules/module_file_info.m
clang/test/Modules/objc-initializer.m
clang/test/Modules/pch-used.m
clang/test/Modules/redecl-ivars.m
clang/test/Modules/use-exportas-for-link.m
clang/test/PCH/externally-retained.m
clang/test/PCH/irgen-rdar13114142.mm
clang/test/PCH/objc_container.m
clang/test/PCH/objc_literals.m
clang/test/PCH/objc_literals.mm
clang/test/PCH/objcxx-ivar-class.mm
clang/test/PCH/pending-ids.m
llvm/test/MC/AsmParser/debug-no-source.s
llvm/test/Support/encoding.ll
llvm/test/tools/llvm-mc/no_warnings.test
llvm/utils/lit/lit/llvm/config.py

Removed: 




diff  --git a/clang/test/Analysis/cfref_PR2519.c 
b/clang/test/Analysis/cfref_PR2519.c
index e63ac10fb5490..e90a2f17c75dc 100644
--- a/clang/test/Analysis/cfref_PR2519.c
+++ b/clang/test/Analysis/cfref_PR2519.c
@@ -1,4 +1,4 @@
-// UNSUPPORTED: -zos, target={{.*}}-aix{{.*}}
+// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
 // RUN: %clang_analyze_cc1 
-analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s
 // expected-no-diagnostics
 

diff  --git a/clang/test/CodeGen/cfstring2.c b/clang/test/CodeGen/cfstring2.c
index 74e3751fe49f8..da6190539e9e6 100644
--- a/clang/test/CodeGen/cfstring2.c
+++ b/clang/test/CodeGen/cfstring2.c
@@ -1,4 +1,4 @@
-// UNSUPPORTED: -zos, target={{.*}}-aix{{.*}}
+// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
 // RUN: %clang_cc1 -emit-llvm %s -o %t
 
 typedef const struct __CFString * CFStringRef;

diff  --git a/clang/test/Driver/as-version.s b/clang/test/Driver/as-version.s
index 296f9e83ece93..a96b2b5762c65 100644
--- a/clang/test/Driver/as-version.s
+++ b/clang/test/Driver/as-version.s
@@ -1,6 +1,6 @@
 // Test version information.
 
-// UNSUPPORTED: -zos
+// UNSUPPORTED: target={{.*}}-zos{{.*}}
 // RUN: %clang -Wa,--version -c -fintegrated-as %s -o /dev/null \
 // RUN:   | FileCheck --check-prefix=IAS %s
 // IAS: clang version

diff  --git a/clang/test/Import/forward-declared-objc-class/test.m 
b/clang/test/Import/forward-declared-objc-class/test.m
index adf0c25d00cdd..c94c677dcef6a 100644
--- a/clang/test/Import/forward-declared-objc-class/test.m
+++ b/clang/test/Import/forward-declared-objc-class/test.m
@@ -1,4 +1,4 @@
-// UNSUPPORTED: -zos, target={{.*}}-aix{{.*}}
+// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
 // RUN: clang-import-test -x objective-c++ -import %S/Inputs/S1.m --import 
%S/Inputs/S2.m --import %S/Inputs/S3.m -expression %s
 void expr() {
   MyClass *c = [MyClass fromInteger:3];

diff  --git a/clang/test/Import/objc-arc/test-cleanup-object.m 
b/clang/test/Import/objc-arc/test-cleanup-object.m
index 

[clang] b7ada67 - [lit] Use 'target=' in a few more places

2022-12-12 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-12T09:58:38-08:00
New Revision: b7ada67f1c28ae67c61578dd3bc8acb4d8d55d28

URL: 
https://github.com/llvm/llvm-project/commit/b7ada67f1c28ae67c61578dd3bc8acb4d8d55d28
DIFF: 
https://github.com/llvm/llvm-project/commit/b7ada67f1c28ae67c61578dd3bc8acb4d8d55d28.diff

LOG: [lit] Use 'target=' in a few more places

Missed these on the first pass.

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/CodeGen/volatile-1.c
clang/test/Modules/hidden-duplicates.m
clang/test/Modules/override.m

Removed: 




diff  --git a/clang/test/CodeGen/volatile-1.c b/clang/test/CodeGen/volatile-1.c
index d27abbfdbef1..cd919c78989f 100644
--- a/clang/test/CodeGen/volatile-1.c
+++ b/clang/test/CodeGen/volatile-1.c
@@ -1,4 +1,4 @@
-// XFAIL: aarch64-pc-windows-msvc
+// XFAIL: target=aarch64-pc-windows-msvc
 // RUN: %clang_cc1 -Wno-return-type -Wno-unused-value -emit-llvm %s -w -o - | 
FileCheck %s
 
 // CHECK: @i = {{(dso_local )?}}global [[INT:i[0-9]+]] 0

diff  --git a/clang/test/Modules/hidden-duplicates.m 
b/clang/test/Modules/hidden-duplicates.m
index ec9549dab53e..423654502fd8 100644
--- a/clang/test/Modules/hidden-duplicates.m
+++ b/clang/test/Modules/hidden-duplicates.m
@@ -1,4 +1,4 @@
-// XFAIL: aix, -zos
+// XFAIL: target={{.*}}-aix{{.*}}, target={{.*}}-zos{{.*}}
 // RUN: rm -rf %t
 // RUN: split-file %s %t
 // RUN: %clang_cc1 -emit-llvm -o %t/test.bc -I %t/include %t/test.m -verify \

diff  --git a/clang/test/Modules/override.m b/clang/test/Modules/override.m
index 247c2be76ee1..5725ef16552d 100644
--- a/clang/test/Modules/override.m
+++ b/clang/test/Modules/override.m
@@ -1,4 +1,4 @@
-// UNSUPPORTED: -aix
+// UNSUPPORTED: target={{.*}}-aix{{.*}}
 // RUN: rm -rf %t
 // RUN: split-file %s %t
 // RUN: %clang_cc1 -fsyntax-only -I%t/include %t/test.m \



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


[clang] fe21126 - [Windows] Convert tests to check 'target=...'

2022-12-06 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-06T13:15:48-08:00
New Revision: fe2112611258f9a16f101d642f3dfe7a47a161d7

URL: 
https://github.com/llvm/llvm-project/commit/fe2112611258f9a16f101d642f3dfe7a47a161d7
DIFF: 
https://github.com/llvm/llvm-project/commit/fe2112611258f9a16f101d642f3dfe7a47a161d7.diff

LOG: [Windows] Convert tests to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/CodeGen/2007-06-18-SextAttrAggregate.c
llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir
llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll
llvm/test/ExecutionEngine/MCJIT/eh.ll
llvm/test/ExecutionEngine/MCJIT/multi-module-eh-a.ll
llvm/test/ExecutionEngine/MCJIT/remote/eh.ll

Removed: 




diff  --git a/clang/test/CodeGen/2007-06-18-SextAttrAggregate.c 
b/clang/test/CodeGen/2007-06-18-SextAttrAggregate.c
index bcd2a9f67708c..daed3baf4643e 100644
--- a/clang/test/CodeGen/2007-06-18-SextAttrAggregate.c
+++ b/clang/test/CodeGen/2007-06-18-SextAttrAggregate.c
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -no-enable-noundef-analysis %s -o - -emit-llvm | FileCheck 
%s
-// XFAIL: aarch64, arm64, x86_64-pc-windows-msvc, x86_64-w64-windows-gnu, 
x86_64-pc-windows-gnu
+// XFAIL: target={{(aarch64|arm64).*}}, target=x86_64-pc-windows-msvc, 
target=x86_64-{{(pc|w64)}}-windows-gnu
 
 // PR1513
 

diff  --git a/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir 
b/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir
index 2c38dedad545d..8ba64c47cb38b 100644
--- a/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir
+++ b/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir
@@ -4,7 +4,7 @@
 #
 # CHECK-NOT: .loc 1 0
 # CHECK: .cfi_def_cfa_offset
-# UNSUPPORTED: cygwin,windows-gnu,windows-msvc
+# UNSUPPORTED: target={{.*-(cygwin|windows-gnu|windows-msvc)}}
 
 --- |
   ; ModuleID = 'no-cfi-loc.ll'

diff  --git a/llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll 
b/llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll
index 02cb98c9da0e5..ac2b7b9409c78 100644
--- a/llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll
+++ b/llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll
@@ -10,7 +10,7 @@
 
 ; On Windows, we don't handle the relocations needed for AT_return_pc properly
 ; and fail with "failed to compute relocation: IMAGE_REL_AMD64_ADDR32".
-; UNSUPPORTED: cygwin,windows-gnu,windows-msvc
+; UNSUPPORTED: target={{.*-(cygwin|windows-gnu|windows-msvc)}}
 
 ; RUN: llc -mtriple=x86_64 < %s -o - | FileCheck %s -check-prefix=ASM
 ; RUN: llc -mtriple=x86_64 -debugger-tune=lldb < %s -filetype=obj -o %t.o

diff  --git a/llvm/test/ExecutionEngine/MCJIT/eh.ll 
b/llvm/test/ExecutionEngine/MCJIT/eh.ll
index 571f92d4a947f..73bade5e30ea0 100644
--- a/llvm/test/ExecutionEngine/MCJIT/eh.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/eh.ll
@@ -1,7 +1,7 @@
 ; REQUIRES: cxx-shared-library
 ; RUN: %lli -jit-kind=mcjit %s
 
-; XFAIL: arm, cygwin, windows-msvc, windows-gnu
+; XFAIL: target=arm{{.*}}, target={{.*-(cygwin|windows-msvc|windows-gnu)}}
 declare ptr @__cxa_allocate_exception(i64)
 declare void @__cxa_throw(ptr, ptr, ptr)
 declare i32 @__gxx_personality_v0(...)

diff  --git a/llvm/test/ExecutionEngine/MCJIT/multi-module-eh-a.ll 
b/llvm/test/ExecutionEngine/MCJIT/multi-module-eh-a.ll
index f3e837b80e149..39c7f342ab1f2 100644
--- a/llvm/test/ExecutionEngine/MCJIT/multi-module-eh-a.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/multi-module-eh-a.ll
@@ -1,7 +1,7 @@
 ; REQUIRES: cxx-shared-library
 ; RUN: %lli -jit-kind=mcjit -extra-module=%p/Inputs/multi-module-eh-b.ll %s
 
-; XFAIL: arm, cygwin, windows-msvc, windows-gnu
+; XFAIL: target=arm{{.*}}, target={{.*-(cygwin|windows-msvc|windows-gnu)}}
 declare ptr @__cxa_allocate_exception(i64)
 declare void @__cxa_throw(ptr, ptr, ptr)
 declare i32 @__gxx_personality_v0(...)

diff  --git a/llvm/test/ExecutionEngine/MCJIT/remote/eh.ll 
b/llvm/test/ExecutionEngine/MCJIT/remote/eh.ll
index c7e4b128e30d3..be96ac4c517e3 100644
--- a/llvm/test/ExecutionEngine/MCJIT/remote/eh.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/remote/eh.ll
@@ -1,6 +1,6 @@
 ; REQUIRES: cxx-shared-library
 ; RUN: %lli -jit-kind=mcjit -remote-mcjit 
-mcjit-remote-process=lli-child-target%exeext %s
-; XFAIL: arm, cygwin, windows-msvc, windows-gnu
+; XFAIL: target=arm{{.*}}, target={{.*-(cygwin|windows-msvc|windows-gnu)}}
 ; UNSUPPORTED: powerpc64-unknown-linux-gnu
 ; Remove UNSUPPORTED for powerpc64-unknown-linux-gnu if problem caused by 
r23 is fixed
 ; FIXME: Something hangs here.



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


[clang] 26e50c4 - [ARM/Darwin] Convert tests to check 'target='

2022-12-06 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-06T06:58:39-08:00
New Revision: 26e50c4c4df10de7bd8fcad520bf11ab94331eac

URL: 
https://github.com/llvm/llvm-project/commit/26e50c4c4df10de7bd8fcad520bf11ab94331eac
DIFF: 
https://github.com/llvm/llvm-project/commit/26e50c4c4df10de7bd8fcad520bf11ab94331eac.diff

LOG: [ARM/Darwin] Convert tests to check 'target='

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/CodeGen/2004-02-13-IllegalVararg.c
clang/test/Driver/clang-offload-bundler-asserts-on.c
clang/test/Driver/clang-offload-bundler.c
clang/test/Index/pch-from-libclang.c
clang/test/Interpreter/simple-exception.cpp
llvm/test/DebugInfo/Generic/empty.ll
llvm/test/DebugInfo/Generic/gmlt.test
llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll

Removed: 




diff  --git a/clang/test/CodeGen/2004-02-13-IllegalVararg.c 
b/clang/test/CodeGen/2004-02-13-IllegalVararg.c
index b3acda1f9e72f..9a2d286b77766 100644
--- a/clang/test/CodeGen/2004-02-13-IllegalVararg.c
+++ b/clang/test/CodeGen/2004-02-13-IllegalVararg.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1  %s -w -emit-llvm -o -
 
 // https://bugs.llvm.org/show_bug.cgi?id=46644#c6
-// XFAIL: arm64-apple
+// XFAIL: target=arm64-apple-{{.*}}
 
 float test(int X, ...) {
   __builtin_va_list ap;

diff  --git a/clang/test/Driver/clang-offload-bundler-asserts-on.c 
b/clang/test/Driver/clang-offload-bundler-asserts-on.c
index e92ecdf0107aa..aceda09f7bfa1 100644
--- a/clang/test/Driver/clang-offload-bundler-asserts-on.c
+++ b/clang/test/Driver/clang-offload-bundler-asserts-on.c
@@ -1,6 +1,6 @@
 // REQUIRES: x86-registered-target
 // REQUIRES: asserts
-// UNSUPPORTED: darwin, target={{.*}}-aix{{.*}}
+// UNSUPPORTED: target={{.*}}-darwin{{.*}}, target={{.*}}-aix{{.*}}
 
 // Generate the file we can bundle.
 // RUN: %clang -O0 -target %itanium_abi_triple %s -c -o %t.o

diff  --git a/clang/test/Driver/clang-offload-bundler.c 
b/clang/test/Driver/clang-offload-bundler.c
index 9c4b7cd2cc996..b803db5f90ca8 100644
--- a/clang/test/Driver/clang-offload-bundler.c
+++ b/clang/test/Driver/clang-offload-bundler.c
@@ -1,6 +1,6 @@
 // REQUIRES: x86-registered-target
 // REQUIRES: powerpc-registered-target
-// UNSUPPORTED: darwin, target={{.*}}-aix{{.*}}
+// UNSUPPORTED: target={{.*}}-darwin{{.*}}, target={{.*}}-aix{{.*}}
 
 //
 // Generate all the types of files we can bundle.

diff  --git a/clang/test/Index/pch-from-libclang.c 
b/clang/test/Index/pch-from-libclang.c
index 5ad5ecb9157a0..52722b629982c 100644
--- a/clang/test/Index/pch-from-libclang.c
+++ b/clang/test/Index/pch-from-libclang.c
@@ -1,7 +1,7 @@
 // Check that clang can use a PCH created from libclang.
 
 // https://PR46644
-// XFAIL: arm64-apple
+// XFAIL: target=arm64-apple-{{.*}}
 
 // This test doesn't use -fdisable-module-hash and hence requires that
 // CompilerInvocation::getModuleHash() computes exactly the same hash

diff  --git a/clang/test/Interpreter/simple-exception.cpp 
b/clang/test/Interpreter/simple-exception.cpp
index 5af656396d4a3..57e14e47a30a1 100644
--- a/clang/test/Interpreter/simple-exception.cpp
+++ b/clang/test/Interpreter/simple-exception.cpp
@@ -1,6 +1,7 @@
 // clang-format off
 // UNSUPPORTED: system-aix
-// XFAIL: arm, arm64-apple, system-windows
+// XFAIL for arm and arm64, or running on Windows.
+// XFAIL: target=arm{{.*}}, system-windows
 // RUN: cat %s | clang-repl | FileCheck %s
 extern "C" int printf(const char *, ...);
 

diff  --git a/llvm/test/DebugInfo/Generic/empty.ll 
b/llvm/test/DebugInfo/Generic/empty.ll
index 83b2e40b4328a..8de50ff23bb5b 100644
--- a/llvm/test/DebugInfo/Generic/empty.ll
+++ b/llvm/test/DebugInfo/Generic/empty.ll
@@ -3,7 +3,7 @@
 ; RUN: %llc_dwarf -split-dwarf-file=foo.dwo < %s -filetype=obj | 
llvm-dwarfdump -v - | FileCheck --check-prefix=FISSION %s
 
 ; darwin has a workaround for a linker bug so it always emits one line table 
entry
-; XFAIL: darwin
+; XFAIL: target={{.*}}-darwin{{.*}}
 
 ; Expect no line table entry since there are no functions and file references 
in this compile unit
 ; CHECK: .debug_line contents:

diff  --git a/llvm/test/DebugInfo/Generic/gmlt.test 
b/llvm/test/DebugInfo/Generic/gmlt.test
index 2b82cef8cb052..3cb3d9c14761c 100644
--- a/llvm/test/DebugInfo/Generic/gmlt.test
+++ b/llvm/test/DebugInfo/Generic/gmlt.test
@@ -1,4 +1,4 @@
 ; RUN: %llc_dwarf -O0 -filetype=obj < %S/../Inputs/gmlt.ll | llvm-dwarfdump -v 
- | FileCheck %S/../Inputs/gmlt.ll
 
 ; There's a darwin specific test in X86/gmlt, so it's okay to XFAIL this here.
-; XFAIL: darwin
+; XFAIL: target={{.*}}-darwin{{.*}}

diff  --git a/llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll 
b/llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll
index 1dbe9398065d0..2e95e7eda588a 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll
@@ -1,6 +1,6 @@
 

[clang] 64e4d03 - [lit][AIX] Convert clang tests to use 'target={{.*}}-aix{{.*}}'

2022-12-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-02T09:44:15-08:00
New Revision: 64e4d03c681a1c43ec22aee9ce32b784ed5aee9c

URL: 
https://github.com/llvm/llvm-project/commit/64e4d03c681a1c43ec22aee9ce32b784ed5aee9c
DIFF: 
https://github.com/llvm/llvm-project/commit/64e4d03c681a1c43ec22aee9ce32b784ed5aee9c.diff

LOG: [lit][AIX] Convert clang tests to use 'target={{.*}}-aix{{.*}}'

Part of the project to eliminate special handling for triples in lit
expressions.

Differential Revision: https://reviews.llvm.org/D137437

Added: 


Modified: 
clang/test/ASTMerge/codegen-body/test.c
clang/test/Analysis/cfref_PR2519.c
clang/test/ClangScanDeps/modules-full-by-mod-name.cpp
clang/test/ClangScanDeps/modules-no-undeclared-includes.c
clang/test/ClangScanDeps/modules-pch-common-submodule.c
clang/test/ClangScanDeps/modules-pch-common-via-submodule.c
clang/test/ClangScanDeps/modules-pch-dangling.c
clang/test/ClangScanDeps/modules-pch.c
clang/test/ClangScanDeps/modules-symlink.c
clang/test/ClangScanDeps/resource_directory.c
clang/test/CodeGen/cfstring2.c
clang/test/CodeGen/thinlto-backend-option.ll
clang/test/CodeGen/thinlto-emit-llvm.c
clang/test/Driver/clang-offload-bundler-asserts-on.c
clang/test/Driver/clang-offload-bundler.c
clang/test/Driver/experimental-library-flag.cpp
clang/test/Driver/fat-archive-unbundle-ext.c
clang/test/Driver/hip-version.hip
clang/test/Driver/thinlto_backend.c
clang/test/Import/forward-declared-objc-class/test.m
clang/test/Import/objc-arc/test-cleanup-object.m
clang/test/Import/objc-autoreleasepool/test.m
clang/test/Import/objc-definitions-in-expression/test.m
clang/test/Import/objc-method/test.m
clang/test/Import/objc-param-decl/test.m
clang/test/Import/objc-try-catch/test.m
clang/test/Integration/thinlto_profile_sample_accurate.c
clang/test/Modules/DebugInfoNamespace.cpp
clang/test/Modules/DebugInfoSubmoduleImport.c
clang/test/Modules/DebugInfoTransitiveImport.m
clang/test/Modules/ExtDebugInfo.cpp
clang/test/Modules/ExtDebugInfo.m
clang/test/Modules/ModuleDebugInfo.cpp
clang/test/Modules/ModuleDebugInfo.m
clang/test/Modules/ModuleDebugInfoDwoId.cpp
clang/test/Modules/ModuleModuleDebugInfo.cpp
clang/test/Modules/autolink.m
clang/test/Modules/autolinkTBD.m
clang/test/Modules/builtins.m
clang/test/Modules/clang_module_file_info.m
clang/test/Modules/cxx-irgen.cpp
clang/test/Modules/debug-info-moduleimport-in-module.m
clang/test/Modules/debug-info-moduleimport.m
clang/test/Modules/direct-module-import.m
clang/test/Modules/merge-anon-record-definition-in-objc.m
clang/test/Modules/merge-extension-ivars.m
clang/test/Modules/merge-objc-interface-visibility.m
clang/test/Modules/merge-objc-interface.m
clang/test/Modules/merge-objc-protocol-visibility.m
clang/test/Modules/merge-record-definition-nonmodular.m
clang/test/Modules/merge-record-definition-visibility.m
clang/test/Modules/merge-record-definition.m
clang/test/Modules/module-debuginfo-prefix.m
clang/test/Modules/module-file-home-is-cwd.m
clang/test/Modules/module_file_info.m
clang/test/Modules/objc-initializer.m
clang/test/Modules/pch-used.m
clang/test/Modules/redecl-ivars.m
clang/test/Modules/use-exportas-for-link.m
clang/test/PCH/debug-info-pch-path.c
clang/test/PCH/externally-retained.m
clang/test/PCH/irgen-rdar13114142.mm
clang/test/PCH/objc_container.m
clang/test/PCH/objc_literals.m
clang/test/PCH/objc_literals.mm
clang/test/PCH/objcxx-ivar-class.mm
clang/test/PCH/pending-ids.m

Removed: 




diff  --git a/clang/test/ASTMerge/codegen-body/test.c 
b/clang/test/ASTMerge/codegen-body/test.c
index fc5553facbd95..d6346c618750d 100644
--- a/clang/test/ASTMerge/codegen-body/test.c
+++ b/clang/test/ASTMerge/codegen-body/test.c
@@ -1,4 +1,4 @@
-// UNSUPPORTED: powerpc64-ibm-aix
+// UNSUPPORTED: target=powerpc64-ibm-aix{{.*}}
 // RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/body1.c
 // RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/body2.c
 // RUN: %clang_cc1 -emit-obj -o /dev/null -ast-merge %t.1.ast -ast-merge 
%t.2.ast %s

diff  --git a/clang/test/Analysis/cfref_PR2519.c 
b/clang/test/Analysis/cfref_PR2519.c
index 5c1ab1a96012d..e63ac10fb5490 100644
--- a/clang/test/Analysis/cfref_PR2519.c
+++ b/clang/test/Analysis/cfref_PR2519.c
@@ -1,4 +1,4 @@
-// UNSUPPORTED: -zos, -aix
+// UNSUPPORTED: -zos, target={{.*}}-aix{{.*}}
 // RUN: %clang_analyze_cc1 
-analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s
 // expected-no-diagnostics
 

diff  --git a/clang/test/ClangScanDeps/modules-full-by-mod-name.cpp 
b/clang/test/ClangScanDeps/modules-full-by-mod-name.cpp
index 5f6e2edc7260e..41b1ef6ebe901 100644
--- a/clang/test/ClangScanDeps/modules-full-by-mod-name.cpp
+++ 

[clang] aa14968 - [PS4/PS5] Canonicalize tests to use 'target=.*-(ps4|ps5)'

2022-12-01 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-12-01T07:21:07-08:00
New Revision: aa149687dc76f304a5228a167f4eebf19e5fb2d7

URL: 
https://github.com/llvm/llvm-project/commit/aa149687dc76f304a5228a167f4eebf19e5fb2d7
DIFF: 
https://github.com/llvm/llvm-project/commit/aa149687dc76f304a5228a167f4eebf19e5fb2d7.diff

LOG: [PS4/PS5] Canonicalize tests to use 'target=.*-(ps4|ps5)'

This allows grepping for ps4 or ps5 to continue to work.

Added: 


Modified: 
clang/test/Driver/experimental-library-flag.cpp
clang/test/Driver/lld-repro.c
clang/test/Driver/nostdincxx.cpp
clang/test/Modules/crash-vfs-path-traversal.m
clang/test/Preprocessor/lang-std.cpp

Removed: 




diff  --git a/clang/test/Driver/experimental-library-flag.cpp 
b/clang/test/Driver/experimental-library-flag.cpp
index 6f827ccd6275b..eec5df1bd3a77 100644
--- a/clang/test/Driver/experimental-library-flag.cpp
+++ b/clang/test/Driver/experimental-library-flag.cpp
@@ -1,6 +1,6 @@
 // On some platforms, -stdlib=libc++ is currently ignored, so 
-lc++experimental is not added.
 // Once -stdlib=libc++ works on those, this XFAIL can be removed.
-// XFAIL: target={{.*-windows.*}}, target={{.*-ps(4|5)}}
+// XFAIL: target={{.*-windows.*}}, target={{.*-(ps4|ps5)}}
 
 // For some reason, this fails with a core dump on AIX. This needs to be 
investigated.
 // UNSUPPORTED: aix

diff  --git a/clang/test/Driver/lld-repro.c b/clang/test/Driver/lld-repro.c
index 9fc37d98cef6c..9457dd334b5b9 100644
--- a/clang/test/Driver/lld-repro.c
+++ b/clang/test/Driver/lld-repro.c
@@ -1,5 +1,5 @@
 // REQUIRES: lld
-// UNSUPPORTED: target={{.*-ps(4|5)}}
+// UNSUPPORTED: target={{.*-(ps4|ps5)}}
 
 // RUN: echo "-nostartfiles -nostdlib -fuse-ld=lld -gen-reproducer=error 
-fcrash-diagnostics-dir=%t" \
 // RUN:   | sed -e 's/\\//g' > %t.rsp

diff  --git a/clang/test/Driver/nostdincxx.cpp 
b/clang/test/Driver/nostdincxx.cpp
index 11fd59fab2c29..ef5702a19c037 100644
--- a/clang/test/Driver/nostdincxx.cpp
+++ b/clang/test/Driver/nostdincxx.cpp
@@ -6,4 +6,4 @@
 #include 
 
 // MSVC, PS4, PS5 have C++ headers in the same directory as C headers.
-// UNSUPPORTED: ms-sdk, target={{.*-ps(4|5)}}
+// UNSUPPORTED: ms-sdk, target={{.*-(ps4|ps5)}}

diff  --git a/clang/test/Modules/crash-vfs-path-traversal.m 
b/clang/test/Modules/crash-vfs-path-traversal.m
index 6cd43a440cc94..891c7960f08b1 100644
--- a/clang/test/Modules/crash-vfs-path-traversal.m
+++ b/clang/test/Modules/crash-vfs-path-traversal.m
@@ -1,5 +1,5 @@
 // REQUIRES: crash-recovery, shell
-// UNSUPPORTED: ms-sdk, target={{.*-ps4}}
+// UNSUPPORTED: ms-sdk, target={{.*-(ps4|ps5)}}
 
 // FIXME: Canonicalizing paths to remove relative traversal components
 // currenty fails a unittest on windows and is disable by default.

diff  --git a/clang/test/Preprocessor/lang-std.cpp 
b/clang/test/Preprocessor/lang-std.cpp
index 86aeb9ad45d51..881d38641bc73 100644
--- a/clang/test/Preprocessor/lang-std.cpp
+++ b/clang/test/Preprocessor/lang-std.cpp
@@ -1,4 +1,4 @@
-// UNSUPPORTED: target={{.*-ps(4|5)}}
+// UNSUPPORTED: target={{.*-(ps4|ps5)}}
 /// Test default standards.
 /// PS4/PS5 default to gnu++14.
 



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


[clang] b6a73d0 - [analyzer] Test depends on windows as host, not target

2022-11-30 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-11-30T14:11:51-08:00
New Revision: b6a73d06bad46cf11a15a873f4fca732570af458

URL: 
https://github.com/llvm/llvm-project/commit/b6a73d06bad46cf11a15a873f4fca732570af458
DIFF: 
https://github.com/llvm/llvm-project/commit/b6a73d06bad46cf11a15a873f4fca732570af458.diff

LOG: [analyzer] Test depends on windows as host, not target

Added: 


Modified: 
clang/test/Analysis/exploded-graph-rewriter/win_path_forbidden_chars.cpp

Removed: 




diff  --git 
a/clang/test/Analysis/exploded-graph-rewriter/win_path_forbidden_chars.cpp 
b/clang/test/Analysis/exploded-graph-rewriter/win_path_forbidden_chars.cpp
index 4c217e6dc502..5b955a0aae3e 100644
--- a/clang/test/Analysis/exploded-graph-rewriter/win_path_forbidden_chars.cpp
+++ b/clang/test/Analysis/exploded-graph-rewriter/win_path_forbidden_chars.cpp
@@ -3,7 +3,7 @@
 // RUN: -analyzer-checker=core \
 // RUN: -analyzer-dump-egraph=%t.dot %s
 // RUN: %exploded_graph_rewriter --verbose %t.dot 2>&1 | FileCheck %s
-// UNSUPPORTED: !windows
+// REQUIRES: system-windows
 
 // Angle brackets shall not be presented in the field `file`,
 // because exploded_graph_rewriter handles it as a file path



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


[clang] 2fbcf8b - [Hexagon] Convert tests to check 'target=hexagon-.*'

2022-11-30 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-11-30T13:36:10-08:00
New Revision: 2fbcf8b9b38c84fd1c3a250b4ef76f7e7adad0d3

URL: 
https://github.com/llvm/llvm-project/commit/2fbcf8b9b38c84fd1c3a250b4ef76f7e7adad0d3
DIFF: 
https://github.com/llvm/llvm-project/commit/2fbcf8b9b38c84fd1c3a250b4ef76f7e7adad0d3.diff

LOG: [Hexagon] Convert tests to check 'target=hexagon-.*'

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/CodeGen/c-strings.c
clang/test/CodeGen/string-literal-short-wstring.c
llvm/test/CodeGen/Generic/MachineBranchProb.ll
llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll
llvm/test/DebugInfo/Generic/sugared-constants.ll

Removed: 




diff  --git a/clang/test/CodeGen/c-strings.c b/clang/test/CodeGen/c-strings.c
index ebb3217ca48a7..687394168534d 100644
--- a/clang/test/CodeGen/c-strings.c
+++ b/clang/test/CodeGen/c-strings.c
@@ -16,7 +16,7 @@
 // MSABI: @f4.x = internal global %struct.s { ptr 
@"??_C@_05CJBACGMB@hello?$AA@" }
 // CHECK: @x = {{(dso_local )?}}global [3 x i8] c"ola", align [[ALIGN]]
 
-// XFAIL: hexagon
+// XFAIL: target=hexagon-{{.*}}
 // Hexagon aligns arrays of size 8+ bytes to a 64-bit boundary, which
 // fails the check for "@f3.x = ... align [ALIGN]", since ALIGN is derived
 // from the alignment of a single i8, which is still 1.

diff  --git a/clang/test/CodeGen/string-literal-short-wstring.c 
b/clang/test/CodeGen/string-literal-short-wstring.c
index c9e7a2afee092..7daa64b0af374 100644
--- a/clang/test/CodeGen/string-literal-short-wstring.c
+++ b/clang/test/CodeGen/string-literal-short-wstring.c
@@ -3,7 +3,7 @@
 
 // Run in C mode as wide multichar literals are not valid in C++
 
-// XFAIL: hexagon
+// XFAIL: target=hexagon-{{.*}}
 // Hexagon aligns arrays of size 8+ bytes to a 64-bit boundary, which fails
 // the first check line with "align 1".
 

diff  --git a/llvm/test/CodeGen/Generic/MachineBranchProb.ll 
b/llvm/test/CodeGen/Generic/MachineBranchProb.ll
index afe454a62e30d..9a5ea0c5e13cc 100644
--- a/llvm/test/CodeGen/Generic/MachineBranchProb.ll
+++ b/llvm/test/CodeGen/Generic/MachineBranchProb.ll
@@ -2,7 +2,7 @@
 
 ; Hexagon runs passes that renumber the basic blocks, causing this test
 ; to fail.
-; XFAIL: hexagon
+; XFAIL: target=hexagon-{{.*}}
 
 declare void @foo()
 

diff  --git a/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll 
b/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll
index d741fb3fe6e20..7edc971334c8e 100644
--- a/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll
+++ b/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll
@@ -1,6 +1,6 @@
 ; xfail this test on hexagon because at O2, instructions are bundled in packets
 ; and DW_OP_lit13 is correctly omitted.
-; XFAIL: hexagon
+; XFAIL: target=hexagon-{{.*}}
 
 ; RUN: %llc_dwarf -O2  -dwarf-version 2 -filetype=obj < %s | llvm-dwarfdump - 
| FileCheck %s  --check-prefix=DWARF23
 ; RUN: %llc_dwarf -O2  -dwarf-version 3 -filetype=obj < %s | llvm-dwarfdump - 
| FileCheck %s  --check-prefix=DWARF23

diff  --git a/llvm/test/DebugInfo/Generic/sugared-constants.ll 
b/llvm/test/DebugInfo/Generic/sugared-constants.ll
index 9bb66423e97aa..c8ee035dbca1d 100644
--- a/llvm/test/DebugInfo/Generic/sugared-constants.ll
+++ b/llvm/test/DebugInfo/Generic/sugared-constants.ll
@@ -1,6 +1,6 @@
 ; xfail this test on hexagon because upstream llc is not emitting the
 ; correct DWARF info. Downstream llc is.
-; XFAIL: hexagon
+; XFAIL: target=hexagon-{{.*}}
 
 ; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -v -debug-info - 
| FileCheck %s
 ; Use correct signedness when emitting constants of derived (sugared) types.



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


[clang] 57b1c02 - [Windows] Canonicalize on 'target=.*-windows'

2022-11-30 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-11-30T12:07:27-08:00
New Revision: 57b1c0250d5da6ac5342f10cd8f046412a46f153

URL: 
https://github.com/llvm/llvm-project/commit/57b1c0250d5da6ac5342f10cd8f046412a46f153
DIFF: 
https://github.com/llvm/llvm-project/commit/57b1c0250d5da6ac5342f10cd8f046412a46f153.diff

LOG: [Windows] Canonicalize on 'target=.*-windows'

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/CodeGenCXX/vtable-debug-info.cpp
clang/test/Driver/fat-archive-unbundle-ext.c
llvm/test/MC/RISCV/rv32i-aliases-invalid.s
llvm/test/MC/RISCV/rv64i-aliases-invalid.s

Removed: 




diff  --git a/clang/test/CodeGenCXX/vtable-debug-info.cpp 
b/clang/test/CodeGenCXX/vtable-debug-info.cpp
index 5b2816529f8b3..b426ce96fa7fc 100644
--- a/clang/test/CodeGenCXX/vtable-debug-info.cpp
+++ b/clang/test/CodeGenCXX/vtable-debug-info.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang -emit-llvm -S -g %s -o /dev/null
 // Radar 8730409
-// XFAIL: target={{.*windows-msvc}}
+// XFAIL: target={{.*-windows-msvc}}
 
 // FIXME: This test crashes on *-pc-win32
 // for lack of debugging support on -integrated-as (MCCOFF).

diff  --git a/clang/test/Driver/fat-archive-unbundle-ext.c 
b/clang/test/Driver/fat-archive-unbundle-ext.c
index f257012c8f337..93fdb1a91f638 100644
--- a/clang/test/Driver/fat-archive-unbundle-ext.c
+++ b/clang/test/Driver/fat-archive-unbundle-ext.c
@@ -1,5 +1,5 @@
 // REQUIRES: x86-registered-target
-// UNSUPPORTED: target={{.*windows.*}}, darwin, aix
+// UNSUPPORTED: target={{.*-windows.*}}, darwin, aix
 
 // Generate dummy fat object
 // RUN: %clang -O0 -target %itanium_abi_triple %s -c -o %t.host.o

diff  --git a/llvm/test/MC/RISCV/rv32i-aliases-invalid.s 
b/llvm/test/MC/RISCV/rv32i-aliases-invalid.s
index 985f86f087fb8..d78398267111e 100644
--- a/llvm/test/MC/RISCV/rv32i-aliases-invalid.s
+++ b/llvm/test/MC/RISCV/rv32i-aliases-invalid.s
@@ -1,4 +1,4 @@
-# UNSUPPORTED: target={{.*windows.*}}
+# UNSUPPORTED: target={{.*-windows.*}}
 # RUN: not llvm-mc -triple=riscv32 -riscv-no-aliases < %s -o /dev/null 2>&1 | 
FileCheck %s
 # RUN: not llvm-mc -triple=riscv32 < %s -o /dev/null 2>&1 | FileCheck %s
 

diff  --git a/llvm/test/MC/RISCV/rv64i-aliases-invalid.s 
b/llvm/test/MC/RISCV/rv64i-aliases-invalid.s
index 93e191d2e3312..93777002dcadb 100644
--- a/llvm/test/MC/RISCV/rv64i-aliases-invalid.s
+++ b/llvm/test/MC/RISCV/rv64i-aliases-invalid.s
@@ -1,4 +1,4 @@
-# UNSUPPORTED: target={{.*windows.*}}
+# UNSUPPORTED: target={{.*-windows.*}}
 # RUN: not llvm-mc -triple=riscv64 -riscv-no-aliases < %s -o /dev/null 2>&1 | 
FileCheck %s
 # RUN: not llvm-mc -triple=riscv64 < %s 2>&1 -o /dev/null | FileCheck %s
 



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


[clang] b8da574 - [PS4/PS5] Convert tests to check 'target='

2022-11-30 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-11-30T12:02:30-08:00
New Revision: b8da574c0d5079d2e6e44d2ccb7cf466b2872065

URL: 
https://github.com/llvm/llvm-project/commit/b8da574c0d5079d2e6e44d2ccb7cf466b2872065
DIFF: 
https://github.com/llvm/llvm-project/commit/b8da574c0d5079d2e6e44d2ccb7cf466b2872065.diff

LOG: [PS4/PS5] Convert tests to check 'target='

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/Driver/experimental-library-flag.cpp
clang/test/Driver/inhibit-downstream-commands.c
clang/test/Driver/no-integrated-as.s
clang/test/Modules/crash-vfs-path-traversal.m

Removed: 




diff  --git a/clang/test/Driver/experimental-library-flag.cpp 
b/clang/test/Driver/experimental-library-flag.cpp
index 523c8e410f6c3..6f827ccd6275b 100644
--- a/clang/test/Driver/experimental-library-flag.cpp
+++ b/clang/test/Driver/experimental-library-flag.cpp
@@ -1,6 +1,6 @@
 // On some platforms, -stdlib=libc++ is currently ignored, so 
-lc++experimental is not added.
 // Once -stdlib=libc++ works on those, this XFAIL can be removed.
-// XFAIL: target={{.*windows.*}}, x86_64-scei-ps4, x86_64-sie-ps5
+// XFAIL: target={{.*-windows.*}}, target={{.*-ps(4|5)}}
 
 // For some reason, this fails with a core dump on AIX. This needs to be 
investigated.
 // UNSUPPORTED: aix

diff  --git a/clang/test/Driver/inhibit-downstream-commands.c 
b/clang/test/Driver/inhibit-downstream-commands.c
index f6dc4ee61e9bb..a0fde23df7d45 100644
--- a/clang/test/Driver/inhibit-downstream-commands.c
+++ b/clang/test/Driver/inhibit-downstream-commands.c
@@ -2,5 +2,5 @@
 // CHECK: error: unknown type name 'invalid'
 // CHECK-NOT: clang: error: assembler command failed
 // CHECK-NOT: clang: error: linker command failed
-// XFAIL: target={{.*windows-msvc}}, ps5
+// XFAIL: target={{.*-windows-msvc}}, target={{.*-ps5}}
 invalid C code!

diff  --git a/clang/test/Driver/no-integrated-as.s 
b/clang/test/Driver/no-integrated-as.s
index 6be8e17398afe..f03217d19a206 100644
--- a/clang/test/Driver/no-integrated-as.s
+++ b/clang/test/Driver/no-integrated-as.s
@@ -1,6 +1,6 @@
 ; RUN: %clang -### -no-integrated-as -c %s 2>&1 | FileCheck %s -check-prefix 
IAS
 ; Windows and PS5 don't support no-integrated-as
-; XFAIL: target={{.*windows-msvc}}, ps5
+; XFAIL: target={{.*-windows-msvc}}, target={{.*-ps5}}
 ;
 ; Make sure the current file's filename appears in the output.
 ; We can't generically match on the assembler name, so we just make sure

diff  --git a/clang/test/Modules/crash-vfs-path-traversal.m 
b/clang/test/Modules/crash-vfs-path-traversal.m
index 7705b7930e9c0..6cd43a440cc94 100644
--- a/clang/test/Modules/crash-vfs-path-traversal.m
+++ b/clang/test/Modules/crash-vfs-path-traversal.m
@@ -1,5 +1,5 @@
 // REQUIRES: crash-recovery, shell
-// UNSUPPORTED: ms-sdk, ps4
+// UNSUPPORTED: ms-sdk, target={{.*-ps4}}
 
 // FIXME: Canonicalizing paths to remove relative traversal components
 // currenty fails a unittest on windows and is disable by default.



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


[clang] f2c0c72 - [Windows] Convert clang/test/Modules tests to check 'target='

2022-11-29 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-11-29T12:17:36-08:00
New Revision: f2c0c7299b18448ac3ae04891b53fd8cac4af178

URL: 
https://github.com/llvm/llvm-project/commit/f2c0c7299b18448ac3ae04891b53fd8cac4af178
DIFF: 
https://github.com/llvm/llvm-project/commit/f2c0c7299b18448ac3ae04891b53fd8cac4af178.diff

LOG: [Windows] Convert clang/test/Modules tests to check 'target='

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/Modules/crash-vfs-path-emptydir-entries.m
clang/test/Modules/crash-vfs-path-symlink-component.m
clang/test/Modules/crash-vfs-path-symlink-topheader.m
clang/test/Modules/crash-vfs-path-traversal.m
clang/test/Modules/crash-vfs-relative-overlay.m
clang/test/Modules/crash-vfs-umbrella-frameworks.m
clang/test/SemaTemplate/instantiation-depth-default.cpp

Removed: 




diff  --git a/clang/test/Modules/crash-vfs-path-emptydir-entries.m 
b/clang/test/Modules/crash-vfs-path-emptydir-entries.m
index a5b22d7c2be9..a7ee1fe176fb 100644
--- a/clang/test/Modules/crash-vfs-path-emptydir-entries.m
+++ b/clang/test/Modules/crash-vfs-path-emptydir-entries.m
@@ -1,7 +1,7 @@
 // REQUIRES: crash-recovery, shell
 
 // FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?
-// XFAIL: windows-gnu
+// XFAIL: target={{.*-windows-gnu}}
 
 // Test clang can collect symbolic link headers used in modules.
 // crash reproducer if there's a symbolic link header file used in a module.

diff  --git a/clang/test/Modules/crash-vfs-path-symlink-component.m 
b/clang/test/Modules/crash-vfs-path-symlink-component.m
index e8b5848abfdd..8280cd79bbc2 100644
--- a/clang/test/Modules/crash-vfs-path-symlink-component.m
+++ b/clang/test/Modules/crash-vfs-path-symlink-component.m
@@ -1,7 +1,7 @@
 // REQUIRES: crash-recovery, shell
 
 // FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?
-// XFAIL: windows-gnu
+// XFAIL: target={{.*-windows-gnu}}
 
 // Test that clang is capable of collecting the right header files in the
 // crash reproducer if there's a symbolic link component in the path.

diff  --git a/clang/test/Modules/crash-vfs-path-symlink-topheader.m 
b/clang/test/Modules/crash-vfs-path-symlink-topheader.m
index beea957a7784..5c2d502b209d 100644
--- a/clang/test/Modules/crash-vfs-path-symlink-topheader.m
+++ b/clang/test/Modules/crash-vfs-path-symlink-topheader.m
@@ -1,7 +1,7 @@
 // REQUIRES: crash-recovery, shell
 
 // FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?
-// XFAIL: windows-gnu
+// XFAIL: target={{.*-windows-gnu}}
 
 // Test clang can collect symbolic link headers used in modules.
 // crash reproducer if there's a symbolic link header file used in a module.

diff  --git a/clang/test/Modules/crash-vfs-path-traversal.m 
b/clang/test/Modules/crash-vfs-path-traversal.m
index 198e1fc68cad..7705b7930e9c 100644
--- a/clang/test/Modules/crash-vfs-path-traversal.m
+++ b/clang/test/Modules/crash-vfs-path-traversal.m
@@ -4,7 +4,7 @@
 // FIXME: Canonicalizing paths to remove relative traversal components
 // currenty fails a unittest on windows and is disable by default.
 // FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?
-// XFAIL: windows-gnu
+// XFAIL: target={{.*-windows-gnu}}
 
 // RUN: rm -rf %t
 // RUN: mkdir -p %t/i %t/m %t

diff  --git a/clang/test/Modules/crash-vfs-relative-overlay.m 
b/clang/test/Modules/crash-vfs-relative-overlay.m
index 59cd8fd9c70d..ce2902417943 100644
--- a/clang/test/Modules/crash-vfs-relative-overlay.m
+++ b/clang/test/Modules/crash-vfs-relative-overlay.m
@@ -1,7 +1,7 @@
 // REQUIRES: crash-recovery, shell
 
 // FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?
-// XFAIL: windows-gnu
+// XFAIL: target={{.*-windows-gnu}}
 
 // RUN: rm -rf %t
 // RUN: mkdir -p %t/i %t/m %t

diff  --git a/clang/test/Modules/crash-vfs-umbrella-frameworks.m 
b/clang/test/Modules/crash-vfs-umbrella-frameworks.m
index 8cd3afb731b6..d097ffb81a03 100644
--- a/clang/test/Modules/crash-vfs-umbrella-frameworks.m
+++ b/clang/test/Modules/crash-vfs-umbrella-frameworks.m
@@ -1,7 +1,7 @@
 // REQUIRES: crash-recovery, shell
 
 // FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?
-// XFAIL: windows-gnu
+// XFAIL: target={{.*-windows-gnu}}
 
 // RUN: rm -rf %t
 // RUN: mkdir -p %t/i %t/m %t

diff  --git a/clang/test/SemaTemplate/instantiation-depth-default.cpp 
b/clang/test/SemaTemplate/instantiation-depth-default.cpp
index 61619623c97c..852621aa89e7 100644
--- a/clang/test/SemaTemplate/instantiation-depth-default.cpp
+++ b/clang/test/SemaTemplate/instantiation-depth-default.cpp
@@ -17,4 +17,4 @@ template struct X : X {};
 X<0, int> x; // expected-note {{in instantiation of}}
 
 // FIXME: It crashes. Investigating.
-// UNSUPPORTED: windows-gnu
+// UNSUPPORTED: target={{.*-windows-gnu}}



___

[clang] df3f5f7 - [Windows] Convert tests to check 'target='

2022-11-29 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-11-29T10:33:21-08:00
New Revision: df3f5f714985a45ed7ad34a60f16a853b6cd40f2

URL: 
https://github.com/llvm/llvm-project/commit/df3f5f714985a45ed7ad34a60f16a853b6cd40f2
DIFF: 
https://github.com/llvm/llvm-project/commit/df3f5f714985a45ed7ad34a60f16a853b6cd40f2.diff

LOG: [Windows] Convert tests to check 'target='

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 


Modified: 
clang/test/CodeGenCXX/vtable-debug-info.cpp
clang/test/Driver/experimental-library-flag.cpp
clang/test/Driver/fat-archive-unbundle-ext.c
clang/test/Driver/inhibit-downstream-commands.c
clang/test/Driver/no-integrated-as.s
llvm/test/MC/RISCV/rv32i-aliases-invalid.s
llvm/test/MC/RISCV/rv64i-aliases-invalid.s

Removed: 




diff  --git a/clang/test/CodeGenCXX/vtable-debug-info.cpp 
b/clang/test/CodeGenCXX/vtable-debug-info.cpp
index 0ac90b3ec1d32..5b2816529f8b3 100644
--- a/clang/test/CodeGenCXX/vtable-debug-info.cpp
+++ b/clang/test/CodeGenCXX/vtable-debug-info.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang -emit-llvm -S -g %s -o /dev/null
 // Radar 8730409
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc}}
 
 // FIXME: This test crashes on *-pc-win32
 // for lack of debugging support on -integrated-as (MCCOFF).

diff  --git a/clang/test/Driver/experimental-library-flag.cpp 
b/clang/test/Driver/experimental-library-flag.cpp
index 529888b867c16..523c8e410f6c3 100644
--- a/clang/test/Driver/experimental-library-flag.cpp
+++ b/clang/test/Driver/experimental-library-flag.cpp
@@ -1,6 +1,6 @@
 // On some platforms, -stdlib=libc++ is currently ignored, so 
-lc++experimental is not added.
 // Once -stdlib=libc++ works on those, this XFAIL can be removed.
-// XFAIL: windows, x86_64-scei-ps4, x86_64-sie-ps5
+// XFAIL: target={{.*windows.*}}, x86_64-scei-ps4, x86_64-sie-ps5
 
 // For some reason, this fails with a core dump on AIX. This needs to be 
investigated.
 // UNSUPPORTED: aix

diff  --git a/clang/test/Driver/fat-archive-unbundle-ext.c 
b/clang/test/Driver/fat-archive-unbundle-ext.c
index fff977c237a87..f257012c8f337 100644
--- a/clang/test/Driver/fat-archive-unbundle-ext.c
+++ b/clang/test/Driver/fat-archive-unbundle-ext.c
@@ -1,5 +1,5 @@
 // REQUIRES: x86-registered-target
-// UNSUPPORTED: windows, darwin, aix
+// UNSUPPORTED: target={{.*windows.*}}, darwin, aix
 
 // Generate dummy fat object
 // RUN: %clang -O0 -target %itanium_abi_triple %s -c -o %t.host.o

diff  --git a/clang/test/Driver/inhibit-downstream-commands.c 
b/clang/test/Driver/inhibit-downstream-commands.c
index b4086bd4d4e2c..f6dc4ee61e9bb 100644
--- a/clang/test/Driver/inhibit-downstream-commands.c
+++ b/clang/test/Driver/inhibit-downstream-commands.c
@@ -2,5 +2,5 @@
 // CHECK: error: unknown type name 'invalid'
 // CHECK-NOT: clang: error: assembler command failed
 // CHECK-NOT: clang: error: linker command failed
-// XFAIL: windows-msvc, ps5
+// XFAIL: target={{.*windows-msvc}}, ps5
 invalid C code!

diff  --git a/clang/test/Driver/no-integrated-as.s 
b/clang/test/Driver/no-integrated-as.s
index 16a1f0535cc14..6be8e17398afe 100644
--- a/clang/test/Driver/no-integrated-as.s
+++ b/clang/test/Driver/no-integrated-as.s
@@ -1,6 +1,6 @@
 ; RUN: %clang -### -no-integrated-as -c %s 2>&1 | FileCheck %s -check-prefix 
IAS
 ; Windows and PS5 don't support no-integrated-as
-; XFAIL: windows-msvc, ps5
+; XFAIL: target={{.*windows-msvc}}, ps5
 ;
 ; Make sure the current file's filename appears in the output.
 ; We can't generically match on the assembler name, so we just make sure

diff  --git a/llvm/test/MC/RISCV/rv32i-aliases-invalid.s 
b/llvm/test/MC/RISCV/rv32i-aliases-invalid.s
index d237554615029..985f86f087fb8 100644
--- a/llvm/test/MC/RISCV/rv32i-aliases-invalid.s
+++ b/llvm/test/MC/RISCV/rv32i-aliases-invalid.s
@@ -1,4 +1,4 @@
-# UNSUPPORTED: windows
+# UNSUPPORTED: target={{.*windows.*}}
 # RUN: not llvm-mc -triple=riscv32 -riscv-no-aliases < %s -o /dev/null 2>&1 | 
FileCheck %s
 # RUN: not llvm-mc -triple=riscv32 < %s -o /dev/null 2>&1 | FileCheck %s
 

diff  --git a/llvm/test/MC/RISCV/rv64i-aliases-invalid.s 
b/llvm/test/MC/RISCV/rv64i-aliases-invalid.s
index 71c5cf4d35c11..93e191d2e3312 100644
--- a/llvm/test/MC/RISCV/rv64i-aliases-invalid.s
+++ b/llvm/test/MC/RISCV/rv64i-aliases-invalid.s
@@ -1,4 +1,4 @@
-# UNSUPPORTED: windows
+# UNSUPPORTED: target={{.*windows.*}}
 # RUN: not llvm-mc -triple=riscv64 -riscv-no-aliases < %s -o /dev/null 2>&1 | 
FileCheck %s
 # RUN: not llvm-mc -triple=riscv64 < %s 2>&1 -o /dev/null | FileCheck %s
 



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


[clang] cd5900d - [PCH] Remove useless UNSUPPORTED clause

2022-11-29 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-11-29T10:07:38-08:00
New Revision: cd5900dcd1ecea9a5e2ec7b8bc53c61d90b856ed

URL: 
https://github.com/llvm/llvm-project/commit/cd5900dcd1ecea9a5e2ec7b8bc53c61d90b856ed
DIFF: 
https://github.com/llvm/llvm-project/commit/cd5900dcd1ecea9a5e2ec7b8bc53c61d90b856ed.diff

LOG: [PCH] Remove useless UNSUPPORTED clause

"win32" is never defined as a lit feature, AFAICT, and Windows bots
appear to be running this just fine.

Part of the project to eliminate special handling for triples in lit 
expressions.

Added: 


Modified: 
clang/test/PCH/modified-header-error.c

Removed: 




diff  --git a/clang/test/PCH/modified-header-error.c 
b/clang/test/PCH/modified-header-error.c
index fb638363ba659..a6b0475e18e87 100644
--- a/clang/test/PCH/modified-header-error.c
+++ b/clang/test/PCH/modified-header-error.c
@@ -9,6 +9,3 @@
 #include "header2.h"
 
 // CHECK: fatal error: file {{.*}} has been modified since the precompiled 
header {{.*}} was built
-
-// FIXME: Flaky on Windows, timestamp resolution?
-// UNSUPPORTED: win32



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


[clang] dee009d - [lit] UNSUPPORTED ps4/ps5 => target={{.*-ps(4|5)}}

2022-11-29 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-11-29T09:07:59-08:00
New Revision: dee009d3b5c71a340eb4ebb3cfb49f6015a789cc

URL: 
https://github.com/llvm/llvm-project/commit/dee009d3b5c71a340eb4ebb3cfb49f6015a789cc
DIFF: 
https://github.com/llvm/llvm-project/commit/dee009d3b5c71a340eb4ebb3cfb49f6015a789cc.diff

LOG: [lit] UNSUPPORTED ps4/ps5 => target={{.*-ps(4|5)}}

Part of the project to eliminate special handling for triples in lit 
expressions.

Added: 


Modified: 
clang/test/Driver/lld-repro.c
clang/test/Driver/nostdincxx.cpp
clang/test/Preprocessor/lang-std.cpp

Removed: 




diff  --git a/clang/test/Driver/lld-repro.c b/clang/test/Driver/lld-repro.c
index 1333f68d911e..9fc37d98cef6 100644
--- a/clang/test/Driver/lld-repro.c
+++ b/clang/test/Driver/lld-repro.c
@@ -1,5 +1,5 @@
 // REQUIRES: lld
-// UNSUPPORTED: ps4, ps5
+// UNSUPPORTED: target={{.*-ps(4|5)}}
 
 // RUN: echo "-nostartfiles -nostdlib -fuse-ld=lld -gen-reproducer=error 
-fcrash-diagnostics-dir=%t" \
 // RUN:   | sed -e 's/\\//g' > %t.rsp

diff  --git a/clang/test/Driver/nostdincxx.cpp 
b/clang/test/Driver/nostdincxx.cpp
index e27bee8dc613..11fd59fab2c2 100644
--- a/clang/test/Driver/nostdincxx.cpp
+++ b/clang/test/Driver/nostdincxx.cpp
@@ -6,4 +6,4 @@
 #include 
 
 // MSVC, PS4, PS5 have C++ headers in the same directory as C headers.
-// UNSUPPORTED: ms-sdk, ps4, ps5
+// UNSUPPORTED: ms-sdk, target={{.*-ps(4|5)}}

diff  --git a/clang/test/Preprocessor/lang-std.cpp 
b/clang/test/Preprocessor/lang-std.cpp
index e8260147f40e..86aeb9ad45d5 100644
--- a/clang/test/Preprocessor/lang-std.cpp
+++ b/clang/test/Preprocessor/lang-std.cpp
@@ -1,4 +1,4 @@
-// UNSUPPORTED: ps4, ps5
+// UNSUPPORTED: target={{.*-ps(4|5)}}
 /// Test default standards.
 /// PS4/PS5 default to gnu++14.
 



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


[clang] f19c272 - [PS4] Remove an UNSUPPORTED, this test seems to work now

2022-11-29 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-11-29T08:59:09-08:00
New Revision: f19c2720e3f0571d0fb415efa8f4b9fc5ae6eb17

URL: 
https://github.com/llvm/llvm-project/commit/f19c2720e3f0571d0fb415efa8f4b9fc5ae6eb17
DIFF: 
https://github.com/llvm/llvm-project/commit/f19c2720e3f0571d0fb415efa8f4b9fc5ae6eb17.diff

LOG: [PS4] Remove an UNSUPPORTED, this test seems to work now

Added: 


Modified: 
clang/test/Preprocessor/pragma_microsoft.c

Removed: 




diff  --git a/clang/test/Preprocessor/pragma_microsoft.c 
b/clang/test/Preprocessor/pragma_microsoft.c
index 057f5ea006e86..aae6e284cb4dc 100644
--- a/clang/test/Preprocessor/pragma_microsoft.c
+++ b/clang/test/Preprocessor/pragma_microsoft.c
@@ -1,6 +1,5 @@
 // RUN: %clang_cc1 -triple i686-unknown-windows-msvc %s -fsyntax-only -verify 
-fms-extensions -Wunknown-pragmas
 // RUN: not %clang_cc1 -triple i686-unknown-windows-msvc %s -fms-extensions -E 
| FileCheck %s
-// UNSUPPORTED: ps4
 
 // rdar://6495941
 



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


[clang] 6288f70 - [lit] Fix typo in REQUIRES clause

2022-10-31 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-10-31T13:15:09-07:00
New Revision: 6288f70bda7438c7d249a4d54d8317172bce2b88

URL: 
https://github.com/llvm/llvm-project/commit/6288f70bda7438c7d249a4d54d8317172bce2b88
DIFF: 
https://github.com/llvm/llvm-project/commit/6288f70bda7438c7d249a4d54d8317172bce2b88.diff

LOG: [lit] Fix typo in REQUIRES clause

Added: 


Modified: 

clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-load-store-reversed-64bit-only.c

Removed: 




diff  --git 
a/clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-load-store-reversed-64bit-only.c
 
b/clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-load-store-reversed-64bit-only.c
index ba97bfa199103..8053516f60175 100644
--- 
a/clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-load-store-reversed-64bit-only.c
+++ 
b/clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-load-store-reversed-64bit-only.c
@@ -1,4 +1,4 @@
-// REQUIRES: powerpc-registered-target.
+// REQUIRES: powerpc-registered-target
 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu \
 // RUN:   -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s
 // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu \



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


[clang] 7af01fe - [lit] Remove undefined keyword from a Driver test

2022-10-31 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-10-31T13:01:05-07:00
New Revision: 7af01fe42f1634297601016cd4ef84c34cd84bca

URL: 
https://github.com/llvm/llvm-project/commit/7af01fe42f1634297601016cd4ef84c34cd84bca
DIFF: 
https://github.com/llvm/llvm-project/commit/7af01fe42f1634297601016cd4ef84c34cd84bca.diff

LOG: [lit] Remove undefined keyword from a Driver test

`clang-driver` hasn't been a valid keyword for a long time.
The test fails when the keyword is removed, so added XFAIL: *
to reflect the true status of the test (XFAIL not UNSUPPORTED)
and filed issue #58711 to get it fixed.

Added: 


Modified: 
clang/test/Driver/hip-link-bc-to-bc.hip

Removed: 




diff  --git a/clang/test/Driver/hip-link-bc-to-bc.hip 
b/clang/test/Driver/hip-link-bc-to-bc.hip
index df858cf158522..972822b5260c2 100644
--- a/clang/test/Driver/hip-link-bc-to-bc.hip
+++ b/clang/test/Driver/hip-link-bc-to-bc.hip
@@ -1,4 +1,6 @@
-// REQUIRES: clang-driver, x86-registered-target, amdgpu-registered-target
+// REQUIRES: x86-registered-target, amdgpu-registered-target
+// See issue #58711
+// XFAIL: *
 
 // Check that clang unbundles the two bitcodes and links via llvm-link
 // RUN: rm -rf %t && mkdir %t



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


[clang] 2b9055c - [PS4/PS5] NFC: Use preferred predicate in a triple check

2022-07-12 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-07-12T08:10:25-07:00
New Revision: 2b9055cee657fbec1afa93da3751bb923649fbde

URL: 
https://github.com/llvm/llvm-project/commit/2b9055cee657fbec1afa93da3751bb923649fbde
DIFF: 
https://github.com/llvm/llvm-project/commit/2b9055cee657fbec1afa93da3751bb923649fbde.diff

LOG: [PS4/PS5] NFC: Use preferred predicate in a triple check

Also add a test to verify this difference in the PS4/PS5 ABIs,
now that we have identified it.

Added: 


Modified: 
clang/lib/Basic/TargetInfo.cpp
clang/test/CodeGenCXX/uncopyable-args.cpp

Removed: 




diff  --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp
index e22ed34e7da46..6685145ea6d2e 100644
--- a/clang/lib/Basic/TargetInfo.cpp
+++ b/clang/lib/Basic/TargetInfo.cpp
@@ -503,7 +503,7 @@ bool TargetInfo::initFeatureMap(
 TargetInfo::CallingConvKind
 TargetInfo::getCallingConvKind(bool ClangABICompat4) const {
   if (getCXXABI() != TargetCXXABI::Microsoft &&
-  (ClangABICompat4 || getTriple().getOS() == llvm::Triple::PS4))
+  (ClangABICompat4 || getTriple().isPS4()))
 return CCK_ClangABI4OrPS4;
   return CCK_Default;
 }

diff  --git a/clang/test/CodeGenCXX/uncopyable-args.cpp 
b/clang/test/CodeGenCXX/uncopyable-args.cpp
index 529bc3baf798d..e03c9970747a5 100644
--- a/clang/test/CodeGenCXX/uncopyable-args.cpp
+++ b/clang/test/CodeGenCXX/uncopyable-args.cpp
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -triple 
x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK 
--check-prefix=NEWABI
 // RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -triple 
x86_64-unknown-unknown -fclang-abi-compat=4.0 -emit-llvm -o - %s | FileCheck %s 
--check-prefix=CHECK --check-prefix=OLDABI
 // RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -triple x86_64-scei-ps4 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK --check-prefix=OLDABI
+// RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -triple x86_64-sie-ps5  
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK --check-prefix=NEWABI
 // RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -triple x86_64-windows-msvc 
-emit-llvm -o - %s -fms-compatibility -fms-compatibility-version=18 | FileCheck 
%s -check-prefix=WIN64 -check-prefix=WIN64-18
 // RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -triple x86_64-windows-msvc 
-emit-llvm -o - %s -fms-compatibility -fms-compatibility-version=19 | FileCheck 
%s -check-prefix=WIN64 -check-prefix=WIN64-19
 



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


[clang] 08e4fe6 - [X86] Add RDPRU instruction

2022-07-06 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-07-06T07:17:47-07:00
New Revision: 08e4fe6c61967d5c6c16ef7a4cc63d51c4992b55

URL: 
https://github.com/llvm/llvm-project/commit/08e4fe6c61967d5c6c16ef7a4cc63d51c4992b55
DIFF: 
https://github.com/llvm/llvm-project/commit/08e4fe6c61967d5c6c16ef7a4cc63d51c4992b55.diff

LOG: [X86] Add RDPRU instruction

Add support for the RDPRU instruction on Zen2 processors.

User-facing features:

- Clang option -m[no-]rdpru to enable/disable the feature
- Support is implicit for znver2/znver3 processors
- Preprocessor symbol __RDPRU__ to indicate support
- Header rdpruintrin.h to define intrinsics
- "rdpru" mnemonic supported for assembler code

Internal features:

- Clang builtin __builtin_ia32_rdpru
- IR intrinsic @llvm.x86.rdpru

Differential Revision: https://reviews.llvm.org/D128934

Added: 
clang/lib/Headers/rdpruintrin.h
clang/test/CodeGen/rdpru-builtins.c
llvm/test/CodeGen/X86/rdpru.ll
llvm/test/MC/X86/RDPRU.s

Modified: 
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/BuiltinsX86.def
clang/include/clang/Driver/Options.td
clang/lib/Basic/Targets/X86.cpp
clang/lib/Basic/Targets/X86.h
clang/lib/Headers/CMakeLists.txt
clang/lib/Headers/x86intrin.h
clang/test/Driver/x86-target-features.c
clang/test/Preprocessor/x86_target_features.c
llvm/docs/ReleaseNotes.rst
llvm/include/llvm/IR/IntrinsicsX86.td
llvm/include/llvm/Support/X86TargetParser.def
llvm/lib/Support/X86TargetParser.cpp
llvm/lib/Target/X86/X86.td
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrInfo.td
llvm/lib/Target/X86/X86InstrSystem.td
llvm/lib/Target/X86/X86IntrinsicsInfo.h
llvm/test/MC/Disassembler/X86/x86-32.txt
llvm/test/MC/Disassembler/X86/x86-64.txt

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 98153fd6e68d..0f542e08b841 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -527,6 +527,9 @@ X86 Support in Clang
 - Support for the ``_Float16`` type has been added for all targets with SSE2.
   When AVX512-FP16 is not available, arithmetic on ``_Float16`` is emulated
   using ``float``.
+- Added the ``-m[no-]rdpru`` flag to enable/disable the RDPRU instruction
+  provided by AMD Zen2 and later processors. Defined intrinsics for using
+  this instruction (see rdpruintrin.h).
 
 DWARF Support in Clang
 --

diff  --git a/clang/include/clang/Basic/BuiltinsX86.def 
b/clang/include/clang/Basic/BuiltinsX86.def
index 3e5c376f9bc1..6bf35c340c2d 100644
--- a/clang/include/clang/Basic/BuiltinsX86.def
+++ b/clang/include/clang/Basic/BuiltinsX86.def
@@ -825,6 +825,7 @@ BUILTIN(__rdtsc, "UOi", "")
 BUILTIN(__builtin_ia32_rdtscp, "UOiUi*", "")
 
 TARGET_BUILTIN(__builtin_ia32_rdpid, "Ui", "n", "rdpid")
+TARGET_BUILTIN(__builtin_ia32_rdpru, "ULLii", "n", "rdpru")
 
 // PKU
 TARGET_BUILTIN(__builtin_ia32_rdpkru, "Ui", "n", "pku")

diff  --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index f4fe08aa1a5b..8ae9145a271a 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4570,6 +4570,8 @@ def mptwrite : Flag<["-"], "mptwrite">, 
Group;
 def mno_ptwrite : Flag<["-"], "mno-ptwrite">, Group;
 def mrdpid : Flag<["-"], "mrdpid">, Group;
 def mno_rdpid : Flag<["-"], "mno-rdpid">, Group;
+def mrdpru : Flag<["-"], "mrdpru">, Group;
+def mno_rdpru : Flag<["-"], "mno-rdpru">, Group;
 def mrdrnd : Flag<["-"], "mrdrnd">, Group;
 def mno_rdrnd : Flag<["-"], "mno-rdrnd">, Group;
 def mrtm : Flag<["-"], "mrtm">, Group;

diff  --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp
index 06988830eaed..69afdf8a3584 100644
--- a/clang/lib/Basic/Targets/X86.cpp
+++ b/clang/lib/Basic/Targets/X86.cpp
@@ -297,6 +297,8 @@ bool 
X86TargetInfo::handleTargetFeatures(std::vector ,
   HasCLDEMOTE = true;
 } else if (Feature == "+rdpid") {
   HasRDPID = true;
+} else if (Feature == "+rdpru") {
+  HasRDPRU = true;
 } else if (Feature == "+kl") {
   HasKL = true;
 } else if (Feature == "+widekl") {
@@ -743,6 +745,8 @@ void X86TargetInfo::getTargetDefines(const LangOptions 
,
 Builder.defineMacro("__WIDEKL__");
   if (HasRDPID)
 Builder.defineMacro("__RDPID__");
+  if (HasRDPRU)
+Builder.defineMacro("__RDPRU__");
   if (HasCLDEMOTE)
 Builder.defineMacro("__CLDEMOTE__");
   if (HasWAITPKG)
@@ -926,6 +930,7 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) 
const {
   .Case("prfchw", true)
   .Case("ptwrite", true)
   .Case("rdpid", true)
+  .Case("rdpru", true)
   .Case("rdrnd", true)
   .Case("rdseed", true)
   .Case("rtm", true)
@@ -1021,6 +1026,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const {
   .Case("prfchw", HasPRFCHW)
   .Case("ptwrite", HasPTWRITE)
   .Case("rdpid", 

[clang] 0fe88f9 - [PS4/PS5] Don't inherit base class alignment

2022-06-10 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-10T13:15:17-07:00
New Revision: 0fe88f9679ff6df5a7cce7e89038602c35a5e272

URL: 
https://github.com/llvm/llvm-project/commit/0fe88f9679ff6df5a7cce7e89038602c35a5e272
DIFF: 
https://github.com/llvm/llvm-project/commit/0fe88f9679ff6df5a7cce7e89038602c35a5e272.diff

LOG: [PS4/PS5] Don't inherit base class alignment

Added: 


Modified: 
clang/lib/AST/RecordLayoutBuilder.cpp
clang/test/SemaCXX/alignment-of-derived-class.cpp

Removed: 




diff  --git a/clang/lib/AST/RecordLayoutBuilder.cpp 
b/clang/lib/AST/RecordLayoutBuilder.cpp
index 6e775baed147f..6f3ede2ce42a7 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -1261,7 +1261,9 @@ ItaniumRecordLayoutBuilder::LayoutBase(const 
BaseSubobjectInfo *Base) {
   (!HasExternalLayout || Offset == CharUnits::Zero()) &&
   EmptySubobjects->CanPlaceBaseAtOffset(Base, CharUnits::Zero())) {
 setSize(std::max(getSize(), Layout.getSize()));
-UpdateAlignment(BaseAlign, UnpackedAlignTo, PreferredBaseAlign);
+// On PS4/PS5, don't update the alignment, to preserve compatibility.
+if (!Context.getTargetInfo().getTriple().isPS())
+  UpdateAlignment(BaseAlign, UnpackedAlignTo, PreferredBaseAlign);
 
 return CharUnits::Zero();
   }

diff  --git a/clang/test/SemaCXX/alignment-of-derived-class.cpp 
b/clang/test/SemaCXX/alignment-of-derived-class.cpp
index 28c1fa9144b78..ab28bc0a235f1 100644
--- a/clang/test/SemaCXX/alignment-of-derived-class.cpp
+++ b/clang/test/SemaCXX/alignment-of-derived-class.cpp
@@ -2,7 +2,7 @@
 // expected-no-diagnostics
 
 // Test that the alignment of a empty direct base class is correctly
-// inherited by the derived class.
+// inherited by the derived class, and correctly not inherited on PS4/PS5.
 
 struct A {
 } __attribute__ ((aligned(16)));
@@ -12,22 +12,38 @@ static_assert(__alignof(A) == 16, "A should be aligned to 
16 bytes");
 struct B1 : public A {
 };
 
+#if defined(__SCE__)
+static_assert(__alignof(B1) == 1, "B1 should be aligned to 1 byte");
+#else
 static_assert(__alignof(B1) == 16, "B1 should be aligned to 16 bytes");
+#endif
 
 struct B2 : public A {
 } __attribute__ ((aligned(2)));
 
+#if defined(__SCE__)
+static_assert(__alignof(B2) == 2, "B2 should be aligned to 2 bytes");
+#else
 static_assert(__alignof(B2) == 16, "B2 should be aligned to 16 bytes");
+#endif
 
 struct B3 : public A {
 } __attribute__ ((aligned(4)));
 
+#if defined(__SCE__)
+static_assert(__alignof(B3) == 4, "B3 should be aligned to 4 bytes");
+#else
 static_assert(__alignof(B3) == 16, "B3 should be aligned to 16 bytes");
+#endif
 
 struct B4 : public A {
 } __attribute__ ((aligned(8)));
 
+#if defined(__SCE__)
+static_assert(__alignof(B4) == 8, "B4 should be aligned to 8 bytes");
+#else
 static_assert(__alignof(B4) == 16, "B4 should be aligned to 16 bytes");
+#endif
 
 struct B5 : public A {
 } __attribute__ ((aligned(16)));



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


[clang] aa1cdf8 - [PS5] Ignore 'packed' on one-byte bitfields, matching PS4

2022-06-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-02T14:41:18-07:00
New Revision: aa1cdf87b5a97c2476a80f3aa6ac5af3e5ec0494

URL: 
https://github.com/llvm/llvm-project/commit/aa1cdf87b5a97c2476a80f3aa6ac5af3e5ec0494
DIFF: 
https://github.com/llvm/llvm-project/commit/aa1cdf87b5a97c2476a80f3aa6ac5af3e5ec0494.diff

LOG: [PS5] Ignore 'packed' on one-byte bitfields, matching PS4

Added: 


Modified: 
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/Sema/struct-packed-align.c

Removed: 




diff  --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 466ca1b573be..b629fcb91b25 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -1404,9 +1404,9 @@ static void handlePackedAttr(Sema , Decl *D, const 
ParsedAttr ) {
 FD->isBitField() &&
 S.Context.getTypeAlign(FD->getType()) <= 8);
 
-if (S.getASTContext().getTargetInfo().getTriple().isPS4()) {
+if (S.getASTContext().getTargetInfo().getTriple().isPS()) {
   if (BitfieldByteAligned)
-// The PS4 target needs to maintain ABI backwards compatibility.
+// The PS4/PS5 targets need to maintain ABI backwards compatibility.
 S.Diag(AL.getLoc(), diag::warn_attribute_ignored_for_field_of_type)
 << AL << FD->getType();
   else

diff  --git a/clang/test/Sema/struct-packed-align.c 
b/clang/test/Sema/struct-packed-align.c
index 03b012e34028..2a60f368479a 100644
--- a/clang/test/Sema/struct-packed-align.c
+++ b/clang/test/Sema/struct-packed-align.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 %s -fsyntax-only -verify
 // RUN: %clang_cc1 %s -fsyntax-only -triple=x86_64-windows-coff -verify
 // RUN: %clang_cc1 %s -fsyntax-only -triple=x86_64-scei-ps4 -verify
+// RUN: %clang_cc1 %s -fsyntax-only -triple=x86_64-sie-ps5 -verify
 
 // Packed structs.
 struct s {
@@ -147,9 +148,9 @@ extern int n2[__alignof(struct nS) == 1 ? 1 : -1];
 // See the documentation of -Wpacked-bitfield-compat for more information.
 struct packed_chars {
   char a : 8, b : 8, c : 8, d : 4;
-#ifdef __ORBIS__
-  // Test for pre-r254596 clang behavior on the PS4 target. PS4 must maintain
-  // ABI backwards compatibility.
+#ifdef __SCE__
+  // Test for pre-r254596 clang behavior on the PS4/PS5 targets, which must
+  // maintain ABI backwards compatibility.
   char e : 8 __attribute__((packed));
   // expected-warning@-1 {{'packed' attribute ignored for field of type 
'char'}}
 #else
@@ -159,11 +160,11 @@ struct packed_chars {
   char f : 4, g : 8, h : 8, i : 8;
 };
 
-#if (defined(_WIN32) || defined(__ORBIS__)) && !defined(__declspec) // 
_MSC_VER is unavailable in cc1.
+#if (defined(_WIN32) || defined(__SCE__)) && !defined(__declspec) // _MSC_VER 
is unavailable in cc1.
 // On Windows clang uses MSVC compatible layout in this case.
 //
-// Additionally, test for pre-r254596 clang behavior on the PS4 target. PS4
-// must maintain ABI backwards compatibility.
+// Additionally, test for pre-r254596 clang behavior on the PS4/PS5 targets.
+// They must maintain ABI backwards compatibility.
 extern int o1[sizeof(struct packed_chars) == 9 ? 1 : -1];
 extern int o2[__alignof(struct packed_chars) == 1 ? 1 : -1];
 #elif defined(_AIX)



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


[clang] 30b7ffe - [PS5] Pack non-POD members in packed structs, matching PS4 ABI

2022-06-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-02T12:26:26-07:00
New Revision: 30b7ffe74e66aa0c33c689429c593f261c2c9d13

URL: 
https://github.com/llvm/llvm-project/commit/30b7ffe74e66aa0c33c689429c593f261c2c9d13
DIFF: 
https://github.com/llvm/llvm-project/commit/30b7ffe74e66aa0c33c689429c593f261c2c9d13.diff

LOG: [PS5] Pack non-POD members in packed structs, matching PS4 ABI

Added: 


Modified: 
clang/lib/AST/RecordLayoutBuilder.cpp
clang/test/SemaCXX/class-layout.cpp

Removed: 




diff  --git a/clang/lib/AST/RecordLayoutBuilder.cpp 
b/clang/lib/AST/RecordLayoutBuilder.cpp
index 30f9d84a9dfdd..6e775baed147f 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -1891,7 +1891,7 @@ void ItaniumRecordLayoutBuilder::LayoutField(const 
FieldDecl *D,
   bool FieldPacked = (Packed && (!FieldClass || FieldClass->isPOD() ||
  Context.getLangOpts().getClangABICompat() <=
  LangOptions::ClangABI::Ver14 ||
- Target.isPS4() || Target.isOSDarwin())) ||
+ Target.isPS() || Target.isOSDarwin())) ||
  D->hasAttr();
 
   AlignRequirementKind AlignRequirement = AlignRequirementKind::None;

diff  --git a/clang/test/SemaCXX/class-layout.cpp 
b/clang/test/SemaCXX/class-layout.cpp
index 940966950d8be..f81e526d0e2ad 100644
--- a/clang/test/SemaCXX/class-layout.cpp
+++ b/clang/test/SemaCXX/class-layout.cpp
@@ -2,6 +2,7 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify 
-std=c++11 -Wno-inaccessible-base
 // RUN: %clang_cc1 -triple x86_64-apple-darwin%s -fsyntax-only -verify 
-std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=14
 // RUN: %clang_cc1 -triple x86_64-scei-ps4%s -fsyntax-only -verify 
-std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=6
+// RUN: %clang_cc1 -triple x86_64-sie-ps5 %s -fsyntax-only -verify 
-std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=6
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify 
-std=c++11 -Wno-inaccessible-base -fclang-abi-compat=6 -DCLANG_ABI_COMPAT=6
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify 
-std=c++11 -Wno-inaccessible-base -fclang-abi-compat=14 -DCLANG_ABI_COMPAT=14
 // expected-no-diagnostics



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


[clang] bb7835e - [PS5] Apply 'packed' attribute to base classes, matching PS4 ABI

2022-06-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-02T12:26:26-07:00
New Revision: bb7835e2a7fbb12d711736862e75497c83a45be2

URL: 
https://github.com/llvm/llvm-project/commit/bb7835e2a7fbb12d711736862e75497c83a45be2
DIFF: 
https://github.com/llvm/llvm-project/commit/bb7835e2a7fbb12d711736862e75497c83a45be2.diff

LOG: [PS5] Apply 'packed' attribute to base classes, matching PS4 ABI

Added: 


Modified: 
clang/lib/AST/RecordLayoutBuilder.cpp
clang/test/CodeGenCXX/alignment.cpp

Removed: 




diff  --git a/clang/lib/AST/RecordLayoutBuilder.cpp 
b/clang/lib/AST/RecordLayoutBuilder.cpp
index 8827e956fc2f4..30f9d84a9dfdd 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -1223,7 +1223,7 @@ ItaniumRecordLayoutBuilder::LayoutBase(const 
BaseSubobjectInfo *Base) {
 // Per GCC's documentation, it only applies to non-static data members.
 return (Packed && ((Context.getLangOpts().getClangABICompat() <=
 LangOptions::ClangABI::Ver6) ||
-   Context.getTargetInfo().getTriple().isPS4() ||
+   Context.getTargetInfo().getTriple().isPS() ||
Context.getTargetInfo().getTriple().isOSAIX()))
? CharUnits::One()
: UnpackedAlign;

diff  --git a/clang/test/CodeGenCXX/alignment.cpp 
b/clang/test/CodeGenCXX/alignment.cpp
index ffa4d873b5d76..98ce2fa28540f 100644
--- a/clang/test/CodeGenCXX/alignment.cpp
+++ b/clang/test/CodeGenCXX/alignment.cpp
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -no-opaque-pointers %s -emit-llvm -o - 
-triple=x86_64-apple-darwin10 | FileCheck %s --check-prefix=CHECK 
--check-prefix=CHECK-NOCOMPAT
 // RUN: %clang_cc1 -no-opaque-pointers %s -emit-llvm -o - 
-triple=x86_64-apple-darwin10 -fclang-abi-compat=6.0 | FileCheck %s 
--check-prefix=CHECK --check-prefix=CHECK-V6COMPAT
 // RUN: %clang_cc1 -no-opaque-pointers %s -emit-llvm -o - 
-triple=x86_64-scei-ps4 | FileCheck %s --check-prefix=CHECK 
--check-prefix=CHECK-V6COMPAT
+// RUN: %clang_cc1 -no-opaque-pointers %s -emit-llvm -o - 
-triple=x86_64-sie-ps5  | FileCheck %s --check-prefix=CHECK 
--check-prefix=CHECK-V6COMPAT
 
 extern int int_source();
 extern void int_sink(int x);



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


[clang] dc5175a - [PS5] Make passing unions in registers match PS4 ABI

2022-06-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-02T11:00:54-07:00
New Revision: dc5175adef0804eb396690ea3fe35c6d450e6e64

URL: 
https://github.com/llvm/llvm-project/commit/dc5175adef0804eb396690ea3fe35c6d450e6e64
DIFF: 
https://github.com/llvm/llvm-project/commit/dc5175adef0804eb396690ea3fe35c6d450e6e64.diff

LOG: [PS5] Make passing unions in registers match PS4 ABI

Added: 


Modified: 
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGen/X86/avx-union.c

Removed: 




diff  --git a/clang/lib/CodeGen/TargetInfo.cpp 
b/clang/lib/CodeGen/TargetInfo.cpp
index 0f4987efae75..5e97a946782c 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -3131,7 +3131,7 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t 
OffsetBase, Class ,
 unsigned idx = 0;
 bool UseClang11Compat = getContext().getLangOpts().getClangABICompat() <=
 LangOptions::ClangABI::Ver11 ||
-getContext().getTargetInfo().getTriple().isPS4();
+getContext().getTargetInfo().getTriple().isPS();
 bool IsUnion = RT->isUnionType() && !UseClang11Compat;
 
 for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end();

diff  --git a/clang/test/CodeGen/X86/avx-union.c 
b/clang/test/CodeGen/X86/avx-union.c
index 386d8cc32ec4..65fd62cf45bf 100644
--- a/clang/test/CodeGen/X86/avx-union.c
+++ b/clang/test/CodeGen/X86/avx-union.c
@@ -5,6 +5,7 @@
 // RUN: %clang_cc1 -no-opaque-pointers -w -ffreestanding -triple 
x86_64-linux-gnu -target-feature +avx -fclang-abi-compat=10.0 -emit-llvm -o - 
%s | FileCheck %s --check-prefixes=CHECK-LEGACY,AVX
 // RUN: %clang_cc1 -no-opaque-pointers -w -ffreestanding -triple 
x86_64-linux-gnu -target-feature +avx512f -fclang-abi-compat=11.0 -emit-llvm -o 
- %s | FileCheck %s --check-prefixes=CHECK-LEGACY,AVX512-LEGACY
 // RUN: %clang_cc1 -no-opaque-pointers -w -ffreestanding -triple 
x86_64-scei-ps4 -target-feature +avx -emit-llvm -o - %s | FileCheck %s 
--check-prefix=CHECK-LEGACY
+// RUN: %clang_cc1 -no-opaque-pointers -w -ffreestanding -triple 
x86_64-sie-ps5  -target-feature +avx -emit-llvm -o - %s | FileCheck %s 
--check-prefix=CHECK-LEGACY
 
 // This tests verifies that a union parameter should pass by a vector 
regitster whose first eightbyte is SSE and the other eightbytes are SSEUP.
 



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


[clang] cc756f9 - [PS5] Classify __m64 as integer, matching PS4 ABI

2022-06-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-02T11:00:53-07:00
New Revision: cc756f91c3803a7f91868ecf64929a90399cb4bb

URL: 
https://github.com/llvm/llvm-project/commit/cc756f91c3803a7f91868ecf64929a90399cb4bb
DIFF: 
https://github.com/llvm/llvm-project/commit/cc756f91c3803a7f91868ecf64929a90399cb4bb.diff

LOG: [PS5] Classify __m64 as integer, matching PS4 ABI

Added: 


Modified: 
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGen/X86/3dnow-builtins.c

Removed: 




diff  --git a/clang/lib/CodeGen/TargetInfo.cpp 
b/clang/lib/CodeGen/TargetInfo.cpp
index 4b7b301594d77..0f4987efae758 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -2364,7 +2364,7 @@ class X86_64ABIInfo : public SwiftABIInfo {
   return false;
 
 const llvm::Triple  = getTarget().getTriple();
-if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::PS4)
+if (Triple.isOSDarwin() || Triple.isPS())
   return false;
 if (Triple.isOSFreeBSD() && Triple.getOSMajorVersion() >= 10)
   return false;

diff  --git a/clang/test/CodeGen/X86/3dnow-builtins.c 
b/clang/test/CodeGen/X86/3dnow-builtins.c
index 71a46c9b44b5c..af754b71555c4 100644
--- a/clang/test/CodeGen/X86/3dnow-builtins.c
+++ b/clang/test/CodeGen/X86/3dnow-builtins.c
@@ -1,5 +1,6 @@
 // RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-unknown-unknown 
-target-feature +3dnowa -emit-llvm -o - -Wall -Werror | FileCheck %s 
-check-prefix=GCC -check-prefix=CHECK
 // RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-scei-ps4 -target-feature 
+3dnowa -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=PS4 
-check-prefix=CHECK
+// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-sie-ps5  -target-feature 
+3dnowa -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=PS4 
-check-prefix=CHECK
 
 
 #include 



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


[clang] 5a6352b - Tidy up `pragma comment lib` handling and testing

2022-06-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-02T07:52:26-07:00
New Revision: 5a6352bc70fb0f309de22ea75ef132f32d8be9b4

URL: 
https://github.com/llvm/llvm-project/commit/5a6352bc70fb0f309de22ea75ef132f32d8be9b4
DIFF: 
https://github.com/llvm/llvm-project/commit/5a6352bc70fb0f309de22ea75ef132f32d8be9b4.diff

LOG: Tidy up `pragma comment lib` handling and testing

A bit of historical research shows that over the years:
Commit 99efc036 added `pragma comment lib` support for PS4.
Commit fd4db533 added `pragma comment lib` support for all ELF targets.
Commit 1d16515f reworked dependent-library support for all ELF targets.

The upshot is that some PS4-specific code became dead, and the
testing became somewhat fragmented.  I've removed the dead code and
combined the previous PS4-specific and linux-specific tests for the
diagnostics into one generic ELF test.
Also added a couple of PS5 runs while I was in there.

Added: 
clang/test/Preprocessor/pragma-comment-elf.c

Modified: 
clang/lib/Parse/ParsePragma.cpp
clang/test/CodeGen/pragma-comment.c

Removed: 
clang/test/Preprocessor/pragma-comment-linux.c
clang/test/Preprocessor/pragma_ps4.c



diff  --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp
index f8e311c7c35ad..c94640c31c500 100644
--- a/clang/lib/Parse/ParsePragma.cpp
+++ b/clang/lib/Parse/ParsePragma.cpp
@@ -3027,14 +3027,6 @@ void PragmaCommentHandler::HandlePragma(Preprocessor ,
 return;
   }
 
-  // On PS4, issue a warning about any pragma comments other than
-  // #pragma comment lib.
-  if (PP.getTargetInfo().getTriple().isPS4() && Kind != PCK_Lib) {
-PP.Diag(Tok.getLocation(), diag::warn_pragma_comment_ignored)
-  << II->getName();
-return;
-  }
-
   // Read the optional string if present.
   PP.Lex(Tok);
   std::string ArgumentString;

diff  --git a/clang/test/CodeGen/pragma-comment.c 
b/clang/test/CodeGen/pragma-comment.c
index 25675d94c5a4d..a4746f5c47bf6 100644
--- a/clang/test/CodeGen/pragma-comment.c
+++ b/clang/test/CodeGen/pragma-comment.c
@@ -4,6 +4,7 @@
 // RUN: %clang_cc1 %s -triple thumbv7-linux-gnueabihf -fms-extensions 
-emit-llvm -o - | FileCheck -check-prefix ELF %s --implicit-check-not 
llvm.linker.options
 // RUN: %clang_cc1 %s -triple i686-pc-linux -fms-extensions -emit-llvm -o - | 
FileCheck -check-prefix ELF %s --implicit-check-not llvm.linker.options
 // RUN: %clang_cc1 %s -triple x86_64-scei-ps4 -fms-extensions -emit-llvm -o - 
| FileCheck -check-prefix ELF %s --implicit-check-not llvm.linker.options
+// RUN: %clang_cc1 %s -triple x86_64-sie-ps5 -fms-extensions -emit-llvm -o - | 
FileCheck -check-prefix ELF %s --implicit-check-not llvm.linker.options
 // RUN: %clang_cc1 %s -triple aarch64-windows-msvc -fms-extensions -emit-llvm 
-o - | FileCheck %s
 
 #pragma comment(lib, "msvcrt.lib")

diff  --git a/clang/test/Preprocessor/pragma_ps4.c 
b/clang/test/Preprocessor/pragma-comment-elf.c
similarity index 79%
rename from clang/test/Preprocessor/pragma_ps4.c
rename to clang/test/Preprocessor/pragma-comment-elf.c
index 63651b6a96fb1..7b84aba51a0da 100644
--- a/clang/test/Preprocessor/pragma_ps4.c
+++ b/clang/test/Preprocessor/pragma-comment-elf.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 %s -triple x86_64-scei-ps4 -fsyntax-only -verify 
-fms-extensions 
+// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions -triple 
x86_64-scei-ps4
+// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions -triple 
x86_64-sie-ps5
+// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions -triple 
i686-unknown-linux-gnu
 
-// On PS4, issue a diagnostic that pragma comments are ignored except:
+// On ELF targets, issue a diagnostic that pragma comments are ignored except:
 //   #pragma comment lib
 
 #pragma comment(lib)

diff  --git a/clang/test/Preprocessor/pragma-comment-linux.c 
b/clang/test/Preprocessor/pragma-comment-linux.c
deleted file mode 100644
index fcac049f46e83..0
--- a/clang/test/Preprocessor/pragma-comment-linux.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fsyntax-only -verify %s 
-Wunknown-pragmas
-
-#pragma comment(linker, "")
-// expected-warning@-1 {{'#pragma comment linker' ignored}}
-



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


[clang] b2c6251 - [PS5] Support r and y specifiers of freebsd_kernel_printf format strings

2022-06-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-02T06:27:11-07:00
New Revision: b2c6251c06700bfe8a69b780cb27928d3ba029db

URL: 
https://github.com/llvm/llvm-project/commit/b2c6251c06700bfe8a69b780cb27928d3ba029db
DIFF: 
https://github.com/llvm/llvm-project/commit/b2c6251c06700bfe8a69b780cb27928d3ba029db.diff

LOG: [PS5] Support r and y specifiers of freebsd_kernel_printf format strings

Added: 


Modified: 
clang/lib/AST/FormatString.cpp
clang/test/Sema/format-strings-freebsd.c

Removed: 




diff  --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp
index 102bcca96a389..4977aaa513195 100644
--- a/clang/lib/AST/FormatString.cpp
+++ b/clang/lib/AST/FormatString.cpp
@@ -760,7 +760,7 @@ bool FormatSpecifier::hasValidLengthModifier(const 
TargetInfo ,
   return true;
 case ConversionSpecifier::FreeBSDrArg:
 case ConversionSpecifier::FreeBSDyArg:
-  return Target.getTriple().isOSFreeBSD() || 
Target.getTriple().isPS4();
+  return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS();
 default:
   return false;
   }
@@ -795,7 +795,7 @@ bool FormatSpecifier::hasValidLengthModifier(const 
TargetInfo ,
   return true;
 case ConversionSpecifier::FreeBSDrArg:
 case ConversionSpecifier::FreeBSDyArg:
-  return Target.getTriple().isOSFreeBSD() || 
Target.getTriple().isPS4();
+  return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS();
 default:
   return false;
   }

diff  --git a/clang/test/Sema/format-strings-freebsd.c 
b/clang/test/Sema/format-strings-freebsd.c
index 965d7c287be65..64b526eb2f076 100644
--- a/clang/test/Sema/format-strings-freebsd.c
+++ b/clang/test/Sema/format-strings-freebsd.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -triple i386-unknown-freebsd %s
 // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-unknown-freebsd %s
 // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-scei-ps4 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-sie-ps5 %s
 
 // Test FreeBSD kernel printf extensions.
 int freebsd_kernel_printf(const char *, ...) 
__attribute__((__format__(__freebsd_kprintf__, 1, 2)));



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


[clang] 5d005d8 - Refactor PS4OSTargetInfo into a base class and PS4 subclass; prep for PS5

2022-06-01 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-01T13:30:29-07:00
New Revision: 5d005d8256ecd7d57c72e24e7169c4e3d40a773a

URL: 
https://github.com/llvm/llvm-project/commit/5d005d8256ecd7d57c72e24e7169c4e3d40a773a
DIFF: 
https://github.com/llvm/llvm-project/commit/5d005d8256ecd7d57c72e24e7169c4e3d40a773a.diff

LOG: Refactor PS4OSTargetInfo into a base class and PS4 subclass; prep for PS5

Added: 


Modified: 
clang/lib/Basic/Targets/OSTargets.h

Removed: 




diff  --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index e9832977c7fe8..cf317f58540e3 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -541,8 +541,9 @@ class LLVM_LIBRARY_VISIBILITY PS3PPUTargetInfo : public 
OSTargetInfo {
   }
 };
 
+// Common base class for PS4/PS5 targets.
 template 
-class LLVM_LIBRARY_VISIBILITY PS4OSTargetInfo : public OSTargetInfo {
+class LLVM_LIBRARY_VISIBILITY PSOSTargetInfo : public OSTargetInfo {
 protected:
   void getOSDefines(const LangOptions , const llvm::Triple ,
 MacroBuilder ) const override {
@@ -552,36 +553,49 @@ class LLVM_LIBRARY_VISIBILITY PS4OSTargetInfo : public 
OSTargetInfo {
 DefineStd(Builder, "unix", Opts);
 Builder.defineMacro("__ELF__");
 Builder.defineMacro("__SCE__");
-Builder.defineMacro("__ORBIS__");
   }
 
 public:
-  PS4OSTargetInfo(const llvm::Triple , const TargetOptions )
+  PSOSTargetInfo(const llvm::Triple , const TargetOptions )
   : OSTargetInfo(Triple, Opts) {
 this->WCharType = TargetInfo::UnsignedShort;
 
-// On PS4, TLS variable cannot be aligned to more than 32 bytes (256 bits).
+// On PS4/PS5, TLS variable cannot be aligned to more than 32 bytes (256
+// bits).
 this->MaxTLSAlign = 256;
 
-// On PS4, do not honor explicit bit field alignment,
+// On PS4/PS5, do not honor explicit bit field alignment,
 // as in "__attribute__((aligned(2))) int b : 1;".
 this->UseExplicitBitFieldAlignment = false;
 
-switch (Triple.getArch()) {
-default:
-case llvm::Triple::x86_64:
-  this->MCountName = ".mcount";
-  this->NewAlign = 256;
-  this->SuitableAlign = 256;
-  break;
-}
+this->MCountName = ".mcount";
+this->NewAlign = 256;
+this->SuitableAlign = 256;
   }
+
   TargetInfo::CallingConvCheckResult
   checkCallingConvention(CallingConv CC) const override {
 return (CC == CC_C) ? TargetInfo::CCCR_OK : TargetInfo::CCCR_Error;
   }
 };
 
+// PS4 Target
+template 
+class LLVM_LIBRARY_VISIBILITY PS4OSTargetInfo : public PSOSTargetInfo {
+protected:
+  void getOSDefines(const LangOptions , const llvm::Triple ,
+MacroBuilder ) const override {
+// Start with base class defines.
+PSOSTargetInfo::getOSDefines(Opts, Triple, Builder);
+
+Builder.defineMacro("__ORBIS__");
+  }
+
+public:
+  PS4OSTargetInfo(const llvm::Triple , const TargetOptions )
+  : PSOSTargetInfo(Triple, Opts) {}
+};
+
 // RTEMS Target
 template 
 class LLVM_LIBRARY_VISIBILITY RTEMSTargetInfo : public OSTargetInfo {



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


[clang] 8869ba3 - [PS5] Add PS5OSTargetInfo class, update affected tests

2022-06-01 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-06-01T13:30:29-07:00
New Revision: 8869ba366268c644200784b15c4e6b8efe891397

URL: 
https://github.com/llvm/llvm-project/commit/8869ba366268c644200784b15c4e6b8efe891397
DIFF: 
https://github.com/llvm/llvm-project/commit/8869ba366268c644200784b15c4e6b8efe891397.diff

LOG: [PS5] Add PS5OSTargetInfo class, update affected tests

Added: 


Modified: 
clang/lib/Basic/LangStandards.cpp
clang/lib/Basic/Targets.cpp
clang/lib/Basic/Targets/OSTargets.h
clang/test/Preprocessor/init.c
clang/test/Sema/wchar.c
clang/unittests/Tooling/RecursiveASTVisitorTests/LambdaExpr.cpp

Removed: 




diff  --git a/clang/lib/Basic/LangStandards.cpp 
b/clang/lib/Basic/LangStandards.cpp
index a21898dd3c627..5bacc3b164960 100644
--- a/clang/lib/Basic/LangStandards.cpp
+++ b/clang/lib/Basic/LangStandards.cpp
@@ -61,8 +61,8 @@ LangStandard::Kind 
clang::getDefaultLanguageStandard(clang::Language Lang,
 if (CLANG_DEFAULT_STD_C != LangStandard::lang_unspecified)
   return CLANG_DEFAULT_STD_C;
 
-// The PS4 uses C99 as the default C standard.
-if (T.isPS4())
+// The PS4 and PS5 use C99 as the default C standard.
+if (T.isPS())
   return LangStandard::lang_gnu99;
 return LangStandard::lang_gnu17;
   case Language::ObjC:

diff  --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 85c73abde1826..2d6ef998485ae 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -592,6 +592,8 @@ TargetInfo *AllocateTarget(const llvm::Triple ,
   return new NaClTargetInfo(Triple, Opts);
 case llvm::Triple::PS4:
   return new PS4OSTargetInfo(Triple, Opts);
+case llvm::Triple::PS5:
+  return new PS5OSTargetInfo(Triple, Opts);
 default:
   return new X86_64TargetInfo(Triple, Opts);
 }

diff  --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index cf317f58540e3..a814f681b1468 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -596,6 +596,23 @@ class LLVM_LIBRARY_VISIBILITY PS4OSTargetInfo : public 
PSOSTargetInfo {
   : PSOSTargetInfo(Triple, Opts) {}
 };
 
+// PS5 Target
+template 
+class LLVM_LIBRARY_VISIBILITY PS5OSTargetInfo : public PSOSTargetInfo {
+protected:
+  void getOSDefines(const LangOptions , const llvm::Triple ,
+MacroBuilder ) const override {
+// Start with base class defines.
+PSOSTargetInfo::getOSDefines(Opts, Triple, Builder);
+
+Builder.defineMacro("__PROSPERO__");
+  }
+
+public:
+  PS5OSTargetInfo(const llvm::Triple , const TargetOptions )
+  : PSOSTargetInfo(Triple, Opts) {}
+};
+
 // RTEMS Target
 template 
 class LLVM_LIBRARY_VISIBILITY RTEMSTargetInfo : public OSTargetInfo {

diff  --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c
index 07b5fb86c45c2..61324fd5e43d8 100644
--- a/clang/test/Preprocessor/init.c
+++ b/clang/test/Preprocessor/init.c
@@ -1241,7 +1241,8 @@
 // TCE:#define __tce__ 1
 // TCE:#define tce 1
 //
-// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 
-triple=x86_64-scei-ps4 < /dev/null | FileCheck -match-full-lines -check-prefix 
PS4 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-scei-ps4 < /dev/null | 
FileCheck --match-full-lines --check-prefixes=PS4,PS4ONLY %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-sie-ps5 < /dev/null | 
FileCheck --match-full-lines --check-prefixes=PS4,PS5ONLY %s
 //
 // PS4:#define _LP64 1
 // PS4:#define __BIGGEST_ALIGNMENT__ 32
@@ -1311,8 +1312,9 @@
 // PS4:#define __LP64__ 1
 // PS4:#define __MMX__ 1
 // PS4:#define __NO_MATH_INLINES 1
-// PS4:#define __ORBIS__ 1
+// PS4ONLY:#define __ORBIS__ 1
 // PS4:#define __POINTER_WIDTH__ 64
+// PS5ONLY:#define __PROSPERO__ 1
 // PS4:#define __PTRDIFF_MAX__ 9223372036854775807L
 // PS4:#define __PTRDIFF_TYPE__ long int
 // PS4:#define __PTRDIFF_WIDTH__ 64
@@ -1357,7 +1359,8 @@
 // PS4:#define __x86_64__ 1
 // PS4:#define unix 1
 //
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=x86_64-scei-ps4 < 
/dev/null | FileCheck -match-full-lines -check-prefix PS4-CXX %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=x86_64-scei-ps4 < 
/dev/null | FileCheck --match-full-lines --check-prefix PS4-CXX %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=x86_64-sie-ps5 < 
/dev/null | FileCheck --match-full-lines --check-prefix PS4-CXX %s
 // PS4-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 32UL
 //
 // RUN: %clang_cc1 -E -dM -triple=x86_64-pc-mingw32 < /dev/null | FileCheck 
-match-full-lines -check-prefix X86-64-DECLSPEC %s

diff  --git a/clang/test/Sema/wchar.c b/clang/test/Sema/wchar.c
index 5566207e50d7f..fa32ae6512fce 100644
--- a/clang/test/Sema/wchar.c
+++ b/clang/test/Sema/wchar.c
@@ -4,8 +4,8 @@
 typedef __WCHAR_TYPE__ wchar_t;
 
 #if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \
- || 

[clang] 10555a8 - [PS5] Tweak dllexport test

2022-05-31 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-31T08:22:15-07:00
New Revision: 10555a82df22bf67a9c30165e952b44969b46b6f

URL: 
https://github.com/llvm/llvm-project/commit/10555a82df22bf67a9c30165e952b44969b46b6f
DIFF: 
https://github.com/llvm/llvm-project/commit/10555a82df22bf67a9c30165e952b44969b46b6f.diff

LOG: [PS5] Tweak dllexport test

Post-commit review pointed out that both PS4 and PS5 were using the
same -std argument, better to use different ones just in case.

Added: 


Modified: 
clang/test/SemaCXX/dllexport.cpp

Removed: 




diff  --git a/clang/test/SemaCXX/dllexport.cpp 
b/clang/test/SemaCXX/dllexport.cpp
index 4aa1427563a2e..7d8bfdadbb839 100644
--- a/clang/test/SemaCXX/dllexport.cpp
+++ b/clang/test/SemaCXX/dllexport.cpp
@@ -4,7 +4,7 @@
 // RUN: %clang_cc1 -triple x86_64-mingw32 -fsyntax-only 
-fms-extensions -verify -std=c++11 -Wunsupported-dll-base-class-template %s
 // RUN: %clang_cc1 -triple i686-windows-itanium   -fsyntax-only 
-fms-extensions -verify -std=c++11 -Wunsupported-dll-base-class-template -DWI %s
 // RUN: %clang_cc1 -triple x86_64-windows-itanium -fsyntax-only 
-fms-extensions -verify -std=c++1y -Wunsupported-dll-base-class-template -DWI %s
-// RUN: %clang_cc1 -triple x86_64-scei-ps4-fsyntax-only -fdeclspec 
 -verify -std=c++1y -Wunsupported-dll-base-class-template -DWI %s
+// RUN: %clang_cc1 -triple x86_64-scei-ps4-fsyntax-only -fdeclspec 
 -verify -std=c++11 -Wunsupported-dll-base-class-template -DWI %s
 // RUN: %clang_cc1 -triple x86_64-sie-ps5 -fsyntax-only -fdeclspec 
 -verify -std=c++1y -Wunsupported-dll-base-class-template -DWI %s
 
 // Helper structs to make templates more expressive.



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


[clang] 634c8ef - [PS5] Allow dllimport/dllexport same as PS4

2022-05-26 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-26T07:01:30-07:00
New Revision: 634c8ef69a836f3436d027b03965965bad6f3ff0

URL: 
https://github.com/llvm/llvm-project/commit/634c8ef69a836f3436d027b03965965bad6f3ff0
DIFF: 
https://github.com/llvm/llvm-project/commit/634c8ef69a836f3436d027b03965965bad6f3ff0.diff

LOG: [PS5] Allow dllimport/dllexport same as PS4

Added: 


Modified: 
clang/include/clang/Basic/TargetInfo.h
clang/lib/Sema/SemaTemplate.cpp
clang/test/CodeGen/ps4-dllimport-dllexport.c
clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp
clang/test/CodeGenCXX/ps4-dllstorage-vtable-rtti.cpp
clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp
clang/test/CodeGenCXX/windows-itanium-dllexport.cpp
clang/test/Sema/dllimport.c
clang/test/SemaCXX/dllexport.cpp
clang/test/SemaCXX/dllimport.cpp
llvm/include/llvm/ADT/Triple.h

Removed: 




diff  --git a/clang/include/clang/Basic/TargetInfo.h 
b/clang/include/clang/Basic/TargetInfo.h
index 470d153d845de..e4b5f0b751c48 100644
--- a/clang/include/clang/Basic/TargetInfo.h
+++ b/clang/include/clang/Basic/TargetInfo.h
@@ -1195,12 +1195,12 @@ class TargetInfo : public virtual 
TransferrableTargetInfo,
   /// Microsoft C++ code using dllimport/export attributes?
   virtual bool shouldDLLImportComdatSymbols() const {
 return getTriple().isWindowsMSVCEnvironment() ||
-   getTriple().isWindowsItaniumEnvironment() || getTriple().isPS4();
+   getTriple().isWindowsItaniumEnvironment() || getTriple().isPS();
   }
 
   // Does this target have PS4 specific dllimport/export handling?
   virtual bool hasPS4DLLImportExport() const {
-return getTriple().isPS4() ||
+return getTriple().isPS() ||
// Windows Itanium support allows for testing the SCEI flavour of
// dllimport/export handling on a Windows system.
(getTriple().isWindowsItaniumEnvironment() &&

diff  --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 4a42969c34d3f..b11b97e12403c 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -9760,7 +9760,7 @@ DeclResult Sema::ActOnExplicitInstantiation(
 
   if (!getDLLAttr(Def) && getDLLAttr(Specialization) &&
   (Context.getTargetInfo().shouldDLLImportComdatSymbols() &&
-   !Context.getTargetInfo().getTriple().isPS4())) {
+   !Context.getTargetInfo().getTriple().isPS())) {
 // An explicit instantiation definition can add a dll attribute to a
 // template with a previous instantiation declaration. MinGW doesn't
 // allow this.
@@ -9778,7 +9778,7 @@ DeclResult Sema::ActOnExplicitInstantiation(
 !PreviouslyDLLExported && Specialization->hasAttr();
 if (Old_TSK == TSK_ImplicitInstantiation && NewlyDLLExported &&
 (Context.getTargetInfo().shouldDLLImportComdatSymbols() &&
- !Context.getTargetInfo().getTriple().isPS4())) {
+ !Context.getTargetInfo().getTriple().isPS())) {
   // An explicit instantiation definition can add a dll attribute to a
   // template with a previous implicit instantiation. MinGW doesn't allow
   // this. We limit clang to only adding dllexport, to avoid potentially

diff  --git a/clang/test/CodeGen/ps4-dllimport-dllexport.c 
b/clang/test/CodeGen/ps4-dllimport-dllexport.c
index a945000e7e323..efcdc4d7a5c48 100644
--- a/clang/test/CodeGen/ps4-dllimport-dllexport.c
+++ b/clang/test/CodeGen/ps4-dllimport-dllexport.c
@@ -1,9 +1,5 @@
-// RUN: %clang_cc1 \
-// RUN: -triple x86_64-scei-ps4 \
-// RUN: -fdeclspec \
-// RUN: -Werror \
-// RUN: -emit-llvm %s -o - | \
-// RUN:   FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-scei-ps4 -fdeclspec -Werror -emit-llvm %s -o 
- | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-sie-ps5  -fdeclspec -Werror -emit-llvm %s -o 
- | FileCheck %s
 
 __declspec(dllexport) int export_int;
 

diff  --git a/clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp 
b/clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp
index f0327567d5d08..432ef7835ddc5 100644
--- a/clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp
+++ b/clang/test/CodeGenCXX/dllexport-vtable-thunks.cpp
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows-gnu -fdeclspec -emit-llvm -o - 
%s | FileCheck %s -DDSO_ATTRS="dso_local dllexport"
 // RUN: %clang_cc1 -triple x86_64-windows-itanium -fdeclspec -emit-llvm -o - 
%s | FileCheck %s -DDSO_ATTRS="dso_local dllexport"
 // RUN: %clang_cc1 -triple x86_64-scei-ps4-fdeclspec -emit-llvm -o - 
%s | FileCheck %s -DDSO_ATTRS=dllexport
+// RUN: %clang_cc1 -triple x86_64-sie-ps5 -fdeclspec -emit-llvm -o - 
%s | FileCheck %s -DDSO_ATTRS=dllexport
 
 struct __declspec(dllexport) A {
   virtual void m();

diff  --git a/clang/test/CodeGenCXX/ps4-dllstorage-vtable-rtti.cpp 
b/clang/test/CodeGenCXX/ps4-dllstorage-vtable-rtti.cpp
index 

[clang] d8dda57 - [PS5] Default to -fno-rtti

2022-05-25 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-25T06:48:21-07:00
New Revision: d8dda57ae7798a052e52ef5979980e815d2e4bc5

URL: 
https://github.com/llvm/llvm-project/commit/d8dda57ae7798a052e52ef5979980e815d2e4bc5
DIFF: 
https://github.com/llvm/llvm-project/commit/d8dda57ae7798a052e52ef5979980e815d2e4bc5.diff

LOG: [PS5] Default to -fno-rtti

Added: 


Modified: 
clang/lib/Driver/ToolChain.cpp
clang/test/Driver/rtti-options.cpp

Removed: 




diff  --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index efbf2442acfc..eb3117e689d8 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -67,8 +67,8 @@ static ToolChain::RTTIMode CalculateRTTIMode(const ArgList 
,
   return ToolChain::RM_Disabled;
   }
 
-  // -frtti is default, except for the PS4 and DriverKit.
-  bool NoRTTI = Triple.isPS4() || Triple.isDriverKit();
+  // -frtti is default, except for the PS4/PS5 and DriverKit.
+  bool NoRTTI = Triple.isPS() || Triple.isDriverKit();
   return NoRTTI ? ToolChain::RM_Disabled : ToolChain::RM_Enabled;
 }
 

diff  --git a/clang/test/Driver/rtti-options.cpp 
b/clang/test/Driver/rtti-options.cpp
index e1d37d35bb68..5a8a9fe43c74 100644
--- a/clang/test/Driver/rtti-options.cpp
+++ b/clang/test/Driver/rtti-options.cpp
@@ -22,6 +22,7 @@
 // RUN: %clang -### -c -target x86_64-unknown-linux -fsanitize=undefined %s 
2>&1 | FileCheck -check-prefix=CHECK-OK %s
 // RUN: %clang -### -c -target x86_64-unknown-linux -fsanitize=undefined 
-frtti %s 2>&1 | FileCheck -check-prefix=CHECK-OK %s
 // RUN: %clang -### -c -target x86_64-scei-ps4 -fsanitize=vptr %s 2>&1 | 
FileCheck -check-prefix=CHECK-SAN-WARN %s
+// RUN: %clang -### -c -target x86_64-sie-ps5 -fsanitize=vptr %s 2>&1 | 
FileCheck -check-prefix=CHECK-SAN-WARN %s
 
 // Exceptions + no/default rtti
 // RUN: %clang -### -c -target x86_64-unknown-unknown -fcxx-exceptions 
-fno-rtti %s 2>&1 | FileCheck -check-prefix=CHECK-OK %s
@@ -35,6 +36,7 @@
 
 // -f{no-,}rtti/default
 // RUN: %clang -### -c -target x86_64-scei-ps4 %s 2>&1 | FileCheck 
-check-prefix=CHECK-NO-RTTI %s
+// RUN: %clang -### -c -target x86_64-sie-ps5 %s 2>&1 | FileCheck 
-check-prefix=CHECK-NO-RTTI %s
 // RUN: %clang -### -c -target x86_64-unknown-unknown -frtti %s 2>&1 | 
FileCheck -check-prefix=CHECK-RTTI %s
 // RUN: %clang -### -c -target x86_64-unknown-unknown -fno-rtti %s 2>&1 | 
FileCheck -check-prefix=CHECK-NO-RTTI %s
 // RUN: %clang -### -c -target x86_64-unknown-unknown %s 2>&1 | FileCheck 
-check-prefix=CHECK-RTTI %s



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


[clang] 4a3e2af - Reland "[PS5] Verify defaults to -fno-stack-size-section"

2022-05-24 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-24T10:09:39-07:00
New Revision: 4a3e2aff5f849278f6c49678fd21f8ca5e59c4e7

URL: 
https://github.com/llvm/llvm-project/commit/4a3e2aff5f849278f6c49678fd21f8ca5e59c4e7
DIFF: 
https://github.com/llvm/llvm-project/commit/4a3e2aff5f849278f6c49678fd21f8ca5e59c4e7.diff

LOG: Reland "[PS5] Verify defaults to -fno-stack-size-section"

This reverts commit efebb27b745a0d677ad2ea9aefff242c12aef29c.
Fixes typos (accidentally omitted %s from some RUN lines).

Added: 


Modified: 
clang/test/Driver/stack-size-section.c

Removed: 




diff  --git a/clang/test/Driver/stack-size-section.c 
b/clang/test/Driver/stack-size-section.c
index 461f0b5c9aee..f50c9767e707 100644
--- a/clang/test/Driver/stack-size-section.c
+++ b/clang/test/Driver/stack-size-section.c
@@ -1,4 +1,5 @@
 // RUN: %clang -target x86_64-unknown %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-ABSENT
+// RUN: %clang -target x86_64-sie-ps5 %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-ABSENT
 // RUN: %clang -target x86_64-scei-ps4 -fno-stack-size-section %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-ABSENT
 // CHECK-ABSENT-NOT: -fstack-size-section
 
@@ -6,4 +7,9 @@
 // RUN: %clang -target x86_64-scei-ps4 %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-PRESENT
 // CHECK-PRESENT: -fstack-size-section
 
+// RUN: %clang -target x86_64-unknown -fstack-size-section 
-fno-stack-size-section %s -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ABSENT
+// RUN: %clang -target x86_64-unknown -fno-stack-size-section 
-fstack-size-section %s -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-PRESENT
+
 int foo() { return 42; }



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


[clang] efebb27 - Revert "[PS5] Verify defaults to -fno-stack-size-section"

2022-05-24 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-24T10:00:33-07:00
New Revision: efebb27b745a0d677ad2ea9aefff242c12aef29c

URL: 
https://github.com/llvm/llvm-project/commit/efebb27b745a0d677ad2ea9aefff242c12aef29c
DIFF: 
https://github.com/llvm/llvm-project/commit/efebb27b745a0d677ad2ea9aefff242c12aef29c.diff

LOG: Revert "[PS5] Verify defaults to -fno-stack-size-section"

This reverts commit 28432b0f655641df7f9d079cf69ba235038d6340.

Caused some unexpected buildbot failures.

Added: 


Modified: 
clang/test/Driver/stack-size-section.c

Removed: 




diff  --git a/clang/test/Driver/stack-size-section.c 
b/clang/test/Driver/stack-size-section.c
index 18fb55f4ac9f..461f0b5c9aee 100644
--- a/clang/test/Driver/stack-size-section.c
+++ b/clang/test/Driver/stack-size-section.c
@@ -1,5 +1,4 @@
 // RUN: %clang -target x86_64-unknown %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-ABSENT
-// RUN: %clang -target x86_64-sie-ps5 %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-ABSENT
 // RUN: %clang -target x86_64-scei-ps4 -fno-stack-size-section %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-ABSENT
 // CHECK-ABSENT-NOT: -fstack-size-section
 
@@ -7,9 +6,4 @@
 // RUN: %clang -target x86_64-scei-ps4 %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-PRESENT
 // CHECK-PRESENT: -fstack-size-section
 
-// RUN: %clang -target x86_64-unknown -fstack-size-section 
-fno-stack-size-section -### 2>&1 \
-// RUN: | FileCheck %s --check-prefix=CHECK-ABSENT
-// RUN: %clang -target x86_64-unknown -fnostack-size-section 
-fstack-size-section -### 2>&1 \
-// RUN: | FileCheck %s --check-prefix=CHECK-PRESENT
-
 int foo() { return 42; }



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


[clang] 28432b0 - [PS5] Verify defaults to -fno-stack-size-section

2022-05-24 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-24T09:47:37-07:00
New Revision: 28432b0f655641df7f9d079cf69ba235038d6340

URL: 
https://github.com/llvm/llvm-project/commit/28432b0f655641df7f9d079cf69ba235038d6340
DIFF: 
https://github.com/llvm/llvm-project/commit/28432b0f655641df7f9d079cf69ba235038d6340.diff

LOG: [PS5] Verify defaults to -fno-stack-size-section

Added: 


Modified: 
clang/test/Driver/stack-size-section.c

Removed: 




diff  --git a/clang/test/Driver/stack-size-section.c 
b/clang/test/Driver/stack-size-section.c
index 461f0b5c9aee..18fb55f4ac9f 100644
--- a/clang/test/Driver/stack-size-section.c
+++ b/clang/test/Driver/stack-size-section.c
@@ -1,4 +1,5 @@
 // RUN: %clang -target x86_64-unknown %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-ABSENT
+// RUN: %clang -target x86_64-sie-ps5 %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-ABSENT
 // RUN: %clang -target x86_64-scei-ps4 -fno-stack-size-section %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-ABSENT
 // CHECK-ABSENT-NOT: -fstack-size-section
 
@@ -6,4 +7,9 @@
 // RUN: %clang -target x86_64-scei-ps4 %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-PRESENT
 // CHECK-PRESENT: -fstack-size-section
 
+// RUN: %clang -target x86_64-unknown -fstack-size-section 
-fno-stack-size-section -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ABSENT
+// RUN: %clang -target x86_64-unknown -fnostack-size-section 
-fstack-size-section -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-PRESENT
+
 int foo() { return 42; }



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


[clang] 217531f - [PS5] Make driver's PIC behavior match PS4

2022-05-23 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-23T12:50:22-07:00
New Revision: 217531f12b4b97dadb80c66ab97c71e57ae0adcf

URL: 
https://github.com/llvm/llvm-project/commit/217531f12b4b97dadb80c66ab97c71e57ae0adcf
DIFF: 
https://github.com/llvm/llvm-project/commit/217531f12b4b97dadb80c66ab97c71e57ae0adcf.diff

LOG: [PS5] Make driver's PIC behavior match PS4

The new test is a copy of the corresponding PS4 test, with the triple
etc updated, because there's currently no good way to make one lit test
"iterate" with multiple targets.

Added: 
clang/test/Driver/ps5-pic.c

Modified: 
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/lib/Driver/ToolChains/CommonArgs.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td 
b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index 7961b006a9a00..3cc9565e6e8b2 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -546,8 +546,8 @@ def warn_drv_unable_to_find_directory_expected : Warning<
   "unable to find %0 directory, expected to be in '%1'">,
   InGroup, DefaultIgnore;
 
-def warn_drv_ps4_force_pic : Warning<
-  "option '%0' was ignored by the PS4 toolchain, using '-fPIC'">,
+def warn_drv_ps_force_pic : Warning<
+  "option '%0' was ignored by the %1 toolchain, using '-fPIC'">,
   InGroup;
 
 def warn_drv_ps_sdk_dir : Warning<

diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 33f3df80a2a2e..45add8ad94a5f 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1286,23 +1286,24 @@ tools::ParsePICArgs(const ToolChain , const 
ArgList ) {
 O.matches(options::OPT_fPIE) || O.matches(options::OPT_fPIC);
   } else {
 PIE = PIC = false;
-if (EffectiveTriple.isPS4()) {
+if (EffectiveTriple.isPS()) {
   Arg *ModelArg = Args.getLastArg(options::OPT_mcmodel_EQ);
   StringRef Model = ModelArg ? ModelArg->getValue() : "";
   if (Model != "kernel") {
 PIC = true;
-ToolChain.getDriver().Diag(diag::warn_drv_ps4_force_pic)
-<< LastPICArg->getSpelling();
+ToolChain.getDriver().Diag(diag::warn_drv_ps_force_pic)
+<< LastPICArg->getSpelling()
+<< (EffectiveTriple.isPS4() ? "PS4" : "PS5");
   }
 }
   }
 }
   }
 
-  // Introduce a Darwin and PS4-specific hack. If the default is PIC, but the
-  // PIC level would've been set to level 1, force it back to level 2 PIC
+  // Introduce a Darwin and PS4/PS5-specific hack. If the default is PIC, but
+  // the PIC level would've been set to level 1, force it back to level 2 PIC
   // instead.
-  if (PIC && (Triple.isOSDarwin() || EffectiveTriple.isPS4()))
+  if (PIC && (Triple.isOSDarwin() || EffectiveTriple.isPS()))
 IsPICLevelTwo |= ToolChain.isPICDefault();
 
   // This kernel flags are a trump-card: they will disable PIC/PIE

diff  --git a/clang/test/Driver/ps5-pic.c b/clang/test/Driver/ps5-pic.c
new file mode 100644
index 0..0396122accf40
--- /dev/null
+++ b/clang/test/Driver/ps5-pic.c
@@ -0,0 +1,106 @@
+// REQUIRES: x86-registered-target
+
+// Test the driver's control over the PIC behavior for PS5 compiler.
+// These consist of tests of the relocation model flags and the
+// pic level flags passed to CC1.
+//
+// CHECK-NO-PIC: "-mrelocation-model" "static"
+// CHECK-NO-PIC-NOT: "-pic-level"
+// CHECK-NO-PIC-NOT: "-pic-is-pie"
+//
+// CHECK-DYNAMIC-NO-PIC2: unsupported option '-mdynamic-no-pic'
+// CHECK-DYNAMIC-NO-PIC2: "-mrelocation-model" "dynamic-no-pic"
+//
+// CHECK-PIC2: "-mrelocation-model" "pic"
+// CHECK-PIC2: "-pic-level" "2"
+//
+// CHECK-PIE2: "-mrelocation-model" "pic"
+// CHECK-PIE2: "-pic-is-pie"
+//
+// CHECK-NOPIC-IGNORED: using '-fPIC'
+// CHECK-NOPIC-IGNORED: "-mrelocation-model" "pic"
+// CHECK-NOPIC-IGNORED: "-pic-level" "2"
+//
+// CHECK-DIAG-PIC: option '-fno-PIC' was ignored by the PS5 toolchain, using 
'-fPIC'
+// CHECK-DIAG-PIE: option '-fno-PIE' was ignored by the PS5 toolchain, using 
'-fPIC'
+// CHECK-DIAG-pic: option '-fno-pic' was ignored by the PS5 toolchain, using 
'-fPIC'
+// CHECK-DIAG-pie: option '-fno-pie' was ignored by the PS5 toolchain, using 
'-fPIC'
+//
+// CHECK-STATIC-ERR: unsupported option '-static' for target 'PS5'
+
+// RUN: %clang -c %s -target x86_64-sie-ps5 -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
+// RUN: %clang -c %s -target x86_64-sie-ps5 -fpic -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
+// RUN: %clang -c %s -target x86_64-sie-ps5 -fPIC -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
+// RUN: %clang -c %s -target x86_64-sie-ps5 -fpie -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-PIE2
+// RUN: %clang -c %s -target x86_64-sie-ps5 -fPIE 

[clang] dbd1ba2 - [PS5] Disable a test, same as PS4

2022-05-23 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-23T10:43:26-07:00
New Revision: dbd1ba28a3a435c87eb2a977028ea22e9aabf148

URL: 
https://github.com/llvm/llvm-project/commit/dbd1ba28a3a435c87eb2a977028ea22e9aabf148
DIFF: 
https://github.com/llvm/llvm-project/commit/dbd1ba28a3a435c87eb2a977028ea22e9aabf148.diff

LOG: [PS5] Disable a test, same as PS4

Added: 


Modified: 
clang/test/Driver/nostdincxx.cpp

Removed: 






  
Unicorn!  GitHub

  body {
background-color: #f1f1f1;
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  }

  .container { margin: 50px auto 40px auto; width: 600px; text-align: 
center; }

  a { color: #4183c4; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { letter-spacing: -1px; line-height: 60px; font-size: 60px; 
font-weight: 100; margin: 0px; text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 10px 0 10px; font-size: 18px; 
font-weight: 200; line-height: 1.6em;}

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  


  

  

  No server is currently available to service your 
request.
  Sorry about that. Please try refreshing and contact us if the problem 
persists.
  
https://github.com/contact;>Contact Support 
https://www.githubstatus.com;>GitHub Status 
https://twitter.com/githubstatus;>@githubstatus
  

  

  

  

  

  




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


[clang] 2ed0123 - [PS5] Check for HasNativeLLVMSupport

2022-05-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-02T11:06:33-07:00
New Revision: 2ed0123b7fedd6360b0dc06cab9721f108123a98

URL: 
https://github.com/llvm/llvm-project/commit/2ed0123b7fedd6360b0dc06cab9721f108123a98
DIFF: 
https://github.com/llvm/llvm-project/commit/2ed0123b7fedd6360b0dc06cab9721f108123a98.diff

LOG: [PS5] Check for HasNativeLLVMSupport

Added: 


Modified: 
clang/test/Driver/ps4-ps5-toolchain.c

Removed: 




diff  --git a/clang/test/Driver/ps4-ps5-toolchain.c 
b/clang/test/Driver/ps4-ps5-toolchain.c
index 308b80c6774b5..444e9df24714b 100644
--- a/clang/test/Driver/ps4-ps5-toolchain.c
+++ b/clang/test/Driver/ps4-ps5-toolchain.c
@@ -1,7 +1,13 @@
-// PS4/PS5 miscellaneous toolchain defaults.
+/// PS4/PS5 miscellaneous toolchain behavior.
 
 // RUN: %clang -c %s -### -target x86_64-scei-ps4 2>&1 | FileCheck %s
 // RUN: %clang -c %s -### -target x86_64-sie-ps5 2>&1 | FileCheck %s
 // CHECK-DAG: "-ffunction-sections"
 // CHECK-DAG: "-fdata-sections"
 // CHECK-DAG: "-fdeclspec"
+
+/// Verify LTO is enabled (no diagnostic).
+// RUN: %clang %s -### -target x86_64-scei-ps4 -flto 2>&1 | FileCheck %s 
--check-prefix=LTO
+// RUN: %clang %s -### -target x86_64-sie-ps5 -flto 2>&1 | FileCheck %s 
--check-prefix=LTO
+// LTO-NOT: error:
+// LTO-NOT: unable to pass LLVM bit-code



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


[clang] 214265b - [NFC] Add test for HasNativeLLVMSupport

2022-05-02 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-05-02T11:06:33-07:00
New Revision: 214265bce9dfe3a86d9e8e8869d58ee7eded20fa

URL: 
https://github.com/llvm/llvm-project/commit/214265bce9dfe3a86d9e8e8869d58ee7eded20fa
DIFF: 
https://github.com/llvm/llvm-project/commit/214265bce9dfe3a86d9e8e8869d58ee7eded20fa.diff

LOG: [NFC] Add test for HasNativeLLVMSupport

It looks like there used to be a test for this, but the test evolved
in a way that caused the check for the diagnostic to be eliminated.
Add a test that is obviously and specifically for that diagnostic.

Added: 
clang/test/Driver/native-llvm.c

Modified: 


Removed: 




diff  --git a/clang/test/Driver/native-llvm.c b/clang/test/Driver/native-llvm.c
new file mode 100644
index 0..c9543b855bc76
--- /dev/null
+++ b/clang/test/Driver/native-llvm.c
@@ -0,0 +1,5 @@
+// Check that clang reports an error message if -flto without -c is used
+// on a toolchain that is not expecting it (HasNativeLLVMSupport() is false).
+
+// RUN: %clang -### -flto -target x86_64-unknown-unknown %s 2>&1 | FileCheck %s
+// CHECK: error: {{.*}} unable to pass LLVM bit-code files to linker



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


[clang] 17f3a92 - [PS5] Default to omit leaf frame pointer

2022-04-28 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-28T10:35:14-07:00
New Revision: 17f3a92ee5d5490e84cc81481b0947f6a9be3106

URL: 
https://github.com/llvm/llvm-project/commit/17f3a92ee5d5490e84cc81481b0947f6a9be3106
DIFF: 
https://github.com/llvm/llvm-project/commit/17f3a92ee5d5490e84cc81481b0947f6a9be3106.diff

LOG: [PS5] Default to omit leaf frame pointer

Added: 


Modified: 
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/frame-pointer-elim.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 8c68473e56a7..05034ab15f40 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -634,7 +634,7 @@ getFramePointerKind(const ArgList , const llvm::Triple 
) {
   bool OmitLeafFP =
   Args.hasFlag(options::OPT_momit_leaf_frame_pointer,
options::OPT_mno_omit_leaf_frame_pointer,
-   Triple.isAArch64() || Triple.isPS4() || Triple.isVE());
+   Triple.isAArch64() || Triple.isPS() || Triple.isVE());
   if (NoOmitFP || mustUseNonLeafFramePointerForTarget(Triple) ||
   (!OmitFP && useFramePointerForTargetByDefault(Args, Triple))) {
 if (OmitLeafFP)

diff  --git a/clang/test/Driver/frame-pointer-elim.c 
b/clang/test/Driver/frame-pointer-elim.c
index beb14a9a671a..79cc0ee1b18b 100644
--- a/clang/test/Driver/frame-pointer-elim.c
+++ b/clang/test/Driver/frame-pointer-elim.c
@@ -90,7 +90,7 @@
 // WARN-OMIT-LEAF-7S-NOT: warning: optimization flag 
'-momit-leaf-frame-pointer' is not supported for target 'armv7s'
 // WARN-OMIT-LEAF-7S: "-mframe-pointer=non-leaf"
 
-// On AArch64, PS4, and VE, default to omitting the frame pointer on leaf
+// On AArch64, PS4, PS5, and VE, default to omitting the frame pointer on leaf
 // functions
 // RUN: %clang -### -target aarch64 -S %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=KEEP-NON-LEAF %s
@@ -98,6 +98,10 @@
 // RUN:   FileCheck --check-prefix=KEEP-NON-LEAF %s
 // RUN: %clang -### -target x86_64-scei-ps4 -S -O2 %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=KEEP-NON-LEAF %s
+// RUN: %clang -### -target x86_64-sie-ps5 -S %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=KEEP-NON-LEAF %s
+// RUN: %clang -### -target x86_64-sie-ps5 -S -O2 %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=KEEP-NON-LEAF %s
 // RUN: %clang -### -target aarch64-apple-darwin -arch arm64_32 -S %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=KEEP-NON-LEAF %s
 // RUN: %clang -### -target ve-unknown-linux-gnu -S %s 2>&1 | \



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


[clang] db013b2 - [PS5] Defaults for -fdeclspec, -ffunction/data-sections

2022-04-28 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-28T10:03:46-07:00
New Revision: db013b28c3d4a92cc007c878eb4d6585ba86dd1a

URL: 
https://github.com/llvm/llvm-project/commit/db013b28c3d4a92cc007c878eb4d6585ba86dd1a
DIFF: 
https://github.com/llvm/llvm-project/commit/db013b28c3d4a92cc007c878eb4d6585ba86dd1a.diff

LOG: [PS5] Defaults for -fdeclspec, -ffunction/data-sections

Added: 
clang/test/Driver/ps4-ps5-toolchain.c

Modified: 
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 4c22d331be03..8c68473e56a7 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -6441,9 +6441,9 @@ void Clang::ConstructJob(Compilation , const JobAction 
,
   Args.addOptInFlag(CmdArgs, options::OPT_fborland_extensions,
 options::OPT_fno_borland_extensions);
 
-  // -fno-declspec is default, except for PS4.
+  // -fno-declspec is default, except for PS4/PS5.
   if (Args.hasFlag(options::OPT_fdeclspec, options::OPT_fno_declspec,
-   RawTriple.isPS4()))
+   RawTriple.isPS()))
 CmdArgs.push_back("-fdeclspec");
   else if (Args.hasArg(options::OPT_fno_declspec))
 CmdArgs.push_back("-fno-declspec"); // Explicitly disabling __declspec.

diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 03a887a7527b..b646a1ddaf03 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -486,9 +486,9 @@ llvm::StringRef tools::getLTOParallelism(const ArgList 
, const Driver ) {
   return LtoJobsArg->getValue();
 }
 
-// CloudABI uses -ffunction-sections and -fdata-sections by default.
+// CloudABI and PS4/PS5 use -ffunction-sections and -fdata-sections by default.
 bool tools::isUseSeparateSections(const llvm::Triple ) {
-  return Triple.getOS() == llvm::Triple::CloudABI;
+  return Triple.getOS() == llvm::Triple::CloudABI || Triple.isPS();
 }
 
 void tools::addLTOOptions(const ToolChain , const ArgList ,

diff  --git a/clang/test/Driver/ps4-ps5-toolchain.c 
b/clang/test/Driver/ps4-ps5-toolchain.c
new file mode 100644
index ..308b80c6774b
--- /dev/null
+++ b/clang/test/Driver/ps4-ps5-toolchain.c
@@ -0,0 +1,7 @@
+// PS4/PS5 miscellaneous toolchain defaults.
+
+// RUN: %clang -c %s -### -target x86_64-scei-ps4 2>&1 | FileCheck %s
+// RUN: %clang -c %s -### -target x86_64-sie-ps5 2>&1 | FileCheck %s
+// CHECK-DAG: "-ffunction-sections"
+// CHECK-DAG: "-fdata-sections"
+// CHECK-DAG: "-fdeclspec"



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


[clang] 501cc4a - [PS5] Rename a test to reflect its new purpose

2022-04-28 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-28T08:07:50-07:00
New Revision: 501cc4ae304f29e392a2b7e21c316e3abf954daa

URL: 
https://github.com/llvm/llvm-project/commit/501cc4ae304f29e392a2b7e21c316e3abf954daa
DIFF: 
https://github.com/llvm/llvm-project/commit/501cc4ae304f29e392a2b7e21c316e3abf954daa.diff

LOG: [PS5] Rename a test to reflect its new purpose

Added: 
clang/test/Driver/ps4-ps5-cpu-defaults.cpp

Modified: 


Removed: 
clang/test/Driver/ps4-cpu-defaults.cpp



diff  --git a/clang/test/Driver/ps4-cpu-defaults.cpp 
b/clang/test/Driver/ps4-ps5-cpu-defaults.cpp
similarity index 100%
rename from clang/test/Driver/ps4-cpu-defaults.cpp
rename to clang/test/Driver/ps4-ps5-cpu-defaults.cpp



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


[clang] 451c557 - [PS5] Set default cpu to znver2, with no tuning

2022-04-28 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-28T07:50:37-07:00
New Revision: 451c5578b834fe3aca4e495aaf6a2f32639e86a6

URL: 
https://github.com/llvm/llvm-project/commit/451c5578b834fe3aca4e495aaf6a2f32639e86a6
DIFF: 
https://github.com/llvm/llvm-project/commit/451c5578b834fe3aca4e495aaf6a2f32639e86a6.diff

LOG: [PS5] Set default cpu to znver2, with no tuning

Added: 


Modified: 
clang/lib/Driver/ToolChains/Arch/X86.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/ps4-cpu-defaults.cpp

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Arch/X86.cpp 
b/clang/lib/Driver/ToolChains/Arch/X86.cpp
index 73df835585239..de0725b8d6de6 100644
--- a/clang/lib/Driver/ToolChains/Arch/X86.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/X86.cpp
@@ -88,9 +88,11 @@ std::string x86::getX86TargetCPU(const Driver , const 
ArgList ,
 return Is64Bit ? "core2" : "yonah";
   }
 
-  // Set up default CPU name for PS4 compilers.
+  // Set up default CPU name for PS4/PS5 compilers.
   if (Triple.isPS4())
 return "btver2";
+  if (Triple.isPS5())
+return "znver2";
 
   // On Android use targets compatible with gcc
   if (Triple.isAndroid())

diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 1f083de405f0a..52dbe07ab3551 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -2296,10 +2296,10 @@ void Clang::AddX86TargetArgs(const ArgList ,
 
   // Handle -mtune.
 
-  // Default to "generic" unless -march is present or targetting the PS4.
+  // Default to "generic" unless -march is present or targetting the PS4/PS5.
   std::string TuneCPU;
   if (!Args.hasArg(clang::driver::options::OPT_march_EQ) &&
-  !getToolChain().getTriple().isPS4())
+  !getToolChain().getTriple().isPS())
 TuneCPU = "generic";
 
   // Override based on -mtune.

diff  --git a/clang/test/Driver/ps4-cpu-defaults.cpp 
b/clang/test/Driver/ps4-cpu-defaults.cpp
index 46fa8897e6fae..8102c4b144a35 100644
--- a/clang/test/Driver/ps4-cpu-defaults.cpp
+++ b/clang/test/Driver/ps4-cpu-defaults.cpp
@@ -1,7 +1,10 @@
 // Check that on the PS4 we default to:
-// -target-cpu btver2, no exceptions and not -tune-cpu generic
+// -target-cpu btver2, not -tune-cpu generic
+// And on the PS5 we default to:
+// -target-cpu znver2, not -tune-cpu generic
 
-// RUN: %clang -target x86_64-scei-ps4 -c %s -### 2>&1 | FileCheck %s
-// CHECK: "-target-cpu" "btver2"
-// CHECK-NOT: exceptions
-// CHECK-NOT: "-tune-cpu"
+// RUN: %clang -target x86_64-scei-ps4 -c %s -### 2>&1 | FileCheck 
--check-prefixes=PS4,BOTH %s
+// RUN: %clang -target x86_64-sie-ps5 -c %s -### 2>&1 | FileCheck 
--check-prefixes=PS5,BOTH %s
+// PS4: "-target-cpu" "btver2"
+// PS5: "-target-cpu" "znver2"
+// BOTH-NOT: "-tune-cpu"



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


[clang] 8854d12 - [PS5] Disable exceptions by default

2022-04-28 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-28T07:16:16-07:00
New Revision: 8854d1244c905b20dd62db3a7430043477e1ad3b

URL: 
https://github.com/llvm/llvm-project/commit/8854d1244c905b20dd62db3a7430043477e1ad3b
DIFF: 
https://github.com/llvm/llvm-project/commit/8854d1244c905b20dd62db3a7430043477e1ad3b.diff

LOG: [PS5] Disable exceptions by default

Added: 


Modified: 
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/clang-exception-flags.cpp

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 01380f9e1985..1f083de405f0 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -459,9 +459,9 @@ static bool addExceptionArgs(const ArgList , types::ID 
InputType,
   }
 
   if (types::isCXX(InputType)) {
-// Disable C++ EH by default on XCore and PS4.
+// Disable C++ EH by default on XCore and PS4/PS5.
 bool CXXExceptionsEnabled =
-Triple.getArch() != llvm::Triple::xcore && !Triple.isPS4();
+Triple.getArch() != llvm::Triple::xcore && !Triple.isPS();
 Arg *ExceptionArg = Args.getLastArg(
 options::OPT_fcxx_exceptions, options::OPT_fno_cxx_exceptions,
 options::OPT_fexceptions, options::OPT_fno_exceptions);

diff  --git a/clang/test/Driver/clang-exception-flags.cpp 
b/clang/test/Driver/clang-exception-flags.cpp
index a5faed228e05..af63a0ab03be 100644
--- a/clang/test/Driver/clang-exception-flags.cpp
+++ b/clang/test/Driver/clang-exception-flags.cpp
@@ -24,5 +24,6 @@
 // RUN: %clang -### -fexceptions -fno-cxx-exceptions %s 2>&1 | FileCheck %s 
-check-prefix=OFF4
 // OFF4-NOT: "-cc1" {{.*}} "-fcxx-exceptions"
 //
-// RUN: %clang -### -target x86_64-scei-ps4 %s 2>&1 | FileCheck %s 
-check-prefix=PS4-OFF
-// PS4-OFF-NOT: "-cc1" {{.*}} "-f{{(cxx-)?}}exceptions"
+// RUN: %clang -### -target x86_64-scei-ps4 %s 2>&1 | FileCheck %s 
-check-prefix=PS-OFF
+// RUN: %clang -### -target x86_64-sie-ps5 %s 2>&1 | FileCheck %s 
-check-prefix=PS-OFF
+// PS-OFF-NOT: "-cc1" {{.*}} "-f{{(cxx-)?}}exceptions"



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


[clang] 7d2dddc - [PS5] Enable dead-stripping globals in ASan

2022-04-27 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-27T15:44:42-07:00
New Revision: 7d2dddce8f0d3ed896f1437b01a097cb7fd1bfe9

URL: 
https://github.com/llvm/llvm-project/commit/7d2dddce8f0d3ed896f1437b01a097cb7fd1bfe9
DIFF: 
https://github.com/llvm/llvm-project/commit/7d2dddce8f0d3ed896f1437b01a097cb7fd1bfe9.diff

LOG: [PS5] Enable dead-stripping globals in ASan

Added: 


Modified: 
clang/lib/Driver/SanitizerArgs.cpp
clang/test/Driver/fsanitize.c

Removed: 




diff  --git a/clang/lib/Driver/SanitizerArgs.cpp 
b/clang/lib/Driver/SanitizerArgs.cpp
index a8227f1f8285..b63c6e463706 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -857,13 +857,13 @@ SanitizerArgs::SanitizerArgs(const ToolChain ,
  AsanOutlineInstrumentation);
 
 // As a workaround for a bug in gold 2.26 and earlier, dead stripping of
-// globals in ASan is disabled by default on ELF targets.
+// globals in ASan is disabled by default on most ELF targets.
 // See https://sourceware.org/bugzilla/show_bug.cgi?id=19002
 AsanGlobalsDeadStripping = Args.hasFlag(
 options::OPT_fsanitize_address_globals_dead_stripping,
 options::OPT_fno_sanitize_address_globals_dead_stripping,
 !TC.getTriple().isOSBinFormatELF() || TC.getTriple().isOSFuchsia() ||
-TC.getTriple().isPS4());
+TC.getTriple().isPS());
 
 AsanUseOdrIndicator =
 Args.hasFlag(options::OPT_fsanitize_address_use_odr_indicator,

diff  --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
index c6135f88541b..4b03bfc9dcb7 100644
--- a/clang/test/Driver/fsanitize.c
+++ b/clang/test/Driver/fsanitize.c
@@ -245,6 +245,7 @@
 // RUN: %clang_cl --target=x86_64-windows-msvc -fsanitize=address 
-fsanitize-address-globals-dead-stripping -### -- %s 2>&1 | FileCheck %s 
--check-prefix=CHECK-ASAN-GLOBALS
 // RUN: %clang_cl --target=x86_64-windows-msvc -fsanitize=address -### -- %s 
2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
 // RUN: %clang -target x86_64-scei-ps4  -fsanitize=address %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
+// RUN: %clang -target x86_64-sie-ps5  -fsanitize=address %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-ASAN-GLOBALS
 // CHECK-ASAN-GLOBALS: -cc1{{.*}}-fsanitize-address-globals-dead-stripping
 // CHECK-NO-ASAN-GLOBALS-NOT: 
-cc1{{.*}}-fsanitize-address-globals-dead-stripping
 



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


[clang] fd0e60d - [PS5] Test sanitizer options/lib names

2022-04-27 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-27T13:45:41-07:00
New Revision: fd0e60d7874363a641e35a862b05d8dfabab77ef

URL: 
https://github.com/llvm/llvm-project/commit/fd0e60d7874363a641e35a862b05d8dfabab77ef
DIFF: 
https://github.com/llvm/llvm-project/commit/fd0e60d7874363a641e35a862b05d8dfabab77ef.diff

LOG: [PS5] Test sanitizer options/lib names

The functionality was added in 7726ad0, catching up on the tests now.

Added: 


Modified: 
clang/test/Driver/fsanitize.c
clang/test/Driver/sanitizer-ld.c

Removed: 




diff  --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
index f31e6156120fd..c6135f88541b6 100644
--- a/clang/test/Driver/fsanitize.c
+++ b/clang/test/Driver/fsanitize.c
@@ -783,6 +783,29 @@
 // RUN: %clang -target x86_64-scei-ps4 -fsanitize=address -nodefaultlibs 
-nostdlib  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-NOLIB-PS4
 // CHECK-ASAN-NOLIB-PS4-NOT: SceDbgAddressSanitizer_stub_weak
 
+// RUN: %clang -target x86_64-sie-ps5 -fsanitize=address %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-ASAN-PS5
+// Make sure there are no *.{o,bc} or -l passed before the ASan library.
+// CHECK-ASAN-PS5-NOT: {{(\.(o|bc)"? 
|-l).*-lSceAddressSanitizer_nosubmission_stub_weak}}
+// CHECK-ASAN-PS5: 
--dependent-lib=libSceAddressSanitizer_nosubmission_stub_weak.a
+// CHECK-ASAN-PS5-NOT: {{(\.(o|bc)"? 
|-l).*-lSceAddressSanitizer_nosubmission_stub_weak}}
+// CHECK-ASAN-PS5: -lSceAddressSanitizer_nosubmission_stub_weak
+// RUN: %clang -target x86_64-sie-ps5 -fsanitize=address -nostdlib %s -### 
2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-NOLIB-PS5
+// RUN: %clang -target x86_64-sie-ps5 -fsanitize=address -nodefaultlibs %s 
-### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-NOLIB-PS5
+// RUN: %clang -target x86_64-sie-ps5 -fsanitize=address -nodefaultlibs 
-nostdlib  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-NOLIB-PS5
+// CHECK-ASAN-NOLIB-PS5-NOT: SceAddressSanitizer_nosubmission_stub_weak
+
+// RUN: %clang -target x86_64-sie-ps5 -fsanitize=thread %s -### 2>&1 | 
FileCheck %s --check-prefix=CHECK-TSAN-PS5
+// Make sure there are no *.{o,bc} or -l passed before the TSan library.
+// CHECK-TSAN-PS5-NOT: {{(\.(o|bc)"? 
|-l).*-lSceThreadSanitizer_nosubmission_stub_weak}}
+// CHECK-TSAN-PS5: 
--dependent-lib=libSceThreadSanitizer_nosubmission_stub_weak.a
+// CHECK-TSAN-PS5-NOT: {{(\.(o|bc)"? 
|-l).*-lSceThreadSanitizer_nosubmission_stub_weak}}
+// CHECK-TSAN-PS5: -lSceThreadSanitizer_nosubmission_stub_weak
+// RUN: %clang -target x86_64-sie-ps5 -fsanitize=thread -nostdlib %s -### 2>&1 
| FileCheck %s --check-prefix=CHECK-TSAN-NOLIB-PS5
+// RUN: %clang -target x86_64-sie-ps5 -fsanitize=thread -nodefaultlibs %s -### 
2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-NOLIB-PS5
+// RUN: %clang -target x86_64-sie-ps5 -fsanitize=thread -nodefaultlibs 
-nostdlib  %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-NOLIB-PS5
+// CHECK-TSAN-NOLIB-PS5-NOT: SceThreadSanitizer_nosubmission_stub_weak
+
+
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=address 
-fsanitize-minimal-runtime %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-ASAN-MINIMAL
 // CHECK-ASAN-MINIMAL: error: invalid argument '-fsanitize-minimal-runtime' 
not allowed with '-fsanitize=address'
 

diff  --git a/clang/test/Driver/sanitizer-ld.c 
b/clang/test/Driver/sanitizer-ld.c
index 966edbd7d038b..def3ef967a46e 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -759,6 +759,14 @@
 // CHECK-UBSAN-PS4: "{{.*}}ld{{(.gold)?(.exe)?}}"
 // CHECK-UBSAN-PS4: -lSceDbgUBSanitizer_stub_weak
 
+// RUN: %clang -fsanitize=undefined %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-sie-ps5 -fuse-ld=ld \
+// RUN: -shared \
+// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-PS5 %s
+// CHECK-UBSAN-PS5: --dependent-lib=libSceUBSanitizer_nosubmission_stub_weak.a
+// CHECK-UBSAN-PS5: "{{.*}}ld{{(.gold)?(.exe)?}}"
+// CHECK-UBSAN-PS5: -lSceUBSanitizer_nosubmission_stub_weak
+
 // RUN: %clang -fsanitize=address %s -### -o %t.o 2>&1 \
 // RUN: -target x86_64-scei-ps4 -fuse-ld=ld \
 // RUN: -shared \
@@ -767,6 +775,14 @@
 // CHECK-ASAN-PS4: "{{.*}}ld{{(.gold)?(.exe)?}}"
 // CHECK-ASAN-PS4: -lSceDbgAddressSanitizer_stub_weak
 
+// RUN: %clang -fsanitize=address %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-sie-ps5 -fuse-ld=ld \
+// RUN: -shared \
+// RUN:   | FileCheck --check-prefix=CHECK-ASAN-PS5 %s
+// CHECK-ASAN-PS5: 
--dependent-lib=libSceAddressSanitizer_nosubmission_stub_weak.a
+// CHECK-ASAN-PS5: "{{.*}}ld{{(.gold)?(.exe)?}}"
+// CHECK-ASAN-PS5: -lSceAddressSanitizer_nosubmission_stub_weak
+
 // RUN: %clang -fsanitize=address,undefined %s -### -o %t.o 2>&1 \
 // RUN: -target x86_64-scei-ps4 -fuse-ld=ld \
 // RUN: -shared \
@@ -777,6 +793,16 @@
 // CHECK-AUBSAN-PS4: "{{.*}}ld{{(.gold)?(.exe)?}}"
 // CHECK-AUBSAN-PS4: -lSceDbgAddressSanitizer_stub_weak
 
+// RUN: %clang 

[clang] 72adc46 - [PS5] Add debug option testing for the PS5 target

2022-04-26 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-26T13:42:38-07:00
New Revision: 72adc461cca59e3ed1fd2409aa592805572b

URL: 
https://github.com/llvm/llvm-project/commit/72adc461cca59e3ed1fd2409aa592805572b
DIFF: 
https://github.com/llvm/llvm-project/commit/72adc461cca59e3ed1fd2409aa592805572b.diff

LOG: [PS5] Add debug option testing for the PS5 target

The functionality was added in 7726ad0, catching up on the tests now.

This test mostly runs clang and checks one thing each time, which isn't
very efficient.  I added some -DAG suffixes and combined some checks so
adding PS5 checking didn't actually increase the number of clang runs.

Added: 


Modified: 
clang/test/Driver/debug-options.c

Removed: 




diff  --git a/clang/test/Driver/debug-options.c 
b/clang/test/Driver/debug-options.c
index e4a49269a8c70..4b0d7912003d2 100644
--- a/clang/test/Driver/debug-options.c
+++ b/clang/test/Driver/debug-options.c
@@ -89,16 +89,17 @@
 // RUN: %clang_cl -### -c -Z7 -target x86_64-windows-msvc -- %s 2>&1 \
 // RUN: | FileCheck -check-prefix=G_NOTUNING %s
 
-// On the PS4, -g defaults to -gno-column-info, and we always generate the
+// On the PS4/PS5, -g defaults to -gno-column-info, and we always generate the
 // arange section.
 // RUN: %clang -### -c %s -target x86_64-scei-ps4 2>&1 \
-// RUN: | FileCheck -check-prefix=NOG_PS4 %s
-// RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \
-// RUN: | FileCheck -check-prefix=G_PS4 %s
-// RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \
-// RUN: | FileCheck -check-prefix=G_SCE %s
+// RUN: | FileCheck -check-prefix=NOG_PS %s
+// RUN: %clang -### -c %s -target x86_64-sie-ps5 2>&1 \
+// RUN: | FileCheck -check-prefix=NOG_PS %s
+/// PS4 will stay on v4 even if the generic default version changes.
 // RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \
-// RUN: | FileCheck -check-prefix=NOCI %s
+// RUN: | FileCheck 
-check-prefixes=G_DWARF4,GARANGE,G_SCE,NOCI,FWD_TMPL_PARAMS %s
+// RUN: %clang -### -c %s -g -target x86_64-sie-ps5 2>&1 \
+// RUN: | FileCheck 
-check-prefixes=G_DWARF5,GARANGE,G_SCE,NOCI,FWD_TMPL_PARAMS %s
 // RUN: %clang -### -c %s -g -gcolumn-info -target x86_64-scei-ps4 2>&1 \
 // RUN: | FileCheck -check-prefix=CI %s
 // RUN: %clang -### -c %s -gsce -target x86_64-unknown-linux 2>&1 \
@@ -280,15 +281,10 @@
 // RUN: %clang -### -target %itanium_abi_triple -gmodules 
-gline-directives-only %s 2>&1 \
 // RUN:| FileCheck -check-prefix=GLIO_ONLY %s
 //
-// NOG_PS4: "-cc1"
-// NOG_PS4-NOT: "-dwarf-version=
-// NOG_PS4: "-generate-arange-section"
-// NOG_PS4-NOT: "-dwarf-version=
-//
-// G_PS4: "-cc1"
-/// PS4 will stay on v4 even if the generic default version changes.
-// G_PS4: "-dwarf-version=4"
-// G_PS4: "-generate-arange-section"
+// NOG_PS: "-cc1"
+// NOG_PS-NOT: "-dwarf-version=
+// NOG_PS: "-generate-arange-section"
+// NOG_PS-NOT: "-dwarf-version=
 //
 // G_ERR: error: unknown argument:
 //
@@ -327,11 +323,12 @@
 // G_LIMITED: "-cc1"
 // G_LIMITED: "-debug-info-kind=constructor"
 // G_DWARF2: "-dwarf-version=2"
-// G_DWARF4: "-dwarf-version=4"
+// G_DWARF4-DAG: "-dwarf-version=4"
+// G_DWARF5-DAG: "-dwarf-version=5"
 //
 // G_GDB:  "-debugger-tuning=gdb"
 // G_LLDB: "-debugger-tuning=lldb"
-// G_SCE:  "-debugger-tuning=sce"
+// G_SCE-DAG:  "-debugger-tuning=sce"
 // G_DBX:  "-debugger-tuning=dbx"
 //
 // STRICT:  "-gstrict-dwarf"
@@ -370,7 +367,7 @@
 // RNGBSE: -fdebug-ranges-base-address
 // NORNGBSE-NOT: -fdebug-ranges-base-address
 //
-// GARANGE: -generate-arange-section
+// GARANGE-DAG: -generate-arange-section
 //
 // FDTS: "-mllvm" "-generate-type-units"
 // FDTSE: error: unsupported option '-fdebug-types-section' for target 
'x86_64-apple-darwin'
@@ -380,7 +377,7 @@
 //
 // CI-NOT: "-gno-column-info"
 //
-// NOCI: "-gno-column-info"
+// NOCI-DAG: "-gno-column-info"
 //
 // GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj"
 // GEXTREFS: "-debug-info-kind={{standalone|constructor}}"
@@ -444,9 +441,9 @@
 // DIRECTORY-NOT: "-fno-dwarf-directory-asm"
 // NODIRECTORY: "-fno-dwarf-directory-asm"
 
-// RUN: %clang -### -target x86_64 -c -g -gsimple-template-names %s 2>&1 | 
FileCheck --check-prefix=SIMPLE_TEMP_NAMES %s
-// SIMPLE_TEMP_NAMES: -gsimple-template-names=simple
-// SIMPLE_TEMP_NAMES: -debug-forward-template-params
+// RUN: %clang -### -target x86_64 -c -g -gsimple-template-names %s 2>&1 | 
FileCheck --check-prefixes=SIMPLE_TMPL_NAMES,FWD_TMPL_PARAMS %s
+// SIMPLE_TMPL_NAMES: -gsimple-template-names=simple
+// FWD_TMPL_PARAMS-DAG: -debug-forward-template-params
 // RUN: not %clang -### -target x86_64 -c -g -gsimple-template-names=mangled 
%s 2>&1 | FileCheck --check-prefix=MANGLED_TEMP_NAMES %s
 // MANGLED_TEMP_NAMES: error: unknown argument: 
'-gsimple-template-names=mangled'
 // RUN: %clang -### -target x86_64 

[clang] b375882 - [PS5] Correctly test for analyzer defaults

2022-04-26 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-26T07:14:48-07:00
New Revision: b375882014ccaa19c14bc7dc46a666a5a09bbb40

URL: 
https://github.com/llvm/llvm-project/commit/b375882014ccaa19c14bc7dc46a666a5a09bbb40
DIFF: 
https://github.com/llvm/llvm-project/commit/b375882014ccaa19c14bc7dc46a666a5a09bbb40.diff

LOG: [PS5] Correctly test for analyzer defaults

Commit 5c90eca added some analyzer option checking, but a typo meant
it was redundantly checking PS4 and not adding checking for PS5.
With the test corrected, it identified the necessary driver updates,
added in this commit.

Added: 


Modified: 
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/ps4-ps5-analyzer-defaults.cpp

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 0fd639da45ddf..6e4eadd3ab0e7 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3167,8 +3167,8 @@ static void RenderAnalyzerOptions(const ArgList , 
ArgStringList ,
   CmdArgs.push_back("-analyzer-checker=unix.cstring.NullArg");
 }
 
-// Disable some unix checkers for PS4.
-if (Triple.isPS4()) {
+// Disable some unix checkers for PS4/PS5.
+if (Triple.isPS()) {
   CmdArgs.push_back("-analyzer-disable-checker=unix.API");
   CmdArgs.push_back("-analyzer-disable-checker=unix.Vfork");
 }
@@ -3186,7 +3186,7 @@ static void RenderAnalyzerOptions(const ArgList , 
ArgStringList ,
 if (types::isCXX(Input.getType()))
   CmdArgs.push_back("-analyzer-checker=cplusplus");
 
-if (!Triple.isPS4()) {
+if (!Triple.isPS()) {
   
CmdArgs.push_back("-analyzer-checker=security.insecureAPI.UncheckedReturn");
   CmdArgs.push_back("-analyzer-checker=security.insecureAPI.getpw");
   CmdArgs.push_back("-analyzer-checker=security.insecureAPI.gets");

diff  --git a/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp 
b/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp
index 6e76f2c90ac84..81a302c6bcbe3 100644
--- a/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp
+++ b/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp
@@ -17,13 +17,13 @@
 // Negative check for unexpected checkers
 // RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-NEG-CHECKERS
-// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
+// RUN: %clang -target x86_64-sie-ps5 --analyze %s -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-NEG-CHECKERS
 //
 // Check for all unix checkers except API and Vfork
 // RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-UNIX-CHECKERS
-// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
+// RUN: %clang -target x86_64-sie-ps5 --analyze %s -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-UNIX-CHECKERS
 
 // CHECK-POS-CHECKERS-DAG: analyzer-checker=core



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


[clang] 5c90eca - [PS5] Driver test for analyzer defaults

2022-04-25 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-25T12:42:00-07:00
New Revision: 5c90ecae2db104a816aeb33b6f773aaf782850e7

URL: 
https://github.com/llvm/llvm-project/commit/5c90ecae2db104a816aeb33b6f773aaf782850e7
DIFF: 
https://github.com/llvm/llvm-project/commit/5c90ecae2db104a816aeb33b6f773aaf782850e7.diff

LOG: [PS5] Driver test for analyzer defaults

Added: 
clang/test/Driver/ps4-ps5-analyzer-defaults.cpp

Modified: 


Removed: 
clang/test/Driver/ps4-analyzer-defaults.cpp



diff  --git a/clang/test/Driver/ps4-analyzer-defaults.cpp 
b/clang/test/Driver/ps4-analyzer-defaults.cpp
deleted file mode 100644
index e1649a38b6287..0
--- a/clang/test/Driver/ps4-analyzer-defaults.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-// Check that the default analyzer checkers for PS4 are:
-//   core
-//   cplusplus
-//   deadcode
-//   nullability
-//   unix
-// Excluding:
-//   unix.API
-//   unix.Vfork
-
-// Check for expected checkers
-// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-PS4-POS-CHECKERS
-//
-// Negative check for unexpected checkers
-// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-PS4-NEG-CHECKERS
-//
-// Check for all unix checkers except API and Vfork
-// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-PS4-UNIX-CHECKERS
-
-// CHECK-PS4-POS-CHECKERS-DAG: analyzer-checker=core
-// CHECK-PS4-POS-CHECKERS-DAG: analyzer-checker=cplusplus
-// CHECK-PS4-POS-CHECKERS-DAG: analyzer-checker=deadcode
-// CHECK-PS4-POS-CHECKERS-DAG: analyzer-checker=nullability
-//
-// CHECK-PS4-NEG-CHECKERS-NOT: analyzer-checker={{osx|security}}
-//
-// CHECK-PS4-UNIX-CHECKERS: analyzer-checker=unix
-// CHECK-PS4-UNIX-CHECKERS-DAG: analyzer-disable-checker=unix.API
-// CHECK-PS4-UNIX-CHECKERS-DAG: analyzer-disable-checker=unix.Vfork
-// CHECK-PS4-UNIX-CHECKERS-NOT: analyzer-checker=unix.{{API|Vfork}}

diff  --git a/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp 
b/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp
new file mode 100644
index 0..6e76f2c90ac84
--- /dev/null
+++ b/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp
@@ -0,0 +1,39 @@
+// Check that the default analyzer checkers for PS4/PS5 are:
+//   core
+//   cplusplus
+//   deadcode
+//   nullability
+//   unix
+// Excluding:
+//   unix.API
+//   unix.Vfork
+
+// Check for expected checkers
+// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-POS-CHECKERS
+// RUN: %clang -target x86_64-sie-ps5 --analyze %s -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-POS-CHECKERS
+//
+// Negative check for unexpected checkers
+// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-NEG-CHECKERS
+// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-NEG-CHECKERS
+//
+// Check for all unix checkers except API and Vfork
+// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-UNIX-CHECKERS
+// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-UNIX-CHECKERS
+
+// CHECK-POS-CHECKERS-DAG: analyzer-checker=core
+// CHECK-POS-CHECKERS-DAG: analyzer-checker=cplusplus
+// CHECK-POS-CHECKERS-DAG: analyzer-checker=deadcode
+// CHECK-POS-CHECKERS-DAG: analyzer-checker=nullability
+//
+// CHECK-NEG-CHECKERS-NOT: analyzer-checker={{osx|security}}
+//
+// CHECK-UNIX-CHECKERS: analyzer-checker=unix
+// CHECK-UNIX-CHECKERS-DAG: analyzer-disable-checker=unix.API
+// CHECK-UNIX-CHECKERS-DAG: analyzer-disable-checker=unix.Vfork
+// CHECK-UNIX-CHECKERS-NOT: analyzer-checker=unix.{{API|Vfork}}



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


[clang] f80e369 - [PS4] Driver: use correct --shared option

2022-04-21 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-21T08:19:42-07:00
New Revision: f80e369f61ebd33dd9377bb42fcab64d17072b18

URL: 
https://github.com/llvm/llvm-project/commit/f80e369f61ebd33dd9377bb42fcab64d17072b18
DIFF: 
https://github.com/llvm/llvm-project/commit/f80e369f61ebd33dd9377bb42fcab64d17072b18.diff

LOG: [PS4] Driver: use correct --shared option

Added: 


Modified: 
clang/lib/Driver/ToolChains/PS4CPU.cpp
clang/test/Driver/ps4-ps5-linker-non-win.c
clang/test/Driver/ps4-ps5-linker-win.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp 
b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index 55a8d4dbc24b4..35a83d79abfd1 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -143,7 +143,7 @@ void tools::PScpu::Linker::ConstructJob(Compilation , 
const JobAction ,
   if (Args.hasArg(options::OPT_rdynamic))
 CmdArgs.push_back("-export-dynamic");
   if (Args.hasArg(options::OPT_shared))
-CmdArgs.push_back("--oformat=so");
+CmdArgs.push_back("--shared");
 
   if (Output.isFilename()) {
 CmdArgs.push_back("-o");

diff  --git a/clang/test/Driver/ps4-ps5-linker-non-win.c 
b/clang/test/Driver/ps4-ps5-linker-non-win.c
index cd7cd8e11ea07..b9686b88a7573 100644
--- a/clang/test/Driver/ps4-ps5-linker-non-win.c
+++ b/clang/test/Driver/ps4-ps5-linker-non-win.c
@@ -13,14 +13,15 @@
 // RUN: env "PATH=%t:%PATH%" %clang -### -target x86_64-scei-ps4  %s 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-PS4-LINKER %s
 // RUN: env "PATH=%t:%PATH%" %clang -### -target x86_64-scei-ps4  %s -shared 
2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-PS4-LINKER %s
+// RUN:   | FileCheck --check-prefixes=CHECK-PS4-LINKER,SHARED %s
 // RUN: env "PATH=%t:%PATH%" %clang -### -target x86_64-sie-ps5  %s 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-PS5-LINKER %s
 // RUN: env "PATH=%t:%PATH%" %clang -### -target x86_64-sie-ps5  %s -shared 
2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-PS5-LINKER %s
+// RUN:   | FileCheck --check-prefixes=CHECK-PS5-LINKER,SHARED %s
 
 // CHECK-PS4-LINKER: /orbis-ld
 // CHECK-PS5-LINKER: /prospero-lld
+// SHARED: "--shared"
 
 // RUN: env "PATH=%t:%PATH%" %clang -### -target x86_64-scei-ps4 %s 
-fuse-ld=gold 2>&1 \
 // RUN:   | FileCheck --check-prefix=ERROR %s

diff  --git a/clang/test/Driver/ps4-ps5-linker-win.c 
b/clang/test/Driver/ps4-ps5-linker-win.c
index ca4084d4fccff..acff2c0f1f24c 100644
--- a/clang/test/Driver/ps4-ps5-linker-win.c
+++ b/clang/test/Driver/ps4-ps5-linker-win.c
@@ -10,14 +10,15 @@
 // RUN: env "PATH=%t;%PATH%;" %clang -target x86_64-scei-ps4  %s -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-PS4-LINKER %s
 // RUN: env "PATH=%t;%PATH%;" %clang -target x86_64-scei-ps4  %s -shared -### 
2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-PS4-LINKER %s
+// RUN:   | FileCheck --check-prefixes=CHECK-PS4-LINKER,SHARED %s
 // RUN: env "PATH=%t;%PATH%;" %clang -target x86_64-sie-ps5  %s -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-PS5-LINKER %s
 // RUN: env "PATH=%t;%PATH%;" %clang -target x86_64-sie-ps5  %s -shared -### 
2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-PS5-LINKER %s
+// RUN:   | FileCheck --check-prefixes=CHECK-PS5-LINKER,SHARED %s
 
 // CHECK-PS4-LINKER: \\orbis-ld
 // CHECK-PS5-LINKER: \\prospero-lld
+// SHARED: "--shared"
 
 // RUN: env "PATH=%t;%PATH%;" %clang -target x86_64-scei-ps4 %s -fuse-ld=gold 
-### 2>&1 \
 // RUN:   | FileCheck --check-prefix=ERROR %s



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


[clang] dfdb2cc - [PS5][NFC] Fix a test with a misplaced -x option

2022-04-20 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-20T08:56:50-07:00
New Revision: dfdb2cc0fbc91feeaa95d3651728df36a975912e

URL: 
https://github.com/llvm/llvm-project/commit/dfdb2cc0fbc91feeaa95d3651728df36a975912e
DIFF: 
https://github.com/llvm/llvm-project/commit/dfdb2cc0fbc91feeaa95d3651728df36a975912e.diff

LOG: [PS5][NFC] Fix a test with a misplaced -x option

Added: 


Modified: 
clang/test/Driver/no-integrated-as.c

Removed: 




diff  --git a/clang/test/Driver/no-integrated-as.c 
b/clang/test/Driver/no-integrated-as.c
index 617e319764efb..763304aa80053 100644
--- a/clang/test/Driver/no-integrated-as.c
+++ b/clang/test/Driver/no-integrated-as.c
@@ -16,6 +16,6 @@
 /// -c omitted on purpose, this used to crash.
 // RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s 2>&1 \
 // RUN: | FileCheck %s -check-prefix PS5
-// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s -x assembler 
2>&1 \
+// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as -x assembler %s 
2>&1 \
 // RUN: | FileCheck %s -check-prefix PS5
 // PS5: there is no external assembler that can be used on this platform



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


[clang] a5c847e - [PS4][NFC] Rename classes to align with prevailing practice

2022-04-20 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-20T08:35:52-07:00
New Revision: a5c847e8cf2a60fe09d4016788c4944ab4739e45

URL: 
https://github.com/llvm/llvm-project/commit/a5c847e8cf2a60fe09d4016788c4944ab4739e45
DIFF: 
https://github.com/llvm/llvm-project/commit/a5c847e8cf2a60fe09d4016788c4944ab4739e45.diff

LOG: [PS4][NFC] Rename classes to align with prevailing practice

Rename classes Assemble -> Assembler, Link -> Linker,
for consistency with names other toolchains use.

Added: 


Modified: 
clang/lib/Driver/ToolChains/PS4CPU.cpp
clang/lib/Driver/ToolChains/PS4CPU.h

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp 
b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index 3c8798ebbc511..55a8d4dbc24b4 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -54,11 +54,11 @@ void tools::PScpu::addProfileRTArgs(const ToolChain , 
const ArgList ,
 Args, "--dependent-lib=", PSTC.getProfileRTLibName(), ""));
 }
 
-void tools::PScpu::Assemble::ConstructJob(Compilation , const JobAction ,
-  const InputInfo ,
-  const InputInfoList ,
-  const ArgList ,
-  const char *LinkingOutput) const {
+void tools::PScpu::Assembler::ConstructJob(Compilation , const JobAction ,
+   const InputInfo ,
+   const InputInfoList ,
+   const ArgList ,
+   const char *LinkingOutput) const {
   auto  = static_cast(getToolChain());
   claimNoWarnArgs(Args);
   ArgStringList CmdArgs;
@@ -117,11 +117,11 @@ void toolchains::PS5CPU::addSanitizerArgs(const ArgList 
,
 CmdArgs.push_back(arg("SceThreadSanitizer_nosubmission_stub_weak"));
 }
 
-void tools::PScpu::Link::ConstructJob(Compilation , const JobAction ,
-  const InputInfo ,
-  const InputInfoList ,
-  const ArgList ,
-  const char *LinkingOutput) const {
+void tools::PScpu::Linker::ConstructJob(Compilation , const JobAction ,
+const InputInfo ,
+const InputInfoList ,
+const ArgList ,
+const char *LinkingOutput) const {
   auto  = static_cast(getToolChain());
   const Driver  = TC.getDriver();
   ArgStringList CmdArgs;
@@ -245,7 +245,7 @@ toolchains::PS4PS5Base::PS4PS5Base(const Driver , const 
llvm::Triple ,
 }
 
 Tool *toolchains::PS4CPU::buildAssembler() const {
-  return new tools::PScpu::Assemble(*this);
+  return new tools::PScpu::Assembler(*this);
 }
 
 Tool *toolchains::PS5CPU::buildAssembler() const {
@@ -255,7 +255,7 @@ Tool *toolchains::PS5CPU::buildAssembler() const {
 }
 
 Tool *toolchains::PS4PS5Base::buildLinker() const {
-  return new tools::PScpu::Link(*this);
+  return new tools::PScpu::Linker(*this);
 }
 
 SanitizerMask toolchains::PS4PS5Base::getSupportedSanitizers() const {

diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.h 
b/clang/lib/Driver/ToolChains/PS4CPU.h
index dd6d7df432a4f..954e7d8d8d684 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.h
+++ b/clang/lib/Driver/ToolChains/PS4CPU.h
@@ -27,9 +27,9 @@ void addProfileRTArgs(const ToolChain , const 
llvm::opt::ArgList ,
 void addSanitizerArgs(const ToolChain , const llvm::opt::ArgList ,
   llvm::opt::ArgStringList );
 
-class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
+class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
 public:
-  Assemble(const ToolChain ) : Tool("PScpu::Assemble", "assembler", TC) {}
+  Assembler(const ToolChain ) : Tool("PScpu::Assembler", "assembler", TC) {}
 
   bool hasIntegratedCPP() const override { return false; }
 
@@ -39,9 +39,9 @@ class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
 const char *LinkingOutput) const override;
 };
 
-class LLVM_LIBRARY_VISIBILITY Link : public Tool {
+class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
 public:
-  Link(const ToolChain ) : Tool("PScpu::Link", "linker", TC) {}
+  Linker(const ToolChain ) : Tool("PScpu::Linker", "linker", TC) {}
 
   bool hasIntegratedCPP() const override { return false; }
   bool isLinkJob() const override { return true; }



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


[clang] 20c873c - [PS5] Avoid a driver crash

2022-04-19 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-19T15:55:32-07:00
New Revision: 20c873c12fa5563bbfb07c880db51fa68db571cc

URL: 
https://github.com/llvm/llvm-project/commit/20c873c12fa5563bbfb07c880db51fa68db571cc
DIFF: 
https://github.com/llvm/llvm-project/commit/20c873c12fa5563bbfb07c880db51fa68db571cc.diff

LOG: [PS5] Avoid a driver crash

In some cases, an error constructing a compiler or assembler job could
leave the Inputs in a state that the code for constructing the linker
job was not ready for.

Added: 


Modified: 
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/no-integrated-as.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 1207bf37b5bb0..96a54228626f6 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -255,6 +255,10 @@ void tools::AddLinkerInputs(const ToolChain , const 
InputInfoList ,
   continue;
 }
 
+// In some error cases, the input could be Nothing; skip those.
+if (II.isNothing())
+  continue;
+
 // Otherwise, this is a linker input argument.
 const Arg  = II.getInputArg();
 

diff  --git a/clang/test/Driver/no-integrated-as.c 
b/clang/test/Driver/no-integrated-as.c
index 6f45a6050e9fd..617e319764efb 100644
--- a/clang/test/Driver/no-integrated-as.c
+++ b/clang/test/Driver/no-integrated-as.c
@@ -13,8 +13,9 @@
 
 // DEFAULT-NOT: -no-integrated-as
 
-// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s -c 2>&1 \
+/// -c omitted on purpose, this used to crash.
+// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s 2>&1 \
 // RUN: | FileCheck %s -check-prefix PS5
-// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s -c -x 
assembler 2>&1 \
+// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s -x assembler 
2>&1 \
 // RUN: | FileCheck %s -check-prefix PS5
 // PS5: there is no external assembler that can be used on this platform



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


[clang] 7726ad0 - [PS5] Add basic PS5 driver behavior

2022-04-14 Thread Paul Robinson via cfe-commits

Author: Paul Robinson
Date: 2022-04-14T12:45:33-07:00
New Revision: 7726ad04e2633a843fb9743e5adfbb404446e657

URL: 
https://github.com/llvm/llvm-project/commit/7726ad04e2633a843fb9743e5adfbb404446e657
DIFF: 
https://github.com/llvm/llvm-project/commit/7726ad04e2633a843fb9743e5adfbb404446e657.diff

LOG: [PS5] Add basic PS5 driver behavior

This adds a PS5-specific ToolChain subclass, which defines some basic
PS5 driver behavior. Future patches will add more target-specific
driver behavior.

Added: 
clang/test/Driver/ps4-ps5-header-search.c
clang/test/Driver/ps4-ps5-linker-non-win.c
clang/test/Driver/ps4-ps5-linker-win.c
clang/test/Driver/ps4-ps5-relax-relocations.c
clang/test/Driver/ps4-ps5-runtime-flags.c
clang/test/Driver/ps4ps5base.c
clang/test/Driver/ps5-sdk-root.c

Modified: 
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/PS4CPU.cpp
clang/lib/Driver/ToolChains/PS4CPU.h
clang/lib/Lex/InitHeaderSearch.cpp
clang/test/Driver/inhibit-downstream-commands.c
clang/test/Driver/no-integrated-as.c
clang/test/Driver/no-integrated-as.s

Removed: 
clang/test/Driver/ps4-header-search.c
clang/test/Driver/ps4-linker-non-win.c
clang/test/Driver/ps4-linker-win.c
clang/test/Driver/ps4-relax-relocations.c
clang/test/Driver/ps4-runtime-flags.c
clang/test/Driver/ps4cpu.c



diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 392364ce22bad..8de1a364092dc 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -5672,6 +5672,9 @@ const ToolChain ::getToolChain(const ArgList ,
 case llvm::Triple::PS4:
   TC = std::make_unique(*this, Target, Args);
   break;
+case llvm::Triple::PS5:
+  TC = std::make_unique(*this, Target, Args);
+  break;
 case llvm::Triple::Contiki:
   TC = std::make_unique(*this, Target, Args);
   break;

diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index bf47212374ce4..8aefcaeed37dc 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5541,11 +5541,11 @@ void Clang::ConstructJob(Compilation , const 
JobAction ,
 
   Args.AddLastArg(CmdArgs, options::OPT_fclang_abi_compat_EQ);
 
-  // Add runtime flag for PS4 when PGO, coverage, or sanitizers are enabled.
-  if (RawTriple.isPS4() &&
+  // Add runtime flag for PS4/PS5 when PGO, coverage, or sanitizers are 
enabled.
+  if (RawTriple.isPS() &&
   !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
-PS4cpu::addProfileRTArgs(TC, Args, CmdArgs);
-PS4cpu::addSanitizerArgs(TC, Args, CmdArgs);
+PScpu::addProfileRTArgs(TC, Args, CmdArgs);
+PScpu::addSanitizerArgs(TC, Args, CmdArgs);
   }
 
   // Pass options for controlling the default header search paths.

diff  --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp 
b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index 154eb78ce207c..3c8798ebbc511 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -29,8 +29,8 @@ static const char *makeArgString(const ArgList , const 
char *Prefix,
   return Args.MakeArgString(Twine(StringRef(Prefix), Base) + Suffix);
 }
 
-void tools::PS4cpu::addProfileRTArgs(const ToolChain , const ArgList ,
- ArgStringList ) {
+void tools::PScpu::addProfileRTArgs(const ToolChain , const ArgList ,
+ArgStringList ) {
   assert(TC.getTriple().isPS());
   auto  = static_cast(TC);
 
@@ -54,11 +54,11 @@ void tools::PS4cpu::addProfileRTArgs(const ToolChain , 
const ArgList ,
 Args, "--dependent-lib=", PSTC.getProfileRTLibName(), ""));
 }
 
-void tools::PS4cpu::Assemble::ConstructJob(Compilation , const JobAction ,
-   const InputInfo ,
-   const InputInfoList ,
-   const ArgList ,
-   const char *LinkingOutput) const {
+void tools::PScpu::Assemble::ConstructJob(Compilation , const JobAction ,
+  const InputInfo ,
+  const InputInfoList ,
+  const ArgList ,
+  const char *LinkingOutput) const {
   auto  = static_cast(getToolChain());
   claimNoWarnArgs(Args);
   ArgStringList CmdArgs;
@@ -80,8 +80,8 @@ void tools::PS4cpu::Assemble::ConstructJob(Compilation , 
const JobAction ,
  Exec, CmdArgs, Inputs, Output));
 }
 
-void tools::PS4cpu::addSanitizerArgs(const ToolChain , const ArgList ,
- ArgStringList ) {
+void tools::PScpu::addSanitizerArgs(const ToolChain , const ArgList ,
+  

  1   2   3   >