LLVM API Documentation

Defines | Functions
InstCombineSimplifyDemanded.cpp File Reference
#include "InstCombineInternal.h"
#include "llvm/IR/DataLayout.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.


#define DEBUG_TYPE   "instcombine"


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

Define 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]

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 29 of file InstCombineSimplifyDemanded.cpp.

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