LLVM: lib/Target/ARM/MVETailPredication.cpp File Reference (original) (raw)
Armv8.1m introduced MVE, M-Profile Vector Extension, and low-overhead branches to help accelerate DSP applications. More...
Armv8.1m introduced MVE, M-Profile Vector Extension, and low-overhead branches to help accelerate DSP applications.
These two extensions, combined with a new form of predication called tail-predication, can be used to provide implicit vector predication within a low-overhead loop. This is implicit because the predicate of active/inactive lanes is calculated by hardware, and thus does not need to be explicitly passed to vector instructions. The instructions responsible for this are the DLSTP and WLSTP instructions, which setup a tail-predicated loop and the the total number of data elements processed by the loop. The loop-end LETP instruction is responsible for decrementing and setting the remaining elements to be processed and generating the mask of active lanes.
The HardwareLoops pass inserts intrinsics identifying loops that the backend will attempt to convert into a low-overhead loop. The vectorizer is responsible for generating a vectorized loop in which the lanes are predicated upon an get.active.lane.mask intrinsic. This pass looks at these get.active.lane.mask intrinsic and attempts to convert them to VCTP instructions. This will be picked up by the ARM Low-overhead loop pass later in the backend, which performs the final transformation to a DLSTP or WLSTP tail-predicated loop.
Definition in file MVETailPredication.cpp.