aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/ConfigParseTest.cpp
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2024-06-16 17:24:23 +0100
committerGitHub <noreply@github.com>2024-06-16 17:24:23 +0100
commit1644a31ae93177e1d046878a480ce95484882b2b (patch)
treecfa944009cadc1e792d8ceb5f6a9cd24672c8dac /clang/unittests/Format/ConfigParseTest.cpp
parent5548ea34341e9d0ae645719c34b466ca3b9eaa5a (diff)
downloadllvm-1644a31ae93177e1d046878a480ce95484882b2b.zip
llvm-1644a31ae93177e1d046878a480ce95484882b2b.tar.gz
llvm-1644a31ae93177e1d046878a480ce95484882b2b.tar.bz2
[Clang][AArch64] Generalise streaming mode checks for builtins. (#93802)
PR #76975 added 'IsStreamingOrSVE2p1' to emit a diagnostic when a builtin marked with 'IsStreamingOrSVE2p1' is used in a non-streaming function that is not compiled with `+sve2p1`. The problem is a bit more complex than only this case. For example, we've marked lots of builtins with 'IsStreamingCompatible', meaning it can be used in either streaming, streaming-compatible or non-streaming functions. But the code in SemaChecking, doesn't check the appropriate target guards. This issue becomes relevant when SVE builtins are only available in streaming mode, e.g. when compiling for SME without SVE. If we were to add the appropriate target guards, we'd have to add many more combinations, e.g.: IsStreamingSMEOrSVE IsStreamingSME2OrSVE2 IsStreamingSMEOrSVE2p1 IsStreamingSME2OrSVE2p1 etc. To avoid having to add more combinations (and avoid having to add more in the future for new extensions), we use a single 'IsSVEOrStreamingSVE' flag for all builtins that are available in streaming mode for the appropriate SME flags, or in non-streaming mode for the appropriate SVE flags, or both. The code in SemaChecking will then verify for which mode (or both) the builtin would be defined, given the target features of the function/compilation unit. For example: 'svclamp' is enabled under FEAT_SVE2p1 and FEAT_SME2 * When we compile for SVE2p1 and SME (but not SME2), the builtin is undefined behaviour when called from a streaming function. * When we compile for SME2 and SVE2 (but not SVE2p1), the builtin is undefined behaviour when called from a non-streaming function. * When we compile for _both_ SVE2p1 and SME2, the builtin can be used in either mode (non-streaming, streaming or streaming-compatible)
Diffstat (limited to 'clang/unittests/Format/ConfigParseTest.cpp')
0 files changed, 0 insertions, 0 deletions