[clang] [clang][test] Add `%clang_cc1_arm64_neon` substitution (PR #188547)

Andrzej WarzyƄski via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 09:28:01 PDT 2026


banach-space wrote:

> So there is no Windows-specific testing needed?

There is currently much less Windows-specific coverage in this area, so I think it is reasonable to keep those tests separate for now.

> -Wall enables a lot of diagnostics, including ones that are likely to be unrelated to what the test file is after. -Werror in a test file is definitely odd as well -- why do we need the diagnostics to be errors, is there something about that code path which could impact test behavior?

As far as I can tell, `-Wall`, `-Werror`, and `-flax-vector-conversions={...`} are purely Sema-related flags, so I also would not expect them to be part of codegen tests. My guess is that, given the volume of these tests, they were included to catch subtle Sema issues as well. I do see some value in that, but if we want to keep that coverage, I think it would be better to hide those behind something like `%sema_flags`.

> In general, I think that the more we put behind a substitution, the harder it is for that substitution to apply to every test scenario. I can sort of see benefit to a substitution which handles the triple and the target feature because those are verbose command line options to repeat and the substitution name captures the details nicely. But I'm less comfortable with the other suggestions because those aren't really implied by the name of the substitution but those details matter for the test or don't apply consistently to all test scenarios.

That's very helpful feedback, thank you. Let me update the PR accordingly.

> Clang tests usually aren't expected to be sensitive to opt levels, so I'm not certain if switching to -O1 makes sense or not. 

> From what I recall, the point of running optimizations on the intrinsics tests is just to reduce clutter: intrinsics tests are already long due to the number of intrinsic variants, and raw -O0 output is a lot longer. Each function in the intrinsics tests is usually small enough that they're pretty stable anyway, so there's less downside to running optimizations.

Indeed, these code-gen tests use either:
* `... disable-O0-optnone | opt -S -passes=mem2reg,sroa`, or
* `%clang_cc1 -O1`

to clean up the generated IR. Since those two approaches are meaningfully different, I would prefer to keep the IR-cleanup behavior explicit in the tests.

> (...) if these are purely for codegen tests, perhaps we want to add -emit-llvm -o - to the substitution and put "codegen" or "cg" in the name?)

I like these suggestions; let me incorporate them. I do not plan to add `-emit-llvm`, though, because some of these tests need `-emit-cir` instead.

Thank you!

https://github.com/llvm/llvm-project/pull/188547


More information about the cfe-commits mailing list