LLVM 22.0.0git
HexagonVectorCombine.cpp File Reference
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/InstSimplifyFolder.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Analysis/VectorUtils.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsHexagon.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Utils/Local.h"
#include "Hexagon.h"
#include "HexagonSubtarget.h"
#include "HexagonTargetMachine.h"
#include <algorithm>
#include <deque>
#include <map>
#include <optional>
#include <set>
#include <utility>
#include <vector>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "hexagon-vc"
#define DEFAULT_HVX_VTCM_PAGE_SIZE   131072
#define CallBuilder(B, F)

Functions

InstructionlocateDestination (Instruction *In, HvxIdioms::DstQualifier &Qual)
bool isArithmetic (unsigned Opc)
ValuegetPointer (Value *Ptr)
static InstructionselectDestination (Instruction *In, HvxIdioms::DstQualifier &Qual)
GetElementPtrInstlocateGepFromIntrinsic (Instruction *In)
static ValuelocateAddressFromIntrinsic (Instruction *In)
static TypegetIndexType (Value *In)
static ValuelocateIndexesFromGEP (Value *In)
static ValuelocateIndexesFromIntrinsic (Instruction *In)
ValuegetReinterpretiveCast_i16_to_i32 (const HexagonVectorCombine &HVC, IRBuilderBase &Builder, LLVMContext &Ctx, Value *I)
ValuegetReinterpretiveCast_i8_to_i32 (const HexagonVectorCombine &HVC, IRBuilderBase &Builder, LLVMContext &Ctx, Value *I)
Valueget_i32_Mask (const HexagonVectorCombine &HVC, IRBuilderBase &Builder, LLVMContext &Ctx, unsigned int pattern)
 INITIALIZE_PASS_BEGIN (HexagonVectorCombineLegacy, DEBUG_TYPE, "Hexagon Vector Combine", false, false) INITIALIZE_PASS_END(HexagonVectorCombineLegacy

Variables

 DEBUG_TYPE
Hexagon Vector Combine
Hexagon Vector false

Macro Definition Documentation

◆ CallBuilder

#define CallBuilder ( B,
F )
Value:
[&](auto &B_) { \
Value *V = B_.F; \
if (auto *I = dyn_cast<Instruction>(V)) \
B_.ToErase.push_back(I); \
return V; \
}(B)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define I(x, y, z)
Definition MD5.cpp:58
LLVM Value Representation.
Definition Value.h:75
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643

◆ DEBUG_TYPE

#define DEBUG_TYPE   "hexagon-vc"

Definition at line 58 of file HexagonVectorCombine.cpp.

◆ DEFAULT_HVX_VTCM_PAGE_SIZE

#define DEFAULT_HVX_VTCM_PAGE_SIZE   131072

Definition at line 63 of file HexagonVectorCombine.cpp.

Function Documentation

◆ get_i32_Mask()

Value * get_i32_Mask ( const HexagonVectorCombine & HVC,
IRBuilderBase & Builder,
LLVMContext & Ctx,
unsigned int pattern )
inline

◆ getIndexType()

Type * getIndexType ( Value * In)
static

Definition at line 2008 of file HexagonVectorCombine.cpp.

References llvm::dyn_cast(), llvm::getLoadStoreType(), II, and llvm::isa().

◆ getPointer()

◆ getReinterpretiveCast_i16_to_i32()

Value * getReinterpretiveCast_i16_to_i32 ( const HexagonVectorCombine & HVC,
IRBuilderBase & Builder,
LLVMContext & Ctx,
Value * I )
inline

Definition at line 2069 of file HexagonVectorCombine.cpp.

References assert(), llvm::ConstantDataVector::get(), and I.

◆ getReinterpretiveCast_i8_to_i32()

Value * getReinterpretiveCast_i8_to_i32 ( const HexagonVectorCombine & HVC,
IRBuilderBase & Builder,
LLVMContext & Ctx,
Value * I )
inline

Definition at line 2084 of file HexagonVectorCombine.cpp.

References assert(), llvm::ConstantDataVector::get(), and I.

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( HexagonVectorCombineLegacy ,
DEBUG_TYPE ,
"Hexagon Vector Combine" ,
false ,
false  )

◆ isArithmetic()

bool isArithmetic ( unsigned Opc)
inline

Definition at line 1839 of file HexagonVectorCombine.cpp.

References Opc.

Referenced by selectDestination().

◆ locateAddressFromIntrinsic()

◆ locateDestination()

Instruction * locateDestination ( Instruction * In,
HvxIdioms::DstQualifier & Qual )

Definition at line 1923 of file HexagonVectorCombine.cpp.

References llvm::dyn_cast(), getPointer(), I, selectDestination(), and Users.

Referenced by selectDestination().

◆ locateGepFromIntrinsic()

◆ locateIndexesFromGEP()

Value * locateIndexesFromGEP ( Value * In)
static

◆ locateIndexesFromIntrinsic()

Value * locateIndexesFromIntrinsic ( Instruction * In)
static

◆ selectDestination()

Instruction * selectDestination ( Instruction * In,
HvxIdioms::DstQualifier & Qual )
static

Variable Documentation

◆ Combine

Hexagon Vector Combine

Definition at line 3858 of file HexagonVectorCombine.cpp.

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 3857 of file HexagonVectorCombine.cpp.

◆ false

Hexagon Vector false

Definition at line 3858 of file HexagonVectorCombine.cpp.