LLVM  mainline
Defines | Functions
InstCombineCalls.cpp File Reference
#include "InstCombineInternal.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/Statepoint.h"
#include "llvm/Transforms/Utils/BuildLibCalls.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/SimplifyLibCalls.h"
Include dependency graph for InstCombineCalls.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "instcombine"

Functions

 STATISTIC (NumSimplified,"Number of library calls simplified")
static TypegetPromotedType (Type *Ty)
 Return the specified type promoted as it would be to pass though a va_arg area.
static TypereduceToSingleValueType (Type *T)
 Given an aggregate type which ultimately holds a single scalar element, like {{{type}}} or [1 x type], return type.
static ValueSimplifyX86immshift (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
static ValueSimplifyX86extend (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder, bool SignExtend)
static ValueSimplifyX86insertps (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
static ValueSimplifyX86extrq (IntrinsicInst &II, Value *Op0, ConstantInt *CILength, ConstantInt *CIIndex, InstCombiner::BuilderTy &Builder)
 Attempt to simplify SSE4A EXTRQ/EXTRQI instructions using constant folding or conversion to a shuffle vector.
static ValueSimplifyX86insertq (IntrinsicInst &II, Value *Op0, Value *Op1, APInt APLength, APInt APIndex, InstCombiner::BuilderTy &Builder)
 Attempt to simplify SSE4A INSERTQ/INSERTQI instructions using constant folding or conversion to a shuffle vector.
static ValueSimplifyX86vperm2 (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
 The shuffle mask for a perm2*128 selects any two halves of two 256-bit source vectors, unless a zero bit is set.
static ValueSimplifyX86vpcom (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder, bool IsSigned)
 Decode XOP integer vector comparison intrinsics.
static bool isSafeToEliminateVarargsCast (const CallSite CS, const DataLayout &DL, const CastInst *const CI, const int ix)
 If this cast does not affect the value passed through the varargs area, we can eliminate the use of the cast.
static IntrinsicInstFindInitTrampolineFromAlloca (Value *TrampMem)
static IntrinsicInstFindInitTrampolineFromBB (IntrinsicInst *AdjustTramp, Value *TrampMem)
static IntrinsicInstFindInitTrampoline (Value *Callee)

Define Documentation

#define DEBUG_TYPE   "instcombine"

Definition at line 28 of file InstCombineCalls.cpp.


Function Documentation

static IntrinsicInst* FindInitTrampoline ( Value Callee) [static]
static IntrinsicInst* FindInitTrampolineFromAlloca ( Value TrampMem) [static]
static IntrinsicInst* FindInitTrampolineFromBB ( IntrinsicInst AdjustTramp,
Value TrampMem 
) [static]
static Type* getPromotedType ( Type Ty) [static]

Return the specified type promoted as it would be to pass though a va_arg area.

Definition at line 34 of file InstCombineCalls.cpp.

References llvm::Type::getContext(), and llvm::Type::getInt32Ty().

static bool isSafeToEliminateVarargsCast ( const CallSite  CS,
const DataLayout DL,
const CastInst *const  CI,
const int  ix 
) [static]
static Type* reduceToSingleValueType ( Type T) [static]

Given an aggregate type which ultimately holds a single scalar element, like {{{type}}} or [1 x type], return type.

Definition at line 44 of file InstCombineCalls.cpp.

References llvm::Type::isSingleValueType(), and T.

static Value* SimplifyX86extend ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder,
bool  SignExtend 
) [static]
static Value* SimplifyX86extrq ( IntrinsicInst II,
Value Op0,
ConstantInt CILength,
ConstantInt CIIndex,
InstCombiner::BuilderTy Builder 
) [static]
static Value* SimplifyX86immshift ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
) [static]
static Value* SimplifyX86insertps ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
) [static]
static Value* SimplifyX86insertq ( IntrinsicInst II,
Value Op0,
Value Op1,
APInt  APLength,
APInt  APIndex,
InstCombiner::BuilderTy Builder 
) [static]
static Value* SimplifyX86vpcom ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder,
bool  IsSigned 
) [static]
static Value* SimplifyX86vperm2 ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
) [static]

The shuffle mask for a perm2*128 selects any two halves of two 256-bit source vectors, unless a zero bit is set.

If a zero bit is set, then ignore that half of the mask and clear that half of the vector.

Definition at line 577 of file InstCombineCalls.cpp.

References llvm::IRBuilder< preserveNames, T, Inserter >::CreateShuffleVector(), llvm::ConstantAggregateZero::get(), llvm::CallInst::getArgOperand(), llvm::VectorType::getNumElements(), and llvm::Value::getType().

Referenced by llvm::InstCombiner::visitCallInst().

STATISTIC ( NumSimplified  ,
"Number of library calls simplified"   
)