LLVM 24.0.0git
llvm::TargetFolder Class Referencefinal

TargetFolder - Create constants with target dependent folding. More...

#include "llvm/Analysis/TargetFolder.h"

Inheritance diagram for llvm::TargetFolder:
[legend]

Public Member Functions

 TargetFolder (const DataLayout &DL)
Value * FoldBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS) const override
Value * FoldExactBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool IsExact) const override
Value * FoldNoWrapBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool HasNUW, bool HasNSW) const override
Value * FoldBinOpFMF (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, FastMathFlags FMF) const override
Value * FoldCmp (CmpInst::Predicate P, Value *LHS, Value *RHS) const override
Value * FoldUnOpFMF (Instruction::UnaryOps Opc, Value *V, FastMathFlags FMF) const override
Value * FoldGEP (Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, GEPNoWrapFlags NW) const override
Value * FoldSelect (Value *C, Value *True, Value *False, FastMathFlags FMF) const override
Value * FoldExtractValue (Value *Agg, ArrayRef< unsigned > IdxList) const override
Value * FoldInsertValue (Value *Agg, Value *Val, ArrayRef< unsigned > IdxList) const override
Value * FoldExtractElement (Value *Vec, Value *Idx) const override
Value * FoldInsertElement (Value *Vec, Value *NewElt, Value *Idx) const override
Value * FoldShuffleVector (Value *V1, Value *V2, ArrayRef< int > Mask) const override
Value * FoldCast (Instruction::CastOps Op, Value *V, Type *DestTy) const override
Value * FoldIntrinsic (Intrinsic::ID ID, ArrayRef< Value * > Ops, Type *Ty, FastMathFlags FMF={}, Function *CxtF=nullptr) const override
Constant * CreatePointerCast (Constant *C, Type *DestTy) const override
Constant * CreatePointerBitCastOrAddrSpaceCast (Constant *C, Type *DestTy) const override
Public Member Functions inherited from llvm::IRBuilderFolder
virtual ~IRBuilderFolder ()

Detailed Description

TargetFolder - Create constants with target dependent folding.

Definition at line 36 of file TargetFolder.h.

Constructor & Destructor Documentation

◆ TargetFolder()

llvm::TargetFolder::TargetFolder ( const DataLayout & DL)
inlineexplicit

Definition at line 47 of file TargetFolder.h.

Member Function Documentation

◆ CreatePointerBitCastOrAddrSpaceCast()

Constant * llvm::TargetFolder::CreatePointerBitCastOrAddrSpaceCast ( Constant * C,
Type * DestTy ) const
inlineoverridevirtual

◆ CreatePointerCast()

Constant * llvm::TargetFolder::CreatePointerCast ( Constant * C,
Type * DestTy ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 212 of file TargetFolder.h.

References C(), and llvm::ConstantExpr::getPointerCast().

◆ FoldBinOp()

Value * llvm::TargetFolder::FoldBinOp ( Instruction::BinaryOps Opc,
Value * LHS,
Value * RHS ) const
inlineoverridevirtual

◆ FoldBinOpFMF()

Value * llvm::TargetFolder::FoldBinOpFMF ( Instruction::BinaryOps Opc,
Value * LHS,
Value * RHS,
FastMathFlags FMF ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 99 of file TargetFolder.h.

References FoldBinOp(), LHS, Opc, and RHS.

◆ FoldCast()

Value * llvm::TargetFolder::FoldCast ( Instruction::CastOps Op,
Value * V,
Type * DestTy ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 191 of file TargetFolder.h.

References C(), llvm::ConstantFoldCastOperand(), and llvm::dyn_cast().

◆ FoldCmp()

Value * llvm::TargetFolder::FoldCmp ( CmpInst::Predicate P,
Value * LHS,
Value * RHS ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 104 of file TargetFolder.h.

References llvm::ConstantFoldCompareInstOperands(), dyn_cast(), LHS, P, and RHS.

◆ FoldExactBinOp()

Value * llvm::TargetFolder::FoldExactBinOp ( Instruction::BinaryOps Opc,
Value * LHS,
Value * RHS,
bool IsExact ) const
inlineoverridevirtual

◆ FoldExtractElement()

Value * llvm::TargetFolder::FoldExtractElement ( Value * Vec,
Value * Idx ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 164 of file TargetFolder.h.

References dyn_cast(), and llvm::ConstantExpr::getExtractElement().

◆ FoldExtractValue()

Value * llvm::TargetFolder::FoldExtractValue ( Value * Agg,
ArrayRef< unsigned > IdxList ) const
inlineoverridevirtual

◆ FoldGEP()

Value * llvm::TargetFolder::FoldGEP ( Type * Ty,
Value * Ptr,
ArrayRef< Value * > IdxList,
GEPNoWrapFlags NW ) const
inlineoverridevirtual

◆ FoldInsertElement()

Value * llvm::TargetFolder::FoldInsertElement ( Value * Vec,
Value * NewElt,
Value * Idx ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 172 of file TargetFolder.h.

References dyn_cast(), and llvm::ConstantExpr::getInsertElement().

◆ FoldInsertValue()

Value * llvm::TargetFolder::FoldInsertValue ( Value * Agg,
Value * Val,
ArrayRef< unsigned > IdxList ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 155 of file TargetFolder.h.

References llvm::ConstantFoldInsertValueInstruction(), and dyn_cast().

◆ FoldIntrinsic()

Value * llvm::TargetFolder::FoldIntrinsic ( Intrinsic::ID ID,
ArrayRef< Value * > Ops,
Type * Ty,
FastMathFlags FMF = {},
Function * CxtF = nullptr ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 198 of file TargetFolder.h.

References AbstractManglingParser< Derived, Alloc >::Ops.

◆ FoldNoWrapBinOp()

◆ FoldSelect()

Value * llvm::TargetFolder::FoldSelect ( Value * C,
Value * True,
Value * False,
FastMathFlags FMF ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 137 of file TargetFolder.h.

References C(), llvm::ConstantFoldSelectInstruction(), and dyn_cast().

◆ FoldShuffleVector()

Value * llvm::TargetFolder::FoldShuffleVector ( Value * V1,
Value * V2,
ArrayRef< int > Mask ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 182 of file TargetFolder.h.

References dyn_cast(), llvm::ConstantExpr::getShuffleVector(), and llvm::V1.

◆ FoldUnOpFMF()

Value * llvm::TargetFolder::FoldUnOpFMF ( Instruction::UnaryOps Opc,
Value * V,
FastMathFlags FMF ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 112 of file TargetFolder.h.

References C(), llvm::ConstantFoldUnaryOpOperand(), llvm::dyn_cast(), and Opc.


The documentation for this class was generated from the following file: