LLVM  3.7.0
Public Member Functions | Public Attributes | List of all members
llvm::TargetLowering::TargetLoweringOpt Struct Reference

A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetLowering to its clients that want to combine. More...

#include <TargetLowering.h>

Collaboration diagram for llvm::TargetLowering::TargetLoweringOpt:
[legend]

Public Member Functions

 TargetLoweringOpt (SelectionDAG &InDAG, bool LT, bool LO)
 
bool LegalTypes () const
 
bool LegalOperations () const
 
bool CombineTo (SDValue O, SDValue N)
 
bool ShrinkDemandedConstant (SDValue Op, const APInt &Demanded)
 Check to see if the specified operand of the specified instruction is a constant integer. More...
 
bool ShrinkDemandedOp (SDValue Op, unsigned BitWidth, const APInt &Demanded, SDLoc dl)
 Convert x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free. More...
 

Public Attributes

SelectionDAGDAG
 
bool LegalTys
 
bool LegalOps
 
SDValue Old
 
SDValue New
 

Detailed Description

A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetLowering to its clients that want to combine.

Definition at line 2102 of file TargetLowering.h.

Constructor & Destructor Documentation

llvm::TargetLowering::TargetLoweringOpt::TargetLoweringOpt ( SelectionDAG InDAG,
bool  LT,
bool  LO 
)
inlineexplicit

Definition at line 2109 of file TargetLowering.h.

Member Function Documentation

bool llvm::TargetLowering::TargetLoweringOpt::CombineTo ( SDValue  O,
SDValue  N 
)
inline

Definition at line 2116 of file TargetLowering.h.

References N, New, and Old.

Referenced by llvm::TargetLowering::SimplifyDemandedBits().

bool llvm::TargetLowering::TargetLoweringOpt::LegalOperations ( ) const
inline

Definition at line 2114 of file TargetLowering.h.

References LegalOps.

bool llvm::TargetLowering::TargetLoweringOpt::LegalTypes ( ) const
inline

Definition at line 2113 of file TargetLowering.h.

References LegalTys.

bool TargetLowering::TargetLoweringOpt::ShrinkDemandedConstant ( SDValue  Op,
const APInt Demanded 
)

Check to see if the specified operand of the specified instruction is a constant integer.

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 286 of file TargetLowering.cpp.

References llvm::ISD::AND, llvm::C, llvm::dyn_cast(), llvm::ConstantSDNode::getAPIntValue(), llvm::SDValue::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValueType(), llvm::APInt::intersects(), llvm::ISD::OR, and llvm::ISD::XOR.

Referenced by llvm::TargetLowering::SimplifyDemandedBits().

bool TargetLowering::TargetLoweringOpt::ShrinkDemandedOp ( SDValue  Op,
unsigned  BitWidth,
const APInt Demanded,
SDLoc  dl 
)

Convert x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free.

ShrinkDemandedOp - Convert x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free.

This uses isZExtFree and ZERO_EXTEND for the widening cast, but it could be generalized for targets with other types of implicit widening casts.

Definition at line 325 of file TargetLowering.cpp.

References llvm::ISD::ANY_EXTEND, llvm::APInt::countLeadingZeros(), llvm::EVT::getIntegerVT(), llvm::SDValue::getNode(), llvm::SDValue::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDValue::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getValueType(), llvm::SDNode::hasOneUse(), llvm::isPowerOf2_32(), llvm::TargetLoweringBase::isTruncateFree(), llvm::EVT::isVector(), llvm::TargetLoweringBase::isZExtFree(), llvm::NextPowerOf2(), llvm::ISD::TRUNCATE, X, and llvm::ISD::ZERO_EXTEND.

Member Data Documentation

SelectionDAG& llvm::TargetLowering::TargetLoweringOpt::DAG

Definition at line 2103 of file TargetLowering.h.

Referenced by llvm::TargetLowering::SimplifyDemandedBits().

bool llvm::TargetLowering::TargetLoweringOpt::LegalOps

Definition at line 2105 of file TargetLowering.h.

Referenced by LegalOperations().

bool llvm::TargetLowering::TargetLoweringOpt::LegalTys

Definition at line 2104 of file TargetLowering.h.

Referenced by LegalTypes().

SDValue llvm::TargetLowering::TargetLoweringOpt::New

Definition at line 2107 of file TargetLowering.h.

Referenced by CombineTo().

SDValue llvm::TargetLowering::TargetLoweringOpt::Old

Definition at line 2106 of file TargetLowering.h.

Referenced by CombineTo().


The documentation for this struct was generated from the following files: