LLVM API Documentation
#include "InstCombine.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Support/PatternMatch.h"
Go to the source code of this file.
|
static |
CvtFDivConstToReciprocal tries to convert X/C into X*1/C if C not a special FP value and: 1) 1/C is exact, or 2) reciprocal is allowed. If the conversion was successful, the simplified expression "X * 1/C" is returned; otherwise, NULL is returned.
Definition at line 967 of file InstCombineMulDivRem.cpp.
References llvm::lltok::APFloat, llvm::ConstantFP::get(), llvm::Type::getContext(), llvm::APFloat::getExactInverse(), llvm::APFloat::getSemantics(), llvm::Value::getType(), llvm::ConstantFP::getValueAPF(), llvm::APFloat::isFiniteNonZero(), and llvm::APFloat::rmNearestTiesToEven.
Referenced by llvm::InstCombiner::visitFDiv().
|
static |
Definition at line 294 of file InstCombineMulDivRem.cpp.
References llvm::dyn_cast(), llvm::CallInst::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::hasOneUse(), llvm::Instruction::hasUnsafeAlgebra(), I, llvm::ConstantFP::isExactlyValue(), and llvm::Intrinsic::log2.
Referenced by llvm::InstCombiner::visitFMul().
dyn_castZExtVal - Checks if V is a zext or constant that can be truncated to Ty without losing bits.
Definition at line 727 of file InstCombineMulDivRem.cpp.
References llvm::CallingConv::C, getBitWidth(), and llvm::ConstantExpr::getTrunc().
Referenced by llvm::InstCombiner::visitUDiv(), and llvm::InstCombiner::visitURem().
|
static |
Definition at line 777 of file InstCombineMulDivRem.cpp.
References llvm::InstCombiner::Builder, llvm::SelectInst::Create(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateICmpULT(), llvm::ConstantInt::get(), llvm::Constant::getNullValue(), and llvm::Value::getType().
Referenced by visitUDivOperand().
|
static |
Definition at line 767 of file InstCombineMulDivRem.cpp.
References llvm::CallingConv::C, llvm::ConstantInt::get(), llvm::Value::getType(), llvm::BinaryOperator::isExact(), llvm::APInt::logBase2(), and llvm::BinaryOperator::setIsExact().
Referenced by visitUDivOperand().
|
static |
Definition at line 786 of file InstCombineMulDivRem.cpp.
References llvm::InstCombiner::Builder, llvm::IRBuilder< preserveNames, T, Inserter >::CreateAdd(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateZExt(), llvm::ConstantInt::get(), llvm::User::getOperand(), llvm::Value::getType(), llvm::BinaryOperator::isExact(), llvm::APInt::logBase2(), N, and llvm::BinaryOperator::setIsExact().
Referenced by visitUDivOperand().
|
static |
A helper routine of InstCombiner::visitMul().
If C is a vector of known powers of 2, then this function returns a new vector obtained from C replacing each element with its logBase2. Return a null pointer otherwise.
Definition at line 103 of file InstCombineMulDivRem.cpp.
References llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::ConstantDataSequential::getElementAsConstant(), llvm::ConstantDataSequential::getNumElements(), llvm::Value::getType(), I, llvm::APInt::isPowerOf2(), llvm::APInt::logBase2(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::match(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by llvm::InstCombiner::visitMul().
Helper function of InstCombiner::visitFMul(BinaryOperator(). It returns true iff the given value is FMul or FDiv with one and only one operand being a normal constant (i.e. not Zero/NaN/Infinity).
Definition at line 329 of file InstCombineMulDivRem.cpp.
References llvm::dyn_cast(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::ConstantFP::getValueAPF(), I, and llvm::APFloat::isFiniteNonZero().
Referenced by llvm::InstCombiner::foldFMulConst(), and llvm::InstCombiner::visitFMul().
|
static |
Definition at line 345 of file InstCombineMulDivRem.cpp.
References llvm::ConstantFP::getValueAPF(), and llvm::APFloat::isNormal().
Referenced by llvm::InstCombiner::foldFMulConst(), and llvm::InstCombiner::visitFMul().
|
static |
MultiplyOverflows - True if the multiply can not be expressed in an int this size.
Definition at line 77 of file InstCombineMulDivRem.cpp.
References llvm::ConstantInt::getBitWidth(), llvm::APInt::getLowBitsSet(), llvm::APInt::getSignedMaxValue(), llvm::APInt::getSignedMinValue(), llvm::ConstantInt::getValue(), llvm::APInt::sext(), llvm::APInt::sgt(), llvm::APInt::slt(), llvm::APInt::ugt(), and llvm::APInt::zext().
Referenced by llvm::InstCombiner::commonIDivTransforms().
|
static |
simplifyValueKnownNonZero - The specific integer value is used in a context where it is known to be non-zero. If this allows us to simplify the computation, do so and return the new operand, otherwise return null.
Definition at line 26 of file InstCombineMulDivRem.cpp.
References llvm::ARM_PROC::A, llvm::InstCombiner::Builder, llvm::IRBuilder< preserveNames, T, Inserter >::CreateShl(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateSub(), llvm::Value::hasOneUse(), I, llvm::isKnownToBeAPowerOfTwo(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and llvm::NVPTX::PTXLdStInstCode::V2.
Referenced by llvm::InstCombiner::commonIDivTransforms(), and llvm::InstCombiner::commonIRemTransforms().
|
static |
Definition at line 808 of file InstCombineMulDivRem.cpp.
References llvm::CallingConv::C, foldUDivNegCst(), foldUDivPow2Cst(), foldUDivShl(), I, llvm::PatternMatch::m_Power2(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::match(), MaxDepth, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::SmallVectorTemplateCommon< T >::size().
Referenced by llvm::InstCombiner::visitUDiv().