[PATCH] D60485: [AArch64] Add support for MTE intrinsics

2019-04-10 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Do we need a separate file for that one "__arm_mte_ptrdiff" test? Wouldn't it 
be easier to wrap the whole function in "__cplusplus" and put it in the same 
file.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60485/new/

https://reviews.llvm.org/D60485



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


[PATCH] D60472: [AArch64][PowerPC][Driver] Allow setting crypto feature through -mcrypto for ARM/AArch64

2019-04-10 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

What's the motivation for this change, are you working towards common flags for 
both platforms? The current way to select crypto on AArch64 is 
'-march=armv8.x-a+crypto/nocrypto'. I can see that would be an issue if Power 
PC doesn't support that syntax, or doesn't have a specific crypto extension.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60472/new/

https://reviews.llvm.org/D60472



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


[PATCH] D60272: [Aarch64] Add v8.2-a half precision element extract intrinsics

2019-04-12 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett accepted this revision.
DavidSpickett added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60272/new/

https://reviews.llvm.org/D60272



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


[PATCH] D61668: [ARM] Fix the extensions implied by a cpu name

2019-05-08 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

LGTM but the use of "intrinsic" in the commit message is confusing. Do you mean 
feature/implied feature, as in "the implied features defined by"?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61668/new/

https://reviews.llvm.org/D61668



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


[PATCH] D64243: [NFC][AArch64] Fix vector vqtb[lx][1-4]_s8 operand

2019-07-09 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett accepted this revision.
DavidSpickett added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64243/new/

https://reviews.llvm.org/D64243



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


