LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
InstCombineSimplifyDemanded.cpp File Reference
#include "InstCombine.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Support/PatternMatch.h"
Include dependency graph for InstCombineSimplifyDemanded.cpp:

Go to the source code of this file.

Functions

static bool ShrinkDemandedConstant (Instruction *I, unsigned OpNo, APInt Demanded)
 

Function Documentation

static bool ShrinkDemandedConstant ( Instruction I,
unsigned  OpNo,
APInt  Demanded 
)
static

ShrinkDemandedConstant - Check to see if the specified operand of the specified instruction is a constant integer. If so, check to see if there are any bits set in the constant that are not demanded. If so, shrink the constant and return true.

Definition at line 28 of file InstCombineSimplifyDemanded.cpp.

References llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::APInt::getBitWidth(), llvm::User::getOperand(), llvm::ConstantInt::getType(), llvm::ConstantInt::getValue(), llvm::User::setOperand(), and llvm::APInt::zextOrTrunc().