banach-space wrote:

> > Just to clarify this particular case, `-internal-isystem <path>` is crucial 
> > for AArch64 code-gen tests. Indeed, they all depend on Arm headers (e.g. 
> > `#include <arm_neon.h>`).
> 
> Yes, but don't those headers always live in the same place in tree 
> (`clang/lib/Headers`) and so "where do I find the contents of the header 
> being included" is almost never in question?

Yes.
 
> The discussion is mostly so I can understand what situations we _want_ 
> substitutions for because I don't think we've ever discussed it as a 
> community (at least on the Clang side). 

Sure, we want canonical substitutions (i.e. set of flags) that can be used 
code-gen tests for builtins. 

For now I've just extracted the common denominator from a few tests, but I 
guess it's a good time to discuss what fits and what does not. I want to focus 
on the bare minimum that is required for lowering the builtins:
* `-triple arm64-none-linux-gnu` (this should be sufficient for most cases that 
I will focus on, i.e. AArch64) (*).
*  `-disable-O0-optnone` (many tests pipe things to `opt`) (**).
* Neon, SVE and SME are the major ISA extensions, hence:
   * `-target-feature +neon` for  `%clang_cc1_arm64_neon`,  
   * `-target-feature +sve` for  `%clang_cc1_arm64_sve`, and 
   * `-target-feature +sme` for  `%clang_cc1_arm64_sme` .
* Flags for rigorous semantics checks, 
e.g.`-flax-vector-conversions=none`alongside `-Werror -Wall` (suggestions are 
welcome).

In the end, the following `RUN` lines:

```C
// RUN:  %clang_cc1 -triple arm64-none-linux-gnu  -disable-O0-optnone 
-flax-vector-conversions=none -target-feature +neon <other flags> | FileCheck 
// RUN:  %clang_cc1 -triple arm64-none-linux-gnu  -disable-O0-optnone 
-flax-vector-conversions=none -target-feature +sve <other flags> | FileCheck
// RUN:  %clang_cc1 -triple arm64-none-linux-gnu  -disable-O0-optnone 
-flax-vector-conversions=none -target-feature +neon -target-feature +fullfp16 
<other flags> | FileCheck
```

would be replaced with:
```C
// RUN: %clang_cc1_arm64_neon                            <other flags> | 
FileCheck
// RUN: %clang_cc1_arm64_sve                             <other flags> | 
FileCheck
// RUN: %clang_cc1_arm64_neon -target-feature +fullfp16  <other flags> | 
FileCheck
```

One other downside of all of this is that, due the number of test files, I will 
have do it incrementally.

-Andrzej

P.S.  I am away next week, so my next reply will be delayed.

(*) I have no plans to work on older architectures like `ArmV7` that require 
other triple - that's a minority though). Also, I actually expect `-triple 
aarch64` to be sufficient.
(**) We might just switch to `-O1` at some later point.

https://github.com/llvm/llvm-project/pull/188547
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to