LLVM  4.0.0
Macros | Functions
InstCombineSimplifyDemanded.cpp File Reference
#include "InstCombineInternal.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PatternMatch.h"
Include dependency graph for InstCombineSimplifyDemanded.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "instcombine"
 

Functions

static bool ShrinkDemandedConstant (Instruction *I, unsigned OpNo, APInt Demanded)
 Check to see if the specified operand of the specified instruction is a constant integer. More...
 

Macro Definition Documentation

#define DEBUG_TYPE   "instcombine"

Definition at line 23 of file InstCombineSimplifyDemanded.cpp.

Function Documentation

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

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 assert(), 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().