LLVM 20.0.0git
Macros | Functions | Variables
SVEIntrinsicOpts.cpp File Reference
#include "AArch64.h"
#include "Utils/AArch64BaseInfo.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/IntrinsicsAArch64.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
#include <optional>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "aarch64-sve-intrinsic-opts"
 

Functions

 INITIALIZE_PASS_DEPENDENCY (DominatorTreeWrapperPass)
 
static bool isPTruePromoted (IntrinsicInst *PTrue)
 Checks if a ptrue intrinsic call is promoted.
 

Variables

static const charname = "SVE intrinsics optimizations"
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "aarch64-sve-intrinsic-opts"

Definition at line 43 of file SVEIntrinsicOpts.cpp.

Function Documentation

◆ INITIALIZE_PASS_DEPENDENCY()

INITIALIZE_PASS_DEPENDENCY ( DominatorTreeWrapperPass  )

◆ isPTruePromoted()

static bool isPTruePromoted ( IntrinsicInst PTrue)
static

Checks if a ptrue intrinsic call is promoted.

The act of promoting a ptrue will introduce zeroing. For example:

%1 = <vscale x 4 x i1> call @llvm.aarch64.sve.ptrue.nxv4i1(i32 31)
%2 = <vscale x 16 x i1> call @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %1)
%3 = <vscale x 8 x i1> call @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %2)

%1 is promoted, because it is converted:

<vscale x 4 x i1> => <vscale x 16 x i1> => <vscale x 8 x i1>

via a sequence of the SVE reinterpret intrinsics convert.{to,from}.svbool.

Definition at line 97 of file SVEIntrinsicOpts.cpp.

References llvm::SmallVectorBase< Size_T >::empty(), llvm::Value::getType(), llvm::PatternMatch::match(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::Value::users().

Variable Documentation

◆ name

const char* name = "SVE intrinsics optimizations"
static

Definition at line 76 of file SVEIntrinsicOpts.cpp.