LLVM API Documentation

Public Member Functions | Public Attributes
llvm::TargetLowering::TargetLoweringOpt Struct Reference

#include <TargetLowering.h>

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

List of all members.

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, SDLoc dl)

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 1979 of file TargetLowering.h.


Constructor & Destructor Documentation

llvm::TargetLowering::TargetLoweringOpt::TargetLoweringOpt ( SelectionDAG InDAG,
bool  LT,
bool  LO 
) [inline, explicit]

Definition at line 1986 of file TargetLowering.h.


Member Function Documentation

Definition at line 1993 of file TargetLowering.h.

References New, and Old.

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

Definition at line 1991 of file TargetLowering.h.

References LegalOps.

Definition at line 1990 of file TargetLowering.h.

References LegalTys.

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.

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

References llvm::ISD::AND, llvm::CallingConv::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().

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.

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 322 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, llvm::X, and llvm::ISD::ZERO_EXTEND.


Member Data Documentation

Definition at line 1980 of file TargetLowering.h.

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

Definition at line 1982 of file TargetLowering.h.

Referenced by LegalOperations().

Definition at line 1981 of file TargetLowering.h.

Referenced by LegalTypes().

Definition at line 1984 of file TargetLowering.h.

Referenced by CombineTo().

Definition at line 1983 of file TargetLowering.h.

Referenced by CombineTo().


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