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)
 
ValueFoldAdd (Value *LHS, Value *RHS, bool HasNUW=false, bool HasNSW=false) const override
 
ValueFoldAnd (Value *LHS, Value *RHS) const override
 
ValueFoldOr (Value *LHS, Value *RHS) 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
 
ValueCreateFAdd (Constant *LHS, Constant *RHS) const override
 
ValueCreateSub (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
 
ValueCreateFSub (Constant *LHS, Constant *RHS) const override
 
ValueCreateMul (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
 
ValueCreateFMul (Constant *LHS, Constant *RHS) const override
 
ValueCreateUDiv (Constant *LHS, Constant *RHS, bool isExact=false) const override
 
ValueCreateSDiv (Constant *LHS, Constant *RHS, bool isExact=false) const override
 
ValueCreateFDiv (Constant *LHS, Constant *RHS) const override
 
ValueCreateURem (Constant *LHS, Constant *RHS) const override
 
ValueCreateSRem (Constant *LHS, Constant *RHS) const override
 
ValueCreateFRem (Constant *LHS, Constant *RHS) const override
 
ValueCreateShl (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
 
ValueCreateLShr (Constant *LHS, Constant *RHS, bool isExact=false) const override
 
ValueCreateAShr (Constant *LHS, Constant *RHS, bool isExact=false) const override
 
ValueCreateXor (Constant *LHS, Constant *RHS) const override
 
ValueCreateBinOp (Instruction::BinaryOps Opc, Constant *LHS, Constant *RHS) const override
 
ValueCreateNeg (Constant *C, bool HasNUW=false, bool HasNSW=false) const override
 
ValueCreateFNeg (Constant *C) const override
 
ValueCreateNot (Constant *C) const override
 
ValueCreateUnOp (Instruction::UnaryOps Opc, Constant *C) 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
 
ValueCreateExtractElement (Constant *Vec, Constant *Idx) const override
 
ValueCreateInsertElement (Constant *Vec, Constant *NewElt, Constant *Idx) const override
 
ValueCreateShuffleVector (Constant *V1, Constant *V2, ArrayRef< int > Mask) 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

◆ CreateAShr()

Value* llvm::InstSimplifyFolder::CreateAShr ( Constant LHS,
Constant RHS,
bool  isExact = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 134 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateBinOp()

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

Implements llvm::IRBuilderFolder.

Definition at line 142 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 192 of file InstSimplifyFolder.h.

◆ CreateCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 170 of file InstSimplifyFolder.h.

◆ CreateExtractElement()

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

Implements llvm::IRBuilderFolder.

Definition at line 237 of file InstSimplifyFolder.h.

◆ CreateFAdd()

Value* llvm::InstSimplifyFolder::CreateFAdd ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 89 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateFCmp()

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

Implements llvm::IRBuilderFolder.

Definition at line 228 of file InstSimplifyFolder.h.

References LHS, P, and RHS.

◆ CreateFDiv()

Value* llvm::InstSimplifyFolder::CreateFDiv ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 114 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateFMul()

Value* llvm::InstSimplifyFolder::CreateFMul ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 103 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateFNeg()

Value* llvm::InstSimplifyFolder::CreateFNeg ( Constant C) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 155 of file InstSimplifyFolder.h.

◆ CreateFPCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 187 of file InstSimplifyFolder.h.

◆ CreateFRem()

Value* llvm::InstSimplifyFolder::CreateFRem ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 123 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateFSub()

Value* llvm::InstSimplifyFolder::CreateFSub ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 96 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateInsertElement()

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

Implements llvm::IRBuilderFolder.

Definition at line 241 of file InstSimplifyFolder.h.

◆ CreateIntCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 176 of file InstSimplifyFolder.h.

◆ CreateIntToPtr()

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

Implements llvm::IRBuilderFolder.

Definition at line 195 of file InstSimplifyFolder.h.

◆ CreateLShr()

Value* llvm::InstSimplifyFolder::CreateLShr ( Constant LHS,
Constant RHS,
bool  isExact = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 130 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateMul()

Value* llvm::InstSimplifyFolder::CreateMul ( Constant LHS,
Constant RHS,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 99 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateNeg()

Value* llvm::InstSimplifyFolder::CreateNeg ( Constant C,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 151 of file InstSimplifyFolder.h.

◆ CreateNot()

Value* llvm::InstSimplifyFolder::CreateNot ( Constant C) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 158 of file InstSimplifyFolder.h.

◆ CreatePointerBitCastOrAddrSpaceCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 217 of file InstSimplifyFolder.h.

◆ CreatePointerCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 182 of file InstSimplifyFolder.h.

◆ CreatePtrToInt()

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

Implements llvm::IRBuilderFolder.

Definition at line 198 of file InstSimplifyFolder.h.

◆ CreateSDiv()

Value* llvm::InstSimplifyFolder::CreateSDiv ( Constant LHS,
Constant RHS,
bool  isExact = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 110 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateSExtOrBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 206 of file InstSimplifyFolder.h.

◆ CreateShl()

Value* llvm::InstSimplifyFolder::CreateShl ( Constant LHS,
Constant RHS,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 126 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateShuffleVector()

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

◆ CreateSRem()

Value* llvm::InstSimplifyFolder::CreateSRem ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 120 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateSub()

Value* llvm::InstSimplifyFolder::CreateSub ( Constant LHS,
Constant RHS,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 92 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateTruncOrBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 211 of file InstSimplifyFolder.h.

◆ CreateUDiv()

Value* llvm::InstSimplifyFolder::CreateUDiv ( Constant LHS,
Constant RHS,
bool  isExact = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 106 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateUnOp()

Value* llvm::InstSimplifyFolder::CreateUnOp ( Instruction::UnaryOps  Opc,
Constant C 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 162 of file InstSimplifyFolder.h.

◆ CreateURem()

Value* llvm::InstSimplifyFolder::CreateURem ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 117 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateXor()

Value* llvm::InstSimplifyFolder::CreateXor ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 138 of file InstSimplifyFolder.h.

References LHS, and RHS.

◆ CreateZExtOrBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 201 of file InstSimplifyFolder.h.

◆ FoldAdd()

Value* llvm::InstSimplifyFolder::FoldAdd ( Value LHS,
Value RHS,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 49 of file InstSimplifyFolder.h.

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

◆ FoldAnd()

Value* llvm::InstSimplifyFolder::FoldAnd ( Value LHS,
Value RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 54 of file InstSimplifyFolder.h.

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

◆ FoldExtractValue()

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

Implements llvm::IRBuilderFolder.

Definition at line 75 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 66 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 62 of file InstSimplifyFolder.h.

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

◆ FoldInsertValue()

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

Implements llvm::IRBuilderFolder.

Definition at line 80 of file InstSimplifyFolder.h.

References llvm::SimplifyInsertValueInst().

◆ FoldOr()

Value* llvm::InstSimplifyFolder::FoldOr ( Value LHS,
Value RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 58 of file InstSimplifyFolder.h.

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

◆ FoldSelect()

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

Implements llvm::IRBuilderFolder.

Definition at line 71 of file InstSimplifyFolder.h.

References llvm::SimplifySelectInst().


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