LLVM  15.0.0git
Public Member Functions | List of all members
llvm::InstSimplifyFolder Class Referencefinal

InstSimplifyFolder - Use InstructionSimplify to fold operations to existing values. More...

#include "llvm/Analysis/InstSimplifyFolder.h"

Inheritance diagram for llvm::InstSimplifyFolder:
Inheritance graph
[legend]
Collaboration diagram for llvm::InstSimplifyFolder:
Collaboration graph
[legend]

Public Member Functions

 InstSimplifyFolder (const DataLayout &DL)
 
ValueFoldBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS) const override
 
ValueFoldExactBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool IsExact) const override
 
ValueFoldNoWrapBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool HasNUW, bool HasNSW) const override
 
ValueFoldBinOpFMF (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, FastMathFlags FMF) const override
 
ValueFoldUnOpFMF (Instruction::UnaryOps Opc, Value *V, FastMathFlags FMF) const override
 
ValueFoldICmp (CmpInst::Predicate P, Value *LHS, Value *RHS) const override
 
ValueFoldGEP (Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, bool IsInBounds=false) const override
 
ValueFoldSelect (Value *C, Value *True, Value *False) const override
 
ValueFoldExtractValue (Value *Agg, ArrayRef< unsigned > IdxList) const override
 
ValueFoldInsertValue (Value *Agg, Value *Val, ArrayRef< unsigned > IdxList) const override
 
ValueFoldExtractElement (Value *Vec, Value *Idx) const override
 
ValueFoldInsertElement (Value *Vec, Value *NewElt, Value *Idx) const override
 
ValueFoldShuffleVector (Value *V1, Value *V2, ArrayRef< int > Mask) const override
 
ValueCreateCast (Instruction::CastOps Op, Constant *C, Type *DestTy) const override
 
ValueCreateIntCast (Constant *C, Type *DestTy, bool isSigned) const override
 
ValueCreatePointerCast (Constant *C, Type *DestTy) const override
 
ValueCreateFPCast (Constant *C, Type *DestTy) const override
 
ValueCreateBitCast (Constant *C, Type *DestTy) const override
 
ValueCreateIntToPtr (Constant *C, Type *DestTy) const override
 
ValueCreatePtrToInt (Constant *C, Type *DestTy) const override
 
ValueCreateZExtOrBitCast (Constant *C, Type *DestTy) const override
 
ValueCreateSExtOrBitCast (Constant *C, Type *DestTy) const override
 
ValueCreateTruncOrBitCast (Constant *C, Type *DestTy) const override
 
ValueCreatePointerBitCastOrAddrSpaceCast (Constant *C, Type *DestTy) const override
 
ValueCreateFCmp (CmpInst::Predicate P, Constant *LHS, Constant *RHS) const override
 
- Public Member Functions inherited from llvm::IRBuilderFolder
virtual ~IRBuilderFolder ()
 

Detailed Description

InstSimplifyFolder - Use InstructionSimplify to fold operations to existing values.

Also applies target-specific constant folding when not using InstructionSimplify.

Definition at line 34 of file InstSimplifyFolder.h.

Constructor & Destructor Documentation

◆ InstSimplifyFolder()

llvm::InstSimplifyFolder::InstSimplifyFolder ( const DataLayout DL)
inline

Definition at line 41 of file InstSimplifyFolder.h.

Member Function Documentation

◆ CreateBitCast()