[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-05-22 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 265694.
DavidSpickett added a comment.

- Addressed comments from nickdesaulniers


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/program-path-priority.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -46,6 +46,8 @@
 config.substitutions.append(
 ('%src_include_dir', config.clang_src_dir + '/include'))
 
+config.substitutions.append(
+('%target_triple', config.target_triple))
 
 # Propagate path to symbolizer for ASan/MSan.
 llvm_config.with_system_environment(
Index: clang/test/Driver/program-path-priority.c
===
--- /dev/null
+++ clang/test/Driver/program-path-priority.c
@@ -0,0 +1,112 @@
+// Check the priority used when searching for tools
+// Names and locations are usually in this order:
+// -tool, tool, -tool
+// program path, PATH
+// (from highest to lowest priority)
+// A higher priority name found in a lower priority
+// location will win over a lower priority name in a
+// higher priority location.
+// Prefix dirs (added with -B) override the location,
+// so only name priority is accounted for, unless we fail to find
+// anything at all in the prefix.
+
+// Copy clang to a new dir which will be its
+// "program path" for these tests
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: cp %clang %t
+
+// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NO_NOTREAL_GCC %s
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
+// NO_NOTREAL_GCC-NOT: {{/|}}gcc
+
+// -gcc in program path is found
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+
+// -gcc on the PATH is found
+// RUN: mkdir -p %t/env
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: touch %t/env/notreal-none-elf-gcc
+// RUN: chmod +x %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
+// ENV_PATH_NOTREAL_GCC: env{{/|}}notreal-none-elf-gcc
+
+// -gcc in program path is preferred to one on the PATH
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC-NOT: env{{/|}}notreal-none-elf-gcc
+
+// On program path, -gcc is preferred to plain gcc
+// RUN: touch %t/gcc
+// RUN: chmod +x %t/gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
+// NOTREAL_GCC_PREFERRED-NOT: {{/|}}gcc
+
+// -gcc on the PATH is preferred to gcc in program path
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
+// NOTREAL_PATH_OVER_GCC_PROG: env{{/|}}notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: {{/|}}gcc
+
+// -gcc on the PATH is preferred to gcc on the PATH
+// RUN: rm %t/gcc
+// RUN: touch %t/env/gcc
+// RUN: chmod +x %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
+// NOTREAL_PATH_OVER_GCC_PATH: env{{/|}}notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: {{/|}}gcc
+
+// -gcc has lowest priority
+// RUN: touch %t/%target_triple-gcc
+// RUN: chmod +x %t/%target_triple-gcc
+
+// -gcc on PATH beats default triple in program path
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
+// DEFAULT_TRIPLE_GCC: env{{/|}}notreal-none-elf-gcc
+
+// plain gcc on PATH beats default triple in program path
+// RUN: rm %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
+// DEFAULT_TRIPLE_NO_NOTREAL: env{{/|}}gcc
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+
+// default triple only chosen when no others are present
+// RUN: rm %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_OTHERS %s
+// DEFAULT_TRIPLE_NO_OTHERS: -gcc
+// DEFAULT_TRIPLE_NO_OTHERS-NOT: notreal-none-elf-gcc
+// DEFAULT_TR

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-05-22 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Comments on cfe-dev 
(http://lists.llvm.org/pipermail/cfe-dev/2020-May/065432.html) also in favour 
of removing the default triple lookup. I tend to agree but think it makes more 
sense to land this first and address it in a follow up.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842



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


[PATCH] D82948: [Driver][ARM] Disable unsupported features when nofp arch extension is used

2020-07-21 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments.



Comment at: clang/lib/Driver/ToolChains/Arch/ARM.cpp:476
+// -mfpu=none, -march=armvX+nofp or -mcpu=X+nofp is *very* similar to
+// -mfloat-abi=soft, only that it should not disable MVE-I.
 Features.insert(Features.end(),

Why not disable MVE-I? I assume because it's integer only but then why does 
-mfloat-abi=soft disable it?

If possible add a regression test for this. In general a test like the bf16 
test below, but for all the listed extensions would help. Perhaps it makes more 
sense to add a driver test that looks for the "-" bits in the -### output 
instead of doing each extension on its own.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82948/new/

https://reviews.llvm.org/D82948



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


[PATCH] D82948: [Driver][ARM] Disable unsupported features when nofp arch extension is used

2020-07-22 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments.



Comment at: clang/lib/Driver/ToolChains/Arch/ARM.cpp:476
+// -mfpu=none, -march=armvX+nofp or -mcpu=X+nofp is *very* similar to
+// -mfloat-abi=soft, only that it should not disable MVE-I.
 Features.insert(Features.end(),

chill wrote:
> DavidSpickett wrote:
> > Why not disable MVE-I? I assume because it's integer only but then why does 
> > -mfloat-abi=soft disable it?
> > 
> > If possible add a regression test for this. In general a test like the bf16 
> > test below, but for all the listed extensions would help. Perhaps it makes 
> > more sense to add a driver test that looks for the "-" bits in the 
> > -### output instead of doing each extension on its own.
> > Why not disable MVE-I?
> 
> After MVE, "FPU" registers are a separate entity from the FPU.
> 
> `-mfpu=none`/`+nofp` disable the FPU. MVE-I does not require an FPU.
> `-mfloat-abi=soft` disables both the FPU instructions and the FPU registers.
> MVE-I requires "FPU" registers.
> 
> It's possible to define different semantics, but this is the one we agreed 
> with GCC.
Got it. @vhscampos  can you add that to the comment?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82948/new/

https://reviews.llvm.org/D82948



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


[PATCH] D82948: [Driver][ARM] Disable unsupported features when nofp arch extension is used

2020-07-23 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett marked an inline comment as done.
DavidSpickett added a comment.

LGTM, I'll let @chill give the final word.




Comment at: clang/lib/Driver/ToolChains/Arch/ARM.cpp:476
+// -mfpu=none, -march=armvX+nofp or -mcpu=X+nofp is *very* similar to
+// -mfloat-abi=soft, only that it should not disable MVE-I.
 Features.insert(Features.end(),

DavidSpickett wrote:
> chill wrote:
> > DavidSpickett wrote:
> > > Why not disable MVE-I? I assume because it's integer only but then why 
> > > does -mfloat-abi=soft disable it?
> > > 
> > > If possible add a regression test for this. In general a test like the 
> > > bf16 test below, but for all the listed extensions would help. Perhaps it 
> > > makes more sense to add a driver test that looks for the "-" bits in 
> > > the -### output instead of doing each extension on its own.
> > > Why not disable MVE-I?
> > 
> > After MVE, "FPU" registers are a separate entity from the FPU.
> > 
> > `-mfpu=none`/`+nofp` disable the FPU. MVE-I does not require an FPU.
> > `-mfloat-abi=soft` disables both the FPU instructions and the FPU registers.
> > MVE-I requires "FPU" registers.
> > 
> > It's possible to define different semantics, but this is the one we agreed 
> > with GCC.
> Got it. @vhscampos  can you add that to the comment?
Thanks, lgtm.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82948/new/

https://reviews.llvm.org/D82948



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


[PATCH] D77540: [PATCH] [ARM]: Armv8.6-a Matrix Mul Asm and Intrinsics Support

2020-04-08 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments.



Comment at: clang/lib/Basic/Targets/AArch64.cpp:284
+  if (HasMatMul)
+Builder.defineMacro("__ARM_FEATURE_MATMUL_INT8", "1");
+

I don't see specific tests for this #define



Comment at: clang/lib/Basic/Targets/AArch64.h:39
   bool HasTME;
+  unsigned HasMatMul;
 

Why is this feature a number for AArch64, does >1 mean something?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77540/new/

https://reviews.llvm.org/D77540



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


[PATCH] D77875: [ARM] Armv8.6-a Matrix Mul cmd line support

2020-04-14 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a reviewer: DavidSpickett.
DavidSpickett added a comment.

> Note: +f32mm and +f64mm are optional and so have to be enabled by default

I think I know what you mean, but "and so are not enabled by default" would be 
clearer.

Also to double check, does f64mm imply f32mm? (not sure if there's an updated 
ARMARM yet that would tell me that)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77875/new/

https://reviews.llvm.org/D77875



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


[PATCH] D77875: [ARM] Armv8.6-a Matrix Mul cmd line support

2020-04-14 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Or in other words, does amrv8.6-a+sve imply +f32mm *and* +f64mm?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77875/new/

https://reviews.llvm.org/D77875



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


[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-06-15 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 270716.
DavidSpickett added a comment.

Address comments from MaskRay.

- Use triple slash for actual comments
- symlink clang, don't run test on Windows
- Merged some commands onto one line e.g. touch/chmod


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/program-path-priority.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -46,6 +46,8 @@
 config.substitutions.append(
 ('%src_include_dir', config.clang_src_dir + '/include'))
 
+config.substitutions.append(
+('%target_triple', config.target_triple))
 
 # Propagate path to symbolizer for ASan/MSan.
 llvm_config.with_system_environment(
Index: clang/test/Driver/program-path-priority.c
===
--- /dev/null
+++ clang/test/Driver/program-path-priority.c
@@ -0,0 +1,106 @@
+/// Don't create symlinks on Windows
+// UNSUPPORTED: system-windows
+
+/// Check the priority used when searching for tools
+/// Names and locations are usually in this order:
+/// -tool, tool, -tool
+/// program path, PATH
+/// (from highest to lowest priority)
+/// A higher priority name found in a lower priority
+/// location will win over a lower priority name in a
+/// higher priority location.
+/// Prefix dirs (added with -B) override the location,
+/// so only name priority is accounted for, unless we fail to find
+/// anything at all in the prefix.
+
+/// Copy clang to a new dir which will be its
+/// "program path" for these tests
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: ln -s %clang %t/clang
+
+/// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=NO_NOTREAL_GCC %s
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
+// NO_NOTREAL_GCC-NOT: /gcc
+
+/// -gcc in program path is found
+// RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+
+/// -gcc on the PATH is found
+// RUN: mkdir -p %t/env
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+
+/// -gcc in program path is preferred to one on the PATH
+// RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+
+/// On program path, -gcc is preferred to plain gcc
+// RUN: touch %t/gcc && chmod +x %t/gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
+// NOTREAL_GCC_PREFERRED-NOT: /gcc
+
+/// -gcc on the PATH is preferred to gcc in program path
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+
+/// -gcc on the PATH is preferred to gcc on the PATH
+// RUN: rm %t/gcc
+// RUN: touch %t/env/gcc && chmod +x %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+
+/// -gcc has lowest priority so -gcc
+/// on PATH beats default triple in program path
+// RUN: touch %t/%target_triple-gcc && chmod +x %t/%target_triple-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
+// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc
+
+/// plain gcc on PATH beats default triple in program path
+// RUN: rm %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
+// DEFAULT_TRIPLE_NO_NOTREAL: env/gcc
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+
+/// default triple only chosen when no others are present
+// RUN: rm %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=DEFAULT_TRIP

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-06-15 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett marked 4 inline comments as done.
DavidSpickett added inline comments.



Comment at: clang/test/Driver/program-path-priority.c:20
+// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NO_NOTREAL_GCC %s

MaskRay wrote:
> Place `\` on the previous line to emphasize it has a continuation. Add two 
> spaces before the continuation line to emphasize it is a continuation line.
I think I've done this but I didn't quite understand the `\` part of the 
comment. The first lines already have one.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842



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


[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-06-17 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett marked 2 inline comments as done.
DavidSpickett added inline comments.



Comment at: clang/test/Driver/program-path-priority.c:22
+/// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN:   | FileCheck --check-prefix=NO_NOTREAL_GCC %s

MaskRay wrote:
> Nit: this may be the preference of some reviewers, but they tend to favor `| 
> \` in the end of the last line. `|` makes it clear that it has a continuation 
> line (and if you type the first line with `|`, your shell will wait for the 
> next line)
Ah now I understand. Yes that looks clearer so I've done that too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842



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


[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-06-17 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 271345.
DavidSpickett added a comment.

Moved pipe (|) to end of the first lines to
make it clearer that there's a continuation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/program-path-priority.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -46,6 +46,8 @@
 config.substitutions.append(
 ('%src_include_dir', config.clang_src_dir + '/include'))
 
+config.substitutions.append(
+('%target_triple', config.target_triple))
 
 # Propagate path to symbolizer for ASan/MSan.
 llvm_config.with_system_environment(
Index: clang/test/Driver/program-path-priority.c
===
--- /dev/null
+++ clang/test/Driver/program-path-priority.c
@@ -0,0 +1,106 @@
+/// Don't create symlinks on Windows
+// UNSUPPORTED: system-windows
+
+/// Check the priority used when searching for tools
+/// Names and locations are usually in this order:
+/// -tool, tool, -tool
+/// program path, PATH
+/// (from highest to lowest priority)
+/// A higher priority name found in a lower priority
+/// location will win over a lower priority name in a
+/// higher priority location.
+/// Prefix dirs (added with -B) override the location,
+/// so only name priority is accounted for, unless we fail to find
+/// anything at all in the prefix.
+
+/// Copy clang to a new dir which will be its
+/// "program path" for these tests
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: ln -s %clang %t/clang
+
+/// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=NO_NOTREAL_GCC %s
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
+// NO_NOTREAL_GCC-NOT: /gcc
+
+/// -gcc in program path is found
+// RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+
+/// -gcc on the PATH is found
+// RUN: mkdir -p %t/env
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+
+/// -gcc in program path is preferred to one on the PATH
+// RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+
+/// On program path, -gcc is preferred to plain gcc
+// RUN: touch %t/gcc && chmod +x %t/gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
+// NOTREAL_GCC_PREFERRED-NOT: /gcc
+
+/// -gcc on the PATH is preferred to gcc in program path
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+
+/// -gcc on the PATH is preferred to gcc on the PATH
+// RUN: rm %t/gcc
+// RUN: touch %t/env/gcc && chmod +x %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+
+/// -gcc has lowest priority so -gcc
+/// on PATH beats default triple in program path
+// RUN: touch %t/%target_triple-gcc && chmod +x %t/%target_triple-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
+// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc
+
+/// plain gcc on PATH beats default triple in program path
+// RUN: rm %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
+// DEFAULT_TRIPLE_NO_NOTREAL: env/gcc
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+
+/// default triple only chosen when no others are present
+// RUN: rm %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
+// RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_NO_OTHERS %s
+// DEFAULT_TRIPLE_NO_OTHERS: -gcc
+// DEFAULT_TRIPLE_NO_OTHERS

[PATCH] D82948: [Driver][ARM] Disable unsupported features when nofp arch extension is used

2020-07-02 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments.



Comment at: clang/lib/Driver/ToolChains/Arch/ARM.cpp:296
+return llvm::any_of(
+Split, [](const StringRef &Extension) { return Extension == "nofp"; });
+  };

I would check what this does:
$ ./bin/clang -target arm-arm-none-eabi /tmp/test.c -c -march=armv8.1-a+nofp+fp 
-###

I'm not sure if by this point we've resolved "+nofp+fp" to simply "+fp". 
(perhaps you'd end up with a bunch of "-" followed by the same as 
"+". Either way I'd expect +fp to win.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82948/new/

https://reviews.llvm.org/D82948



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


[PATCH] D83055: [clang][Driver] Fix tool path priority test failure

2020-07-02 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This test can fail when the path of the build
includes the strings we're checking for.
E.g "/gcc" is found in ".../gcc_7.3.0/..."

To correct this look for '"' on the end of all
matches. So that we only match the end of paths
printed by clang -###.
(which would be ".../gcc_7.3.0/.../gcc" for the
example)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83055

Files:
  clang/test/Driver/program-path-priority.c

Index: clang/test/Driver/program-path-priority.c
===
--- clang/test/Driver/program-path-priority.c
+++ clang/test/Driver/program-path-priority.c
@@ -13,6 +13,11 @@
 /// so only name priority is accounted for, unless we fail to find
 /// anything at all in the prefix.
 
+/// Note: All matches are expected to be at the end of file paths.
+/// So we match " on the end to account for build systems that
+/// put the name of the compiler in the build path.
+/// E.g. /build/gcc_X.Y.Z/0/...
+
 /// Symlink clang to a new dir which will be its
 /// "program path" for these tests
 // RUN: rm -rf %t && mkdir -p %t
@@ -21,14 +26,14 @@
 /// No gccs at all, nothing is found
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NO_NOTREAL_GCC %s
-// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
-// NO_NOTREAL_GCC-NOT: /gcc
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc"
+// NO_NOTREAL_GCC-NOT: /gcc"
 
 /// -gcc in program path is found
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
-// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc"
 
 /// -gcc on the PATH is found
 // RUN: mkdir -p %t/env
@@ -36,36 +41,36 @@
 // RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
-// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc"
 
 /// -gcc in program path is preferred to one on the PATH
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
-// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
-// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc"
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc"
 
 /// On program path, -gcc is preferred to plain gcc
 // RUN: touch %t/gcc && chmod +x %t/gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
-// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
-// NOTREAL_GCC_PREFERRED-NOT: /gcc
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc"
+// NOTREAL_GCC_PREFERRED-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc in program path
 // RUN: rm %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
-// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc on the PATH
 // RUN: rm %t/gcc
 // RUN: touch %t/env/gcc && chmod +x %t/env/gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
-// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc"
 
 /// -gcc has lowest priority so -gcc
 /// on PATH beats default triple in program path
@@ -75,22 +80,22 @@
 // RUN: touch %t/$DEFAULT_TRIPLE-gcc && chmod +x %t/$DEFAULT_TRIPLE-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
-// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc
+// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc"
 
 /// plain gcc on PATH beats default triple in program path
 // RUN: rm %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
-// DEFAULT_TRIPLE_NO_NOTREAL: env/gcc
-// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+// DEFAULT_TRIPLE_NO_NOTREAL: env/gcc"
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc"
 
 /// default triple only chosen when no others are present
 // RUN: rm %t/env/gcc
 // RUN: env "PATH=%t/env/" %t/

[PATCH] D83055: [clang][Driver] Fix tool path priority test failure

2020-07-02 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 275138.
DavidSpickett added a comment.

- Added check for alternate gcc names in the first test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055

Files:
  clang/test/Driver/program-path-priority.c

Index: clang/test/Driver/program-path-priority.c
===
--- clang/test/Driver/program-path-priority.c
+++ clang/test/Driver/program-path-priority.c
@@ -13,6 +13,11 @@
 /// so only name priority is accounted for, unless we fail to find
 /// anything at all in the prefix.
 
+/// Note: All matches are expected to be at the end of file paths.
+/// So we match " on the end to account for build systems that
+/// put the name of the compiler in the build path.
+/// E.g. /build/gcc_X.Y.Z/0/...
+
 /// Symlink clang to a new dir which will be its
 /// "program path" for these tests
 // RUN: rm -rf %t && mkdir -p %t
@@ -21,14 +26,18 @@
 /// No gccs at all, nothing is found
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NO_NOTREAL_GCC %s
-// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
-// NO_NOTREAL_GCC-NOT: /gcc
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc"
+/// Some systems will have "gcc-x.y.z" so for this first check
+/// make sure we don't find "gcc" or "gcc-x.y.z". If we do find either
+/// then there is no point continuing as this copy of clang is not
+/// isolated as we expected.
+// NO_NOTREAL_GCC-NOT: {{\/gcc[^\/]*"}}
 
 /// -gcc in program path is found
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
-// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc"
 
 /// -gcc on the PATH is found
 // RUN: mkdir -p %t/env
@@ -36,36 +45,36 @@
 // RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
-// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc"
 
 /// -gcc in program path is preferred to one on the PATH
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
-// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
-// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc"
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc"
 
 /// On program path, -gcc is preferred to plain gcc
 // RUN: touch %t/gcc && chmod +x %t/gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
-// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
-// NOTREAL_GCC_PREFERRED-NOT: /gcc
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc"
+// NOTREAL_GCC_PREFERRED-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc in program path
 // RUN: rm %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
-// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc on the PATH
 // RUN: rm %t/gcc
 // RUN: touch %t/env/gcc && chmod +x %t/env/gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
-// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc"
 
 /// -gcc has lowest priority so -gcc
 /// on PATH beats default triple in program path
@@ -75,22 +84,22 @@
 // RUN: touch %t/$DEFAULT_TRIPLE-gcc && chmod +x %t/$DEFAULT_TRIPLE-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
-// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc
+// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc"
 
 /// plain gcc on PATH beats default triple in program path
 // RUN: rm %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
-// DEFAULT_TRIPLE_NO_NOTREAL: env/gcc
-// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+// DEFAULT_TRIPLE_NO_NOTREAL: env/gcc"
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc"
 
 /// default triple only chosen when no others are present
 // RUN: rm %t/en

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-07-07 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

I saw similar behaviour on Mac OSX and fixed that in the reland. 
(https://reviews.llvm.org/rGd6efc9811646edbfe13f06c2676fb469f1c155b1)

Are you still seeing a failure with that applied?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842



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


[PATCH] D83055: [clang][Driver] Fix tool path priority test failure

2020-07-07 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 275950.
DavidSpickett added a comment.

- Removed \ from regex, not needed for POSIX syntax.
- Reflowed text in commit description.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055

Files:
  clang/test/Driver/program-path-priority.c

Index: clang/test/Driver/program-path-priority.c
===
--- clang/test/Driver/program-path-priority.c
+++ clang/test/Driver/program-path-priority.c
@@ -13,6 +13,11 @@
 /// so only name priority is accounted for, unless we fail to find
 /// anything at all in the prefix.
 
+/// Note: All matches are expected to be at the end of file paths.
+/// So we match " on the end to account for build systems that
+/// put the name of the compiler in the build path.
+/// E.g. /build/gcc_X.Y.Z/0/...
+
 /// Symlink clang to a new dir which will be its
 /// "program path" for these tests
 // RUN: rm -rf %t && mkdir -p %t
@@ -21,14 +26,18 @@
 /// No gccs at all, nothing is found
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NO_NOTREAL_GCC %s
-// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
-// NO_NOTREAL_GCC-NOT: /gcc
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc"
+/// Some systems will have "gcc-x.y.z" so for this first check
+/// make sure we don't find "gcc" or "gcc-x.y.z". If we do find either
+/// then there is no point continuing as this copy of clang is not
+/// isolated as we expected.
+// NO_NOTREAL_GCC-NOT: {{/gcc[^/]*"}}
 
 /// -gcc in program path is found
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
-// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc"
 
 /// -gcc on the PATH is found
 // RUN: mkdir -p %t/env
@@ -36,36 +45,36 @@
 // RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
-// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc"
 
 /// -gcc in program path is preferred to one on the PATH
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
-// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
-// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc"
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc"
 
 /// On program path, -gcc is preferred to plain gcc
 // RUN: touch %t/gcc && chmod +x %t/gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
-// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
-// NOTREAL_GCC_PREFERRED-NOT: /gcc
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc"
+// NOTREAL_GCC_PREFERRED-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc in program path
 // RUN: rm %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
-// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc on the PATH
 // RUN: rm %t/gcc
 // RUN: touch %t/env/gcc && chmod +x %t/env/gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
-// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc"
 
 /// -gcc has lowest priority so -gcc
 /// on PATH beats default triple in program path
@@ -75,22 +84,22 @@
 // RUN: touch %t/$DEFAULT_TRIPLE-gcc && chmod +x %t/$DEFAULT_TRIPLE-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
-// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc
+// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc"
 
 /// plain gcc on PATH beats default triple in program path
 // RUN: rm %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
-// DEFAULT_TRIPLE_NO_NOTREAL: env/gcc
-// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+// DEFAULT_TRIPLE_NO_NOTREAL: env/gcc"
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc"
 
 /// default triple only chosen when no oth

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-07-08 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Right, I see the issue.

The code that gets the default triple name 
(https://reviews.llvm.org/D13340?id=36227#inline-108606) looks up the one you 
have in cmake, not the actual default which you get in --version. We could 
"fix" this by doing so when we make the tool name as well, but this breaks 
whatever mips toolchain was using that. (their tools won't be 
mips-unknown-elf-)

So yes it looks up powerpc64le-linux-gnu but shows 
powerpc64le-unknown-linux-gnu. Can't go back to using cmake's value because on 
Mac OS, cmake has x86_64-darwin, clang has x86_64-darwin. Writing to 
both is a short term option so I will try that and fold it into 
https://reviews.llvm.org/D83055. (will add you on review once I update it)

(this whole default triple lookup should probably go but I'd really like to do 
that in its own commit)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842



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


[PATCH] D83055: [clang][Driver] Fix tool path priority test failure

2020-07-08 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 276406.
DavidSpickett added a subscriber: stevewan.
DavidSpickett added a comment.

- Write to cmake and clang's default triple to also fix failure reported by 
@stevewan.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055

Files:
  clang/test/Driver/program-path-priority.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -46,6 +46,8 @@
 config.substitutions.append(
 ('%src_include_dir', config.clang_src_dir + '/include'))
 
+config.substitutions.append(
+('%target_triple', config.target_triple))
 
 # Propagate path to symbolizer for ASan/MSan.
 llvm_config.with_system_environment(
Index: clang/test/Driver/program-path-priority.c
===
--- clang/test/Driver/program-path-priority.c
+++ clang/test/Driver/program-path-priority.c
@@ -13,6 +13,11 @@
 /// so only name priority is accounted for, unless we fail to find
 /// anything at all in the prefix.
 
+/// Note: All matches are expected to be at the end of file paths.
+/// So we match " on the end to account for build systems that
+/// put the name of the compiler in the build path.
+/// E.g. /build/gcc_X.Y.Z/0/...
+
 /// Symlink clang to a new dir which will be its
 /// "program path" for these tests
 // RUN: rm -rf %t && mkdir -p %t
@@ -21,14 +26,18 @@
 /// No gccs at all, nothing is found
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NO_NOTREAL_GCC %s
-// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
-// NO_NOTREAL_GCC-NOT: /gcc
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc"
+/// Some systems will have "gcc-x.y.z" so for this first check
+/// make sure we don't find "gcc" or "gcc-x.y.z". If we do find either
+/// then there is no point continuing as this copy of clang is not
+/// isolated as we expected.
+// NO_NOTREAL_GCC-NOT: {{/gcc[^/]*"}}
 
 /// -gcc in program path is found
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
-// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc"
 
 /// -gcc on the PATH is found
 // RUN: mkdir -p %t/env
@@ -36,74 +45,85 @@
 // RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
-// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc"
 
 /// -gcc in program path is preferred to one on the PATH
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
-// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
-// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc"
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc"
 
 /// On program path, -gcc is preferred to plain gcc
 // RUN: touch %t/gcc && chmod +x %t/gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
-// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
-// NOTREAL_GCC_PREFERRED-NOT: /gcc
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc"
+// NOTREAL_GCC_PREFERRED-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc in program path
 // RUN: rm %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
-// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc on the PATH
 // RUN: rm %t/gcc
 // RUN: touch %t/env/gcc && chmod +x %t/env/gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
-// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc"
+
+/// We cannot trust clang --version, or cmake's LLVM_DEFAULT_TARGET_TRIPLE
+/// to give us the one and only default triple.
+/// Can't trust cmake because on Darwin, triples have a verison appended to them.
+/// (and clang uses the versioned string to search)
+/// Can't trust --version because it will pad 3 item triples to 4 e.g.
+/// powerpc64le-linux-gnu -> powerpc64le-unkn

[PATCH] D83055: [clang][Driver] Fix tool path priority test failures

2020-07-08 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

For the record my logic here is that I could change the tool names to use the 
same name as --version. However that will break whatever mips toolchain needed 
this code in the first place. 
(https://reviews.llvm.org/D13340?id=36227#inline-108606)

This default triple lookup code had some support to be removed anyway, so I'd 
rather patch up this test first before doing so. So that it's easier to roll 
back if there are still users of it. Having tests of the existing behaviour is 
a good thing and I don't think writing to both potential default triples 
undermines that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055



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


[PATCH] D83055: [clang][Driver] Fix tool path priority test failures

2020-07-09 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 276671.
DavidSpickett added a comment.

- Updated rm/mv command lines to account for $DEFAULT_TRIPLE being the same as 
%target_triple.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055

Files:
  clang/test/Driver/program-path-priority.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -46,6 +46,8 @@
 config.substitutions.append(
 ('%src_include_dir', config.clang_src_dir + '/include'))
 
+config.substitutions.append(
+('%target_triple', config.target_triple))
 
 # Propagate path to symbolizer for ASan/MSan.
 llvm_config.with_system_environment(
Index: clang/test/Driver/program-path-priority.c
===
--- clang/test/Driver/program-path-priority.c
+++ clang/test/Driver/program-path-priority.c
@@ -13,6 +13,11 @@
 /// so only name priority is accounted for, unless we fail to find
 /// anything at all in the prefix.
 
+/// Note: All matches are expected to be at the end of file paths.
+/// So we match " on the end to account for build systems that
+/// put the name of the compiler in the build path.
+/// E.g. /build/gcc_X.Y.Z/0/...
+
 /// Symlink clang to a new dir which will be its
 /// "program path" for these tests
 // RUN: rm -rf %t && mkdir -p %t
@@ -21,14 +26,18 @@
 /// No gccs at all, nothing is found
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NO_NOTREAL_GCC %s
-// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
-// NO_NOTREAL_GCC-NOT: /gcc
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc"
+/// Some systems will have "gcc-x.y.z" so for this first check
+/// make sure we don't find "gcc" or "gcc-x.y.z". If we do find either
+/// then there is no point continuing as this copy of clang is not
+/// isolated as we expected.
+// NO_NOTREAL_GCC-NOT: {{/gcc[^/]*"}}
 
 /// -gcc in program path is found
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
-// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc"
 
 /// -gcc on the PATH is found
 // RUN: mkdir -p %t/env
@@ -36,74 +45,89 @@
 // RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
-// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc"
 
 /// -gcc in program path is preferred to one on the PATH
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
-// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
-// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc"
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc"
 
 /// On program path, -gcc is preferred to plain gcc
 // RUN: touch %t/gcc && chmod +x %t/gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
-// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
-// NOTREAL_GCC_PREFERRED-NOT: /gcc
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc"
+// NOTREAL_GCC_PREFERRED-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc in program path
 // RUN: rm %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
-// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc on the PATH
 // RUN: rm %t/gcc
 // RUN: touch %t/env/gcc && chmod +x %t/env/gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
-// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc"
+
+/// We cannot trust clang --version, or cmake's LLVM_DEFAULT_TARGET_TRIPLE
+/// to give us the one and only default triple.
+/// Can't trust cmake because on Darwin, triples have a verison appended to them.
+/// (and clang uses the versioned string to search)
+/// Can't trust --version because it will pad 3 item triples to 4 e.g.
+/// powerpc64le-linux-gnu -> powerpc64le-unknown-linux-gnu
+/// (and clang uses t

[PATCH] D83055: [clang][Driver] Fix tool path priority test failures

2020-07-10 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 276952.
DavidSpickett added a comment.

- mv with stderr redirected instead of using non standard file -E flag


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055

Files:
  clang/test/Driver/program-path-priority.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -46,6 +46,8 @@
 config.substitutions.append(
 ('%src_include_dir', config.clang_src_dir + '/include'))
 
+config.substitutions.append(
+('%target_triple', config.target_triple))
 
 # Propagate path to symbolizer for ASan/MSan.
 llvm_config.with_system_environment(
Index: clang/test/Driver/program-path-priority.c
===
--- clang/test/Driver/program-path-priority.c
+++ clang/test/Driver/program-path-priority.c
@@ -13,6 +13,11 @@
 /// so only name priority is accounted for, unless we fail to find
 /// anything at all in the prefix.
 
+/// Note: All matches are expected to be at the end of file paths.
+/// So we match " on the end to account for build systems that
+/// put the name of the compiler in the build path.
+/// E.g. /build/gcc_X.Y.Z/0/...
+
 /// Symlink clang to a new dir which will be its
 /// "program path" for these tests
 // RUN: rm -rf %t && mkdir -p %t
@@ -21,14 +26,18 @@
 /// No gccs at all, nothing is found
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NO_NOTREAL_GCC %s
-// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
-// NO_NOTREAL_GCC-NOT: /gcc
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc"
+/// Some systems will have "gcc-x.y.z" so for this first check
+/// make sure we don't find "gcc" or "gcc-x.y.z". If we do find either
+/// then there is no point continuing as this copy of clang is not
+/// isolated as we expected.
+// NO_NOTREAL_GCC-NOT: {{/gcc[^/]*"}}
 
 /// -gcc in program path is found
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
-// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc"
 
 /// -gcc on the PATH is found
 // RUN: mkdir -p %t/env
@@ -36,74 +45,87 @@
 // RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
-// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc"
 
 /// -gcc in program path is preferred to one on the PATH
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
-// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
-// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc"
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc"
 
 /// On program path, -gcc is preferred to plain gcc
 // RUN: touch %t/gcc && chmod +x %t/gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
-// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
-// NOTREAL_GCC_PREFERRED-NOT: /gcc
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc"
+// NOTREAL_GCC_PREFERRED-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc in program path
 // RUN: rm %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
-// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc on the PATH
 // RUN: rm %t/gcc
 // RUN: touch %t/env/gcc && chmod +x %t/env/gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
-// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc"
+
+/// We cannot trust clang --version, or cmake's LLVM_DEFAULT_TARGET_TRIPLE
+/// to give us the one and only default triple.
+/// Can't trust cmake because on Darwin, triples have a verison appended to them.
+/// (and clang uses the versioned string to search)
+/// Can't trust --version because it will pad 3 item triples to 4 e.g.
+/// powerpc64le-linux-gnu -> powerpc64le-unknown-linux-gnu
+/// (and clang uses the former to search)
+///

[PATCH] D83055: [clang][Driver] Fix tool path priority test failures

2020-07-10 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett marked 2 inline comments as done.
DavidSpickett added inline comments.



Comment at: clang/test/Driver/program-path-priority.c:117
+/// Check file exists first in case $DEFAULT_TRIPLE == %target_triple
+// RUN: file -E %t/$DEFAULT_TRIPLE-gcc 2>&1 > /dev/null && \
+// RUN:   mv %t/$DEFAULT_TRIPLE-gcc  %t/prefix || true

stevewan wrote:
> Maybe I'm not seeing something obvious here, but I'm not aware of the `file 
> -E` usage, and on Linux I got `file: invalid option -- 'E'`.
I was looking for a way to mimic [! -f ], which worked on the command 
line but not in a test. From my system's file:
-E  On filesystem errors (file not found etc), instead of handling the 
error as regu‐
 lar output as POSIX mandates and keep going, issue an error 
message and exit.

I didn't realise it was non-standard, so I've switched to mv || true with the 
error redirected so it won't confuse the verbose output.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055



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


[PATCH] D83055: [clang][Driver] Fix tool path priority test failures

2020-07-13 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 277344.
DavidSpickett marked an inline comment as done.
DavidSpickett added a comment.

- Use more standard 'test -f' command before 'mv's


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055

Files:
  clang/test/Driver/program-path-priority.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -46,6 +46,8 @@
 config.substitutions.append(
 ('%src_include_dir', config.clang_src_dir + '/include'))
 
+config.substitutions.append(
+('%target_triple', config.target_triple))
 
 # Propagate path to symbolizer for ASan/MSan.
 llvm_config.with_system_environment(
Index: clang/test/Driver/program-path-priority.c
===
--- clang/test/Driver/program-path-priority.c
+++ clang/test/Driver/program-path-priority.c
@@ -13,6 +13,11 @@
 /// so only name priority is accounted for, unless we fail to find
 /// anything at all in the prefix.
 
+/// Note: All matches are expected to be at the end of file paths.
+/// So we match " on the end to account for build systems that
+/// put the name of the compiler in the build path.
+/// E.g. /build/gcc_X.Y.Z/0/...
+
 /// Symlink clang to a new dir which will be its
 /// "program path" for these tests
 // RUN: rm -rf %t && mkdir -p %t
@@ -21,14 +26,18 @@
 /// No gccs at all, nothing is found
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NO_NOTREAL_GCC %s
-// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
-// NO_NOTREAL_GCC-NOT: /gcc
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc"
+/// Some systems will have "gcc-x.y.z" so for this first check
+/// make sure we don't find "gcc" or "gcc-x.y.z". If we do find either
+/// then there is no point continuing as this copy of clang is not
+/// isolated as we expected.
+// NO_NOTREAL_GCC-NOT: {{/gcc[^/]*"}}
 
 /// -gcc in program path is found
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
-// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc"
 
 /// -gcc on the PATH is found
 // RUN: mkdir -p %t/env
@@ -36,74 +45,89 @@
 // RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
-// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc"
 
 /// -gcc in program path is preferred to one on the PATH
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
-// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
-// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc"
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc"
 
 /// On program path, -gcc is preferred to plain gcc
 // RUN: touch %t/gcc && chmod +x %t/gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
-// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
-// NOTREAL_GCC_PREFERRED-NOT: /gcc
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc"
+// NOTREAL_GCC_PREFERRED-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc in program path
 // RUN: rm %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
-// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc on the PATH
 // RUN: rm %t/gcc
 // RUN: touch %t/env/gcc && chmod +x %t/env/gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
-// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc"
+
+/// We cannot trust clang --version, or cmake's LLVM_DEFAULT_TARGET_TRIPLE
+/// to give us the one and only default triple.
+/// Can't trust cmake because on Darwin, triples have a verison appended to them.
+/// (and clang uses the versioned string to search)
+/// Can't trust --version because it will pad 3 item triples to 4 e.g.
+/// powerpc64le-linux-gnu -> powerpc64le-unknown-linux-gnu
+/// (and clang use

[PATCH] D83055: [clang][Driver] Fix tool path priority test failures

2020-07-13 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett marked 2 inline comments as done.
DavidSpickett added inline comments.



Comment at: clang/test/Driver/program-path-priority.c:117
+/// Check file exists first in case $DEFAULT_TRIPLE == %target_triple
+// RUN: file -E %t/$DEFAULT_TRIPLE-gcc 2>&1 > /dev/null && \
+// RUN:   mv %t/$DEFAULT_TRIPLE-gcc  %t/prefix || true

stevewan wrote:
> DavidSpickett wrote:
> > stevewan wrote:
> > > Maybe I'm not seeing something obvious here, but I'm not aware of the 
> > > `file -E` usage, and on Linux I got `file: invalid option -- 'E'`.
> > I was looking for a way to mimic [! -f ], which worked on the command 
> > line but not in a test. From my system's file:
> > -E  On filesystem errors (file not found etc), instead of handling 
> > the error as regu‐
> >  lar output as POSIX mandates and keep going, issue an error 
> > message and exit.
> > 
> > I didn't realise it was non-standard, so I've switched to mv || true with 
> > the error redirected so it won't confuse the verbose output.
> I believe having just `mv || true` works, but I did like the idea of 
> pre-checking for the existence of the file, and the test is more robust with 
> the check. Is there a reason we wouldn't use `test -f` here?
Honestly it slipped my mind that  [ ] was the same as test. Updated to test && 
move || true which you're right is clearer.
(one will always fail if the two triples are the same but at least we're only 
hiding the error we expect, rather than all errors mv could have)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055



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


[PATCH] D83055: [clang][Driver] Fix tool path priority test failures

2020-07-15 Thread David Spickett via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
DavidSpickett marked an inline comment as done.
Closed by commit rGfe5912249efa: [clang][Driver] Fix tool path priority test 
failures (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83055/new/

https://reviews.llvm.org/D83055

Files:
  clang/test/Driver/program-path-priority.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -46,6 +46,8 @@
 config.substitutions.append(
 ('%src_include_dir', config.clang_src_dir + '/include'))
 
+config.substitutions.append(
+('%target_triple', config.target_triple))
 
 # Propagate path to symbolizer for ASan/MSan.
 llvm_config.with_system_environment(
Index: clang/test/Driver/program-path-priority.c
===
--- clang/test/Driver/program-path-priority.c
+++ clang/test/Driver/program-path-priority.c
@@ -13,6 +13,11 @@
 /// so only name priority is accounted for, unless we fail to find
 /// anything at all in the prefix.
 
+/// Note: All matches are expected to be at the end of file paths.
+/// So we match " on the end to account for build systems that
+/// put the name of the compiler in the build path.
+/// E.g. /build/gcc_X.Y.Z/0/...
+
 /// Symlink clang to a new dir which will be its
 /// "program path" for these tests
 // RUN: rm -rf %t && mkdir -p %t
@@ -21,14 +26,18 @@
 /// No gccs at all, nothing is found
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NO_NOTREAL_GCC %s
-// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
-// NO_NOTREAL_GCC-NOT: /gcc
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc"
+/// Some systems will have "gcc-x.y.z" so for this first check
+/// make sure we don't find "gcc" or "gcc-x.y.z". If we do find either
+/// then there is no point continuing as this copy of clang is not
+/// isolated as we expected.
+// NO_NOTREAL_GCC-NOT: {{/gcc[^/]*"}}
 
 /// -gcc in program path is found
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
-// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc"
 
 /// -gcc on the PATH is found
 // RUN: mkdir -p %t/env
@@ -36,74 +45,89 @@
 // RUN: touch %t/env/notreal-none-elf-gcc && chmod +x %t/env/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
-// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc"
 
 /// -gcc in program path is preferred to one on the PATH
 // RUN: touch %t/notreal-none-elf-gcc && chmod +x %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
-// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
-// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc"
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc"
 
 /// On program path, -gcc is preferred to plain gcc
 // RUN: touch %t/gcc && chmod +x %t/gcc
 // RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
-// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
-// NOTREAL_GCC_PREFERRED-NOT: /gcc
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc"
+// NOTREAL_GCC_PREFERRED-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc in program path
 // RUN: rm %t/notreal-none-elf-gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
-// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PROG: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc"
 
 /// -gcc on the PATH is preferred to gcc on the PATH
 // RUN: rm %t/gcc
 // RUN: touch %t/env/gcc && chmod +x %t/env/gcc
 // RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 | \
 // RUN:   FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
-// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc
-// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+// NOTREAL_PATH_OVER_GCC_PATH: env/notreal-none-elf-gcc"
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc"
+
+/// We cannot trust clang --version, or cmake's LLVM_DEFAULT_TARGET_TRIPLE
+/// to give us the one and only default triple.
+/// Can't trust cmake because on Darwin, triples have a verison appended to them.
+/// (and clang uses the versioned string to search)
+/// Can't trust --version because it will pad 3 item triples to 4 e.g.
+/// powerpc64le-linux-gn

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-06-22 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Committed but made a mistake with arc so it landed with the wrong diff number. 
In any case a failure on MacOS was reported so reverted while I investigate 
that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842



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


[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-06-25 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett closed this revision.
DavidSpickett added a comment.

Relanded as d6efc9811646edbfe13f06c2676fb469f1c155b1 
. Change 
was to get the default triple from clang itself, as on MacOS this can be 
different to the value you set via CMake.

Closing this review as the diff shown was committed as 
028571d60843cb87e2637ef69ee09090d4526c62 
 but 
wasn't closed automatically because I had the wrong diff link in the commit msg.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842



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


[PATCH] D78129: Add Marvell ThunderX3T110 support

2020-04-29 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments.



Comment at: clang/lib/Driver/ToolChains/Arch/AArch64.cpp:89
 CPU = llvm::sys::getHostCPUName();
-
   if (CPU == "generic") {

Remove stray change.



Comment at: llvm/include/llvm/Support/AArch64TargetParser.def:167
 AARCH64_CPU_NAME("thunderx2t99", ARMV8_1A, FK_CRYPTO_NEON_FP_ARMV8, false,
- (AArch64::AEK_NONE))
+ (AArch64::AEK_CRC | AEK_CRYPTO | AEK_FP | AEK_SIMD | AEK_LSE 
| AEK_RAND))
+AARCH64_CPU_NAME("thunderx3t110", ARMV8_3A, FK_CRYPTO_NEON_FP_ARMV8, false,

Is this change also correcting the options for the x2t99? I think that should 
be a separate patch if so.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78129/new/

https://reviews.llvm.org/D78129



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


[PATCH] D78129: Add Marvell ThunderX3T110 support

2020-04-29 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments.



Comment at: llvm/include/llvm/Support/AArch64TargetParser.def:168
+ (AArch64::AEK_CRC | AEK_CRYPTO | AEK_FP | AEK_SIMD | AEK_LSE 
| AEK_RAND))
+AARCH64_CPU_NAME("thunderx3t110", ARMV8_3A, FK_CRYPTO_NEON_FP_ARMV8, false,
+ (AArch64::AEK_CRC | AEK_CRYPTO | AEK_FP | AEK_SIMD | AEK_LSE 
| AEK_RAND | AArch64::AEK_PROFILE | AArch64::AEK_RAS))

Add a tests for this in llvm/unittests/Support/TargetParserTest.cpp (there are 
existing ones for "thunderx2t99").
Might need to update "NumAArch64CPUArchs" too.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78129/new/

https://reviews.llvm.org/D78129



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


[PATCH] D85118: [clang][AArch64] Correct return type of Neon vqmovun intrinsics

2020-08-03 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added subscribers: cfe-commits, danielkiss, kristof.beyls.
Herald added a project: clang.
DavidSpickett requested review of this revision.

Neon intrinsics vqmovunh_s16, vqmovuns_s32, vqmovund_s64
should have unsigned return types.

See 
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vqmovun

Fixes https://bugs.llvm.org/show_bug.cgi?id=46840


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85118

Files:
  clang/include/clang/Basic/arm_neon.td
  clang/test/CodeGen/aarch64-neon-intrinsics.c


Index: clang/test/CodeGen/aarch64-neon-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -14094,8 +14094,8 @@
 // CHECK:   [[VQMOVUNH_S16_I:%.*]] = call <8 x i8> 
@llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <8 x i8> [[VQMOVUNH_S16_I]], i64 0
 // CHECK:   ret i8 [[TMP1]]
-int8_t test_vqmovunh_s16(int16_t a) {
-  return (int8_t)vqmovunh_s16(a);
+uint8_t test_vqmovunh_s16(int16_t a) {
+  return (uint8_t)vqmovunh_s16(a);
 }
 
 // CHECK-LABEL: @test_vqmovuns_s32(
@@ -14103,15 +14103,15 @@
 // CHECK:   [[VQMOVUNS_S32_I:%.*]] = call <4 x i16> 
@llvm.aarch64.neon.sqxtun.v4i16(<4 x i32> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <4 x i16> [[VQMOVUNS_S32_I]], i64 0
 // CHECK:   ret i16 [[TMP1]]
-int16_t test_vqmovuns_s32(int32_t a) {
-  return (int16_t)vqmovuns_s32(a);
+uint16_t test_vqmovuns_s32(int32_t a) {
+  return (uint16_t)vqmovuns_s32(a);
 }
 
 // CHECK-LABEL: @test_vqmovund_s64(
 // CHECK:   [[VQMOVUND_S64_I:%.*]] = call i32 
@llvm.aarch64.neon.scalar.sqxtun.i32.i64(i64 %a)
 // CHECK:   ret i32 [[VQMOVUND_S64_I]]
-int32_t test_vqmovund_s64(int64_t a) {
-  return (int32_t)vqmovund_s64(a);
+uint32_t test_vqmovund_s64(int64_t a) {
+  return (uint32_t)vqmovund_s64(a);
 }
 
 // CHECK-LABEL: @test_vqmovnh_s16(
Index: clang/include/clang/Basic/arm_neon.td
===
--- clang/include/clang/Basic/arm_neon.td
+++ clang/include/clang/Basic/arm_neon.td
@@ -1498,7 +1498,7 @@
 
 

 // Scalar Signed Saturating Extract Unsigned Narrow
-def SCALAR_SQXTUN : SInst<"vqmovun", "(1<)1", "SsSiSl">;
+def SCALAR_SQXTUN : SInst<"vqmovun", "(U1<)1", "SsSiSl">;
 
 

 // Scalar Signed Saturating Extract Narrow


Index: clang/test/CodeGen/aarch64-neon-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -14094,8 +14094,8 @@
 // CHECK:   [[VQMOVUNH_S16_I:%.*]] = call <8 x i8> @llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <8 x i8> [[VQMOVUNH_S16_I]], i64 0
 // CHECK:   ret i8 [[TMP1]]
-int8_t test_vqmovunh_s16(int16_t a) {
-  return (int8_t)vqmovunh_s16(a);
+uint8_t test_vqmovunh_s16(int16_t a) {
+  return (uint8_t)vqmovunh_s16(a);
 }
 
 // CHECK-LABEL: @test_vqmovuns_s32(
@@ -14103,15 +14103,15 @@
 // CHECK:   [[VQMOVUNS_S32_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqxtun.v4i16(<4 x i32> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <4 x i16> [[VQMOVUNS_S32_I]], i64 0
 // CHECK:   ret i16 [[TMP1]]
-int16_t test_vqmovuns_s32(int32_t a) {
-  return (int16_t)vqmovuns_s32(a);
+uint16_t test_vqmovuns_s32(int32_t a) {
+  return (uint16_t)vqmovuns_s32(a);
 }
 
 // CHECK-LABEL: @test_vqmovund_s64(
 // CHECK:   [[VQMOVUND_S64_I:%.*]] = call i32 @llvm.aarch64.neon.scalar.sqxtun.i32.i64(i64 %a)
 // CHECK:   ret i32 [[VQMOVUND_S64_I]]
-int32_t test_vqmovund_s64(int64_t a) {
-  return (int32_t)vqmovund_s64(a);
+uint32_t test_vqmovund_s64(int64_t a) {
+  return (uint32_t)vqmovund_s64(a);
 }
 
 // CHECK-LABEL: @test_vqmovnh_s16(
Index: clang/include/clang/Basic/arm_neon.td
===
--- clang/include/clang/Basic/arm_neon.td
+++ clang/include/clang/Basic/arm_neon.td
@@ -1498,7 +1498,7 @@
 
 
 // Scalar Signed Saturating Extract Unsigned Narrow
-def SCALAR_SQXTUN : SInst<"vqmovun", "(1<)1", "SsSiSl">;
+def SCALAR_SQXTUN : SInst<"vqmovun", "(U1<)1", "SsSiSl">;
 
 
 // Scalar Signed Saturating Extract Narrow
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D85118: [clang][AArch64] Correct return type of Neon vqmovun intrinsics

2020-08-04 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

I was surprised too. Perhaps there is a way to write the test file such that 
any type mismatch is a warning and compile with -Werror (maybe a new file, the 
IR might get messy). I will spend some time looking into this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85118/new/

https://reviews.llvm.org/D85118

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


[PATCH] D85118: [clang][AArch64] Correct return type of Neon vqmovun intrinsics

2020-08-11 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Thanks for the pointer, I found more mistakes this way, e.g.: 
https://godbolt.org/z/f6n95z
(I don't think I can use  in a test but there is 
clang/test/Headers/x86-64-apple-macosx-types.cpp which uses is_same with it's 
own implementation so I can use/copy that)

There are ~5 more with incorrect return types so I'll add those to this patch 
as well as the return type check.
The arguments check is complicated by some intrinsics being macros but we can 
check the majority, I'll do that in a separate patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85118/new/

https://reviews.llvm.org/D85118

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


[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-05-13 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett marked an inline comment as done.
DavidSpickett added inline comments.



Comment at: clang/test/Driver/program-path-priority.c:72
+// -gcc has lowest priority
+// RUN: default_triple=$(%t/clang --version | grep -oP "(?<=Target:\s).*")
+// RUN: touch %t/${default_triple}-gcc

Pretty sure I'm stretching the limits here, probably not suitable for Windows. 
I hoped to be able to capture the default triple in a CHECK line, then use it 
in a following RUN line. (though thinking about how FileCheck works, that isn't 
possible)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842



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


[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-05-13 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
DavidSpickett added reviewers: rogfer01, ddunbar, chandlerc.
Herald added subscribers: cfe-commits, kristof.beyls.
Herald added a project: clang.
DavidSpickett marked an inline comment as done.
DavidSpickett added inline comments.



Comment at: clang/test/Driver/program-path-priority.c:72
+// -gcc has lowest priority
+// RUN: default_triple=$(%t/clang --version | grep -oP "(?<=Target:\s).*")
+// RUN: touch %t/${default_triple}-gcc

Pretty sure I'm stretching the limits here, probably not suitable for Windows. 
I hoped to be able to capture the default triple in a CHECK line, then use it 
in a following RUN line. (though thinking about how FileCheck works, that isn't 
possible)


As seen in:
https://bugs.llvm.org/show_bug.cgi?id=45693

When clang looks for a tool it has a set of
possible names for it, in priority order.
Previously it would look for these names in
the program path. Then look for all the names
in the PATH.

This means that aarch64-none-elf-gcc on the PATH
would lose to gcc in the program path.
(which was /usr/bin in the bug's case)

This changes that logic to search each name in both
possible locations, then move to the next name.
Which is more what you would expect to happen when
using a non default triple.

(-B prefixes maybe should follow this logic too,
but are not changed in this patch)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79842

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/program-path-priority.c

Index: clang/test/Driver/program-path-priority.c
===
--- /dev/null
+++ clang/test/Driver/program-path-priority.c
@@ -0,0 +1,113 @@
+// Check the priority used when searching for tools
+// Names and locations have a set priority. (highest to lowest)
+// -tool, tool, -tool
+// program path, PATH
+// Such that a more specific name found in the PATH
+// will win over a less specific name found in the program path
+// Prefix dirs (added with -B) overrride the location,
+// so only name priority is accounted for, unless we fail to find
+// anything at all in the prefix.
+
+// Copy clang to a new dir which will be its
+// "program path" for these tests
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: cp %clang %t
+
+// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NO_NOTREAL_GCC %s
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
+// NO_NOTREAL_GCC-NOT: /gcc
+
+// -gcc in program path is found
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+
+// -gcc on the PATH is found
+// RUN: mkdir -p %t/env
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: touch %t/env/notreal-none-elf-gcc
+// RUN: chmod +x %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+
+// -gcc in program path is preferred to one on the PATH
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+
+// On program path, -gcc is preferred to plain gcc
+// RUN: touch %t/gcc
+// RUN: chmod +x %t/gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
+// NOTREAL_GCC_PREFERRED-NOT: /gcc
+
+// -gcc on the PATH is preferred to gcc in program path
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
+// NOTREAL_PATH_OVER_GCC_PROG: /env/notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+
+// -gcc on the PATH is preferred to gcc on the PATH
+// RUN: rm %t/gcc
+// RUN: touch %t/env/gcc
+// RUN: chmod +x %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
+// NOTREAL_PATH_OVER_GCC_PATH: /env/notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+
+// -gcc has lowest priority
+// RUN: default_triple=$(%t/clang --version | grep -oP "(?<=Target:\s).*")
+// RUN: touch %t/${default_triple}-gcc
+// RUN: chmod +x %t/${default_triple}-gcc
+
+// -gcc on PATH beats default triple in program path
+// RUN: touch %t/${default_triple}-gcc
+// RUN: chmod +x %t/${default_triple}-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-05-13 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 263686.
DavidSpickett added a comment.

- Fix spelling
- Rework explanatory comments to be a bit clearer.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/program-path-priority.c

Index: clang/test/Driver/program-path-priority.c
===
--- /dev/null
+++ clang/test/Driver/program-path-priority.c
@@ -0,0 +1,115 @@
+// Check the priority used when searching for tools
+// Names and locations are usually in this order:
+// -tool, tool, -tool
+// program path, PATH
+// (from highest to lowest priority)
+// A higher priority name found in a lower priority
+// location will win over a lower priority name in a
+// higher priority location.
+// Prefix dirs (added with -B) override the location,
+// so only name priority is accounted for, unless we fail to find
+// anything at all in the prefix.
+
+// Copy clang to a new dir which will be its
+// "program path" for these tests
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: cp %clang %t
+
+// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NO_NOTREAL_GCC %s
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
+// NO_NOTREAL_GCC-NOT: /gcc
+
+// -gcc in program path is found
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+
+// -gcc on the PATH is found
+// RUN: mkdir -p %t/env
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: touch %t/env/notreal-none-elf-gcc
+// RUN: chmod +x %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
+// ENV_PATH_NOTREAL_GCC: env/notreal-none-elf-gcc
+
+// -gcc in program path is preferred to one on the PATH
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC-NOT: env/notreal-none-elf-gcc
+
+// On program path, -gcc is preferred to plain gcc
+// RUN: touch %t/gcc
+// RUN: chmod +x %t/gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
+// NOTREAL_GCC_PREFERRED-NOT: /gcc
+
+// -gcc on the PATH is preferred to gcc in program path
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
+// NOTREAL_PATH_OVER_GCC_PROG: /env/notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: /gcc
+
+// -gcc on the PATH is preferred to gcc on the PATH
+// RUN: rm %t/gcc
+// RUN: touch %t/env/gcc
+// RUN: chmod +x %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
+// NOTREAL_PATH_OVER_GCC_PATH: /env/notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: /gcc
+
+// -gcc has lowest priority
+// RUN: default_triple=$(%t/clang --version | grep -oP "(?<=Target:\s).*")
+// RUN: touch %t/${default_triple}-gcc
+// RUN: chmod +x %t/${default_triple}-gcc
+
+// -gcc on PATH beats default triple in program path
+// RUN: touch %t/${default_triple}-gcc
+// RUN: chmod +x %t/${default_triple}-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
+// DEFAULT_TRIPLE_GCC: env/notreal-none-elf-gcc
+
+// plain gcc on PATH beats default triple in program path
+// RUN: rm %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
+// DEFAULT_TRIPLE_NO_NOTREAL: env/gcc
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+
+// default triple only chosen when no others are present
+// RUN: rm %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_OTHERS %s
+// DEFAULT_TRIPLE_NO_OTHERS: -gcc
+// DEFAULT_TRIPLE_NO_OTHERS-NOT: notreal-none-elf-gcc
+// DEFAULT_TRIPLE_NO_OTHERS-NOT: /gcc
+
+// -B paths are searched separately so default triple will win
+// if put in one of those even if other paths have higher priority names
+// RUN: mkdir -p %t/prefix
+// RUN: mv %t/${default_triple}-gcc %t/prefix
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s -B 

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-05-13 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 263696.
DavidSpickett added a comment.

- Updated test to look for forward or backslash in expected file paths.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/program-path-priority.c

Index: clang/test/Driver/program-path-priority.c
===
--- /dev/null
+++ clang/test/Driver/program-path-priority.c
@@ -0,0 +1,115 @@
+// Check the priority used when searching for tools
+// Names and locations are usually in this order:
+// -tool, tool, -tool
+// program path, PATH
+// (from highest to lowest priority)
+// A higher priority name found in a lower priority
+// location will win over a lower priority name in a
+// higher priority location.
+// Prefix dirs (added with -B) override the location,
+// so only name priority is accounted for, unless we fail to find
+// anything at all in the prefix.
+
+// Copy clang to a new dir which will be its
+// "program path" for these tests
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: cp %clang %t
+
+// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NO_NOTREAL_GCC %s
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
+// NO_NOTREAL_GCC-NOT: {{/|}}gcc
+
+// -gcc in program path is found
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+
+// -gcc on the PATH is found
+// RUN: mkdir -p %t/env
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: touch %t/env/notreal-none-elf-gcc
+// RUN: chmod +x %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
+// ENV_PATH_NOTREAL_GCC: env{{/|}}notreal-none-elf-gcc
+
+// -gcc in program path is preferred to one on the PATH
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC-NOT: env{{/|}}notreal-none-elf-gcc
+
+// On program path, -gcc is preferred to plain gcc
+// RUN: touch %t/gcc
+// RUN: chmod +x %t/gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
+// NOTREAL_GCC_PREFERRED-NOT: {{/|}}gcc
+
+// -gcc on the PATH is preferred to gcc in program path
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
+// NOTREAL_PATH_OVER_GCC_PROG: env{{/|}}notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: {{/|}}gcc
+
+// -gcc on the PATH is preferred to gcc on the PATH
+// RUN: rm %t/gcc
+// RUN: touch %t/env/gcc
+// RUN: chmod +x %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
+// NOTREAL_PATH_OVER_GCC_PATH: env{{/|}}notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: {{/|}}gcc
+
+// -gcc has lowest priority
+// RUN: default_triple=$(%t/clang --version | grep -oP "(?<=Target:\s).*")
+// RUN: touch %t/${default_triple}-gcc
+// RUN: chmod +x %t/${default_triple}-gcc
+
+// -gcc on PATH beats default triple in program path
+// RUN: touch %t/${default_triple}-gcc
+// RUN: chmod +x %t/${default_triple}-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
+// DEFAULT_TRIPLE_GCC: env{{/|}}notreal-none-elf-gcc
+
+// plain gcc on PATH beats default triple in program path
+// RUN: rm %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
+// DEFAULT_TRIPLE_NO_NOTREAL: env{{/|}}gcc
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+
+// default triple only chosen when no others are present
+// RUN: rm %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_OTHERS %s
+// DEFAULT_TRIPLE_NO_OTHERS: -gcc
+// DEFAULT_TRIPLE_NO_OTHERS-NOT: notreal-none-elf-gcc
+// DEFAULT_TRIPLE_NO_OTHERS-NOT: {{/|}}gcc
+
+// -B paths are searched separately so default triple will win
+// if put in one of those even if other paths have higher priority names
+// RUN: mkdir -p %t/prefix
+// RUN: mv %t/${default_triple}-gcc %t/prefix
+// RUN: touch %t/notreal-none-elf-gcc
+// R

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-05-15 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 264187.
DavidSpickett added a comment.

Update from arc to hopefully run harbormaster builds again.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/program-path-priority.c

Index: clang/test/Driver/program-path-priority.c
===
--- /dev/null
+++ clang/test/Driver/program-path-priority.c
@@ -0,0 +1,115 @@
+// Check the priority used when searching for tools
+// Names and locations are usually in this order:
+// -tool, tool, -tool
+// program path, PATH
+// (from highest to lowest priority)
+// A higher priority name found in a lower priority
+// location will win over a lower priority name in a
+// higher priority location.
+// Prefix dirs (added with -B) override the location,
+// so only name priority is accounted for, unless we fail to find
+// anything at all in the prefix.
+
+// Copy clang to a new dir which will be its
+// "program path" for these tests
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: cp %clang %t
+
+// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NO_NOTREAL_GCC %s
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
+// NO_NOTREAL_GCC-NOT: {{/|}}gcc
+
+// -gcc in program path is found
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+
+// -gcc on the PATH is found
+// RUN: mkdir -p %t/env
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: touch %t/env/notreal-none-elf-gcc
+// RUN: chmod +x %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
+// ENV_PATH_NOTREAL_GCC: env{{/|}}notreal-none-elf-gcc
+
+// -gcc in program path is preferred to one on the PATH
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC-NOT: env{{/|}}notreal-none-elf-gcc
+
+// On program path, -gcc is preferred to plain gcc
+// RUN: touch %t/gcc
+// RUN: chmod +x %t/gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
+// NOTREAL_GCC_PREFERRED-NOT: {{/|}}gcc
+
+// -gcc on the PATH is preferred to gcc in program path
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
+// NOTREAL_PATH_OVER_GCC_PROG: env{{/|}}notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: {{/|}}gcc
+
+// -gcc on the PATH is preferred to gcc on the PATH
+// RUN: rm %t/gcc
+// RUN: touch %t/env/gcc
+// RUN: chmod +x %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
+// NOTREAL_PATH_OVER_GCC_PATH: env{{/|}}notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: {{/|}}gcc
+
+// -gcc has lowest priority
+// RUN: default_triple=$(%t/clang --version | grep -oP "(?<=Target:\s).*")
+// RUN: touch %t/${default_triple}-gcc
+// RUN: chmod +x %t/${default_triple}-gcc
+
+// -gcc on PATH beats default triple in program path
+// RUN: touch %t/${default_triple}-gcc
+// RUN: chmod +x %t/${default_triple}-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
+// DEFAULT_TRIPLE_GCC: env{{/|}}notreal-none-elf-gcc
+
+// plain gcc on PATH beats default triple in program path
+// RUN: rm %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
+// DEFAULT_TRIPLE_NO_NOTREAL: env{{/|}}gcc
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+
+// default triple only chosen when no others are present
+// RUN: rm %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_OTHERS %s
+// DEFAULT_TRIPLE_NO_OTHERS: -gcc
+// DEFAULT_TRIPLE_NO_OTHERS-NOT: notreal-none-elf-gcc
+// DEFAULT_TRIPLE_NO_OTHERS-NOT: {{/|}}gcc
+
+// -B paths are searched separately so default triple will win
+// if put in one of those even if other paths have higher priority names
+// RUN: mkdir -p %t/prefix
+// RUN: mv %t/${default_triple}-gcc %t/prefix
+// RUN: touch %t

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-05-15 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 264201.
DavidSpickett added a comment.

Added target triple as a substitution so the tests
don't have to grep for it.
(which I didn't manage to verify on Windows in any case)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/program-path-priority.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -46,6 +46,8 @@
 config.substitutions.append(
 ('%src_include_dir', config.clang_src_dir + '/include'))
 
+config.substitutions.append(
+('%target_triple', config.target_triple))
 
 # Propagate path to symbolizer for ASan/MSan.
 llvm_config.with_system_environment(
Index: clang/test/Driver/program-path-priority.c
===
--- /dev/null
+++ clang/test/Driver/program-path-priority.c
@@ -0,0 +1,112 @@
+// Check the priority used when searching for tools
+// Names and locations are usually in this order:
+// -tool, tool, -tool
+// program path, PATH
+// (from highest to lowest priority)
+// A higher priority name found in a lower priority
+// location will win over a lower priority name in a
+// higher priority location.
+// Prefix dirs (added with -B) override the location,
+// so only name priority is accounted for, unless we fail to find
+// anything at all in the prefix.
+
+// Copy clang to a new dir which will be its
+// "program path" for these tests
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: cp %clang %t
+
+// No gccs at all, nothing is found
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NO_NOTREAL_GCC %s
+// NO_NOTREAL_GCC-NOT: notreal-none-elf-gcc
+// NO_NOTREAL_GCC-NOT: {{/|}}gcc
+
+// -gcc in program path is found
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=PROG_PATH_NOTREAL_GCC %s
+// PROG_PATH_NOTREAL_GCC: notreal-none-elf-gcc
+
+// -gcc on the PATH is found
+// RUN: mkdir -p %t/env
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: touch %t/env/notreal-none-elf-gcc
+// RUN: chmod +x %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=ENV_PATH_NOTREAL_GCC %s
+// ENV_PATH_NOTREAL_GCC: env{{/|}}notreal-none-elf-gcc
+
+// -gcc in program path is preferred to one on the PATH
+// RUN: touch %t/notreal-none-elf-gcc
+// RUN: chmod +x %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=BOTH_NOTREAL_GCC %s
+// BOTH_NOTREAL_GCC: notreal-none-elf-gcc
+// BOTH_NOTREAL_GCC-NOT: env{{/|}}notreal-none-elf-gcc
+
+// On program path, -gcc is preferred to plain gcc
+// RUN: touch %t/gcc
+// RUN: chmod +x %t/gcc
+// RUN: env "PATH=" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_GCC_PREFERRED %s
+// NOTREAL_GCC_PREFERRED: notreal-none-elf-gcc
+// NOTREAL_GCC_PREFERRED-NOT: {{/|}}gcc
+
+// -gcc on the PATH is preferred to gcc in program path
+// RUN: rm %t/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PROG %s
+// NOTREAL_PATH_OVER_GCC_PROG: env{{/|}}notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PROG-NOT: {{/|}}gcc
+
+// -gcc on the PATH is preferred to gcc on the PATH
+// RUN: rm %t/gcc
+// RUN: touch %t/env/gcc
+// RUN: chmod +x %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOTREAL_PATH_OVER_GCC_PATH %s
+// NOTREAL_PATH_OVER_GCC_PATH: env{{/|}}notreal-none-elf-gcc
+// NOTREAL_PATH_OVER_GCC_PATH-NOT: {{/|}}gcc
+
+// -gcc has lowest priority
+// RUN: touch %t/%target_triple-gcc
+// RUN: chmod +x %t/%target_triple-gcc
+
+// -gcc on PATH beats default triple in program path
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_GCC %s
+// DEFAULT_TRIPLE_GCC: env{{/|}}notreal-none-elf-gcc
+
+// plain gcc on PATH beats default triple in program path
+// RUN: rm %t/env/notreal-none-elf-gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_NOTREAL %s
+// DEFAULT_TRIPLE_NO_NOTREAL: env{{/|}}gcc
+// DEFAULT_TRIPLE_NO_NOTREAL-NOT: -gcc
+
+// default triple only chosen when no others are present
+// RUN: rm %t/env/gcc
+// RUN: env "PATH=%t/env/" %t/clang -### -target notreal-none-elf %s 2>&1 \
+// RUN: | FileCheck --check-prefix=DEFAULT_TRIPLE_NO_OTHERS %s
+// DEFAULT

[PATCH] D79842: [clang][Driver] Correct tool search path priority

2020-05-15 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett marked an inline comment as done.
DavidSpickett added inline comments.



Comment at: clang/test/Driver/program-path-priority.c:72
+// -gcc has lowest priority
+// RUN: default_triple=$(%t/clang --version | grep -oP "(?<=Target:\s).*")
+// RUN: touch %t/${default_triple}-gcc

DavidSpickett wrote:
> Pretty sure I'm stretching the limits here, probably not suitable for 
> Windows. I hoped to be able to capture the default triple in a CHECK line, 
> then use it in a following RUN line. (though thinking about how FileCheck 
> works, that isn't possible)
Resolved by adding a substitution for the default triple.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79842/new/

https://reviews.llvm.org/D79842



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


[PATCH] D133109: [LLVM][ARM] Remove options for armv2, 2A, 3 and 3M

2022-09-01 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Fixes #57486

These pre v4 architectures are not specifically supported
by codegen. As demonstrated in the linked issue.

This removes the options and associated testing.

The Pre_v4 build attribute remains mainly because its absence
would be more confusing. It will not be used other than to
complete the list of build attributes as shown in the ABI.

https://github.com/ARM-software/abi-aa/blob/main/addenda32/addenda32.rst#3352the-target-related-attributes


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133109

Files:
  clang/docs/ReleaseNotes.rst
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/Support/ARMTargetParser.def
  llvm/lib/Support/ARMTargetParser.cpp
  llvm/lib/Target/ARM/ARM.td
  llvm/lib/Target/ARM/ARMSubtarget.h
  llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
  llvm/test/MC/ARM/directive-arch-armv2.s
  llvm/test/MC/ARM/directive-arch-armv2a.s
  llvm/test/MC/ARM/directive-arch-armv3.s
  llvm/test/MC/ARM/directive-arch-armv3m.s
  llvm/unittests/Support/TargetParserTest.cpp

Index: llvm/unittests/Support/TargetParserTest.cpp
===
--- llvm/unittests/Support/TargetParserTest.cpp
+++ llvm/unittests/Support/TargetParserTest.cpp
@@ -20,21 +20,20 @@
 
 namespace {
 const char *ARMArch[] = {
-"armv2",   "armv2a", "armv3",   "armv3m","armv4",
-"armv4t",  "armv5",  "armv5t",  "armv5e","armv5te",
-"armv5tej","armv6",  "armv6j",  "armv6k","armv6hl",
-"armv6t2", "armv6kz","armv6z",  "armv6zk",   "armv6-m",
-"armv6m",  "armv6sm","armv6s-m","armv7-a",   "armv7",
-"armv7a",  "armv7ve","armv7hl", "armv7l","armv7-r",
-"armv7r",  "armv7-m","armv7m",  "armv7k","armv7s",
-"armv7e-m","armv7em","armv8-a", "armv8", "armv8a",
-"armv8l",  "armv8.1-a",  "armv8.1a","armv8.2-a", "armv8.2a",
-"armv8.3-a",   "armv8.3a",   "armv8.4-a",   "armv8.4a",  "armv8.5-a",
-"armv8.5a","armv8.6-a",  "armv8.6a","armv8.7-a", "armv8.7a",
-"armv8.8-a",   "armv8.8a",   "armv8-r", "armv8r","armv8-m.base",
-"armv8m.base", "armv8-m.main",   "armv8m.main", "iwmmxt","iwmmxt2",
-"xscale",  "armv8.1-m.main", "armv9-a", "armv9", "armv9a",
-"armv9.1-a",   "armv9.1a",   "armv9.2-a",   "armv9.2a",
+"armv4","armv4t",  "armv5",  "armv5t",  "armv5e",
+"armv5te",  "armv5tej","armv6",  "armv6j",  "armv6k",
+"armv6hl",  "armv6t2", "armv6kz","armv6z",  "armv6zk",
+"armv6-m",  "armv6m",  "armv6sm","armv6s-m","armv7-a",
+"armv7","armv7a",  "armv7ve","armv7hl", "armv7l",
+"armv7-r",  "armv7r",  "armv7-m","armv7m",  "armv7k",
+"armv7s",   "armv7e-m","armv7em","armv8-a", "armv8",
+"armv8a",   "armv8l",  "armv8.1-a",  "armv8.1a","armv8.2-a",
+"armv8.2a", "armv8.3-a",   "armv8.3a",   "armv8.4-a",   "armv8.4a",
+"armv8.5-a","armv8.5a","armv8.6-a",  "armv8.6a","armv8.7-a",
+"armv8.7a", "armv8.8-a",   "armv8.8a",   "armv8-r", "armv8r",
+"armv8-m.base", "armv8m.base", "armv8-m.main",   "armv8m.main", "iwmmxt",
+"iwmmxt2",  "xscale",  "armv8.1-m.main", "armv9-a", "armv9",
+"armv9a",   "armv9.1-a",   "armv9.1a",   "armv9.2-a",   "armv9.2a",
 };
 
 template 
@@ -438,14 +437,6 @@
 }
 
 TEST(TargetParserTest, testARMArch) {
-  EXPECT_TRUE(
-  testARMArch("armv2", "generic", "v2", ARMBuildAttrs::CPUArch::Pre_v4));
-  EXPECT_TRUE(
-  testARMArch("armv2a", "generic", "v2a", ARMBuildAttrs::CPUArch::Pre_v4));
-  EXPECT_TRUE(
-  testARMArch("armv3", "generic", "v3", ARMBuildAttrs::CPUArch::Pre_v4));
-  EXPECT_TRUE(
-  testARMArch("armv3m", "generic", "v3m", ARMBuildAttrs::CPUArch::Pre_v4));
   EXPECT_TRUE(
   testARMArch("armv4", "strongarm", "v4",
   ARMBuildAttrs::CPUArch::v4));
@@ -603,10 +594,6 @@
   EXPECT_FALSE(testARMExtension("xscale", ARM::ArchKind::INVALID, "crc"));
   EXPECT_FALSE(testARMExtension("swift", ARM::ArchKind::INVALID, "crc"));
 
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV2, "thumb"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV2A, "thumb"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV3, "thumb"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV3M, "thumb"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV4, "dsp"));
   EXPECT_FALSE(testARMExtension("

[PATCH] D133109: [LLVM][ARM] Remove options for armv2, 2A, 3 and 3M

2022-09-01 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

https://github.com/llvm/llvm-project/issues/57486


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133109/new/

https://reviews.llvm.org/D133109

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


[PATCH] D133109: [LLVM][ARM] Remove options for armv2, 2A, 3 and 3M

2022-09-01 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added reviewers: psmith, easyaspi314.
DavidSpickett added a comment.

The remaining reference in the repo is a #define in 
`openmp/runtime/src/kmp_platform.h` which seems harmless.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133109/new/

https://reviews.llvm.org/D133109

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


[PATCH] D133109: [LLVM][ARM] Remove options for armv2, 2A, 3 and 3M

2022-09-02 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

This is probably overkill but I posted an RFC just in case 
https://discourse.llvm.org/t/rfc-removal-of-armv2-2a-3-3m-target-options/65040. 
Like I said, no rush to land this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133109/new/

https://reviews.llvm.org/D133109

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


[PATCH] D131465: C++/ObjC++: switch to gnu++17 as the default standard

2022-09-08 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

If it helps here is a failed build from our bots:
https://lab.llvm.org/buildbot/#/builders/179/builds/4420

There are others but just combinations of the same tests.

Example error from the hexxagon build:

  
/home/tcwg-buildbot/worker/clang-armv8-lld-2stage/test/test-suite/MultiSource/Applications/hexxagon/hexxagonboard.cpp:254:10:
 error: reference to 'empty' is ambiguous
  return empty;
 ^
  
/home/tcwg-buildbot/worker/clang-armv8-lld-2stage/test/test-suite/MultiSource/Applications/hexxagon/hexxagonboard.h:42:2:
 note: candidate found by name lookup is 'empty'
  empty,
  ^


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131465/new/

https://reviews.llvm.org/D131465

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


[PATCH] D133109: [LLVM][ARM] Remove options for armv2, 2A, 3 and 3M

2022-09-08 Thread David Spickett via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe428baf0019e: [LLVM][ARM] Remove options for armv2, 2A, 3 
and 3M (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133109/new/

https://reviews.llvm.org/D133109

Files:
  clang/docs/ReleaseNotes.rst
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/Support/ARMTargetParser.def
  llvm/lib/Support/ARMTargetParser.cpp
  llvm/lib/Target/ARM/ARM.td
  llvm/lib/Target/ARM/ARMSubtarget.h
  llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
  llvm/test/MC/ARM/directive-arch-armv2.s
  llvm/test/MC/ARM/directive-arch-armv2a.s
  llvm/test/MC/ARM/directive-arch-armv3.s
  llvm/test/MC/ARM/directive-arch-armv3m.s
  llvm/unittests/Support/TargetParserTest.cpp

Index: llvm/unittests/Support/TargetParserTest.cpp
===
--- llvm/unittests/Support/TargetParserTest.cpp
+++ llvm/unittests/Support/TargetParserTest.cpp
@@ -20,21 +20,20 @@
 
 namespace {
 const char *ARMArch[] = {
-"armv2",   "armv2a", "armv3",   "armv3m","armv4",
-"armv4t",  "armv5",  "armv5t",  "armv5e","armv5te",
-"armv5tej","armv6",  "armv6j",  "armv6k","armv6hl",
-"armv6t2", "armv6kz","armv6z",  "armv6zk",   "armv6-m",
-"armv6m",  "armv6sm","armv6s-m","armv7-a",   "armv7",
-"armv7a",  "armv7ve","armv7hl", "armv7l","armv7-r",
-"armv7r",  "armv7-m","armv7m",  "armv7k","armv7s",
-"armv7e-m","armv7em","armv8-a", "armv8", "armv8a",
-"armv8l",  "armv8.1-a",  "armv8.1a","armv8.2-a", "armv8.2a",
-"armv8.3-a",   "armv8.3a",   "armv8.4-a",   "armv8.4a",  "armv8.5-a",
-"armv8.5a","armv8.6-a",  "armv8.6a","armv8.7-a", "armv8.7a",
-"armv8.8-a",   "armv8.8a",   "armv8-r", "armv8r","armv8-m.base",
-"armv8m.base", "armv8-m.main",   "armv8m.main", "iwmmxt","iwmmxt2",
-"xscale",  "armv8.1-m.main", "armv9-a", "armv9", "armv9a",
-"armv9.1-a",   "armv9.1a",   "armv9.2-a",   "armv9.2a",
+"armv4","armv4t",  "armv5",  "armv5t",  "armv5e",
+"armv5te",  "armv5tej","armv6",  "armv6j",  "armv6k",
+"armv6hl",  "armv6t2", "armv6kz","armv6z",  "armv6zk",
+"armv6-m",  "armv6m",  "armv6sm","armv6s-m","armv7-a",
+"armv7","armv7a",  "armv7ve","armv7hl", "armv7l",
+"armv7-r",  "armv7r",  "armv7-m","armv7m",  "armv7k",
+"armv7s",   "armv7e-m","armv7em","armv8-a", "armv8",
+"armv8a",   "armv8l",  "armv8.1-a",  "armv8.1a","armv8.2-a",
+"armv8.2a", "armv8.3-a",   "armv8.3a",   "armv8.4-a",   "armv8.4a",
+"armv8.5-a","armv8.5a","armv8.6-a",  "armv8.6a","armv8.7-a",
+"armv8.7a", "armv8.8-a",   "armv8.8a",   "armv8-r", "armv8r",
+"armv8-m.base", "armv8m.base", "armv8-m.main",   "armv8m.main", "iwmmxt",
+"iwmmxt2",  "xscale",  "armv8.1-m.main", "armv9-a", "armv9",
+"armv9a",   "armv9.1-a",   "armv9.1a",   "armv9.2-a",   "armv9.2a",
 };
 
 template 
@@ -438,14 +437,6 @@
 }
 
 TEST(TargetParserTest, testARMArch) {
-  EXPECT_TRUE(
-  testARMArch("armv2", "generic", "v2", ARMBuildAttrs::CPUArch::Pre_v4));
-  EXPECT_TRUE(
-  testARMArch("armv2a", "generic", "v2a", ARMBuildAttrs::CPUArch::Pre_v4));
-  EXPECT_TRUE(
-  testARMArch("armv3", "generic", "v3", ARMBuildAttrs::CPUArch::Pre_v4));
-  EXPECT_TRUE(
-  testARMArch("armv3m", "generic", "v3m", ARMBuildAttrs::CPUArch::Pre_v4));
   EXPECT_TRUE(
   testARMArch("armv4", "strongarm", "v4",
   ARMBuildAttrs::CPUArch::v4));
@@ -603,10 +594,6 @@
   EXPECT_FALSE(testARMExtension("xscale", ARM::ArchKind::INVALID, "crc"));
   EXPECT_FALSE(testARMExtension("swift", ARM::ArchKind::INVALID, "crc"));
 
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV2, "thumb"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV2A, "thumb"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV3, "thumb"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV3M, "thumb"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV4, "dsp"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV4T, "dsp"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV5T, "simd"));
Index: llvm/test/MC/ARM/directive-arch-armv3m.s
===
--- llvm/test/MC/ARM/directive-arch-armv3m.s
+++ /dev/null
@@ -1,30 +0,0 @@
-@ Test the .arch directive for armv3m
-
-@ This test case will check the default .ARM.attributes value for the
-@ armv3m architecture.
-
-@ RUN: llvm-m

[PATCH] D113779: [Clang] Add mfp16, mfp16fml and mdotprod flags for ARM target features.

2022-09-08 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

For (1) and (2) is there a need to be able to reset the architecture setting no 
matter the previous `march` and `` are?

Currently we're talking about *not* wanting having to use `-march=armv8-a+crc` 
but would you still want a way to reset the architecture no matter what the 
previous options are?

That said, applying the extra extensions to the last `-march` gives you a way 
to bump the base architecture which could be useful. `-march=armv8-a 
-add-extension=+crc -march=armv8.4-a` => armv8.4-a+crc.

For (3) I agree with your concern.

> There are a lot of supported ISA features, so there would be a lot of -m and 
> -mno- options to document. It would become harder to separate out -m options 
> related to architecture selection from -m options that do other things.

A rough count:

  $ clang --help | grep " \-m" | wc -l
  108

I also wouldn't want to get into a situation where we name an extension such 
that `-mextension` looks more like it's a general compiler option. E.g.

  -mnvj   Enable generation of new-value jumps

"nvj" isn't far off what our extensions end up being called.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113779/new/

https://reviews.llvm.org/D113779

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


[PATCH] D133109: [LLVM][ARM] Remove options for armv2, 2A, 3 and 3M

2022-09-15 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added subscribers: nickdesaulniers, psmith.
DavidSpickett added a comment.

> 1:38 AM  might be good to take them out here as well

So I looked into this. Here are the Arm architectures that clang has that
gcc doesn't:
"armv5tej" // Not in GCC, j = jazelle
"armv7k" // Apple Watch S1
"armv7s" // iPhone 5
"xscale"

(minus some very new ones that are just because I used trunk clang)

These are the gcc architectures that clang doesn't have:
"armv6j"
"armv6s-m"
"armv6z"
"armv6zk"
"armv7"

So a random grab bag of v6 and 7 on both sides. Not worth disturbing that
now.

Arnd picked out jazelle. GCC doesn't list armv5tej but it does accept it
https://godbolt.org/z/cazcbfjGY. For armv6j clang doesn't list it but it
also does accept it https://godbolt.org/z/aEKfnojTY.

llvm's support for jazelle is a single instruction "bxj" which is a branch
exchange, but for jazelle (
https://developer.arm.com/documentation/dui0473/j/arm-and-thumb-instructions/bxj
).
Which makes some sense. If you had that one instruction you could compile
99% of the code with public toolchains, then the rest with some tool from
Arm, I guess. GCC appears to have done the same.

So targets wise I think things are fine as is unless a v6 enthusiast tries
to use clang sometime.

For jazelle the bxj instruction appears to be present on non jazelle
processors, and can be used as a normal bx in ThumbEE. The code to
implement it and the armv5tej target is minimal and compact so I think we
keep it for now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133109/new/

https://reviews.llvm.org/D133109

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


[PATCH] D129135: [doc][ReleaseNotes] Document AArch64 SVE ABI fix from D127209

2022-07-05 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

From reading the release note my understanding is that before this fix the 
caller of a function would store `z0-z7` in situations where it did not need 
to. Which seems low impact unless you were doing something that read the 
previous stack frame (but nevertheless a difference from the AAPCS).

If that's what you were trying to get across then great!

> This affects functions where the first SVE parameter appears in the 9th or 
> later arguments

I'm reading 
https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#642parameter-passing-rules.
 Wouldn't the type of the preceding 8 arguments also be relevant?

Though I was surprised to see that "NSRN" covers floating point and SVE 
registers, so I'm hardly an expert here.

> and the function does not return an SVE type.

This is because the function would return in `z0` therefore the caller must 
preserve at least `z0` and the ABI tells you to preserve `z0-z7` to do that?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129135/new/

https://reviews.llvm.org/D129135

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


[PATCH] D129135: [doc][ReleaseNotes] Document AArch64 SVE ABI fix from D127209

2022-07-05 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

> My intent was to express that the issue is present where it's the 9th or 
> later arguments.

So I take from that that it does not matter if arguments 1-8 were all integers 
and so did not get put in SIMD/floating point registers. I think I am confusing 
what the ABI says (and what llvm *now does*) with the way the previous llvm 
behaviour. So the statement answers the question "of the functions in my 
project which ones might change", it's the ones where the first SVE type 
argument was argument 9 or greater.

Should the release note also say that the key is the *first* SVE type parameter 
being argument 9, not just having an SVE type in argument 9 at all?

Commit msg:

> This affects functions where the first SVE parameter appears in the 9th or 
> later arguments, and the function does not return an SVE type.

Note:

> This would cause an incorrect use of the caller-preserved z8-z23 ABI for 
> example if the 9th argument to a function were an SVE type.

Or in other words what about arguments 1-8, can they be SVE and still hit this 
issue? I realise this is not supposed to be a full on super detailed report but 
mentioning because the "first" stood out to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129135/new/

https://reviews.llvm.org/D129135

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


[PATCH] D129135: [doc][ReleaseNotes] Document AArch64 SVE ABI fix from D127209

2022-07-05 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett accepted this revision.
DavidSpickett added a comment.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129135/new/

https://reviews.llvm.org/D129135

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


[PATCH] D103986: [PowerPC] Floating Point Builtins for XL Compat.

2021-07-21 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

You missed a REQUIRES for the llvm test, I added one in: 
https://reviews.llvm.org/rG2404834c206a8930b0c420d94f4941b31c355de5

So if you see Arm-AArch64 quick bot failures, that was the reason.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103986/new/

https://reviews.llvm.org/D103986

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


[PATCH] D121445: [Clang][CSKY] Add the CSKY target and compiler driver

2022-03-11 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments.



Comment at: clang/lib/Basic/Targets/CSKY.cpp:43
+  Builder.defineMacro("__CSKYABI__", ABI == "abiv2" ? "2" : "1");
+  Builder.defineMacro("__cskyabi__", ABI == "abiv2" ? "2" : "1");
+

Any need to handle when ABI is not avbiv2 or abiv1 or will it always be one of 
the two?



Comment at: clang/lib/Driver/ToolChains/Linux.cpp:373
+
+std::string Path = (GCCInstallation.getInstallPath() + "/../../../../" +
+GCCInstallation.getTriple().str() + "/libc").str();

Can you comment what all the `..` are going to/from. I assume from some deep 
folder back up, down into the sysroot but an example in a comment would be good 
to document it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121445/new/

https://reviews.llvm.org/D121445

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


[PATCH] D121707: [llvm][AArch64] Insert "bti j" after call to setjmp

2022-03-15 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Some implementations of setjmp will end with a br instead of a ret.
This means that the next instruction after a call to setjmp must be
a "bti j" (j for jump) to make this work when branch target identification
is enabled.

The BTI extension was added in armv8.5-a but the bti instruction is in the
hint space. This means we can emit it for any architecture version as long
as branch target enforcement flags are passed.

The starting point for the hint number is 32 then call adds 2, jump adds 4.
Hence "hint #36" for a "bti j" (and "hint #34" for the "bti c" you see
at the start of functions).

The existing Arm command line option -mno-bti-at-return-twice has been
applied to AArch64 as well.

Support is added to SelectionDAG Isel and GlobalIsel. FastIsel will
defer to SelectionDAG.

Based on the change done for M profile Arm in https://reviews.llvm.org/D112427

This is for https://github.com/llvm/llvm-project/issues/4


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121707

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Arch/AArch64.cpp
  llvm/lib/Target/AArch64/AArch64.td
  llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
  llvm/lib/Target/AArch64/AArch64FastISel.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/AArch64/AArch64InstrInfo.td
  llvm/lib/Target/AArch64/AArch64Subtarget.h
  llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
  llvm/test/CodeGen/AArch64/setjmp-bti-no-enforcement.ll
  llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
  llvm/test/CodeGen/AArch64/setjmp-bti.ll

Index: llvm/test/CodeGen/AArch64/setjmp-bti.ll
===
--- /dev/null
+++ llvm/test/CodeGen/AArch64/setjmp-bti.ll
@@ -0,0 +1,55 @@
+; RUN: llc -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+
+; C source
+; 
+; extern int setjmp(void*);
+; extern void notsetjmp(void);
+;
+; void bbb(void) {
+;   setjmp(0);
+;   int (*fnptr)(void*) = setjmp;
+;   fnptr(0);
+;   notsetjmp();
+; }
+
+define void @bbb() {
+; BTI-LABEL: bbb:
+; BTI:   bl setjmp
+; BTI-NEXT:  hint #36
+; BTI:   blr x{{[0-9]+}}
+; BTI-NEXT:  hint #36
+; BTI:   bl notsetjmp
+; BTI-NOT:   hint #36
+
+; NOBTI-LABEL: bbb:
+; NOBTI: bl setjmp
+; NOBTI-NOT: hint #36
+; NOBTI: blr x{{[0-9]+}}
+; NOBTI-NOT: hint #36
+; NOBTI: bl notsetjmp
+; NOBTI-NOT: hint #36
+entry:
+  %fnptr = alloca i32 (i8*)*, align 8
+  %call = call i32 @setjmp(i8* noundef null) #0
+  store i32 (i8*)* @setjmp, i32 (i8*)** %fnptr, align 8
+  %0 = load i32 (i8*)*, i32 (i8*)** %fnptr, align 8
+  %call1 = call i32 %0(i8* noundef null) #0
+  call void @notsetjmp()
+  ret void
+}
+
+declare i32 @setjmp(i8* noundef) #0
+declare void @notsetjmp()
+
+attributes #0 = { returns_twice }
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 1, !"branch-target-enforcement", i32 1}
Index: llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
===
--- /dev/null
+++ llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
@@ -0,0 +1,83 @@
+; RUN: llc -mtriple=aarch64-none-linux-gnu -enable-machine-outliner < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -enable-machine-outliner < %s | \
+; RUN: FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -enable-machine-outliner < %s | \
+; RUN: FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -enable-machine-outliner -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -enable-machine-outliner -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -enable-machine-outliner -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+
+; Check that the outliner does not split up the call to setjmp and the 

[PATCH] D121445: [Clang][CSKY] Add the CSKY target and compiler driver

2022-03-17 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

> You can also run lit directly on each test, but I can't remember how to do 
> that now...

If you're in the build dir:

  ./bin/llvm-lit ../llvm-project/clang/test/.. -a

(-a gives you full output of what happens)

Some tests are a bit odd when you do this but these clang tests are usually ok.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121445/new/

https://reviews.llvm.org/D121445

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


[PATCH] D121707: [llvm][AArch64] Insert "bti j" after call to setjmp

2022-03-21 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 416885.
DavidSpickett added a comment.

Rebase


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121707/new/

https://reviews.llvm.org/D121707

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Arch/AArch64.cpp
  llvm/lib/Target/AArch64/AArch64.td
  llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
  llvm/lib/Target/AArch64/AArch64FastISel.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/AArch64/AArch64InstrInfo.td
  llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
  llvm/test/CodeGen/AArch64/setjmp-bti-no-enforcement.ll
  llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
  llvm/test/CodeGen/AArch64/setjmp-bti.ll

Index: llvm/test/CodeGen/AArch64/setjmp-bti.ll
===
--- /dev/null
+++ llvm/test/CodeGen/AArch64/setjmp-bti.ll
@@ -0,0 +1,55 @@
+; RUN: llc -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+
+; C source
+; 
+; extern int setjmp(void*);
+; extern void notsetjmp(void);
+;
+; void bbb(void) {
+;   setjmp(0);
+;   int (*fnptr)(void*) = setjmp;
+;   fnptr(0);
+;   notsetjmp();
+; }
+
+define void @bbb() {
+; BTI-LABEL: bbb:
+; BTI:   bl setjmp
+; BTI-NEXT:  hint #36
+; BTI:   blr x{{[0-9]+}}
+; BTI-NEXT:  hint #36
+; BTI:   bl notsetjmp
+; BTI-NOT:   hint #36
+
+; NOBTI-LABEL: bbb:
+; NOBTI: bl setjmp
+; NOBTI-NOT: hint #36
+; NOBTI: blr x{{[0-9]+}}
+; NOBTI-NOT: hint #36
+; NOBTI: bl notsetjmp
+; NOBTI-NOT: hint #36
+entry:
+  %fnptr = alloca i32 (i8*)*, align 8
+  %call = call i32 @setjmp(i8* noundef null) #0
+  store i32 (i8*)* @setjmp, i32 (i8*)** %fnptr, align 8
+  %0 = load i32 (i8*)*, i32 (i8*)** %fnptr, align 8
+  %call1 = call i32 %0(i8* noundef null) #0
+  call void @notsetjmp()
+  ret void
+}
+
+declare i32 @setjmp(i8* noundef) #0
+declare void @notsetjmp()
+
+attributes #0 = { returns_twice }
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 1, !"branch-target-enforcement", i32 1}
Index: llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
===
--- /dev/null
+++ llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
@@ -0,0 +1,83 @@
+; RUN: llc -mtriple=aarch64-none-linux-gnu -enable-machine-outliner < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -enable-machine-outliner < %s | \
+; RUN: FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -enable-machine-outliner < %s | \
+; RUN: FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -enable-machine-outliner -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -enable-machine-outliner -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -enable-machine-outliner -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+
+; Check that the outliner does not split up the call to setjmp and the bti after it.
+; When we do not insert a bti, it is allowed to move the setjmp call into an outlined function.
+
+; C source
+; 
+; extern int setjmp(void*);
+;
+; int f(int a, int b, int c, int d) {
+;   setjmp(0);
+;   return 1 + a * (a + b) / (c + d);
+; }
+;
+; int g(int a, int b, int c, int d) {
+;   setjmp(0);
+;   return 2 + a * (a + b) / (c + d);
+; }
+
+define i32 @f(i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d) {
+; BTI-LABEL: f:
+; BTI: bl  OUTLINED_FUNCTION_1
+; BTI-NEXT:bl  setjmp
+; BTI-NEXT:hint#36
+; BTI-NEXT:bl  OUTLINED_FUNCTION_0
+
+; NOBTI:  f:
+; NOBTI:bl  OUTLINED_FUNCTION_0
+; NOBTI-NEXT:   bl  OUTLINED_FUNCTION_1
+
+entry:
+  %call = call i32 @setjmp(i8* noundef null) #0
+  %add = add nsw i32 %b, %a
+  %mul = mul nsw i32 %add, %a
+  %add1 = add nsw i32 %d, %c
+  %div = sdiv i32 %mul, %add1
+  %add2 = add nsw i32 %div, 1
+  ret i32 %add2
+}
+
+declare i32 @setjmp(i8* noundef) #0
+
+define i32 @g(i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d

[PATCH] D122189: [Clang][NeonEmitter] emit ret decl first for -Wdeclaration-after-statement

2022-03-22 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Can you post a bit of the header diff before/after? I think I know what it 
looks like but just to be sure.




Comment at: clang/test/Sema/arm-neon-decl-after-stmt.c:3
+// RUN:  -Wdeclaration-after-statement -fsyntax-only -verify %s
+// REQUIRES: aarch64-registered-target || arm-registered-target
+// https://github.com/llvm/llvm-project/issues/54062

Does `armebv7` work when you only have aarch64?

It probably does just by virtue of aarch64 not knowing what v7 is and 
defaulting to v8 but double check what happens there.

If the emitter is used for both arm and aarch64 then testing one would be 
acceptable. Since you can't really do an if has arm do this else in a lit test 
like this.



Comment at: clang/utils/TableGen/NeonEmitter.cpp:1855
 emitOpeningBrace();
+emitReturnVarDecl();
 emitShadowedArgs();

Comment the reason for doing the return var first


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122189/new/

https://reviews.llvm.org/D122189

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


[PATCH] D122189: [Clang][NeonEmitter] emit ret decl first for -Wdeclaration-after-statement

2022-03-23 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett accepted this revision.
DavidSpickett added a comment.
This revision is now accepted and ready to land.

This LGTM with the test only requiring Arm.

Please mention in the commit that it is possible to ignore this warning in 
system headers, but we chose not to because of potential false positives.




Comment at: clang/test/Sema/arm-neon-decl-after-stmt.c:3
+// RUN:  -Wdeclaration-after-statement -fsyntax-only -verify %s
+// REQUIRES: aarch64-registered-target || arm-registered-target
+// https://github.com/llvm/llvm-project/issues/54062

DavidSpickett wrote:
> Does `armebv7` work when you only have aarch64?
> 
> It probably does just by virtue of aarch64 not knowing what v7 is and 
> defaulting to v8 but double check what happens there.
> 
> If the emitter is used for both arm and aarch64 then testing one would be 
> acceptable. Since you can't really do an if has arm do this else in a lit 
> test like this.
Maybe this is phabricator showing me the diff strangely, but it seems like you 
removed the aarch64 requirement from a different test instead of this one.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122189/new/

https://reviews.llvm.org/D122189

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


[PATCH] D121707: [llvm][AArch64] Insert "bti j" after call to setjmp

2022-03-23 Thread David Spickett via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGeb5ecbbcbb6c: [llvm][AArch64] Insert "bti j" after 
call to setjmp (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121707/new/

https://reviews.llvm.org/D121707

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Arch/AArch64.cpp
  llvm/lib/Target/AArch64/AArch64.td
  llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
  llvm/lib/Target/AArch64/AArch64FastISel.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/AArch64/AArch64InstrInfo.td
  llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
  llvm/test/CodeGen/AArch64/setjmp-bti-no-enforcement.ll
  llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
  llvm/test/CodeGen/AArch64/setjmp-bti.ll

Index: llvm/test/CodeGen/AArch64/setjmp-bti.ll
===
--- /dev/null
+++ llvm/test/CodeGen/AArch64/setjmp-bti.ll
@@ -0,0 +1,55 @@
+; RUN: llc -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+
+; C source
+; 
+; extern int setjmp(void*);
+; extern void notsetjmp(void);
+;
+; void bbb(void) {
+;   setjmp(0);
+;   int (*fnptr)(void*) = setjmp;
+;   fnptr(0);
+;   notsetjmp();
+; }
+
+define void @bbb() {
+; BTI-LABEL: bbb:
+; BTI:   bl setjmp
+; BTI-NEXT:  hint #36
+; BTI:   blr x{{[0-9]+}}
+; BTI-NEXT:  hint #36
+; BTI:   bl notsetjmp
+; BTI-NOT:   hint #36
+
+; NOBTI-LABEL: bbb:
+; NOBTI: bl setjmp
+; NOBTI-NOT: hint #36
+; NOBTI: blr x{{[0-9]+}}
+; NOBTI-NOT: hint #36
+; NOBTI: bl notsetjmp
+; NOBTI-NOT: hint #36
+entry:
+  %fnptr = alloca i32 (i8*)*, align 8
+  %call = call i32 @setjmp(i8* noundef null) #0
+  store i32 (i8*)* @setjmp, i32 (i8*)** %fnptr, align 8
+  %0 = load i32 (i8*)*, i32 (i8*)** %fnptr, align 8
+  %call1 = call i32 %0(i8* noundef null) #0
+  call void @notsetjmp()
+  ret void
+}
+
+declare i32 @setjmp(i8* noundef) #0
+declare void @notsetjmp()
+
+attributes #0 = { returns_twice }
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 1, !"branch-target-enforcement", i32 1}
Index: llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
===
--- /dev/null
+++ llvm/test/CodeGen/AArch64/setjmp-bti-outliner.ll
@@ -0,0 +1,83 @@
+; RUN: llc -mtriple=aarch64-none-linux-gnu -enable-machine-outliner < %s | FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -enable-machine-outliner < %s | \
+; RUN: FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -enable-machine-outliner < %s | \
+; RUN: FileCheck %s --check-prefix=BTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -enable-machine-outliner -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -enable-machine-outliner -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -enable-machine-outliner -mattr=+no-bti-at-return-twice < %s | \
+; RUN: FileCheck %s --check-prefix=NOBTI
+
+; Check that the outliner does not split up the call to setjmp and the bti after it.
+; When we do not insert a bti, it is allowed to move the setjmp call into an outlined function.
+
+; C source
+; 
+; extern int setjmp(void*);
+;
+; int f(int a, int b, int c, int d) {
+;   setjmp(0);
+;   return 1 + a * (a + b) / (c + d);
+; }
+;
+; int g(int a, int b, int c, int d) {
+;   setjmp(0);
+;   return 2 + a * (a + b) / (c + d);
+; }
+
+define i32 @f(i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d) {
+; BTI-LABEL: f:
+; BTI: bl  OUTLINED_FUNCTION_1
+; BTI-NEXT:bl  setjmp
+; BTI-NEXT:hint#36
+; BTI-NEXT:bl  OUTLINED_FUNCTION_0
+
+; NOBTI:  f:
+; NOBTI:bl  OUTLINED_FUNCTION_0
+; NOBTI-NEXT:   bl  OUTLINED_FUNCTION_1
+
+entry:
+  %call = call i32 @setjmp(i8* noundef null) #0
+  %add = add nsw i32 %b, %a
+  %mul = mul nsw i32 %add, %a
+  %add1 = add nsw i32 %d, %c
+  %div = sdiv i32 %mul, %add1
+  %add2 = add n

[PATCH] D123296: [llvm][AArch64] Generate getExtensionFeatures from the list of extensions

2022-04-07 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

This takes the AARCH64_ARCH_EXT_NAME in AArch64TargetParser.def and uses
it to generate all the "if bit is set add this feature name" code.

Which gives us a bunch that we were missing. I've updated testing
to include those and reordered them to match the order in the .def.

The final part of the test will catch any missing extensions if
we somehow manage to not generate an if block for them.

This has changed the order of cc1's "-target-feature" output so I've
updated some tests in clang to reflect that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123296

Files:
  clang/test/Preprocessor/aarch64-target-features.c
  llvm/lib/Support/AArch64TargetParser.cpp
  llvm/unittests/Support/TargetParserTest.cpp

Index: llvm/unittests/Support/TargetParserTest.cpp
===
--- llvm/unittests/Support/TargetParserTest.cpp
+++ llvm/unittests/Support/TargetParserTest.cpp
@@ -12,6 +12,7 @@
 #include "llvm/Support/ARMBuildAttributes.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/TargetParser.h"
+#include "gmock/gmock.h"
 #include "gtest/gtest.h"
 #include 
 
@@ -1448,14 +1449,20 @@
 
 TEST(TargetParserTest, AArch64ExtensionFeatures) {
   std::vector Extensions = {
-  AArch64::AEK_CRC, AArch64::AEK_CRYPTO,  AArch64::AEK_FP,
-  AArch64::AEK_SIMD,AArch64::AEK_FP16,AArch64::AEK_PROFILE,
-  AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
-  AArch64::AEK_DOTPROD, AArch64::AEK_SVE, AArch64::AEK_SVE2,
-  AArch64::AEK_SVE2AES, AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3,
-  AArch64::AEK_SVE2BITPERM, AArch64::AEK_RCPC,AArch64::AEK_FP16FML,
-  AArch64::AEK_SME, AArch64::AEK_SMEF64,  AArch64::AEK_SMEI64,
-  AArch64::AEK_PERFMON};
+  AArch64::AEK_CRC, AArch64::AEK_LSE,  AArch64::AEK_RDM,
+  AArch64::AEK_CRYPTO,  AArch64::AEK_SM4,  AArch64::AEK_SHA3,
+  AArch64::AEK_SHA2,AArch64::AEK_AES,  AArch64::AEK_DOTPROD,
+  AArch64::AEK_FP,  AArch64::AEK_SIMD, AArch64::AEK_FP16,
+  AArch64::AEK_FP16FML, AArch64::AEK_PROFILE,  AArch64::AEK_RAS,
+  AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2AES,
+  AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3, AArch64::AEK_SVE2BITPERM,
+  AArch64::AEK_RCPC,AArch64::AEK_RAND, AArch64::AEK_MTE,
+  AArch64::AEK_SSBS,AArch64::AEK_SB,   AArch64::AEK_PREDRES,
+  AArch64::AEK_BF16,AArch64::AEK_I8MM, AArch64::AEK_F32MM,
+  AArch64::AEK_F64MM,   AArch64::AEK_TME,  AArch64::AEK_LS64,
+  AArch64::AEK_BRBE,AArch64::AEK_PAUTH,AArch64::AEK_FLAGM,
+  AArch64::AEK_SME, AArch64::AEK_SMEF64,   AArch64::AEK_SMEI64,
+  AArch64::AEK_HBC, AArch64::AEK_MOPS, AArch64::AEK_PERFMON};
 
   std::vector Features;
 
@@ -1470,27 +1477,54 @@
   EXPECT_EQ(Extensions.size(), Features.size());
 
   EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
   EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
   EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
   EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
   EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
   EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
   EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
+  

[PATCH] D123296: [llvm][AArch64] Generate getExtensionFeatures from the list of extensions

2022-04-07 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added reviewers: amilendra, tmatheson.
DavidSpickett added a comment.

The background here is that I want to automate what I did in 
https://reviews.llvm.org/D121999 and thought I could do that by passing 0xf...f 
to getExtensionFeatures.

I thought there might be some reason to not list them all but considering that 
things like mte were missing I don't think there is. More likely that any time 
we were adding something like +mte we went through a different function in the 
target parser.




Comment at: clang/test/Preprocessor/aarch64-target-features.c:288
+// CHECK-MCPU-CORTEX-A73: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" 
"-target-feature" "+v8a" "-target-feature" "+crc" "-target-feature" "+crypto" 
"-target-feature" "+fp-armv8" "-target-feature" "+neon"
+// CHECK-MCPU-CORTEX-R82: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" 
"-target-feature" "+v8r" "-target-feature" "+crc" "-target-feature" "+lse" 
"-target-feature" "+rdm" "-target-feature" "+dotprod" "-target-feature" 
"+fp-armv8" "-target-feature" "+neon" "-target-feature" "+fp16fml" 
"-target-feature" "+ras" "-target-feature" "+rcpc" "-target-feature" "+ssbs" 
"-target-feature" "+sb" "-target-feature" "+fullfp16"
+// CHECK-MCPU-M3: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" 
"+v8a" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" 
"+fp-armv8" "-target-feature" "+neon"

Some of the ordering has changed and that means some tests look for new 
features. The CPU already had these features, the test just didn't check for 
them before and now they've been inserted into what it's looking for.

We could change all these to look for the exact feature set but to be 
conservative I stuck to re-ordering them and adding just enough to get them 
passing again.



Comment at: llvm/lib/Support/AArch64TargetParser.cpp:69
+  if (Extensions & ID) {   
\
+const char *feature = FEATURE; 
\
+/* INVALID and NONE have no feature name. */   
\

This looks a bit strange but you can't do:
```
Features.push_back(FEATURE);
```
Because you get:
```
Features.push_back(nullptr);
```
Which calls a deleted constructor, and we don't want empty feature strings in 
any case.

So that's why I assign it to something so that the `push_back` line can still 
be compiled.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123296/new/

https://reviews.llvm.org/D123296

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


[PATCH] D123296: [llvm][AArch64] Generate getExtensionFeatures from the list of extensions

2022-04-11 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 421909.
DavidSpickett added a comment.

Added check that NONE does not return any feature names.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123296/new/

https://reviews.llvm.org/D123296

Files:
  clang/test/Preprocessor/aarch64-target-features.c
  llvm/lib/Support/AArch64TargetParser.cpp
  llvm/unittests/Support/TargetParserTest.cpp

Index: llvm/unittests/Support/TargetParserTest.cpp
===
--- llvm/unittests/Support/TargetParserTest.cpp
+++ llvm/unittests/Support/TargetParserTest.cpp
@@ -12,6 +12,7 @@
 #include "llvm/Support/ARMBuildAttributes.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/TargetParser.h"
+#include "gmock/gmock.h"
 #include "gtest/gtest.h"
 #include 
 
@@ -1448,14 +1449,20 @@
 
 TEST(TargetParserTest, AArch64ExtensionFeatures) {
   std::vector Extensions = {
-  AArch64::AEK_CRC, AArch64::AEK_CRYPTO,  AArch64::AEK_FP,
-  AArch64::AEK_SIMD,AArch64::AEK_FP16,AArch64::AEK_PROFILE,
-  AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
-  AArch64::AEK_DOTPROD, AArch64::AEK_SVE, AArch64::AEK_SVE2,
-  AArch64::AEK_SVE2AES, AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3,
-  AArch64::AEK_SVE2BITPERM, AArch64::AEK_RCPC,AArch64::AEK_FP16FML,
-  AArch64::AEK_SME, AArch64::AEK_SMEF64,  AArch64::AEK_SMEI64,
-  AArch64::AEK_PERFMON};
+  AArch64::AEK_CRC, AArch64::AEK_LSE,  AArch64::AEK_RDM,
+  AArch64::AEK_CRYPTO,  AArch64::AEK_SM4,  AArch64::AEK_SHA3,
+  AArch64::AEK_SHA2,AArch64::AEK_AES,  AArch64::AEK_DOTPROD,
+  AArch64::AEK_FP,  AArch64::AEK_SIMD, AArch64::AEK_FP16,
+  AArch64::AEK_FP16FML, AArch64::AEK_PROFILE,  AArch64::AEK_RAS,
+  AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2AES,
+  AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3, AArch64::AEK_SVE2BITPERM,
+  AArch64::AEK_RCPC,AArch64::AEK_RAND, AArch64::AEK_MTE,
+  AArch64::AEK_SSBS,AArch64::AEK_SB,   AArch64::AEK_PREDRES,
+  AArch64::AEK_BF16,AArch64::AEK_I8MM, AArch64::AEK_F32MM,
+  AArch64::AEK_F64MM,   AArch64::AEK_TME,  AArch64::AEK_LS64,
+  AArch64::AEK_BRBE,AArch64::AEK_PAUTH,AArch64::AEK_FLAGM,
+  AArch64::AEK_SME, AArch64::AEK_SMEF64,   AArch64::AEK_SMEI64,
+  AArch64::AEK_HBC, AArch64::AEK_MOPS, AArch64::AEK_PERFMON};
 
   std::vector Features;
 
@@ -1463,34 +1470,65 @@
   for (auto Ext : Extensions)
 ExtVal |= Ext;
 
+  // INVALID and NONE have no feature names.
   EXPECT_FALSE(AArch64::getExtensionFeatures(AArch64::AEK_INVALID, Features));
   EXPECT_TRUE(!Features.size());
+  // We return True here beccause NONE is a valid choice.
+  EXPECT_TRUE(AArch64::getExtensionFeatures(AArch64::AEK_NONE, Features));
+  EXPECT_TRUE(!Features.size());
 
   AArch64::getExtensionFeatures(ExtVal, Features);
   EXPECT_EQ(Extensions.size(), Features.size());
 
   EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
   EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
   EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
   EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
   EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
   EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
   EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+bf16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+i8mm"));
+  EXPECT_TRUE(ll

[PATCH] D123296: [llvm][AArch64] Generate getExtensionFeatures from the list of extensions

2022-04-11 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 421910.
DavidSpickett added a comment.

Fix a spelling mistake.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123296/new/

https://reviews.llvm.org/D123296

Files:
  clang/test/Preprocessor/aarch64-target-features.c
  llvm/lib/Support/AArch64TargetParser.cpp
  llvm/unittests/Support/TargetParserTest.cpp

Index: llvm/unittests/Support/TargetParserTest.cpp
===
--- llvm/unittests/Support/TargetParserTest.cpp
+++ llvm/unittests/Support/TargetParserTest.cpp
@@ -12,6 +12,7 @@
 #include "llvm/Support/ARMBuildAttributes.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/TargetParser.h"
+#include "gmock/gmock.h"
 #include "gtest/gtest.h"
 #include 
 
@@ -1448,14 +1449,20 @@
 
 TEST(TargetParserTest, AArch64ExtensionFeatures) {
   std::vector Extensions = {
-  AArch64::AEK_CRC, AArch64::AEK_CRYPTO,  AArch64::AEK_FP,
-  AArch64::AEK_SIMD,AArch64::AEK_FP16,AArch64::AEK_PROFILE,
-  AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
-  AArch64::AEK_DOTPROD, AArch64::AEK_SVE, AArch64::AEK_SVE2,
-  AArch64::AEK_SVE2AES, AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3,
-  AArch64::AEK_SVE2BITPERM, AArch64::AEK_RCPC,AArch64::AEK_FP16FML,
-  AArch64::AEK_SME, AArch64::AEK_SMEF64,  AArch64::AEK_SMEI64,
-  AArch64::AEK_PERFMON};
+  AArch64::AEK_CRC, AArch64::AEK_LSE,  AArch64::AEK_RDM,
+  AArch64::AEK_CRYPTO,  AArch64::AEK_SM4,  AArch64::AEK_SHA3,
+  AArch64::AEK_SHA2,AArch64::AEK_AES,  AArch64::AEK_DOTPROD,
+  AArch64::AEK_FP,  AArch64::AEK_SIMD, AArch64::AEK_FP16,
+  AArch64::AEK_FP16FML, AArch64::AEK_PROFILE,  AArch64::AEK_RAS,
+  AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2AES,
+  AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3, AArch64::AEK_SVE2BITPERM,
+  AArch64::AEK_RCPC,AArch64::AEK_RAND, AArch64::AEK_MTE,
+  AArch64::AEK_SSBS,AArch64::AEK_SB,   AArch64::AEK_PREDRES,
+  AArch64::AEK_BF16,AArch64::AEK_I8MM, AArch64::AEK_F32MM,
+  AArch64::AEK_F64MM,   AArch64::AEK_TME,  AArch64::AEK_LS64,
+  AArch64::AEK_BRBE,AArch64::AEK_PAUTH,AArch64::AEK_FLAGM,
+  AArch64::AEK_SME, AArch64::AEK_SMEF64,   AArch64::AEK_SMEI64,
+  AArch64::AEK_HBC, AArch64::AEK_MOPS, AArch64::AEK_PERFMON};
 
   std::vector Features;
 
@@ -1463,34 +1470,65 @@
   for (auto Ext : Extensions)
 ExtVal |= Ext;
 
+  // INVALID and NONE have no feature names.
   EXPECT_FALSE(AArch64::getExtensionFeatures(AArch64::AEK_INVALID, Features));
   EXPECT_TRUE(!Features.size());
+  // We return True here because NONE is a valid choice.
+  EXPECT_TRUE(AArch64::getExtensionFeatures(AArch64::AEK_NONE, Features));
+  EXPECT_TRUE(!Features.size());
 
   AArch64::getExtensionFeatures(ExtVal, Features);
   EXPECT_EQ(Extensions.size(), Features.size());
 
   EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
   EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
   EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
   EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
   EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
   EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
   EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+bf16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+i8mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+f32mm

[PATCH] D123296: [llvm][AArch64] Generate getExtensionFeatures from the list of extensions

2022-04-11 Thread David Spickett via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG55b6a3186cfa: [llvm][AArch64] Generate getExtensionFeatures 
from the list of extensions (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123296/new/

https://reviews.llvm.org/D123296

Files:
  clang/test/Preprocessor/aarch64-target-features.c
  llvm/lib/Support/AArch64TargetParser.cpp
  llvm/unittests/Support/TargetParserTest.cpp

Index: llvm/unittests/Support/TargetParserTest.cpp
===
--- llvm/unittests/Support/TargetParserTest.cpp
+++ llvm/unittests/Support/TargetParserTest.cpp
@@ -12,6 +12,7 @@
 #include "llvm/Support/ARMBuildAttributes.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/TargetParser.h"
+#include "gmock/gmock.h"
 #include "gtest/gtest.h"
 #include 
 
@@ -1448,14 +1449,20 @@
 
 TEST(TargetParserTest, AArch64ExtensionFeatures) {
   std::vector Extensions = {
-  AArch64::AEK_CRC, AArch64::AEK_CRYPTO,  AArch64::AEK_FP,
-  AArch64::AEK_SIMD,AArch64::AEK_FP16,AArch64::AEK_PROFILE,
-  AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
-  AArch64::AEK_DOTPROD, AArch64::AEK_SVE, AArch64::AEK_SVE2,
-  AArch64::AEK_SVE2AES, AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3,
-  AArch64::AEK_SVE2BITPERM, AArch64::AEK_RCPC,AArch64::AEK_FP16FML,
-  AArch64::AEK_SME, AArch64::AEK_SMEF64,  AArch64::AEK_SMEI64,
-  AArch64::AEK_PERFMON};
+  AArch64::AEK_CRC, AArch64::AEK_LSE,  AArch64::AEK_RDM,
+  AArch64::AEK_CRYPTO,  AArch64::AEK_SM4,  AArch64::AEK_SHA3,
+  AArch64::AEK_SHA2,AArch64::AEK_AES,  AArch64::AEK_DOTPROD,
+  AArch64::AEK_FP,  AArch64::AEK_SIMD, AArch64::AEK_FP16,
+  AArch64::AEK_FP16FML, AArch64::AEK_PROFILE,  AArch64::AEK_RAS,
+  AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2AES,
+  AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3, AArch64::AEK_SVE2BITPERM,
+  AArch64::AEK_RCPC,AArch64::AEK_RAND, AArch64::AEK_MTE,
+  AArch64::AEK_SSBS,AArch64::AEK_SB,   AArch64::AEK_PREDRES,
+  AArch64::AEK_BF16,AArch64::AEK_I8MM, AArch64::AEK_F32MM,
+  AArch64::AEK_F64MM,   AArch64::AEK_TME,  AArch64::AEK_LS64,
+  AArch64::AEK_BRBE,AArch64::AEK_PAUTH,AArch64::AEK_FLAGM,
+  AArch64::AEK_SME, AArch64::AEK_SMEF64,   AArch64::AEK_SMEI64,
+  AArch64::AEK_HBC, AArch64::AEK_MOPS, AArch64::AEK_PERFMON};
 
   std::vector Features;
 
@@ -1463,34 +1470,65 @@
   for (auto Ext : Extensions)
 ExtVal |= Ext;
 
+  // INVALID and NONE have no feature names.
   EXPECT_FALSE(AArch64::getExtensionFeatures(AArch64::AEK_INVALID, Features));
   EXPECT_TRUE(!Features.size());
+  // We return True here because NONE is a valid choice.
+  EXPECT_TRUE(AArch64::getExtensionFeatures(AArch64::AEK_NONE, Features));
+  EXPECT_TRUE(!Features.size());
 
   AArch64::getExtensionFeatures(ExtVal, Features);
   EXPECT_EQ(Extensions.size(), Features.size());
 
   EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
   EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
   EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
   EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
   EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
   EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
   EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
   EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
+  

[PATCH] D123601: [clang][AArch64] Split neon tests into 2 files

2022-04-12 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This should reduce the per test execution time and prevent
timeouts in pre-commit buildkite builds.

(for #54821)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123601

Files:
  clang/test/CodeGen/arm_neon_intrinsics.c
  clang/test/CodeGen/arm_neon_intrinsics_2.c

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


[PATCH] D123601: [clang][AArch64] Split neon tests into 2 files

2022-04-12 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

For https://github.com/llvm/llvm-project/issues/54821.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123601/new/

https://reviews.llvm.org/D123601

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


[PATCH] D123498: [clang] Adding Platform/Architecture Specific Resource Header Installation Targets

2022-04-13 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Is there any reason to have an AArch64 specific section? A lot of the files do 
apply to both Arm and AArch64 but for example the mve file Momchil mentioned 
does not.

Would make sense if you wanted AArch64 only there'd be an 
`aarch64-resource-headers`, even if it just makes the config command clearer. 
(I would expect some overlap in the file list though)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123498/new/

https://reviews.llvm.org/D123498

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


[PATCH] D123498: [clang] Adding Platform/Architecture Specific Resource Header Installation Targets

2022-04-13 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Then again a lot of Arm systems can run 32 bit code as well so there is a 
situation where you might include both.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123498/new/

https://reviews.llvm.org/D123498

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


[PATCH] D123498: [clang] Adding Platform/Architecture Specific Resource Header Installation Targets

2022-04-14 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

> Sure, we can have an AArch64 specific section. I have no AArch64/arm 
> background to comment on what the lists should look like. Could you provide a 
> pointer on how to decide what should be AArch64 specific? Thank you!

I looked through the list and here's what goes where:

arm_acle.h - both
arm_cmse.h - Arm only (CMSE is an M profile feature)
armintr.h - Arm only (Windows intrinsics)
arm64intr.h - AArch64 only (Windows intrinsics)

arm_neon.h - both
arm_fp16.h - both

Only includes AArch64 stuff at this time but according to the docs:

  FEAT_FP16 supports:
  • Half-precision data-processing instructions for Advanced SIMD and 
floating-point in both
  AArch64 and AArch32 states.

arm_sve.h - AArch64 (SVE is AArch64 exclusive)
arm_bf16.h - AArch64 only

  "FEAT_BF16 supports the BFloat16, or BF16, 16-bit floating-point storage 
format in AArch64 state." 

arm_mve.h - Arm only (MVE is an M profile feature)
arm_cde.h - Arm only (CDE is an M profile feature)
arm_neon_sve_bridge.h - AArch64 only (SVE is AArch64 exclusive)

@momchil.velikov Please double check I got that right.

So you'd probably want to have an `arm_common`, like you have for the `core`. 
Arm installs `arm_common` and `arm`, AArch64 installs `arm_common` and 
`aarch64`.

Not sure if you'd expect the Windows intrisics files to show up in the 
`windows` headers. My guess is no because you'd configure with Windows and Arm, 
or Windows and AArch64 headers. `windows` would just be arch agnostic stuff.

This split reduces each install by 4 headers. So hardly amazing disk space wise 
but I think your goal is more to only have relevant files and this achieves 
that.

> Then again a lot of Arm systems can run 32 bit code as well so there is a 
> situation where you might include both.

I would guess that having two install targets makes it obvious that if you want 
32 bit code you need to opt into both. (though I am biased since I'm already 
familiar with Arm)

Also, what's the feedback mechanism for issues with these listings? Say we add 
a new Arm header but forget to put it on these lists, who would be the first to 
notice? (I admit I'm not very familiar with the process of distributions)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123498/new/

https://reviews.llvm.org/D123498

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


[PATCH] D123498: [clang] Adding Platform/Architecture Specific Resource Header Installation Targets

2022-04-19 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

The Arm/AArch64 split and the generated files check looks good to me.

Unless I'm missing an existing check, is it possible to check for the existing 
files too? I guess not nicely because along with the resource headers there are 
lots of internal headers, so we'd have to maintain some list of "non resource" 
headers which means we've just created another thing to maintain.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123498/new/

https://reviews.llvm.org/D123498

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


[PATCH] D123498: [clang] Adding Platform/Architecture Specific Resource Header Installation Targets

2022-04-19 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

> Therefore I am keeping this patch in its current shape at this stage.

Sounds good to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123498/new/

https://reviews.llvm.org/D123498

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


[PATCH] D123601: [clang][AArch64] Split neon tests into 2 files

2022-04-22 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett abandoned this revision.
DavidSpickett added a comment.

People are leaning toward fixes on the buildkite side.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123601/new/

https://reviews.llvm.org/D123601

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


[PATCH] D124199: [randstruct] Check final randomized layout ordering

2022-04-22 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

We (Linaro) also got the same failure: 
https://lab.llvm.org/buildbot/#/builders/186/builds/5626


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124199/new/

https://reviews.llvm.org/D124199

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


[PATCH] D124091: [clang][AArch64][SVE] Implement conditional operator for SVE vectors

2022-05-05 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

I think that this has caused assert failures on the VLS (fixed sized vector) 
SVE bot.

https://lab.llvm.org/buildbot/#/builders/176/builds/1632/steps/12/logs/stdio

Based on the other SVE change being in llvm and seeing Sema in the backtrace.

These issues are not on any of the other AArch64 bots or the vector length 
agnostic bot. I appreciate that I'm pulling your change out of a list of 80 
without that much evidence so if it's clearly not the issue just let me know.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124091/new/

https://reviews.llvm.org/D124091

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


[PATCH] D124091: [clang][AArch64][SVE] Implement conditional operator for SVE vectors

2022-05-06 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

> I appreciate that I'm pulling your change out of a list of 80 without that 
> much evidence so if it's clearly not the issue just let me know.

My guess was incorrect, I've tracked this down to a different change. Sorry for 
the noise.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124091/new/

https://reviews.llvm.org/D124091

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


[PATCH] D128411: [syntax] Introduce a TokenManager interface.

2022-07-15 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

FYI, after this change I get:

  
/home/david.spickett/llvm-project/clang/include/clang/Tooling/Syntax/TokenBufferTokenManager.h:20:7:
 warning: 'clang::syntax::TokenBufferTokenManager' has virtual functions but 
non-virtual destructor [-Wnon-virtual-dtor]
  class TokenBufferTokenManager : public TokenManager {
^


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128411/new/

https://reviews.llvm.org/D128411

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


[PATCH] D125788: [flang][driver] Rename `flang-new` as `flang`

2022-05-17 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Do you know how this will work with the llvm-testsuite runs that currrently use 
gfortran for codegen? Here is one we have: 
https://lab.llvm.org/buildbot/#/builders/179/builds/3694

Currently:

  2022-05-17 13:06:53 INFO: Execute: /usr/bin/cmake 
-DCMAKE_C_COMPILER:FILEPATH=/home/tcwg-buildbot/worker/clang-aarch64-full-2stage/stage2.install/bin/clang
 
-DCMAKE_CXX_COMPILER:FILEPATH=/home/tcwg-buildbot/worker/clang-aarch64-full-2stage/stage2.install/bin/clang++
 /home/tcwg-buildbot/worker/clang-aarch64-full-2stage/test/test-suite 
-DCMAKE_C_FLAGS=-mcpu=cortex-a57 -DCMAKE_C_FLAGS_DEBUG= 
-DCMAKE_C_FLAGS_MINSIZEREL= -DCMAKE_C_FLAGS_RELEASE= 
-DCMAKE_C_FLAGS_RELWITHDEBINFO= -DCMAKE_CXX_FLAGS=-mcpu=cortex-a57 
-DCMAKE_CXX_FLAGS_DEBUG= -DCMAKE_CXX_FLAGS_MINSIZEREL= 
-DCMAKE_CXX_FLAGS_RELEASE= -DCMAKE_CXX_FLAGS_RELWITHDEBINFO= 
-DTEST_SUITE_FORTRAN:STRING=ON 
-DCMAKE_Fortran_COMPILER=/home/tcwg-buildbot/worker/clang-aarch64-full-2stage/stage2.install/bin/flang
  <...>
  -- The Fortran compiler identification is unknown
  -- Check for working Fortran compiler: 
/home/tcwg-buildbot/worker/clang-aarch64-full-2stage/stage2.install/bin/flang
  -- Check for working Fortran compiler: 
/home/tcwg-buildbot/worker/clang-aarch64-full-2stage/stage2.install/bin/flang  
-- works
  -- Detecting Fortran compiler ABI info
  -- Detecting Fortran compiler ABI info - failed
  -- Checking whether 
/home/tcwg-buildbot/worker/clang-aarch64-full-2stage/stage2.install/bin/flang 
supports Fortran 90
  -- Checking whether 
/home/tcwg-buildbot/worker/clang-aarch64-full-2stage/stage2.install/bin/flang 
supports Fortran 90 -- yes

Can we expect the current `flang-new`, soon to be `flang` to also cope with 
these tests (I have no expectations myself here, fine if not) or should we move 
the bots to use `flang-to-gfortran`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125788/new/

https://reviews.llvm.org/D125788

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


[PATCH] D125788: [flang][driver] Rename `flang-new` as `flang`

2022-05-17 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

Sounds good to me. https://reviews.llvm.org/D125796 for the bot side, let me 
know if/when the first half of the change goes in.

I'll leave it to others to approve the change overall. I do think being able to 
do `./bin/flang` and get the right flang will save a lot of confusion but I'm 
not a user of either of them myself.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125788/new/

https://reviews.llvm.org/D125788

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


[PATCH] D85118: [clang][AArch64] Correct return type of Neon vqmovun intrinsics

2020-09-17 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 292454.
DavidSpickett added a comment.

Updated to fix all the vqmovun that have incorrect types.

I'm working on a test specifically for intrinic types, using
the function pointer idea. That will be a seperate change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85118/new/

https://reviews.llvm.org/D85118

Files:
  clang/include/clang/Basic/arm_neon.td
  clang/test/CodeGen/aarch64-neon-intrinsics.c
  clang/test/CodeGen/aarch64-neon-misc.c
  clang/test/Sema/arm64-neon-header.c


Index: clang/test/Sema/arm64-neon-header.c
===
--- clang/test/Sema/arm64-neon-header.c
+++ clang/test/Sema/arm64-neon-header.c
@@ -2,6 +2,6 @@
 
 #include 
 
-int16x8_t foo(int8x8_t p0, int16x8_t p1) {
+int16x8_t foo(uint8x8_t p0, int16x8_t p1) {
   return vqmovun_high_s16(p0, p1); // expected-warning {{incompatible vector 
types returning 'uint8x16_t'}}
 }
Index: clang/test/CodeGen/aarch64-neon-misc.c
===
--- clang/test/CodeGen/aarch64-neon-misc.c
+++ clang/test/CodeGen/aarch64-neon-misc.c
@@ -1908,7 +1908,7 @@
 // CHECK:   [[VQMOVUN_V1_I_I:%.*]] = call <8 x i8> 
@llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> %b)
 // CHECK:   [[SHUFFLE_I_I:%.*]] = shufflevector <8 x i8> %a, <8 x i8> 
[[VQMOVUN_V1_I_I]], <16 x i32> 
 // CHECK:   ret <16 x i8> [[SHUFFLE_I_I]]
-int8x16_t test_vqmovun_high_s16(int8x8_t a, int16x8_t b) {
+uint8x16_t test_vqmovun_high_s16(uint8x8_t a, int16x8_t b) {
   return vqmovun_high_s16(a, b);
 }
 
@@ -1918,7 +1918,7 @@
 // CHECK:   [[VQMOVUN_V2_I_I:%.*]] = bitcast <4 x i16> [[VQMOVUN_V1_I_I]] to 
<8 x i8>
 // CHECK:   [[SHUFFLE_I_I:%.*]] = shufflevector <4 x i16> %a, <4 x i16> 
[[VQMOVUN_V1_I_I]], <8 x i32> 
 // CHECK:   ret <8 x i16> [[SHUFFLE_I_I]]
-int16x8_t test_vqmovun_high_s32(int16x4_t a, int32x4_t b) {
+uint16x8_t test_vqmovun_high_s32(uint16x4_t a, int32x4_t b) {
   return vqmovun_high_s32(a, b);
 }
 
@@ -1928,7 +1928,7 @@
 // CHECK:   [[VQMOVUN_V2_I_I:%.*]] = bitcast <2 x i32> [[VQMOVUN_V1_I_I]] to 
<8 x i8>
 // CHECK:   [[SHUFFLE_I_I:%.*]] = shufflevector <2 x i32> %a, <2 x i32> 
[[VQMOVUN_V1_I_I]], <4 x i32> 
 // CHECK:   ret <4 x i32> [[SHUFFLE_I_I]]
-int32x4_t test_vqmovun_high_s64(int32x2_t a, int64x2_t b) {
+uint32x4_t test_vqmovun_high_s64(uint32x2_t a, int64x2_t b) {
   return vqmovun_high_s64(a, b);
 }
 
Index: clang/test/CodeGen/aarch64-neon-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -14094,8 +14094,8 @@
 // CHECK:   [[VQMOVUNH_S16_I:%.*]] = call <8 x i8> 
@llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <8 x i8> [[VQMOVUNH_S16_I]], i64 0
 // CHECK:   ret i8 [[TMP1]]
-int8_t test_vqmovunh_s16(int16_t a) {
-  return (int8_t)vqmovunh_s16(a);
+uint8_t test_vqmovunh_s16(int16_t a) {
+  return (uint8_t)vqmovunh_s16(a);
 }
 
 // CHECK-LABEL: @test_vqmovuns_s32(
@@ -14103,15 +14103,15 @@
 // CHECK:   [[VQMOVUNS_S32_I:%.*]] = call <4 x i16> 
@llvm.aarch64.neon.sqxtun.v4i16(<4 x i32> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <4 x i16> [[VQMOVUNS_S32_I]], i64 0
 // CHECK:   ret i16 [[TMP1]]
-int16_t test_vqmovuns_s32(int32_t a) {
-  return (int16_t)vqmovuns_s32(a);
+uint16_t test_vqmovuns_s32(int32_t a) {
+  return (uint16_t)vqmovuns_s32(a);
 }
 
 // CHECK-LABEL: @test_vqmovund_s64(
 // CHECK:   [[VQMOVUND_S64_I:%.*]] = call i32 
@llvm.aarch64.neon.scalar.sqxtun.i32.i64(i64 %a)
 // CHECK:   ret i32 [[VQMOVUND_S64_I]]
-int32_t test_vqmovund_s64(int64_t a) {
-  return (int32_t)vqmovund_s64(a);
+uint32_t test_vqmovund_s64(int64_t a) {
+  return (uint32_t)vqmovund_s64(a);
 }
 
 // CHECK-LABEL: @test_vqmovnh_s16(
Index: clang/include/clang/Basic/arm_neon.td
===
--- clang/include/clang/Basic/arm_neon.td
+++ clang/include/clang/Basic/arm_neon.td
@@ -830,7 +830,7 @@
 
 

 // Signed integer saturating extract and unsigned narrow to high
-def SQXTUN2 : SOpInst<"vqmovun_high", "(;
+def SQXTUN2 : SOpInst<"vqmovun_high", "(;
 
 

 // Integer saturating extract and narrow to high
@@ -1498,7 +1498,7 @@
 
 

 // Scalar Signed Saturating Extract Unsigned Narrow
-def SCALAR_SQXTUN : SInst<"vqmovun", "(1<)1", "SsSiSl">;
+def SCALAR_SQXTUN : SInst<"vqmovun", "(U1<)1", "SsSiSl">;
 
 

 // Scalar Signed Saturating Extract Narrow


Index: clang/test/Sema/arm64-neon-header.c
===
--- c

[PATCH] D85118: [clang][AArch64] Correct return type of Neon vqmovun intrinsics

2020-09-21 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett updated this revision to Diff 293090.
DavidSpickett added a comment.

Rebased


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85118/new/

https://reviews.llvm.org/D85118

Files:
  clang/include/clang/Basic/arm_neon.td
  clang/test/CodeGen/aarch64-neon-intrinsics.c
  clang/test/CodeGen/aarch64-neon-misc.c
  clang/test/Sema/arm64-neon-header.c


Index: clang/test/Sema/arm64-neon-header.c
===
--- clang/test/Sema/arm64-neon-header.c
+++ clang/test/Sema/arm64-neon-header.c
@@ -2,6 +2,6 @@
 
 #include 
 
-int16x8_t foo(int8x8_t p0, int16x8_t p1) {
+int16x8_t foo(uint8x8_t p0, int16x8_t p1) {
   return vqmovun_high_s16(p0, p1); // expected-warning {{incompatible vector 
types returning 'uint8x16_t'}}
 }
Index: clang/test/CodeGen/aarch64-neon-misc.c
===
--- clang/test/CodeGen/aarch64-neon-misc.c
+++ clang/test/CodeGen/aarch64-neon-misc.c
@@ -1908,7 +1908,7 @@
 // CHECK:   [[VQMOVUN_V1_I_I:%.*]] = call <8 x i8> 
@llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> %b)
 // CHECK:   [[SHUFFLE_I_I:%.*]] = shufflevector <8 x i8> %a, <8 x i8> 
[[VQMOVUN_V1_I_I]], <16 x i32> 
 // CHECK:   ret <16 x i8> [[SHUFFLE_I_I]]
-int8x16_t test_vqmovun_high_s16(int8x8_t a, int16x8_t b) {
+uint8x16_t test_vqmovun_high_s16(uint8x8_t a, int16x8_t b) {
   return vqmovun_high_s16(a, b);
 }
 
@@ -1918,7 +1918,7 @@
 // CHECK:   [[VQMOVUN_V2_I_I:%.*]] = bitcast <4 x i16> [[VQMOVUN_V1_I_I]] to 
<8 x i8>
 // CHECK:   [[SHUFFLE_I_I:%.*]] = shufflevector <4 x i16> %a, <4 x i16> 
[[VQMOVUN_V1_I_I]], <8 x i32> 
 // CHECK:   ret <8 x i16> [[SHUFFLE_I_I]]
-int16x8_t test_vqmovun_high_s32(int16x4_t a, int32x4_t b) {
+uint16x8_t test_vqmovun_high_s32(uint16x4_t a, int32x4_t b) {
   return vqmovun_high_s32(a, b);
 }
 
@@ -1928,7 +1928,7 @@
 // CHECK:   [[VQMOVUN_V2_I_I:%.*]] = bitcast <2 x i32> [[VQMOVUN_V1_I_I]] to 
<8 x i8>
 // CHECK:   [[SHUFFLE_I_I:%.*]] = shufflevector <2 x i32> %a, <2 x i32> 
[[VQMOVUN_V1_I_I]], <4 x i32> 
 // CHECK:   ret <4 x i32> [[SHUFFLE_I_I]]
-int32x4_t test_vqmovun_high_s64(int32x2_t a, int64x2_t b) {
+uint32x4_t test_vqmovun_high_s64(uint32x2_t a, int64x2_t b) {
   return vqmovun_high_s64(a, b);
 }
 
Index: clang/test/CodeGen/aarch64-neon-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -14094,8 +14094,8 @@
 // CHECK:   [[VQMOVUNH_S16_I:%.*]] = call <8 x i8> 
@llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <8 x i8> [[VQMOVUNH_S16_I]], i64 0
 // CHECK:   ret i8 [[TMP1]]
-int8_t test_vqmovunh_s16(int16_t a) {
-  return (int8_t)vqmovunh_s16(a);
+uint8_t test_vqmovunh_s16(int16_t a) {
+  return (uint8_t)vqmovunh_s16(a);
 }
 
 // CHECK-LABEL: @test_vqmovuns_s32(
@@ -14103,15 +14103,15 @@
 // CHECK:   [[VQMOVUNS_S32_I:%.*]] = call <4 x i16> 
@llvm.aarch64.neon.sqxtun.v4i16(<4 x i32> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <4 x i16> [[VQMOVUNS_S32_I]], i64 0
 // CHECK:   ret i16 [[TMP1]]
-int16_t test_vqmovuns_s32(int32_t a) {
-  return (int16_t)vqmovuns_s32(a);
+uint16_t test_vqmovuns_s32(int32_t a) {
+  return (uint16_t)vqmovuns_s32(a);
 }
 
 // CHECK-LABEL: @test_vqmovund_s64(
 // CHECK:   [[VQMOVUND_S64_I:%.*]] = call i32 
@llvm.aarch64.neon.scalar.sqxtun.i32.i64(i64 %a)
 // CHECK:   ret i32 [[VQMOVUND_S64_I]]
-int32_t test_vqmovund_s64(int64_t a) {
-  return (int32_t)vqmovund_s64(a);
+uint32_t test_vqmovund_s64(int64_t a) {
+  return (uint32_t)vqmovund_s64(a);
 }
 
 // CHECK-LABEL: @test_vqmovnh_s16(
Index: clang/include/clang/Basic/arm_neon.td
===
--- clang/include/clang/Basic/arm_neon.td
+++ clang/include/clang/Basic/arm_neon.td
@@ -830,7 +830,7 @@
 
 

 // Signed integer saturating extract and unsigned narrow to high
-def SQXTUN2 : SOpInst<"vqmovun_high", "(;
+def SQXTUN2 : SOpInst<"vqmovun_high", "(;
 
 

 // Integer saturating extract and narrow to high
@@ -1498,7 +1498,7 @@
 
 

 // Scalar Signed Saturating Extract Unsigned Narrow
-def SCALAR_SQXTUN : SInst<"vqmovun", "(1<)1", "SsSiSl">;
+def SCALAR_SQXTUN : SInst<"vqmovun", "(U1<)1", "SsSiSl">;
 
 

 // Scalar Signed Saturating Extract Narrow


Index: clang/test/Sema/arm64-neon-header.c
===
--- clang/test/Sema/arm64-neon-header.c
+++ clang/test/Sema/arm64-neon-header.c
@@ -2,6 +2,6 @@
 
 #include 
 
-int16x8_t foo(int8x8_t p0, int16x8_t p1) {
+int16x8_t foo(uint8x

[PATCH] D85118: [clang][AArch64] Correct return type of Neon vqmovun intrinsics

2020-09-21 Thread David Spickett via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG349af8054218: [clang][AArch64] Correct return type of Neon 
vqmovun intrinsics (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85118/new/

https://reviews.llvm.org/D85118

Files:
  clang/include/clang/Basic/arm_neon.td
  clang/test/CodeGen/aarch64-neon-intrinsics.c
  clang/test/CodeGen/aarch64-neon-misc.c
  clang/test/Sema/arm64-neon-header.c


Index: clang/test/Sema/arm64-neon-header.c
===
--- clang/test/Sema/arm64-neon-header.c
+++ clang/test/Sema/arm64-neon-header.c
@@ -2,6 +2,6 @@
 
 #include 
 
-int16x8_t foo(int8x8_t p0, int16x8_t p1) {
+int16x8_t foo(uint8x8_t p0, int16x8_t p1) {
   return vqmovun_high_s16(p0, p1); // expected-warning {{incompatible vector 
types returning 'uint8x16_t'}}
 }
Index: clang/test/CodeGen/aarch64-neon-misc.c
===
--- clang/test/CodeGen/aarch64-neon-misc.c
+++ clang/test/CodeGen/aarch64-neon-misc.c
@@ -1908,7 +1908,7 @@
 // CHECK:   [[VQMOVUN_V1_I_I:%.*]] = call <8 x i8> 
@llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> %b)
 // CHECK:   [[SHUFFLE_I_I:%.*]] = shufflevector <8 x i8> %a, <8 x i8> 
[[VQMOVUN_V1_I_I]], <16 x i32> 
 // CHECK:   ret <16 x i8> [[SHUFFLE_I_I]]
-int8x16_t test_vqmovun_high_s16(int8x8_t a, int16x8_t b) {
+uint8x16_t test_vqmovun_high_s16(uint8x8_t a, int16x8_t b) {
   return vqmovun_high_s16(a, b);
 }
 
@@ -1918,7 +1918,7 @@
 // CHECK:   [[VQMOVUN_V2_I_I:%.*]] = bitcast <4 x i16> [[VQMOVUN_V1_I_I]] to 
<8 x i8>
 // CHECK:   [[SHUFFLE_I_I:%.*]] = shufflevector <4 x i16> %a, <4 x i16> 
[[VQMOVUN_V1_I_I]], <8 x i32> 
 // CHECK:   ret <8 x i16> [[SHUFFLE_I_I]]
-int16x8_t test_vqmovun_high_s32(int16x4_t a, int32x4_t b) {
+uint16x8_t test_vqmovun_high_s32(uint16x4_t a, int32x4_t b) {
   return vqmovun_high_s32(a, b);
 }
 
@@ -1928,7 +1928,7 @@
 // CHECK:   [[VQMOVUN_V2_I_I:%.*]] = bitcast <2 x i32> [[VQMOVUN_V1_I_I]] to 
<8 x i8>
 // CHECK:   [[SHUFFLE_I_I:%.*]] = shufflevector <2 x i32> %a, <2 x i32> 
[[VQMOVUN_V1_I_I]], <4 x i32> 
 // CHECK:   ret <4 x i32> [[SHUFFLE_I_I]]
-int32x4_t test_vqmovun_high_s64(int32x2_t a, int64x2_t b) {
+uint32x4_t test_vqmovun_high_s64(uint32x2_t a, int64x2_t b) {
   return vqmovun_high_s64(a, b);
 }
 
Index: clang/test/CodeGen/aarch64-neon-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -14094,8 +14094,8 @@
 // CHECK:   [[VQMOVUNH_S16_I:%.*]] = call <8 x i8> 
@llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <8 x i8> [[VQMOVUNH_S16_I]], i64 0
 // CHECK:   ret i8 [[TMP1]]
-int8_t test_vqmovunh_s16(int16_t a) {
-  return (int8_t)vqmovunh_s16(a);
+uint8_t test_vqmovunh_s16(int16_t a) {
+  return (uint8_t)vqmovunh_s16(a);
 }
 
 // CHECK-LABEL: @test_vqmovuns_s32(
@@ -14103,15 +14103,15 @@
 // CHECK:   [[VQMOVUNS_S32_I:%.*]] = call <4 x i16> 
@llvm.aarch64.neon.sqxtun.v4i16(<4 x i32> [[TMP0]])
 // CHECK:   [[TMP1:%.*]] = extractelement <4 x i16> [[VQMOVUNS_S32_I]], i64 0
 // CHECK:   ret i16 [[TMP1]]
-int16_t test_vqmovuns_s32(int32_t a) {
-  return (int16_t)vqmovuns_s32(a);
+uint16_t test_vqmovuns_s32(int32_t a) {
+  return (uint16_t)vqmovuns_s32(a);
 }
 
 // CHECK-LABEL: @test_vqmovund_s64(
 // CHECK:   [[VQMOVUND_S64_I:%.*]] = call i32 
@llvm.aarch64.neon.scalar.sqxtun.i32.i64(i64 %a)
 // CHECK:   ret i32 [[VQMOVUND_S64_I]]
-int32_t test_vqmovund_s64(int64_t a) {
-  return (int32_t)vqmovund_s64(a);
+uint32_t test_vqmovund_s64(int64_t a) {
+  return (uint32_t)vqmovund_s64(a);
 }
 
 // CHECK-LABEL: @test_vqmovnh_s16(
Index: clang/include/clang/Basic/arm_neon.td
===
--- clang/include/clang/Basic/arm_neon.td
+++ clang/include/clang/Basic/arm_neon.td
@@ -830,7 +830,7 @@
 
 

 // Signed integer saturating extract and unsigned narrow to high
-def SQXTUN2 : SOpInst<"vqmovun_high", "(;
+def SQXTUN2 : SOpInst<"vqmovun_high", "(;
 
 

 // Integer saturating extract and narrow to high
@@ -1498,7 +1498,7 @@
 
 

 // Scalar Signed Saturating Extract Unsigned Narrow
-def SCALAR_SQXTUN : SInst<"vqmovun", "(1<)1", "SsSiSl">;
+def SCALAR_SQXTUN : SInst<"vqmovun", "(U1<)1", "SsSiSl">;
 
 

 // Scalar Signed Saturating Extract Narrow


Index: clang/test/Sema/arm64-neon-header.c
===
--- clang/te

[PATCH] D88009: [AArch64] Fix return type of Neon scalar comparison intrinsics

2020-09-21 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added subscribers: cfe-commits, danielkiss, kristof.beyls.
Herald added a project: clang.
DavidSpickett requested review of this revision.

The following should have unsigned return types
but were signed:
vceqd_s64 vceqzd_s64 vcged_s64 vcgezd_s64
vcgtd_s64 vcgtzd_s64 vcled_s64 vclezd_s64
vcltd_s64 vcltzd_s64 vtstd_s64

See https://developer.arm.com/documentation/ihi0073/latest


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88009

Files:
  clang/include/clang/Basic/arm_neon.td
  clang/test/CodeGen/aarch64-neon-intrinsics.c

Index: clang/test/CodeGen/aarch64-neon-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -13746,8 +13746,8 @@
 // CHECK:   [[TMP0:%.*]] = icmp eq i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vceqd_s64(int64_t a, int64_t b) {
-  return (int64_t)vceqd_s64(a, b);
+uint64_t test_vceqd_s64(int64_t a, int64_t b) {
+  return (uint64_t)vceqd_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vceqd_u64(
@@ -13762,8 +13762,8 @@
 // CHECK:   [[TMP0:%.*]] = icmp eq i64 %a, 0
 // CHECK:   [[VCEQZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQZ_I]]
-int64_t test_vceqzd_s64(int64_t a) {
-  return (int64_t)vceqzd_s64(a);
+uint64_t test_vceqzd_s64(int64_t a) {
+  return (uint64_t)vceqzd_s64(a);
 }
 
 // CHECK-LABEL: @test_vceqzd_u64(
@@ -13778,8 +13778,8 @@
 // CHECK:   [[TMP0:%.*]] = icmp sge i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vcged_s64(int64_t a, int64_t b) {
-  return (int64_t)vcged_s64(a, b);
+uint64_t test_vcged_s64(int64_t a, int64_t b) {
+  return (uint64_t)vcged_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vcged_u64(
@@ -13794,16 +13794,16 @@
 // CHECK:   [[TMP0:%.*]] = icmp sge i64 %a, 0
 // CHECK:   [[VCGEZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCGEZ_I]]
-int64_t test_vcgezd_s64(int64_t a) {
-  return (int64_t)vcgezd_s64(a);
+uint64_t test_vcgezd_s64(int64_t a) {
+  return (uint64_t)vcgezd_s64(a);
 }
 
 // CHECK-LABEL: @test_vcgtd_s64(
 // CHECK:   [[TMP0:%.*]] = icmp sgt i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vcgtd_s64(int64_t a, int64_t b) {
-  return (int64_t)vcgtd_s64(a, b);
+uint64_t test_vcgtd_s64(int64_t a, int64_t b) {
+  return (uint64_t)vcgtd_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vcgtd_u64(
@@ -13818,16 +13818,16 @@
 // CHECK:   [[TMP0:%.*]] = icmp sgt i64 %a, 0
 // CHECK:   [[VCGTZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCGTZ_I]]
-int64_t test_vcgtzd_s64(int64_t a) {
-  return (int64_t)vcgtzd_s64(a);
+uint64_t test_vcgtzd_s64(int64_t a) {
+  return (uint64_t)vcgtzd_s64(a);
 }
 
 // CHECK-LABEL: @test_vcled_s64(
 // CHECK:   [[TMP0:%.*]] = icmp sle i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vcled_s64(int64_t a, int64_t b) {
-  return (int64_t)vcled_s64(a, b);
+uint64_t test_vcled_s64(int64_t a, int64_t b) {
+  return (uint64_t)vcled_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vcled_u64(
@@ -13842,16 +13842,16 @@
 // CHECK:   [[TMP0:%.*]] = icmp sle i64 %a, 0
 // CHECK:   [[VCLEZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCLEZ_I]]
-int64_t test_vclezd_s64(int64_t a) {
-  return (int64_t)vclezd_s64(a);
+uint64_t test_vclezd_s64(int64_t a) {
+  return (uint64_t)vclezd_s64(a);
 }
 
 // CHECK-LABEL: @test_vcltd_s64(
 // CHECK:   [[TMP0:%.*]] = icmp slt i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vcltd_s64(int64_t a, int64_t b) {
-  return (int64_t)vcltd_s64(a, b);
+uint64_t test_vcltd_s64(int64_t a, int64_t b) {
+  return (uint64_t)vcltd_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vcltd_u64(
@@ -13866,8 +13866,8 @@
 // CHECK:   [[TMP0:%.*]] = icmp slt i64 %a, 0
 // CHECK:   [[VCLTZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCLTZ_I]]
-int64_t test_vcltzd_s64(int64_t a) {
-  return (int64_t)vcltzd_s64(a);
+uint64_t test_vcltzd_s64(int64_t a) {
+  return (uint64_t)vcltzd_s64(a);
 }
 
 // CHECK-LABEL: @test_vtstd_s64(
@@ -13875,8 +13875,8 @@
 // CHECK:   [[TMP1:%.*]] = icmp ne i64 [[TMP0]], 0
 // CHECK:   [[VTSTD_I:%.*]] = sext i1 [[TMP1]] to i64
 // CHECK:   ret i64 [[VTSTD_I]]
-int64_t test_vtstd_s64(int64_t a, int64_t b) {
-  return (int64_t)vtstd_s64(a, b);
+uint64_t test_vtstd_s64(int64_t a, int64_t b) {
+  return (uint64_t)vtstd_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vtstd_u64(
Index: clang/include/clang/Basic/arm_neon.td
===
--- clang/include/clang/Basic/arm_neon.td
+++ clang/include/clang/Basic/arm_neon.td
@@ -1419,19 +1419,19 @@
 
 
 // Scalar I

[PATCH] D88009: [AArch64] Fix return type of Neon scalar comparison intrinsics

2020-09-21 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a reviewer: efriedma.
DavidSpickett added a comment.

Links instead of searching the document:
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vceqd_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vceqzd_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vcged_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vcgezd_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vcgtd_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vcgtzd_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vcled_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vclezd_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vcltd_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vcltzd_s64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vtstd_s64

There should be one more set of fixes like this, then I'll get a proper types 
test added. (at least for base Neon)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88009/new/

https://reviews.llvm.org/D88009

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


[PATCH] D88013: [AArch64] Correct parameter type for Neon scalar shift intrinsics

2020-09-21 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added subscribers: cfe-commits, danielkiss, kristof.beyls.
Herald added a project: clang.
DavidSpickett requested review of this revision.

In the following intrinsics the shift amount
(parameter 2) should be signed.

vqshlh_u16  vqshls_u32  vqshld_u64
vqrshlh_u16 vqrshls_u32 vqrshld_u64
vqshlb_u8
vqrshlb_u8
vshld_u64
vrshld_u64

See https://developer.arm.com/documentation/ihi0073/latest


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88013

Files:
  clang/include/clang/Basic/arm_neon.td
  clang/test/CodeGen/aarch64-neon-intrinsics.c

Index: clang/test/CodeGen/aarch64-neon-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -8548,7 +8548,7 @@
 // CHECK-LABEL: @test_vshld_u64(
 // CHECK:   [[VSHLD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.ushl.i64(i64 %a, i64 %b)
 // CHECK:   ret i64 [[VSHLD_U64_I]]
-uint64_t test_vshld_u64(uint64_t a, uint64_t b) {
+uint64_t test_vshld_u64(uint64_t a, int64_t b) {
   return vshld_u64(a, b);
 }
 
@@ -8592,7 +8592,7 @@
 // CHECK:   [[VQSHLB_U8_I:%.*]] = call <8 x i8> @llvm.aarch64.neon.uqshl.v8i8(<8 x i8> [[TMP0]], <8 x i8> [[TMP1]])
 // CHECK:   [[TMP2:%.*]] = extractelement <8 x i8> [[VQSHLB_U8_I]], i64 0
 // CHECK:   ret i8 [[TMP2]]
-uint8_t test_vqshlb_u8(uint8_t a, uint8_t b) {
+uint8_t test_vqshlb_u8(uint8_t a, int8_t b) {
   return vqshlb_u8(a, b);
 }
 
@@ -8602,21 +8602,21 @@
 // CHECK:   [[VQSHLH_U16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.uqshl.v4i16(<4 x i16> [[TMP0]], <4 x i16> [[TMP1]])
 // CHECK:   [[TMP2:%.*]] = extractelement <4 x i16> [[VQSHLH_U16_I]], i64 0
 // CHECK:   ret i16 [[TMP2]]
-uint16_t test_vqshlh_u16(uint16_t a, uint16_t b) {
+uint16_t test_vqshlh_u16(uint16_t a, int16_t b) {
   return vqshlh_u16(a, b);
 }
 
 // CHECK-LABEL: @test_vqshls_u32(
 // CHECK:   [[VQSHLS_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uqshl.i32(i32 %a, i32 %b)
 // CHECK:   ret i32 [[VQSHLS_U32_I]]
-uint32_t test_vqshls_u32(uint32_t a, uint32_t b) {
+uint32_t test_vqshls_u32(uint32_t a, int32_t b) {
   return vqshls_u32(a, b);
 }
 
 // CHECK-LABEL: @test_vqshld_u64(
 // CHECK:   [[VQSHLD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.uqshl.i64(i64 %a, i64 %b)
 // CHECK:   ret i64 [[VQSHLD_U64_I]]
-uint64_t test_vqshld_u64(uint64_t a, uint64_t b) {
+uint64_t test_vqshld_u64(uint64_t a, int64_t b) {
   return vqshld_u64(a, b);
 }
 
@@ -8630,7 +8630,7 @@
 // CHECK-LABEL: @test_vrshld_u64(
 // CHECK:   [[VRSHLD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.urshl.i64(i64 %a, i64 %b)
 // CHECK:   ret i64 [[VRSHLD_U64_I]]
-uint64_t test_vrshld_u64(uint64_t a, uint64_t b) {
+uint64_t test_vrshld_u64(uint64_t a, int64_t b) {
   return vrshld_u64(a, b);
 }
 
@@ -8674,7 +8674,7 @@
 // CHECK:   [[VQRSHLB_U8_I:%.*]] = call <8 x i8> @llvm.aarch64.neon.uqrshl.v8i8(<8 x i8> [[TMP0]], <8 x i8> [[TMP1]])
 // CHECK:   [[TMP2:%.*]] = extractelement <8 x i8> [[VQRSHLB_U8_I]], i64 0
 // CHECK:   ret i8 [[TMP2]]
-uint8_t test_vqrshlb_u8(uint8_t a, uint8_t b) {
+uint8_t test_vqrshlb_u8(uint8_t a, int8_t b) {
   return vqrshlb_u8(a, b);
 }
 
@@ -8684,21 +8684,21 @@
 // CHECK:   [[VQRSHLH_U16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.uqrshl.v4i16(<4 x i16> [[TMP0]], <4 x i16> [[TMP1]])
 // CHECK:   [[TMP2:%.*]] = extractelement <4 x i16> [[VQRSHLH_U16_I]], i64 0
 // CHECK:   ret i16 [[TMP2]]
-uint16_t test_vqrshlh_u16(uint16_t a, uint16_t b) {
+uint16_t test_vqrshlh_u16(uint16_t a, int16_t b) {
   return vqrshlh_u16(a, b);
 }
 
 // CHECK-LABEL: @test_vqrshls_u32(
 // CHECK:   [[VQRSHLS_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uqrshl.i32(i32 %a, i32 %b)
 // CHECK:   ret i32 [[VQRSHLS_U32_I]]
-uint32_t test_vqrshls_u32(uint32_t a, uint32_t b) {
+uint32_t test_vqrshls_u32(uint32_t a, int32_t b) {
   return vqrshls_u32(a, b);
 }
 
 // CHECK-LABEL: @test_vqrshld_u64(
 // CHECK:   [[VQRSHLD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.uqrshl.i64(i64 %a, i64 %b)
 // CHECK:   ret i64 [[VQRSHLD_U64_I]]
-uint64_t test_vqrshld_u64(uint64_t a, uint64_t b) {
+uint64_t test_vqrshld_u64(uint64_t a, int64_t b) {
   return vqrshld_u64(a, b);
 }
 
Index: clang/include/clang/Basic/arm_neon.td
===
--- clang/include/clang/Basic/arm_neon.td
+++ clang/include/clang/Basic/arm_neon.td
@@ -1263,13 +1263,13 @@
 
 // Scalar Shift
 // Scalar Shift Left
-def SCALAR_SHL: SInst<"vshl", "111", "SlSUl">;
+def SCALAR_SHL: SInst<"vshl", "11(S1)", "SlSUl">;
 // Scalar Saturating Shift Left
-def SCALAR_QSHL: SInst<"vqshl", "111", "ScSsSiSlSUcSUsSUiSUl">;
+def SCALAR_QSHL: SInst<"vqshl", "11(S1)", "ScSsSiSlSUcSUsSUiSUl">;
 // Scalar Saturating Rounding Shift Left
-def SCALAR_QRSHL: SInst<"vqrshl", "111", "ScSsSiSlSUcSUsSUiSUl">;
+def SCALAR_QRSHL: SInst<"vqrshl", "11(S1)", "ScSsSiSlSUcSUsSUiSUl">;
 // Scalar Shift

[PATCH] D88013: [AArch64] Correct parameter type for Neon scalar shift intrinsics

2020-09-21 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a reviewer: efriedma.
DavidSpickett added a comment.

Links to save combing the document:
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vqshlh_u16
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vqshls_u32
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vqshld_u64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vqrshlh_u16
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vqrshls_u32
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vqrshld_u64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vqshlb_u8
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vqrshlb_u8
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vshld_u64
https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=vrshld_u64


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88013/new/

https://reviews.llvm.org/D88013

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


[PATCH] D88009: [AArch64] Fix return type of Neon scalar comparison intrinsics

2020-09-22 Thread David Spickett via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf93514545cd9: [AArch64] Fix return type of Neon scalar 
comparison intrinsics (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88009/new/

https://reviews.llvm.org/D88009

Files:
  clang/include/clang/Basic/arm_neon.td
  clang/test/CodeGen/aarch64-neon-intrinsics.c

Index: clang/test/CodeGen/aarch64-neon-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -13746,8 +13746,8 @@
 // CHECK:   [[TMP0:%.*]] = icmp eq i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vceqd_s64(int64_t a, int64_t b) {
-  return (int64_t)vceqd_s64(a, b);
+uint64_t test_vceqd_s64(int64_t a, int64_t b) {
+  return (uint64_t)vceqd_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vceqd_u64(
@@ -13762,8 +13762,8 @@
 // CHECK:   [[TMP0:%.*]] = icmp eq i64 %a, 0
 // CHECK:   [[VCEQZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQZ_I]]
-int64_t test_vceqzd_s64(int64_t a) {
-  return (int64_t)vceqzd_s64(a);
+uint64_t test_vceqzd_s64(int64_t a) {
+  return (uint64_t)vceqzd_s64(a);
 }
 
 // CHECK-LABEL: @test_vceqzd_u64(
@@ -13778,8 +13778,8 @@
 // CHECK:   [[TMP0:%.*]] = icmp sge i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vcged_s64(int64_t a, int64_t b) {
-  return (int64_t)vcged_s64(a, b);
+uint64_t test_vcged_s64(int64_t a, int64_t b) {
+  return (uint64_t)vcged_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vcged_u64(
@@ -13794,16 +13794,16 @@
 // CHECK:   [[TMP0:%.*]] = icmp sge i64 %a, 0
 // CHECK:   [[VCGEZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCGEZ_I]]
-int64_t test_vcgezd_s64(int64_t a) {
-  return (int64_t)vcgezd_s64(a);
+uint64_t test_vcgezd_s64(int64_t a) {
+  return (uint64_t)vcgezd_s64(a);
 }
 
 // CHECK-LABEL: @test_vcgtd_s64(
 // CHECK:   [[TMP0:%.*]] = icmp sgt i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vcgtd_s64(int64_t a, int64_t b) {
-  return (int64_t)vcgtd_s64(a, b);
+uint64_t test_vcgtd_s64(int64_t a, int64_t b) {
+  return (uint64_t)vcgtd_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vcgtd_u64(
@@ -13818,16 +13818,16 @@
 // CHECK:   [[TMP0:%.*]] = icmp sgt i64 %a, 0
 // CHECK:   [[VCGTZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCGTZ_I]]
-int64_t test_vcgtzd_s64(int64_t a) {
-  return (int64_t)vcgtzd_s64(a);
+uint64_t test_vcgtzd_s64(int64_t a) {
+  return (uint64_t)vcgtzd_s64(a);
 }
 
 // CHECK-LABEL: @test_vcled_s64(
 // CHECK:   [[TMP0:%.*]] = icmp sle i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vcled_s64(int64_t a, int64_t b) {
-  return (int64_t)vcled_s64(a, b);
+uint64_t test_vcled_s64(int64_t a, int64_t b) {
+  return (uint64_t)vcled_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vcled_u64(
@@ -13842,16 +13842,16 @@
 // CHECK:   [[TMP0:%.*]] = icmp sle i64 %a, 0
 // CHECK:   [[VCLEZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCLEZ_I]]
-int64_t test_vclezd_s64(int64_t a) {
-  return (int64_t)vclezd_s64(a);
+uint64_t test_vclezd_s64(int64_t a) {
+  return (uint64_t)vclezd_s64(a);
 }
 
 // CHECK-LABEL: @test_vcltd_s64(
 // CHECK:   [[TMP0:%.*]] = icmp slt i64 %a, %b
 // CHECK:   [[VCEQD_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCEQD_I]]
-int64_t test_vcltd_s64(int64_t a, int64_t b) {
-  return (int64_t)vcltd_s64(a, b);
+uint64_t test_vcltd_s64(int64_t a, int64_t b) {
+  return (uint64_t)vcltd_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vcltd_u64(
@@ -13866,8 +13866,8 @@
 // CHECK:   [[TMP0:%.*]] = icmp slt i64 %a, 0
 // CHECK:   [[VCLTZ_I:%.*]] = sext i1 [[TMP0]] to i64
 // CHECK:   ret i64 [[VCLTZ_I]]
-int64_t test_vcltzd_s64(int64_t a) {
-  return (int64_t)vcltzd_s64(a);
+uint64_t test_vcltzd_s64(int64_t a) {
+  return (uint64_t)vcltzd_s64(a);
 }
 
 // CHECK-LABEL: @test_vtstd_s64(
@@ -13875,8 +13875,8 @@
 // CHECK:   [[TMP1:%.*]] = icmp ne i64 [[TMP0]], 0
 // CHECK:   [[VTSTD_I:%.*]] = sext i1 [[TMP1]] to i64
 // CHECK:   ret i64 [[VTSTD_I]]
-int64_t test_vtstd_s64(int64_t a, int64_t b) {
-  return (int64_t)vtstd_s64(a, b);
+uint64_t test_vtstd_s64(int64_t a, int64_t b) {
+  return (uint64_t)vtstd_s64(a, b);
 }
 
 // CHECK-LABEL: @test_vtstd_u64(
Index: clang/include/clang/Basic/arm_neon.td
===
--- clang/include/clang/Basic/arm_neon.td
+++ clang/include/clang/Basic/arm_neon.td
@@ -1419,19 +1419,19 @@
 
 
 // Scalar Integer Comparison
-def SCALAR_CMEQ : SInst<"vceq", "111", "SlSUl">;
-def SCALAR_CMEQZ : SInst<"vceqz", "11", "SlSUl">;
-def SCALAR_CMGE : SInst<"vcge", "111", 

[PATCH] D93022: [ARM][AArch64] Add Cortex-A78C Support for Clang and LLVM

2020-12-10 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments.



Comment at: llvm/unittests/Support/TargetParserTest.cpp:833
+}
+  }
   pass &= AArch64::getCPUAttr(AK).equals(CPUAttr);

I assume this was left in from debugging, if not it should be its own change.
(considering this file is already using gtest, you could refactor to ASSERT_EQ 
the flags and get the messages for free)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93022/new/

https://reviews.llvm.org/D93022

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


[PATCH] D93022: [ARM][AArch64] Add Cortex-A78C Support for Clang and LLVM

2020-12-10 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments.



Comment at: llvm/unittests/Support/TargetParserTest.cpp:833
+}
+  }
   pass &= AArch64::getCPUAttr(AK).equals(CPUAttr);

MarkMurrayARM wrote:
> DavidSpickett wrote:
> > I assume this was left in from debugging, if not it should be its own 
> > change.
> > (considering this file is already using gtest, you could refactor to 
> > ASSERT_EQ the flags and get the messages for free)
> I like the idea of ASSERT_EQ, but I need the numbers to be in hex.
(assuming llvm's copy of GTest supports it)
https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#using-a-predicate-formatter


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93022/new/

https://reviews.llvm.org/D93022

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


[PATCH] D92006: Refactoring the attribute plugin example to fit the new API

2020-12-21 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

The last update didn't update the expected errors. I have done so in 
9a93f95fce91fb4616cee0f307b564b253789282 
 and it's 
now passing. (I think it missed the bots since they don't build examples)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92006/new/

https://reviews.llvm.org/D92006

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


[PATCH] D90921: [Clang][AArch64] Remove unused prefix in constrained rounding test

2020-11-06 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added subscribers: cfe-commits, danielkiss, kristof.beyls.
Herald added a project: clang.
DavidSpickett requested review of this revision.

This test was added in 7f38812d5b7e0fd5145e44d5ae831a67d782dca6 

and all the other tests make use of the COMMONIR check. So I think
this was left in by mistake for this particular test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90921

Files:
  clang/test/CodeGen/arm64-vrnd-constrained.c


Index: clang/test/CodeGen/arm64-vrnd-constrained.c
===
--- clang/test/CodeGen/arm64-vrnd-constrained.c
+++ clang/test/CodeGen/arm64-vrnd-constrained.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon 
-ffreestanding -flax-vector-conversions=none -emit-llvm -o - %s \
-// RUN: | FileCheck --check-prefix=COMMON --check-prefix=COMMONIR 
--check-prefix=UNCONSTRAINED %s
+// RUN: | FileCheck --check-prefix=COMMON --check-prefix=UNCONSTRAINED %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon 
-ffreestanding -flax-vector-conversions=none 
-fexperimental-strict-floating-point -ffp-exception-behavior=strict -emit-llvm 
-o - %s \
-// RUN: | FileCheck --check-prefix=COMMON --check-prefix=COMMONIR 
--check-prefix=CONSTRAINED %s
+// RUN: | FileCheck --check-prefix=COMMON --check-prefix=CONSTRAINED %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon 
-ffreestanding -flax-vector-conversions=none -emit-llvm -o - %s | llc -o=- - \
 // RUN: | FileCheck --check-prefix=COMMON --check-prefix=CHECK-ASM %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon 
-ffreestanding -flax-vector-conversions=none 
-fexperimental-strict-floating-point -ffp-exception-behavior=strict -emit-llvm 
-o - %s | llc -o=- - \


Index: clang/test/CodeGen/arm64-vrnd-constrained.c
===
--- clang/test/CodeGen/arm64-vrnd-constrained.c
+++ clang/test/CodeGen/arm64-vrnd-constrained.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -flax-vector-conversions=none -emit-llvm -o - %s \
-// RUN: | FileCheck --check-prefix=COMMON --check-prefix=COMMONIR --check-prefix=UNCONSTRAINED %s
+// RUN: | FileCheck --check-prefix=COMMON --check-prefix=UNCONSTRAINED %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -flax-vector-conversions=none -fexperimental-strict-floating-point -ffp-exception-behavior=strict -emit-llvm -o - %s \
-// RUN: | FileCheck --check-prefix=COMMON --check-prefix=COMMONIR --check-prefix=CONSTRAINED %s
+// RUN: | FileCheck --check-prefix=COMMON --check-prefix=CONSTRAINED %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -flax-vector-conversions=none -emit-llvm -o - %s | llc -o=- - \
 // RUN: | FileCheck --check-prefix=COMMON --check-prefix=CHECK-ASM %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -flax-vector-conversions=none -fexperimental-strict-floating-point -ffp-exception-behavior=strict -emit-llvm -o - %s | llc -o=- - \
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D90921: [Clang][AArch64] Remove unused prefix in constrained rounding test

2020-11-06 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a reviewer: kpn.
DavidSpickett added a comment.

In case this looks like a spammy change, this is for 
http://llvm.1065342.n5.nabble.com/llvm-dev-RFC-FileCheck-dis-allowing-unused-prefixes-td142255.html

AFAICT there is no common IR to check for in this test, unlike the others.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90921/new/

https://reviews.llvm.org/D90921

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


[PATCH] D90921: [Clang][AArch64] Remove unused prefix in constrained rounding test

2020-11-06 Thread David Spickett via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGaecd52b97bb4: [Clang][AArch64] Remove unused prefix in 
constrained rounding test (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90921/new/

https://reviews.llvm.org/D90921

Files:
  clang/test/CodeGen/arm64-vrnd-constrained.c


Index: clang/test/CodeGen/arm64-vrnd-constrained.c
===
--- clang/test/CodeGen/arm64-vrnd-constrained.c
+++ clang/test/CodeGen/arm64-vrnd-constrained.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon 
-ffreestanding -flax-vector-conversions=none -emit-llvm -o - %s \
-// RUN: | FileCheck --check-prefix=COMMON --check-prefix=COMMONIR 
--check-prefix=UNCONSTRAINED %s
+// RUN: | FileCheck --check-prefix=COMMON --check-prefix=UNCONSTRAINED %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon 
-ffreestanding -flax-vector-conversions=none 
-fexperimental-strict-floating-point -ffp-exception-behavior=strict -emit-llvm 
-o - %s \
-// RUN: | FileCheck --check-prefix=COMMON --check-prefix=COMMONIR 
--check-prefix=CONSTRAINED %s
+// RUN: | FileCheck --check-prefix=COMMON --check-prefix=CONSTRAINED %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon 
-ffreestanding -flax-vector-conversions=none -emit-llvm -o - %s | llc -o=- - \
 // RUN: | FileCheck --check-prefix=COMMON --check-prefix=CHECK-ASM %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon 
-ffreestanding -flax-vector-conversions=none 
-fexperimental-strict-floating-point -ffp-exception-behavior=strict -emit-llvm 
-o - %s | llc -o=- - \


Index: clang/test/CodeGen/arm64-vrnd-constrained.c
===
--- clang/test/CodeGen/arm64-vrnd-constrained.c
+++ clang/test/CodeGen/arm64-vrnd-constrained.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -flax-vector-conversions=none -emit-llvm -o - %s \
-// RUN: | FileCheck --check-prefix=COMMON --check-prefix=COMMONIR --check-prefix=UNCONSTRAINED %s
+// RUN: | FileCheck --check-prefix=COMMON --check-prefix=UNCONSTRAINED %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -flax-vector-conversions=none -fexperimental-strict-floating-point -ffp-exception-behavior=strict -emit-llvm -o - %s \
-// RUN: | FileCheck --check-prefix=COMMON --check-prefix=COMMONIR --check-prefix=CONSTRAINED %s
+// RUN: | FileCheck --check-prefix=COMMON --check-prefix=CONSTRAINED %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -flax-vector-conversions=none -emit-llvm -o - %s | llc -o=- - \
 // RUN: | FileCheck --check-prefix=COMMON --check-prefix=CHECK-ASM %s
 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -flax-vector-conversions=none -fexperimental-strict-floating-point -ffp-exception-behavior=strict -emit-llvm -o - %s | llc -o=- - \
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D91799: [clang-format] State where clang-format-diff.py should be run from

2020-11-19 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
DavidSpickett requested review of this revision.

At least with git, file paths in a diff will be relative
to the repo root. So if you are in "llvm-project/lldb"
and the diff shows "clang/foo" modified you get:
No such file or directory

>From clang-format-diff.py, since clang-format was
asked to read:
llvm-project/lldb/clang/foo

Add a note to the docs to explain this.

(there is `git diff --relative` but that excludes
changes outside of the current dir)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91799

Files:
  clang/docs/ClangFormat.rst


Index: clang/docs/ClangFormat.rst
===
--- clang/docs/ClangFormat.rst
+++ clang/docs/ClangFormat.rst
@@ -248,6 +248,9 @@
 The option `-U0` will create a diff without context lines (the script would 
format
 those as well).
 
+These commands use the file paths shown in the diff output
+so they will only work from the root of the repository.
+
 Current State of Clang Format for LLVM
 ==
 


Index: clang/docs/ClangFormat.rst
===
--- clang/docs/ClangFormat.rst
+++ clang/docs/ClangFormat.rst
@@ -248,6 +248,9 @@
 The option `-U0` will create a diff without context lines (the script would format
 those as well).
 
+These commands use the file paths shown in the diff output
+so they will only work from the root of the repository.
+
 Current State of Clang Format for LLVM
 ==
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D88013: [AArch64] Correct parameter type for unsigned Neon scalar shift intrinsics

2020-10-05 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a comment.

ping!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88013/new/

https://reviews.llvm.org/D88013

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


[PATCH] D88013: [AArch64] Correct parameter type for unsigned Neon scalar shift intrinsics

2020-10-06 Thread David Spickett via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf0a78bdfdc6d: [AArch64] Correct parameter type for unsigned 
Neon scalar shift intrinsics (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88013/new/

https://reviews.llvm.org/D88013

Files:
  clang/include/clang/Basic/arm_neon.td
  clang/test/CodeGen/aarch64-neon-intrinsics.c

Index: clang/test/CodeGen/aarch64-neon-intrinsics.c
===
--- clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -8548,7 +8548,7 @@
 // CHECK-LABEL: @test_vshld_u64(
 // CHECK:   [[VSHLD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.ushl.i64(i64 %a, i64 %b)
 // CHECK:   ret i64 [[VSHLD_U64_I]]
-uint64_t test_vshld_u64(uint64_t a, uint64_t b) {
+uint64_t test_vshld_u64(uint64_t a, int64_t b) {
   return vshld_u64(a, b);
 }
 
@@ -8592,7 +8592,7 @@
 // CHECK:   [[VQSHLB_U8_I:%.*]] = call <8 x i8> @llvm.aarch64.neon.uqshl.v8i8(<8 x i8> [[TMP0]], <8 x i8> [[TMP1]])
 // CHECK:   [[TMP2:%.*]] = extractelement <8 x i8> [[VQSHLB_U8_I]], i64 0
 // CHECK:   ret i8 [[TMP2]]
-uint8_t test_vqshlb_u8(uint8_t a, uint8_t b) {
+uint8_t test_vqshlb_u8(uint8_t a, int8_t b) {
   return vqshlb_u8(a, b);
 }
 
@@ -8602,21 +8602,21 @@
 // CHECK:   [[VQSHLH_U16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.uqshl.v4i16(<4 x i16> [[TMP0]], <4 x i16> [[TMP1]])
 // CHECK:   [[TMP2:%.*]] = extractelement <4 x i16> [[VQSHLH_U16_I]], i64 0
 // CHECK:   ret i16 [[TMP2]]
-uint16_t test_vqshlh_u16(uint16_t a, uint16_t b) {
+uint16_t test_vqshlh_u16(uint16_t a, int16_t b) {
   return vqshlh_u16(a, b);
 }
 
 // CHECK-LABEL: @test_vqshls_u32(
 // CHECK:   [[VQSHLS_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uqshl.i32(i32 %a, i32 %b)
 // CHECK:   ret i32 [[VQSHLS_U32_I]]
-uint32_t test_vqshls_u32(uint32_t a, uint32_t b) {
+uint32_t test_vqshls_u32(uint32_t a, int32_t b) {
   return vqshls_u32(a, b);
 }
 
 // CHECK-LABEL: @test_vqshld_u64(
 // CHECK:   [[VQSHLD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.uqshl.i64(i64 %a, i64 %b)
 // CHECK:   ret i64 [[VQSHLD_U64_I]]
-uint64_t test_vqshld_u64(uint64_t a, uint64_t b) {
+uint64_t test_vqshld_u64(uint64_t a, int64_t b) {
   return vqshld_u64(a, b);
 }
 
@@ -8630,7 +8630,7 @@
 // CHECK-LABEL: @test_vrshld_u64(
 // CHECK:   [[VRSHLD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.urshl.i64(i64 %a, i64 %b)
 // CHECK:   ret i64 [[VRSHLD_U64_I]]
-uint64_t test_vrshld_u64(uint64_t a, uint64_t b) {
+uint64_t test_vrshld_u64(uint64_t a, int64_t b) {
   return vrshld_u64(a, b);
 }
 
@@ -8674,7 +8674,7 @@
 // CHECK:   [[VQRSHLB_U8_I:%.*]] = call <8 x i8> @llvm.aarch64.neon.uqrshl.v8i8(<8 x i8> [[TMP0]], <8 x i8> [[TMP1]])
 // CHECK:   [[TMP2:%.*]] = extractelement <8 x i8> [[VQRSHLB_U8_I]], i64 0
 // CHECK:   ret i8 [[TMP2]]
-uint8_t test_vqrshlb_u8(uint8_t a, uint8_t b) {
+uint8_t test_vqrshlb_u8(uint8_t a, int8_t b) {
   return vqrshlb_u8(a, b);
 }
 
@@ -8684,21 +8684,21 @@
 // CHECK:   [[VQRSHLH_U16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.uqrshl.v4i16(<4 x i16> [[TMP0]], <4 x i16> [[TMP1]])
 // CHECK:   [[TMP2:%.*]] = extractelement <4 x i16> [[VQRSHLH_U16_I]], i64 0
 // CHECK:   ret i16 [[TMP2]]
-uint16_t test_vqrshlh_u16(uint16_t a, uint16_t b) {
+uint16_t test_vqrshlh_u16(uint16_t a, int16_t b) {
   return vqrshlh_u16(a, b);
 }
 
 // CHECK-LABEL: @test_vqrshls_u32(
 // CHECK:   [[VQRSHLS_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uqrshl.i32(i32 %a, i32 %b)
 // CHECK:   ret i32 [[VQRSHLS_U32_I]]
-uint32_t test_vqrshls_u32(uint32_t a, uint32_t b) {
+uint32_t test_vqrshls_u32(uint32_t a, int32_t b) {
   return vqrshls_u32(a, b);
 }
 
 // CHECK-LABEL: @test_vqrshld_u64(
 // CHECK:   [[VQRSHLD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.uqrshl.i64(i64 %a, i64 %b)
 // CHECK:   ret i64 [[VQRSHLD_U64_I]]
-uint64_t test_vqrshld_u64(uint64_t a, uint64_t b) {
+uint64_t test_vqrshld_u64(uint64_t a, int64_t b) {
   return vqrshld_u64(a, b);
 }
 
Index: clang/include/clang/Basic/arm_neon.td
===
--- clang/include/clang/Basic/arm_neon.td
+++ clang/include/clang/Basic/arm_neon.td
@@ -1263,13 +1263,13 @@
 
 // Scalar Shift
 // Scalar Shift Left
-def SCALAR_SHL: SInst<"vshl", "111", "SlSUl">;
+def SCALAR_SHL: SInst<"vshl", "11(S1)", "SlSUl">;
 // Scalar Saturating Shift Left
-def SCALAR_QSHL: SInst<"vqshl", "111", "ScSsSiSlSUcSUsSUiSUl">;
+def SCALAR_QSHL: SInst<"vqshl", "11(S1)", "ScSsSiSlSUcSUsSUiSUl">;
 // Scalar Saturating Rounding Shift Left
-def SCALAR_QRSHL: SInst<"vqrshl", "111", "ScSsSiSlSUcSUsSUiSUl">;
+def SCALAR_QRSHL: SInst<"vqrshl", "11(S1)", "ScSsSiSlSUcSUsSUiSUl">;
 // Scalar Shift Rounding Left
-def SCALAR_RSHL: SInst<"vrshl", "111", "SlSUl">;
+def SCALAR_RSHL: SInst<"vrshl", "11(S1)", "SlSUl">;
 
 /

  1   2   3   4   >