LLVM API Documentation
#include "llvm/Transforms/Scalar.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Pass.h"
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalVariable.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/InstIterator.h"
#include "llvm/Support/InstVisitor.h"
#include "llvm/Support/PatternMatch.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/Statistic.h"
#include <algorithm>
Include dependency graph for InstructionCombining.cpp:
Go to the source code of this file.
|
Definition at line 36 of file InstructionCombining.cpp. |
|
Definition at line 2735 of file InstructionCombining.cpp. |
|
Definition at line 362 of file InstructionCombining.cpp. References llvm::Value::getType(). Referenced by llvm::SCEVAddExpr::get(). |
|
AddWithOverflow - Compute Result = In1+In2, returning true if the result overflowed for this type. Definition at line 1855 of file InstructionCombining.cpp. References llvm::Value::getType(), isPositive(), and llvm::Type::isUnsigned(). |
|
AssociativeOpt - Perform an optimization on an associative operator. This function is designed to check a chain of associative operators for a potential to apply a certain optimization. Since the optimization may be applicable if the expression was reassociated, this checks the chain, then reassociates the expression as necessary to expose the optimization opportunity. This makes use of a special Functor, which must define 'shouldApply' and 'apply' methods. Definition at line 389 of file InstructionCombining.cpp. References llvm::BasicBlock::getInstList(), llvm::Instruction::getOpcode(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::Value::replaceAllUsesWith(), llvm::User::setOperand(), and llvm::Constant::setOperand(). |
|
Definition at line 331 of file InstructionCombining.cpp. References llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::Type::isInteger(), and Mul(). |
|
Definition at line 306 of file InstructionCombining.cpp. |
|
Definition at line 316 of file InstructionCombining.cpp. |
|
Definition at line 559 of file InstructionCombining.cpp. References FoldOperationIntoSelectOperand(), llvm::SelectInst::getCondition(), llvm::User::getOperand(), and llvm::Value::hasOneUse(). |
|
Definition at line 487 of file InstructionCombining.cpp. References abort(), llvm::Instruction::getOpcode(), and llvm::User::getOperand(). Referenced by FoldBinOpIntoSelect(). |
|
getCastType - In the future, we will split the cast instruction into these various types. Until then, we have to do the analysis here. Definition at line 2744 of file InstructionCombining.cpp. References llvm::Type::getPrimitiveSize(), llvm::Type::isIntegral(), llvm::Type::isSigned(), Noop, Signext, Truncate, and Zeroext. Referenced by isEliminableCastOfCast(). |
|
Definition at line 228 of file InstructionCombining.cpp. References llvm::BinaryOperator::isNeg(), and llvm::BinaryOperator::isNot(). |
|
GetGEPGlobalInitializer - Given a constant, and a getelementptr constantexpr, return the constant value being addressed by the constant expression, or null if something is funny. Definition at line 3924 of file InstructionCombining.cpp. References E, llvm::gep_type_begin(), llvm::gep_type_end(), llvm::SequentialType::getElementType(), llvm::ArrayType::getNumElements(), llvm::ConstantExpr::getOperand(), llvm::Value::getType(), and llvm::ConstantUInt::getValue(). |
|
Definition at line 246 of file InstructionCombining.cpp. References llvm::Type::DoubleTy, llvm::Type::FloatTyID, llvm::Type::getTypeID(), llvm::Type::IntTy, llvm::Type::SByteTyID, llvm::Type::ShortTyID, llvm::Type::UByteTyID, llvm::Type::UIntTy, and llvm::Type::UShortTyID. |
|
GetSelectFoldableConstant - For the same transformation as the previous function, return the identity constant that goes into the select. Definition at line 3021 of file InstructionCombining.cpp. References abort(), Add(), llvm::ISD::And, llvm::Instruction::getOpcode(), llvm::Value::getType(), Mul(), llvm::ISD::Or, and llvm::ISD::Xor. |
|
GetSelectFoldableOperands - We want to turn code that looks like this: C = or A, B D = select cond, C, A into: C = select cond, B, 0 D = or A, C Assuming that the specified instruction is an operand to the select, return a bitmask indicating which operands of this instruction are foldable if they equal the other incoming value of the select. Definition at line 3002 of file InstructionCombining.cpp. References Add(), llvm::ISD::And, llvm::Instruction::getOpcode(), Mul(), llvm::ISD::Or, and llvm::ISD::Xor. |
|
getSetCCValue - This is the complement of getSetCondCode, which turns an opcode and two operands into either a constant true or false, or a brand new SetCC instruction. Definition at line 1135 of file InstructionCombining.cpp. References False, llvm::ISD::SetEQ, llvm::ISD::SetGE, llvm::ISD::SetGT, llvm::ISD::SetLE, llvm::ISD::SetLT, llvm::ISD::SetNE, and True. Referenced by FoldSetCCLogical::apply(). |
|
getSetCondCode - Encode a setcc opcode into a three bit mask. These bits are carefully arranged to allow folding of expressions such as: (A < B) | (A > B) --> (A != B) Bit value '4' represents that the comparison is true if A > B, bit value '2' represents that the comparison is true if A == B, and bit value '1' is true if A < B. Definition at line 1116 of file InstructionCombining.cpp. References llvm::BinaryOperator::getOpcode(), llvm::ISD::SetEQ, llvm::ISD::SetGE, llvm::ISD::SetGT, llvm::ISD::SetLE, llvm::ISD::SetLT, and llvm::ISD::SetNE. Referenced by FoldSetCCLogical::apply(). |
|
Definition at line 685 of file InstructionCombining.cpp. References llvm::Type::getPrimitiveSize(). |
|
Definition at line 3603 of file InstructionCombining.cpp. References llvm::Type::getPrimitiveSize(), llvm::Type::getSignedVersion(), llvm::Value::getType(), and llvm::Type::isSigned(). |
|
Definition at line 3962 of file InstructionCombining.cpp. References llvm::Value::getName(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::isInteger(), llvm::Type::isSized(), and llvm::LoadInst::isVolatile(). |
|
Definition at line 2762 of file InstructionCombining.cpp. References getCastType(), llvm::TargetData::getIntPtrType(), llvm::Type::isLosslesslyConvertibleTo(), Noop, and Truncate. Referenced by ValueRequiresCast(). |
|
Definition at line 1096 of file InstructionCombining.cpp. References llvm::ConstantIntegral::getRawValue(), llvm::Value::getType(), and U. |
|
Definition at line 1042 of file InstructionCombining.cpp. References llvm::ConstantSInt::getValue(), and INT64_MAX. |
|
Definition at line 1061 of file InstructionCombining.cpp. References llvm::ConstantSInt::getValue(). |
|
Definition at line 1076 of file InstructionCombining.cpp. References llvm::ConstantIntegral::getRawValue(). |
|
Definition at line 240 of file InstructionCombining.cpp. References llvm::Value::hasOneUse(). |
|
Definition at line 1849 of file InstructionCombining.cpp. Referenced by AddWithOverflow(). |
|
isSafeToLoadUnconditionally - Return true if we know that executing a load from this value cannot trap. If it is not obviously safe to load from the specified pointer, we do a quick local scan of the basic block containing ScanFrom, to determine if the address is already accessed. Definition at line 3991 of file InstructionCombining.cpp. References llvm::BasicBlock::begin(), E, llvm::User::getOperand(), and llvm::Instruction::getParent(). |
|
Definition at line 680 of file InstructionCombining.cpp. References llvm::Type::getPrimitiveSize(), llvm::ConstantIntegral::getRawValue(), and llvm::Value::getType(). |
|
isSignBitCheck - Given an exploded setcc instruction, return true if it is really just returns true if the most significant (sign) bit is set. Definition at line 831 of file InstructionCombining.cpp. References llvm::Type::getPrimitiveSize(), llvm::Value::getType(), llvm::ConstantUInt::getValue(), llvm::ConstantIntegral::isAllOnesValue(), llvm::ConstantInt::isNullValue(), llvm::Type::isSigned(), llvm::ISD::SetGE, llvm::ISD::SetGT, llvm::ISD::SetLE, and llvm::ISD::SetLT. |
|
Definition at line 374 of file InstructionCombining.cpp. References llvm::Instruction::getOpcode(), llvm::ISD::SetEQ, llvm::ISD::SetGE, and llvm::ISD::SetLE. |
|
Definition at line 350 of file InstructionCombining.cpp. |
|
MulWithOverflow - Compute Result = In1*In2, returning true if the result overflowed for this type. Definition at line 1843 of file InstructionCombining.cpp. References llvm::ConstantInt::isNullValue(). |
|
RemoveNoopCast - Strip off nonconverting casts from the value. Definition at line 691 of file InstructionCombining.cpp. References llvm::Type::getPrimitiveSize(), llvm::Value::getType(), and llvm::Type::isInteger(). |
|
Definition at line 366 of file InstructionCombining.cpp. References llvm::Value::getType(). |
|
Definition at line 2822 of file InstructionCombining.cpp. References llvm::Constant::getOperand(), llvm::Value::getType(), and isEliminableCastOfCast(). |
|
|
|
|
|
|
|
|