MLIR 22.0.0git
ArmRunnerUtils.cpp File Reference
#include "llvm/Support/MathExtras.h"
#include <iostream>
#include <stdint.h>
#include <string_view>

Go to the source code of this file.

Macros

#define MLIR_ARMRUNNERUTILS_EXPORTED   __attribute__((visibility("default")))
#define PR_SVE_SET_VL   50
#define PR_SME_SET_VL   63
#define PR_VL_LEN_MASK   0xffff

Functions

static void setArmVectorLength (std::string_view helperName, int option, uint32_t bits)
 Sets the vector length (streaming or not, as indicated by option) to bits.
void MLIR_ARMRUNNERUTILS_EXPORTED setArmVLBits (uint32_t bits)
 Sets the SVE vector length (in bits) to bits.
void MLIR_ARMRUNNERUTILS_EXPORTED setArmSVLBits (uint32_t bits)
 Sets the SME streaming vector length (in bits) to bits.

Macro Definition Documentation

◆ MLIR_ARMRUNNERUTILS_EXPORTED

#define MLIR_ARMRUNNERUTILS_EXPORTED   __attribute__((visibility("default")))

Definition at line 17 of file ArmRunnerUtils.cpp.

Referenced by setArmSVLBits(), and setArmVLBits().

◆ PR_SME_SET_VL

#define PR_SME_SET_VL   63

Definition at line 35 of file ArmRunnerUtils.cpp.

Referenced by setArmSVLBits().

◆ PR_SVE_SET_VL

#define PR_SVE_SET_VL   50

Definition at line 31 of file ArmRunnerUtils.cpp.

Referenced by setArmVLBits().

◆ PR_VL_LEN_MASK

#define PR_VL_LEN_MASK   0xffff

Definition at line 39 of file ArmRunnerUtils.cpp.

Referenced by setArmVectorLength().

Function Documentation

◆ setArmSVLBits()

void MLIR_ARMRUNNERUTILS_EXPORTED setArmSVLBits ( uint32_t bits)

Sets the SME streaming vector length (in bits) to bits.

Definition at line 77 of file ArmRunnerUtils.cpp.

References MLIR_ARMRUNNERUTILS_EXPORTED, PR_SME_SET_VL, and setArmVectorLength().

◆ setArmVectorLength()

void setArmVectorLength ( std::string_view helperName,
int option,
uint32_t bits )
static

Sets the vector length (streaming or not, as indicated by option) to bits.

Caveat emptor: If a function has allocated stack slots for SVE registers (e.g. slots for callee-saved SVE registers or spill slots) changing the vector length is tricky and error prone - it may cause incorrect stack deallocation or incorrect access to stack slots.

The recommended strategy is to call setArmVectorLength only from functions that do not access SVE registers, either by themselves or by inlining other functions.

Definition at line 52 of file ArmRunnerUtils.cpp.

References PR_VL_LEN_MASK.

Referenced by setArmSVLBits(), and setArmVLBits().

◆ setArmVLBits()

void MLIR_ARMRUNNERUTILS_EXPORTED setArmVLBits ( uint32_t bits)

Sets the SVE vector length (in bits) to bits.

Definition at line 72 of file ArmRunnerUtils.cpp.

References MLIR_ARMRUNNERUTILS_EXPORTED, PR_SVE_SET_VL, and setArmVectorLength().