Before this patch, the only way to generate streaming-compatible code
was to use the -force-streaming-compatible-sve flag, but the compiler
should also avoid the use of instructions invalid in streaming mode
when a function has the aarch64_pstate_sm_enabled/compatible attribute.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Fixed failing test (streaming-compatible-sve-no-maximize-bandwidth.ll) by forcing fixed-length autovec when -force-streaming-compatible-sve is used.
llvm/lib/Target/AArch64/AArch64Subtarget.cpp | ||
---|---|---|
480 | Is there a reason why we don't do this "properly" (with quotes) by having the neon feature disabled when SSVE is being used? |
llvm/lib/Target/AArch64/AArch64Subtarget.cpp | ||
---|---|---|
480 | Yes. We're trying to model two different concepts: (1) allows the compiler to parse/emit NEON instructions that are predicated under the HasNEON Predicates in TableGen. When a function is marked as streaming compatible (i.e. it must be able to run both in streaming mode as well as non-streaming mode) we want to avoid the compiler from using NEON instructions because if the processor is in streaming-SVE mode at runtime, the NEON instructions will be invalid. This is (2), which we represent this by the interface, isNeonAvailable()). We can use this interface to tell SelectionDAG to lower ISD nodes using streaming-compatible SVE instructions instead of using NEON. The reason we can't use (1), is that a user should still be able to write NEON that compiles, provided that they properly guard the code with if (!__arm_in_streaming_mode()) { /* NEON code here */ }. A user should also be allowed to write inline-asm that disables streaming mode, executes code with NEON instructions, and then re-enables streaming-mode afterwards. If the target being compiled for doesn't allow NEON instructions (i.e. hasNEON() == false), LLVM can't emit them regardless of the runtime mode. |
Is there a reason why we don't do this "properly" (with quotes) by having the neon feature disabled when SSVE is being used?