This is an archive of the discontinued LLVM Phabricator instance.

[Sema][SVE2] Move/simplify Sema testing for SVE2 ACLE builtins
ClosedPublic

Authored by RosieSumpter on May 3 2022, 5:51 AM.

Details

Summary

Currently for SVE2 ACLE builtins, single tests are used to verify both
clang code generation (when the feature is available) and semantic
error/warning messages (when the feature is unavailable). This
patch moves the semantic testing for the target feature flag into
dedicated Sema tests.

Diff Detail

Event Timeline

RosieSumpter created this revision.May 3 2022, 5:51 AM
Herald added a project: Restricted Project. · View Herald Transcript
RosieSumpter requested review of this revision.May 3 2022, 5:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2022, 5:51 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thanks for working on this @RosieSumpter!

clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2.cpp
2

(see my commen later on as well) I'd remove this target feature and move those BF16 tests to a different file.

14

It would be nice if these operands have slightly more descriptive names. Additionally, you may be able to allocate these as globals so that they don't need to be passed as operands to the test function, e.g.

svbool_t pg;
float f32;
double f64;
int32_t i32;
int64_t i64;
float *f32_ptr;
double *f64_ptr;

4993

I think you'll need to move these to a separate test file where the RUN line has only +sve2 (and not +bf16)
We'll probably want to do the same for the SVE bf16 tests

RosieSumpter marked 3 inline comments as done.
  • Changed operand names to be more descriptive
  • Made int/uint/float variables global
  • Moved bfloat tests into a separate file
  • Corrected name const_b16_ptr to const_bf16_ptr in acle_sve2_bfloat.cpp
sdesmalen added inline comments.May 9 2022, 7:51 AM
clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_bfloat.cpp
9

Can you wrap these in SVE_ACLE_FUNC and add an extra RUN line for these?

RosieSumpter marked an inline comment as done.
  • Added REQUIRES: aarch64-registered-target to files where it was missed
  • Added overloaded forms to bfloat tests
clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_bfloat.cpp
9

I've done this how I think it makes sense, which is to have the flags +sve +bf16 in the overload run line, but let me know if this doesn't seem correct to you.

sdesmalen accepted this revision.May 10 2022, 3:16 AM
This revision is now accepted and ready to land.May 10 2022, 3:16 AM
This revision was landed with ongoing or failed builds.May 10 2022, 5:41 AM
This revision was automatically updated to reflect the committed changes.