Value* llvm::InstSimplifyFolder::CreateBitCast ( Constant C,
Type DestTy 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 141 of file InstSimplifyFolder.h.

◆ CreateCast()

Value* llvm::InstSimplifyFolder::CreateCast ( Instruction::CastOps  Op,
Constant C,
Type DestTy 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 119 of file InstSimplifyFolder.h.

◆ CreateFCmp()

Value* llvm::InstSimplifyFolder::CreateFCmp ( CmpInst::Predicate  P,
Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 177 of file InstSimplifyFolder.h.

References LHS, P, and RHS.

◆ CreateFPCast()

Value* llvm::InstSimplifyFolder::CreateFPCast ( Constant C,
Type DestTy 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 136 of file InstSimplifyFolder.h.

◆ CreateIntCast()

Value* llvm::InstSimplifyFolder::CreateIntCast ( Constant C,
Type DestTy,
bool  isSigned 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 125 of file InstSimplifyFolder.h.

◆ CreateIntToPtr()

Value* llvm::InstSimplifyFolder::CreateIntToPtr ( Constant C,
Type DestTy 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 144 of file InstSimplifyFolder.h.

◆ CreatePointerBitCastOrAddrSpaceCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 166 of file InstSimplifyFolder.h.

◆ CreatePointerCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 131 of file InstSimplifyFolder.h.

◆ CreatePtrToInt()

Value* llvm::InstSimplifyFolder::CreatePtrToInt ( Constant C,
Type DestTy 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 147 of file InstSimplifyFolder.h.

◆ CreateSExtOrBitCast()

Value* llvm::InstSimplifyFolder::CreateSExtOrBitCast ( Constant C,
Type DestTy 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 155 of file InstSimplifyFolder.h.

◆ CreateTruncOrBitCast()

Value* llvm::InstSimplifyFolder::CreateTruncOrBitCast ( Constant C,
Type DestTy 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 160 of file InstSimplifyFolder.h.

◆ CreateZExtOrBitCast()

Value* llvm::InstSimplifyFolder::CreateZExtOrBitCast ( Constant C,
Type DestTy 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 150 of file InstSimplifyFolder.h.

◆ FoldBinOp()

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

Implements llvm::IRBuilderFolder.

Definition at line 50 of file InstSimplifyFolder.h.

References LHS, RHS, and llvm::simplifyBinOp().

◆ FoldBinOpFMF()

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

Implements llvm::IRBuilderFolder.

Definition at line 65 of file InstSimplifyFolder.h.

References LHS, RHS, and llvm::simplifyBinOp().

◆ FoldExactBinOp()

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

Implements llvm::IRBuilderFolder.

Definition at line 55 of file InstSimplifyFolder.h.

References LHS, RHS, and llvm::simplifyBinOp().

◆ FoldExtractElement()

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

Implements llvm::IRBuilderFolder.

Definition at line 98 of file InstSimplifyFolder.h.

References llvm::simplifyExtractElementInst().

◆ FoldExtractValue()

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

Implements llvm::IRBuilderFolder.

Definition at line 88 of file InstSimplifyFolder.h.

References llvm::simplifyExtractValueInst().

◆ FoldGEP()

Value* llvm::InstSimplifyFolder::FoldGEP ( Type Ty,
Value Ptr,
ArrayRef< Value * >  IdxList,
bool  IsInBounds = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 79 of file InstSimplifyFolder.h.

References llvm::simplifyGEPInst().

◆ FoldICmp()

Value* llvm::InstSimplifyFolder::FoldICmp ( CmpInst::Predicate  P,
Value LHS,
Value RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 75 of file InstSimplifyFolder.h.

References LHS, P, RHS, and llvm::simplifyICmpInst().

◆ FoldInsertElement()

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

Implements llvm::IRBuilderFolder.

Definition at line 102 of file InstSimplifyFolder.h.

References llvm::simplifyInsertElementInst().

◆ FoldInsertValue()

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

Implements llvm::IRBuilderFolder.

Definition at line 93 of file InstSimplifyFolder.h.

References llvm::simplifyInsertValueInst().

◆ FoldNoWrapBinOp()

Value* llvm::InstSimplifyFolder::FoldNoWrapBinOp ( Instruction::BinaryOps  Opc,
Value LHS,
Value RHS,
bool  HasNUW,
bool  HasNSW 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 60 of file InstSimplifyFolder.h.

References LHS, RHS, and llvm::simplifyBinOp().

◆ FoldSelect()

Value* llvm::InstSimplifyFolder::FoldSelect ( Value C,
Value True,
Value False 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 84 of file InstSimplifyFolder.h.

References llvm::simplifySelectInst().

◆ FoldShuffleVector()

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

◆ FoldUnOpFMF()

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

Implements llvm::IRBuilderFolder.

Definition at line 70 of file InstSimplifyFolder.h.

References llvm::simplifyUnOp().


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