|
LLVM
4.0.0
|
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>
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, const SDLoc &dl) |
| Convert x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free. More... | |
| bool | SimplifyDemandedBits (SDNode *User, unsigned OpIdx, const APInt &Demanded, DAGCombinerInfo &DCI) |
| Helper for SimplifyDemandedBits that can simplify an operation with multiple uses. More... | |
Public Attributes | |
| SelectionDAG & | DAG |
| bool | LegalTys |
| bool | LegalOps |
| SDValue | Old |
| SDValue | New |
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 2310 of file TargetLowering.h.
|
inlineexplicit |
Definition at line 2317 of file TargetLowering.h.
Definition at line 2324 of file TargetLowering.h.
Referenced by llvm::TargetLowering::SimplifyDemandedBits().
|
inline |
Definition at line 2322 of file TargetLowering.h.
References LegalOps.
|
inline |
Definition at line 2321 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.
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 340 of file TargetLowering.cpp.
References llvm::ISD::AND, 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, | ||
| const SDLoc & | dl | ||
| ) |
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 377 of file TargetLowering.cpp.
References llvm::ISD::ANY_EXTEND, assert(), 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.
| bool TargetLowering::TargetLoweringOpt::SimplifyDemandedBits | ( | SDNode * | User, |
| unsigned | OpIdx, | ||
| const APInt & | Demanded, | ||
| DAGCombinerInfo & | DCI | ||
| ) |
Helper for SimplifyDemandedBits that can simplify an operation with multiple uses.
This function uses TLI.SimplifyDemandedBits to simplify Operand OpIdx of User and then updated User with the simplified version. No other uses of OpIdx are updated. If User is the only user of OpIdx, this function behaves exactly like TLI.SimplifyDemandedBits except that it also updates the DAG by calling DCI.CommitTargetLoweringOpt.
Definition at line 422 of file TargetLowering.cpp.
References llvm::TargetLowering::DAGCombinerInfo::AddToWorklist(), assert(), llvm::TargetLowering::DAGCombinerInfo::CommitTargetLoweringOpt(), llvm::SDValue::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getOperand(), i, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::TargetLowering::SimplifyDemandedBits().
Referenced by simplifyI24().
| SelectionDAG& llvm::TargetLowering::TargetLoweringOpt::DAG |
Definition at line 2311 of file TargetLowering.h.
Referenced by llvm::TargetLowering::SimplifyDemandedBits().
| bool llvm::TargetLowering::TargetLoweringOpt::LegalOps |
Definition at line 2313 of file TargetLowering.h.
Referenced by LegalOperations().
| bool llvm::TargetLowering::TargetLoweringOpt::LegalTys |
Definition at line 2312 of file TargetLowering.h.
Referenced by LegalTypes().
| SDValue llvm::TargetLowering::TargetLoweringOpt::New |
Definition at line 2315 of file TargetLowering.h.
Referenced by CombineTo().
| SDValue llvm::TargetLowering::TargetLoweringOpt::Old |
Definition at line 2314 of file TargetLowering.h.
Referenced by CombineTo().
1.8.6