LLVM 19.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]

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
 
ValueFoldCast (Instruction::CastOps Op, Value *V, Type *DestTy) const override
 
ValueFoldBinaryIntrinsic (Intrinsic::ID ID, Value *LHS, Value *RHS, Type *Ty, Instruction *FMFSource) const override
 
ValueCreatePointerCast (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 ()
 
virtual ValueFoldBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS) const =0
 
virtual ValueFoldExactBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool IsExact) const =0
 
virtual ValueFoldNoWrapBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool HasNUW, bool HasNSW) const =0
 
virtual ValueFoldBinOpFMF (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, FastMathFlags FMF) const =0
 
virtual ValueFoldUnOpFMF (Instruction::UnaryOps Opc, Value *V, FastMathFlags FMF) const =0
 
virtual ValueFoldICmp (CmpInst::Predicate P, Value *LHS, Value *RHS) const =0
 
virtual ValueFoldGEP (Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, bool IsInBounds=false) const =0
 
virtual ValueFoldSelect (Value *C, Value *True, Value *False) const =0
 
virtual ValueFoldExtractValue (Value *Agg, ArrayRef< unsigned > IdxList) const =0
 
virtual ValueFoldInsertValue (Value *Agg, Value *Val, ArrayRef< unsigned > IdxList) const =0
 
virtual ValueFoldExtractElement (Value *Vec, Value *Idx) const =0
 
virtual ValueFoldInsertElement (Value *Vec, Value *NewElt, Value *Idx) const =0
 
virtual ValueFoldShuffleVector (Value *V1, Value *V2, ArrayRef< int > Mask) const =0
 
virtual ValueFoldCast (Instruction::CastOps Op, Value *V, Type *DestTy) const =0
 
virtual ValueFoldBinaryIntrinsic (Intrinsic::ID ID, Value *LHS, Value *RHS, Type *Ty, Instruction *FMFSource=nullptr) const =0
 
virtual ValueCreatePointerCast (Constant *C, Type *DestTy) const =0
 
virtual ValueCreatePointerBitCastOrAddrSpaceCast (Constant *C, Type *DestTy) const =0
 
virtual ValueCreateFCmp (CmpInst::Predicate P, Constant *LHS, Constant *RHS) const =0
 

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

◆ CreateFCmp()

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

Implements llvm::IRBuilderFolder.

Definition at line 147 of file InstSimplifyFolder.h.

References LHS, P, and RHS.

◆ CreatePointerBitCastOrAddrSpaceCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 136 of file InstSimplifyFolder.h.

References llvm::CallingConv::C.

◆ CreatePointerCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 130 of file InstSimplifyFolder.h.

References llvm::CallingConv::C.

◆ FoldBinaryIntrinsic()

Value * llvm::InstSimplifyFolder::FoldBinaryIntrinsic ( Intrinsic::ID  ID,
Value LHS,
Value RHS,
Type Ty,
Instruction FMFSource 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 120 of file InstSimplifyFolder.h.

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

◆ 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().

◆ FoldCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 115 of file InstSimplifyFolder.h.

References llvm::simplifyCastInst().

◆ 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 Idx, and 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 Ptr, and 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 Idx, and 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::CallingConv::C, and 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: