LLVM API Documentation
#include <TargetLowering.h>

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) |
| bool | ShrinkDemandedOp (SDValue Op, unsigned BitWidth, const APInt &Demanded, DebugLoc dl) |
Public Attributes | |
| SelectionDAG & | DAG |
| bool | LegalTys |
| bool | LegalOps |
| SDValue | Old |
| SDValue | New |
TargetLoweringOpt - 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 1733 of file TargetLowering.h.
| llvm::TargetLowering::TargetLoweringOpt::TargetLoweringOpt | ( | SelectionDAG & | InDAG, |
| bool | LT, | ||
| bool | LO | ||
| ) | [inline, explicit] |
Definition at line 1740 of file TargetLowering.h.
Definition at line 1747 of file TargetLowering.h.
Referenced by ShrinkDemandedConstant(), and llvm::TargetLowering::SimplifyDemandedBits().
| bool llvm::TargetLowering::TargetLoweringOpt::LegalOperations | ( | ) | const [inline] |
Definition at line 1745 of file TargetLowering.h.
References LegalOps.
| bool llvm::TargetLowering::TargetLoweringOpt::LegalTypes | ( | ) | const [inline] |
Definition at line 1744 of file TargetLowering.h.
References LegalTys.
| bool TargetLowering::TargetLoweringOpt::ShrinkDemandedConstant | ( | SDValue | Op, |
| const APInt & | Demanded | ||
| ) |
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 265 of file TargetLowering.cpp.
References llvm::ISD::AND, llvm::CallingConv::C, CombineTo(), DAG, llvm::dyn_cast(), llvm::ConstantSDNode::getAPIntValue(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getDebugLoc(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValueType(), llvm::APInt::intersects(), New, llvm::ISD::OR, and llvm::ISD::XOR.
Referenced by llvm::TargetLowering::SimplifyDemandedBits().
| bool TargetLowering::TargetLoweringOpt::ShrinkDemandedOp | ( | SDValue | Op, |
| unsigned | BitWidth, | ||
| const APInt & | Demanded, | ||
| DebugLoc | dl | ||
| ) |
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 304 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::TargetLoweringBase::isZExtFree(), llvm::NextPowerOf2(), llvm::ISD::TRUNCATE, llvm::X, and llvm::ISD::ZERO_EXTEND.
Definition at line 1734 of file TargetLowering.h.
Referenced by ShrinkDemandedConstant(), and llvm::TargetLowering::SimplifyDemandedBits().
Definition at line 1736 of file TargetLowering.h.
Referenced by LegalOperations().
Definition at line 1735 of file TargetLowering.h.
Referenced by LegalTypes().
Definition at line 1738 of file TargetLowering.h.
Referenced by CombineTo(), and ShrinkDemandedConstant().
Definition at line 1737 of file TargetLowering.h.
Referenced by CombineTo().