LLVM 20.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
 
ValueFoldCmp (CmpInst::Predicate P, Value *LHS, Value *RHS) const override
 
ValueFoldGEP (Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, GEPNoWrapFlags NW) 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
 
- 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 ValueFoldCmp (CmpInst::Predicate P, Value *LHS, Value *RHS) const =0
 
virtual ValueFoldGEP (Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, GEPNoWrapFlags NW) 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
 

Detailed Description

InstSimplifyFolder - Use InstructionSimplify to fold operations to existing values.

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

Definition at line 35 of file InstSimplifyFolder.h.

Constructor & Destructor Documentation

◆ InstSimplifyFolder()

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

Definition at line 42 of file InstSimplifyFolder.h.

Member Function Documentation

◆ CreatePointerBitCastOrAddrSpaceCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 137 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 131 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 121 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 51 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 66 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 116 of file InstSimplifyFolder.h.

References llvm::simplifyCastInst().

◆ FoldCmp()

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

Implements llvm::IRBuilderFolder.

Definition at line 76 of file InstSimplifyFolder.h.

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

◆ FoldExactBinOp()

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

Implements llvm::IRBuilderFolder.

Definition at line 56 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 99 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 89 of file InstSimplifyFolder.h.

References llvm::simplifyExtractValueInst().

◆ FoldGEP()

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

Implements llvm::IRBuilderFolder.

Definition at line 80 of file InstSimplifyFolder.h.

References Ptr, and llvm::simplifyGEPInst().

◆ FoldInsertElement()

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

Implements llvm::IRBuilderFolder.

Definition at line 103 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 94 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 61 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 85 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 71 of file InstSimplifyFolder.h.

References llvm::simplifyUnOp().


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