mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-25 21:46:50 +00:00
Janitorial services: "Don’t duplicate function or class name at the beginning of the comment."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e43c262106
commit
98491c0ff9
@ -113,22 +113,19 @@ namespace {
|
||||
// AA - Used for DAG load/store alias analysis.
|
||||
AliasAnalysis &AA;
|
||||
|
||||
/// AddUsersToWorklist - When an instruction is simplified, add all users of
|
||||
/// the instruction to the work lists because they might get more simplified
|
||||
/// now.
|
||||
///
|
||||
/// When an instruction is simplified, add all users of the instruction to
|
||||
/// the work lists because they might get more simplified now.
|
||||
void AddUsersToWorklist(SDNode *N) {
|
||||
for (SDNode *Node : N->uses())
|
||||
AddToWorklist(Node);
|
||||
}
|
||||
|
||||
/// visit - call the node-specific routine that knows how to fold each
|
||||
/// particular type of node.
|
||||
/// Call the node-specific routine that folds each particular type of node.
|
||||
SDValue visit(SDNode *N);
|
||||
|
||||
public:
|
||||
/// AddToWorklist - Add to the work list making sure its instance is at the
|
||||
/// back (next to be processed.)
|
||||
/// Add to the worklist making sure its instance is at the back (next to be
|
||||
/// processed.)
|
||||
void AddToWorklist(SDNode *N) {
|
||||
// Skip handle nodes as they can't usefully be combined and confuse the
|
||||
// zero-use deletion strategy.
|
||||
@ -139,8 +136,7 @@ namespace {
|
||||
Worklist.push_back(N);
|
||||
}
|
||||
|
||||
/// removeFromWorklist - remove all instances of N from the worklist.
|
||||
///
|
||||
/// Remove all instances of N from the worklist.
|
||||
void removeFromWorklist(SDNode *N) {
|
||||
CombinedNodes.erase(N);
|
||||
|
||||
@ -173,9 +169,9 @@ namespace {
|
||||
|
||||
private:
|
||||
|
||||
/// SimplifyDemandedBits - Check the specified integer node value to see if
|
||||
/// it can be simplified or if things it uses can be simplified by bit
|
||||
/// propagation. If so, return true.
|
||||
/// Check the specified integer node value to see if it can be simplified or
|
||||
/// if things it uses can be simplified by bit propagation.
|
||||
/// If so, return true.
|
||||
bool SimplifyDemandedBits(SDValue Op) {
|
||||
unsigned BitWidth = Op.getValueType().getScalarType().getSizeInBits();
|
||||
APInt Demanded = APInt::getAllOnesValue(BitWidth);
|
||||
@ -211,7 +207,7 @@ namespace {
|
||||
SDValue Trunc, SDValue ExtLoad, SDLoc DL,
|
||||
ISD::NodeType ExtType);
|
||||
|
||||
/// combine - call the node-specific routine that knows how to fold each
|
||||
/// Call the node-specific routine that knows how to fold each
|
||||
/// particular type of node. If that doesn't do anything, try the
|
||||
/// target-specific DAG combines.
|
||||
SDValue combine(SDNode *N);
|
||||
@ -341,17 +337,16 @@ namespace {
|
||||
|
||||
SDValue GetDemandedBits(SDValue V, const APInt &Mask);
|
||||
|
||||
/// GatherAllAliases - Walk up chain skipping non-aliasing memory nodes,
|
||||
/// Walk up chain skipping non-aliasing memory nodes,
|
||||
/// looking for aliasing nodes and adding them to the Aliases vector.
|
||||
void GatherAllAliases(SDNode *N, SDValue OriginalChain,
|
||||
SmallVectorImpl<SDValue> &Aliases);
|
||||
|
||||
/// isAlias - Return true if there is any possibility that the two addresses
|
||||
/// overlap.
|
||||
/// Return true if there is any possibility that the two addresses overlap.
|
||||
bool isAlias(LSBaseSDNode *Op0, LSBaseSDNode *Op1) const;
|
||||
|
||||
/// FindBetterChain - Walk up chain skipping non-aliasing memory nodes,
|
||||
/// looking for a better chain (aliasing node.)
|
||||
/// Walk up chain skipping non-aliasing memory nodes, looking for a better
|
||||
/// chain (aliasing node.)
|
||||
SDValue FindBetterChain(SDNode *N, SDValue Chain);
|
||||
|
||||
/// Merge consecutive store operations into a wide store.
|
||||
@ -379,13 +374,13 @@ namespace {
|
||||
FnAttrs.hasAttribute(AttributeSet::FunctionIndex, Attribute::MinSize);
|
||||
}
|
||||
|
||||
/// Run - runs the dag combiner on all nodes in the work list
|
||||
/// Runs the dag combiner on all nodes in the work list
|
||||
void Run(CombineLevel AtLevel);
|
||||
|
||||
SelectionDAG &getDAG() const { return DAG; }
|
||||
|
||||
/// getShiftAmountTy - Returns a type large enough to hold any valid
|
||||
/// shift amount - before type legalization these can be huge.
|
||||
/// Returns a type large enough to hold any valid shift amount - before type
|
||||
/// legalization these can be huge.
|
||||
EVT getShiftAmountTy(EVT LHSTy) {
|
||||
assert(LHSTy.isInteger() && "Shift amount is not an integer type!");
|
||||
if (LHSTy.isVector())
|
||||
@ -394,15 +389,14 @@ namespace {
|
||||
: TLI.getPointerTy();
|
||||
}
|
||||
|
||||
/// isTypeLegal - This method returns true if we are running before type
|
||||
/// legalization or if the specified VT is legal.
|
||||
/// This method returns true if we are running before type legalization or
|
||||
/// if the specified VT is legal.
|
||||
bool isTypeLegal(const EVT &VT) {
|
||||
if (!LegalTypes) return true;
|
||||
return TLI.isTypeLegal(VT);
|
||||
}
|
||||
|
||||
/// getSetCCResultType - Convenience wrapper around
|
||||
/// TargetLowering::getSetCCResultType
|
||||
/// Convenience wrapper around TargetLowering::getSetCCResultType
|
||||
EVT getSetCCResultType(EVT VT) const {
|
||||
return TLI.getSetCCResultType(*DAG.getContext(), VT);
|
||||
}
|
||||
@ -411,7 +405,7 @@ namespace {
|
||||
|
||||
|
||||
namespace {
|
||||
/// WorklistRemover - This class is a DAGUpdateListener that removes any deleted
|
||||
/// This class is a DAGUpdateListener that removes any deleted
|
||||
/// nodes from the worklist.
|
||||
class WorklistRemover : public SelectionDAG::DAGUpdateListener {
|
||||
DAGCombiner &DC;
|
||||
@ -474,9 +468,9 @@ void DAGCombiner::deleteAndRecombine(SDNode *N) {
|
||||
DAG.DeleteNode(N);
|
||||
}
|
||||
|
||||
/// isNegatibleForFree - Return 1 if we can compute the negated form of the
|
||||
/// specified expression for the same cost as the expression itself, or 2 if we
|
||||
/// can compute the negated form more cheaply than the expression itself.
|
||||
/// Return 1 if we can compute the negated form of the specified expression for
|
||||
/// the same cost as the expression itself, or 2 if we can compute the negated
|
||||
/// form more cheaply than the expression itself.
|
||||
static char isNegatibleForFree(SDValue Op, bool LegalOperations,
|
||||
const TargetLowering &TLI,
|
||||
const TargetOptions *Options,
|
||||
@ -539,8 +533,7 @@ static char isNegatibleForFree(SDValue Op, bool LegalOperations,
|
||||
}
|
||||
}
|
||||
|
||||
/// GetNegatedExpression - If isNegatibleForFree returns true, this function
|
||||
/// returns the newly negated expression.
|
||||
/// If isNegatibleForFree returns true, return the newly negated expression.
|
||||
static SDValue GetNegatedExpression(SDValue Op, SelectionDAG &DAG,
|
||||
bool LegalOperations, unsigned Depth = 0) {
|
||||
const TargetOptions &Options = DAG.getTarget().Options;
|
||||
@ -643,9 +636,9 @@ bool DAGCombiner::isSetCCEquivalent(SDValue N, SDValue &LHS, SDValue &RHS,
|
||||
return true;
|
||||
}
|
||||
|
||||
// isOneUseSetCC - Return true if this is a SetCC-equivalent operation with only
|
||||
// one use. If this is true, it allows the users to invert the operation for
|
||||
// free when it is profitable to do so.
|
||||
/// Return true if this is a SetCC-equivalent operation with only one use.
|
||||
/// If this is true, it allows the users to invert the operation for free when
|
||||
/// it is profitable to do so.
|
||||
bool DAGCombiner::isOneUseSetCC(SDValue N) const {
|
||||
SDValue N0, N1, N2;
|
||||
if (isSetCCEquivalent(N, N0, N1, N2) && N.getNode()->hasOneUse())
|
||||
@ -653,7 +646,7 @@ bool DAGCombiner::isOneUseSetCC(SDValue N) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// isConstantSplatVector - Returns true if N is a BUILD_VECTOR node whose
|
||||
/// Returns true if N is a BUILD_VECTOR node whose
|
||||
/// elements are all the same constant or undefined.
|
||||
static bool isConstantSplatVector(SDNode *N, APInt& SplatValue) {
|
||||
BuildVectorSDNode *C = dyn_cast<BuildVectorSDNode>(N);
|
||||
@ -820,9 +813,8 @@ CommitTargetLoweringOpt(const TargetLowering::TargetLoweringOpt &TLO) {
|
||||
deleteAndRecombine(TLO.Old.getNode());
|
||||
}
|
||||
|
||||
/// SimplifyDemandedBits - Check the specified integer node value to see if
|
||||
/// it can be simplified or if things it uses can be simplified by bit
|
||||
/// propagation. If so, return true.
|
||||
/// Check the specified integer node value to see if it can be simplified or if
|
||||
/// things it uses can be simplified by bit propagation. If so, return true.
|
||||
bool DAGCombiner::SimplifyDemandedBits(SDValue Op, const APInt &Demanded) {
|
||||
TargetLowering::TargetLoweringOpt TLO(DAG, LegalTypes, LegalOperations);
|
||||
APInt KnownZero, KnownOne;
|
||||
@ -930,9 +922,9 @@ SDValue DAGCombiner::ZExtPromoteOperand(SDValue Op, EVT PVT) {
|
||||
return DAG.getZeroExtendInReg(NewOp, dl, OldVT);
|
||||
}
|
||||
|
||||
/// PromoteIntBinOp - Promote the specified integer binary operation if the
|
||||
/// target indicates it is beneficial. e.g. On x86, it's usually better to
|
||||
/// promote i16 operations to i32 since i16 instructions are longer.
|
||||
/// Promote the specified integer binary operation if the target indicates it is
|
||||
/// beneficial. e.g. On x86, it's usually better to promote i16 operations to
|
||||
/// i32 since i16 instructions are longer.
|
||||
SDValue DAGCombiner::PromoteIntBinOp(SDValue Op) {
|
||||
if (!LegalOperations)
|
||||
return SDValue();
|
||||
@ -988,9 +980,9 @@ SDValue DAGCombiner::PromoteIntBinOp(SDValue Op) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// PromoteIntShiftOp - Promote the specified integer shift operation if the
|
||||
/// target indicates it is beneficial. e.g. On x86, it's usually better to
|
||||
/// promote i16 operations to i32 since i16 instructions are longer.
|
||||
/// Promote the specified integer shift operation if the target indicates it is
|
||||
/// beneficial. e.g. On x86, it's usually better to promote i16 operations to
|
||||
/// i32 since i16 instructions are longer.
|
||||
SDValue DAGCombiner::PromoteIntShiftOp(SDValue Op) {
|
||||
if (!LegalOperations)
|
||||
return SDValue();
|
||||
@ -1413,8 +1405,8 @@ SDValue DAGCombiner::combine(SDNode *N) {
|
||||
return RV;
|
||||
}
|
||||
|
||||
/// getInputChainForNode - Given a node, return its input chain if it has one,
|
||||
/// otherwise return a null sd operand.
|
||||
/// Given a node, return its input chain if it has one, otherwise return a null
|
||||
/// sd operand.
|
||||
static SDValue getInputChainForNode(SDNode *N) {
|
||||
if (unsigned NumOps = N->getNumOperands()) {
|
||||
if (N->getOperand(0).getValueType() == MVT::Other)
|
||||
@ -2356,10 +2348,9 @@ SDValue DAGCombiner::visitMULHU(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// SimplifyNodeWithTwoResults - Perform optimizations common to nodes that
|
||||
/// compute two values. LoOp and HiOp give the opcodes for the two computations
|
||||
/// that are being performed. Return true if a simplification was made.
|
||||
///
|
||||
/// Perform optimizations common to nodes that compute two values. LoOp and HiOp
|
||||
/// give the opcodes for the two computations that are being performed. Return
|
||||
/// true if a simplification was made.
|
||||
SDValue DAGCombiner::SimplifyNodeWithTwoResults(SDNode *N, unsigned LoOp,
|
||||
unsigned HiOp) {
|
||||
// If the high half is not needed, just compute the low half.
|
||||
@ -2502,8 +2493,8 @@ SDValue DAGCombiner::visitUDIVREM(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// SimplifyBinOpWithSameOpcodeHands - If this is a binary operator with
|
||||
/// two operands of the same opcode, try to simplify it.
|
||||
/// If this is a binary operator with two operands of the same opcode, try to
|
||||
/// simplify it.
|
||||
SDValue DAGCombiner::SimplifyBinOpWithSameOpcodeHands(SDNode *N) {
|
||||
SDValue N0 = N->getOperand(0), N1 = N->getOperand(1);
|
||||
EVT VT = N0.getValueType();
|
||||
@ -3042,8 +3033,7 @@ SDValue DAGCombiner::visitAND(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// MatchBSwapHWord - Match (a >> 8) | (a << 8) as (bswap a) >> 16
|
||||
///
|
||||
/// Match (a >> 8) | (a << 8) as (bswap a) >> 16.
|
||||
SDValue DAGCombiner::MatchBSwapHWordLow(SDNode *N, SDValue N0, SDValue N1,
|
||||
bool DemandHighBits) {
|
||||
if (!LegalOperations)
|
||||
@ -3148,9 +3138,12 @@ SDValue DAGCombiner::MatchBSwapHWordLow(SDNode *N, SDValue N0, SDValue N1,
|
||||
return Res;
|
||||
}
|
||||
|
||||
/// isBSwapHWordElement - Return true if the specified node is an element
|
||||
/// that makes up a 32-bit packed halfword byteswap. i.e.
|
||||
/// ((x&0xff)<<8)|((x&0xff00)>>8)|((x&0x00ff0000)<<8)|((x&0xff000000)>>8)
|
||||
/// Return true if the specified node is an element that makes up a 32-bit
|
||||
/// packed halfword byteswap.
|
||||
/// ((x & 0x000000ff) << 8) |
|
||||
/// ((x & 0x0000ff00) >> 8) |
|
||||
/// ((x & 0x00ff0000) << 8) |
|
||||
/// ((x & 0xff000000) >> 8)
|
||||
static bool isBSwapHWordElement(SDValue N, SmallVectorImpl<SDNode *> &Parts) {
|
||||
if (!N.getNode()->hasOneUse())
|
||||
return false;
|
||||
@ -3218,8 +3211,11 @@ static bool isBSwapHWordElement(SDValue N, SmallVectorImpl<SDNode *> &Parts) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/// MatchBSwapHWord - Match a 32-bit packed halfword bswap. That is
|
||||
/// ((x&0xff)<<8)|((x&0xff00)>>8)|((x&0x00ff0000)<<8)|((x&0xff000000)>>8)
|
||||
/// Match a 32-bit packed halfword bswap. That is
|
||||
/// ((x & 0x000000ff) << 8) |
|
||||
/// ((x & 0x0000ff00) >> 8) |
|
||||
/// ((x & 0x00ff0000) << 8) |
|
||||
/// ((x & 0xff000000) >> 8)
|
||||
/// => (rotl (bswap x), 16)
|
||||
SDValue DAGCombiner::MatchBSwapHWord(SDNode *N, SDValue N0, SDValue N1) {
|
||||
if (!LegalOperations)
|
||||
@ -3506,7 +3502,7 @@ SDValue DAGCombiner::visitOR(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// MatchRotateHalf - Match "(X shl/srl V1) & V2" where V2 may not be present.
|
||||
/// Match "(X shl/srl V1) & V2" where V2 may not be present.
|
||||
static bool MatchRotateHalf(SDValue Op, SDValue &Shift, SDValue &Mask) {
|
||||
if (Op.getOpcode() == ISD::AND) {
|
||||
if (isa<ConstantSDNode>(Op.getOperand(1))) {
|
||||
@ -3896,8 +3892,8 @@ SDValue DAGCombiner::visitXOR(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// visitShiftByConstant - Handle transforms common to the three shifts, when
|
||||
/// the shift amount is a constant.
|
||||
/// Handle transforms common to the three shifts, when the shift amount is a
|
||||
/// constant.
|
||||
SDValue DAGCombiner::visitShiftByConstant(SDNode *N, ConstantSDNode *Amt) {
|
||||
// We can't and shouldn't fold opaque constants.
|
||||
if (Amt->isOpaque())
|
||||
@ -5686,9 +5682,9 @@ SDValue DAGCombiner::visitANY_EXTEND(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// GetDemandedBits - See if the specified operand can be simplified with the
|
||||
/// knowledge that only the bits specified by Mask are used. If so, return the
|
||||
/// simpler operand, otherwise return a null SDValue.
|
||||
/// See if the specified operand can be simplified with the knowledge that only
|
||||
/// the bits specified by Mask are used. If so, return the simpler operand,
|
||||
/// otherwise return a null SDValue.
|
||||
SDValue DAGCombiner::GetDemandedBits(SDValue V, const APInt &Mask) {
|
||||
switch (V.getOpcode()) {
|
||||
default: break;
|
||||
@ -5729,11 +5725,11 @@ SDValue DAGCombiner::GetDemandedBits(SDValue V, const APInt &Mask) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// ReduceLoadWidth - If the result of a wider load is shifted to right of N
|
||||
/// bits and then truncated to a narrower type and where N is a multiple
|
||||
/// of number of bits of the narrower type, transform it to a narrower load
|
||||
/// from address + N / num of bits of new type. If the result is to be
|
||||
/// extended, also fold the extension to form a extending load.
|
||||
/// If the result of a wider load is shifted to right of N bits and then
|
||||
/// truncated to a narrower type and where N is a multiple of number of bits of
|
||||
/// the narrower type, transform it to a narrower load from address + N / num of
|
||||
/// bits of new type. If the result is to be extended, also fold the extension
|
||||
/// to form a extending load.
|
||||
SDValue DAGCombiner::ReduceLoadWidth(SDNode *N) {
|
||||
unsigned Opc = N->getOpcode();
|
||||
|
||||
@ -6228,7 +6224,7 @@ static SDNode *getBuildPairElt(SDNode *N, unsigned i) {
|
||||
return Elt.getOperand(Elt.getResNo()).getNode();
|
||||
}
|
||||
|
||||
/// CombineConsecutiveLoads - build_pair (load, load) -> load
|
||||
/// build_pair (load, load) -> load
|
||||
/// if load locations are consecutive.
|
||||
SDValue DAGCombiner::CombineConsecutiveLoads(SDNode *N, EVT VT) {
|
||||
assert(N->getOpcode() == ISD::BUILD_PAIR);
|
||||
@ -6409,9 +6405,8 @@ SDValue DAGCombiner::visitBUILD_PAIR(SDNode *N) {
|
||||
return CombineConsecutiveLoads(N, VT);
|
||||
}
|
||||
|
||||
/// ConstantFoldBITCASTofBUILD_VECTOR - We know that BV is a build_vector
|
||||
/// node with Constant, ConstantFP or Undef operands. DstEltVT indicates the
|
||||
/// destination element value type.
|
||||
/// We know that BV is a build_vector node with Constant, ConstantFP or Undef
|
||||
/// operands. DstEltVT indicates the destination element value type.
|
||||
SDValue DAGCombiner::
|
||||
ConstantFoldBITCASTofBUILD_VECTOR(SDNode *BV, EVT DstEltVT) {
|
||||
EVT SrcEltVT = BV->getValueType(0).getVectorElementType();
|
||||
@ -7631,9 +7626,8 @@ SDValue DAGCombiner::visitBR_CC(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// canFoldInAddressingMode - Return true if 'Use' is a load or a store that
|
||||
/// uses N as its base pointer and that N may be folded in the load / store
|
||||
/// addressing mode.
|
||||
/// Return true if 'Use' is a load or a store that uses N as its base pointer
|
||||
/// and that N may be folded in the load / store addressing mode.
|
||||
static bool canFoldInAddressingMode(SDNode *N, SDNode *Use,
|
||||
SelectionDAG &DAG,
|
||||
const TargetLowering &TLI) {
|
||||
@ -7672,12 +7666,11 @@ static bool canFoldInAddressingMode(SDNode *N, SDNode *Use,
|
||||
return TLI.isLegalAddressingMode(AM, VT.getTypeForEVT(*DAG.getContext()));
|
||||
}
|
||||
|
||||
/// CombineToPreIndexedLoadStore - Try turning a load / store into a
|
||||
/// pre-indexed load / store when the base pointer is an add or subtract
|
||||
/// and it has other uses besides the load / store. After the
|
||||
/// transformation, the new indexed load / store has effectively folded
|
||||
/// the add / subtract in and all of its other uses are redirected to the
|
||||
/// new load / store.
|
||||
/// Try turning a load/store into a pre-indexed load/store when the base
|
||||
/// pointer is an add or subtract and it has other uses besides the load/store.
|
||||
/// After the transformation, the new indexed load/store has effectively folded
|
||||
/// the add/subtract in and all of its other uses are redirected to the
|
||||
/// new load/store.
|
||||
bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
|
||||
if (Level < AfterLegalizeDAG)
|
||||
return false;
|
||||
@ -7898,11 +7891,10 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/// CombineToPostIndexedLoadStore - Try to combine a load / store with a
|
||||
/// add / sub of the base pointer node into a post-indexed load / store.
|
||||
/// The transformation folded the add / subtract into the new indexed
|
||||
/// load / store effectively and all of its uses are redirected to the
|
||||
/// new load / store.
|
||||
/// Try to combine a load/store with a add/sub of the base pointer node into a
|
||||
/// post-indexed load/store. The transformation folded the add/subtract into the
|
||||
/// new indexed load/store effectively and all of its uses are redirected to the
|
||||
/// new load/store.
|
||||
bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) {
|
||||
if (Level < AfterLegalizeDAG)
|
||||
return false;
|
||||
@ -8697,9 +8689,9 @@ bool DAGCombiner::SliceUpLoad(SDNode *N) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/// CheckForMaskedLoad - Check to see if V is (and load (ptr), imm), where the
|
||||
/// load is having specific bytes cleared out. If so, return the byte size
|
||||
/// being masked out and the shift amount.
|
||||
/// Check to see if V is (and load (ptr), imm), where the load is having
|
||||
/// specific bytes cleared out. If so, return the byte size being masked out
|
||||
/// and the shift amount.
|
||||
static std::pair<unsigned, unsigned>
|
||||
CheckForMaskedLoad(SDValue V, SDValue Ptr, SDValue Chain) {
|
||||
std::pair<unsigned, unsigned> Result(0, 0);
|
||||
@ -8772,9 +8764,9 @@ CheckForMaskedLoad(SDValue V, SDValue Ptr, SDValue Chain) {
|
||||
}
|
||||
|
||||
|
||||
/// ShrinkLoadReplaceStoreWithStore - Check to see if IVal is something that
|
||||
/// provides a value as specified by MaskInfo. If so, replace the specified
|
||||
/// store with a narrower store of truncated IVal.
|
||||
/// Check to see if IVal is something that provides a value as specified by
|
||||
/// MaskInfo. If so, replace the specified store with a narrower store of
|
||||
/// truncated IVal.
|
||||
static SDNode *
|
||||
ShrinkLoadReplaceStoreWithStore(const std::pair<unsigned, unsigned> &MaskInfo,
|
||||
SDValue IVal, StoreSDNode *St,
|
||||
@ -8829,10 +8821,10 @@ ShrinkLoadReplaceStoreWithStore(const std::pair<unsigned, unsigned> &MaskInfo,
|
||||
}
|
||||
|
||||
|
||||
/// ReduceLoadOpStoreWidth - Look for sequence of load / op / store where op is
|
||||
/// one of 'or', 'xor', and 'and' of immediates. If 'op' is only touching some
|
||||
/// of the loaded bits, try narrowing the load and store if it would end up
|
||||
/// being a win for performance or code size.
|
||||
/// Look for sequence of load / op / store where op is one of 'or', 'xor', and
|
||||
/// 'and' of immediates. If 'op' is only touching some of the loaded bits, try
|
||||
/// narrowing the load and store if it would end up being a win for performance
|
||||
/// or code size.
|
||||
SDValue DAGCombiner::ReduceLoadOpStoreWidth(SDNode *N) {
|
||||
StoreSDNode *ST = cast<StoreSDNode>(N);
|
||||
if (ST->isVolatile())
|
||||
@ -8953,10 +8945,9 @@ SDValue DAGCombiner::ReduceLoadOpStoreWidth(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// TransformFPLoadStorePair - For a given floating point load / store pair,
|
||||
/// if the load value isn't used by any other operations, then consider
|
||||
/// transforming the pair to integer load / store operations if the target
|
||||
/// deems the transformation profitable.
|
||||
/// For a given floating point load / store pair, if the load value isn't used
|
||||
/// by any other operations, then consider transforming the pair to integer
|
||||
/// load / store operations if the target deems the transformation profitable.
|
||||
SDValue DAGCombiner::TransformFPLoadStorePair(SDNode *N) {
|
||||
StoreSDNode *ST = cast<StoreSDNode>(N);
|
||||
SDValue Chain = ST->getChain();
|
||||
@ -10997,8 +10988,8 @@ SDValue DAGCombiner::visitINSERT_SUBVECTOR(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// XformToShuffleWithZero - Returns a vector_shuffle if it able to transform
|
||||
/// an AND to a vector_shuffle with the destination vector and a zero vector.
|
||||
/// Returns a vector_shuffle if it able to transform an AND to a vector_shuffle
|
||||
/// with the destination vector and a zero vector.
|
||||
/// e.g. AND V, <0xffffffff, 0, 0xffffffff, 0>. ==>
|
||||
/// vector_shuffle V, Zero, <0, 4, 2, 4>
|
||||
SDValue DAGCombiner::XformToShuffleWithZero(SDNode *N) {
|
||||
@ -11044,7 +11035,7 @@ SDValue DAGCombiner::XformToShuffleWithZero(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// SimplifyVBinOp - Visit a binary vector operation, like ADD.
|
||||
/// Visit a binary vector operation, like ADD.
|
||||
SDValue DAGCombiner::SimplifyVBinOp(SDNode *N) {
|
||||
assert(N->getValueType(0).isVector() &&
|
||||
"SimplifyVBinOp only works on vectors!");
|
||||
@ -11130,7 +11121,7 @@ SDValue DAGCombiner::SimplifyVBinOp(SDNode *N) {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// SimplifyVUnaryOp - Visit a binary vector operation, like FABS/FNEG.
|
||||
/// Visit a binary vector operation, like FABS/FNEG.
|
||||
SDValue DAGCombiner::SimplifyVUnaryOp(SDNode *N) {
|
||||
assert(N->getValueType(0).isVector() &&
|
||||
"SimplifyVUnaryOp only works on vectors!");
|
||||
@ -11190,12 +11181,11 @@ SDValue DAGCombiner::SimplifySelect(SDLoc DL, SDValue N0,
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// SimplifySelectOps - Given a SELECT or a SELECT_CC node, where LHS and RHS
|
||||
/// are the two values being selected between, see if we can simplify the
|
||||
/// select. Callers of this should assume that TheSelect is deleted if this
|
||||
/// returns true. As such, they should return the appropriate thing (e.g. the
|
||||
/// node) back to the top-level of the DAG combiner loop to avoid it being
|
||||
/// looked at.
|
||||
/// Given a SELECT or a SELECT_CC node, where LHS and RHS are the two values
|
||||
/// being selected between, see if we can simplify the select. Callers of this
|
||||
/// should assume that TheSelect is deleted if this returns true. As such, they
|
||||
/// should return the appropriate thing (e.g. the node) back to the top-level of
|
||||
/// the DAG combiner loop to avoid it being looked at.
|
||||
bool DAGCombiner::SimplifySelectOps(SDNode *TheSelect, SDValue LHS,
|
||||
SDValue RHS) {
|
||||
|
||||
@ -11310,7 +11300,7 @@ bool DAGCombiner::SimplifySelectOps(SDNode *TheSelect, SDValue LHS,
|
||||
return false;
|
||||
}
|
||||
|
||||
/// SimplifySelectCC - Simplify an expression of the form (N0 cond N1) ? N2 : N3
|
||||
/// Simplify an expression of the form (N0 cond N1) ? N2 : N3
|
||||
/// where 'cond' is the comparison specified by CC.
|
||||
SDValue DAGCombiner::SimplifySelectCC(SDLoc DL, SDValue N0, SDValue N1,
|
||||
SDValue N2, SDValue N3,
|
||||
@ -11602,7 +11592,7 @@ SDValue DAGCombiner::SimplifySelectCC(SDLoc DL, SDValue N0, SDValue N1,
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
/// SimplifySetCC - This is a stub for TargetLowering::SimplifySetCC.
|
||||
/// This is a stub for TargetLowering::SimplifySetCC.
|
||||
SDValue DAGCombiner::SimplifySetCC(EVT VT, SDValue N0,
|
||||
SDValue N1, ISD::CondCode Cond,
|
||||
SDLoc DL, bool foldBooleans) {
|
||||
@ -11611,7 +11601,7 @@ SDValue DAGCombiner::SimplifySetCC(EVT VT, SDValue N0,
|
||||
return TLI.SimplifySetCC(VT, N0, N1, Cond, foldBooleans, DagCombineInfo, DL);
|
||||
}
|
||||
|
||||
/// BuildSDIV - Given an ISD::SDIV node expressing a divide by constant, return
|
||||
/// Given an ISD::SDIV node expressing a divide by constant, return
|
||||
/// a DAG expression to select that will generate the same value by multiplying
|
||||
/// by a magic number. See:
|
||||
/// <http://the.wall.riscom.net/books/proc/ppc/cwg/code2.html>
|
||||
@ -11633,9 +11623,8 @@ SDValue DAGCombiner::BuildSDIV(SDNode *N) {
|
||||
return S;
|
||||
}
|
||||
|
||||
/// BuildSDIVPow2 - Given an ISD::SDIV node expressing a divide by constant
|
||||
/// power of 2, return a DAG expression to select that will generate the same
|
||||
/// value by right shifting.
|
||||
/// Given an ISD::SDIV node expressing a divide by constant power of 2, return a
|
||||
/// DAG expression that will generate the same value by right shifting.
|
||||
SDValue DAGCombiner::BuildSDIVPow2(SDNode *N) {
|
||||
ConstantSDNode *C = isConstOrConstSplat(N->getOperand(1));
|
||||
if (!C)
|
||||
@ -11653,9 +11642,9 @@ SDValue DAGCombiner::BuildSDIVPow2(SDNode *N) {
|
||||
return S;
|
||||
}
|
||||
|
||||
/// BuildUDIV - Given an ISD::UDIV node expressing a divide by constant,
|
||||
/// return a DAG expression to select that will generate the same value by
|
||||
/// multiplying by a magic number. See:
|
||||
/// Given an ISD::UDIV node expressing a divide by constant, return a DAG
|
||||
/// expression that will generate the same value by multiplying by a magic
|
||||
/// number. See:
|
||||
/// <http://the.wall.riscom.net/books/proc/ppc/cwg/code2.html>
|
||||
SDValue DAGCombiner::BuildUDIV(SDNode *N) {
|
||||
ConstantSDNode *C = isConstOrConstSplat(N->getOperand(1));
|
||||
@ -11675,9 +11664,8 @@ SDValue DAGCombiner::BuildUDIV(SDNode *N) {
|
||||
return S;
|
||||
}
|
||||
|
||||
/// FindBaseOffset - Return true if base is a frame index, which is known not
|
||||
// to alias with anything but itself. Provides base object and offset as
|
||||
// results.
|
||||
/// Return true if base is a frame index, which is known not to alias with
|
||||
/// anything but itself. Provides base object and offset as results.
|
||||
static bool FindBaseOffset(SDValue Ptr, SDValue &Base, int64_t &Offset,
|
||||
const GlobalValue *&GV, const void *&CV) {
|
||||
// Assume it is a primitive operation.
|
||||
@ -11713,8 +11701,7 @@ static bool FindBaseOffset(SDValue Ptr, SDValue &Base, int64_t &Offset,
|
||||
return isa<FrameIndexSDNode>(Base);
|
||||
}
|
||||
|
||||
/// isAlias - Return true if there is any possibility that the two addresses
|
||||
/// overlap.
|
||||
/// Return true if there is any possibility that the two addresses overlap.
|
||||
bool DAGCombiner::isAlias(LSBaseSDNode *Op0, LSBaseSDNode *Op1) const {
|
||||
// If they are the same then they must be aliases.
|
||||
if (Op0->getBasePtr() == Op1->getBasePtr()) return true;
|
||||
@ -11804,7 +11791,7 @@ bool DAGCombiner::isAlias(LSBaseSDNode *Op0, LSBaseSDNode *Op1) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
/// GatherAllAliases - Walk up chain skipping non-aliasing memory nodes,
|
||||
/// Walk up chain skipping non-aliasing memory nodes,
|
||||
/// looking for aliasing nodes and adding them to the Aliases vector.
|
||||
void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain,
|
||||
SmallVectorImpl<SDValue> &Aliases) {
|
||||
@ -11944,8 +11931,8 @@ void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain,
|
||||
}
|
||||
}
|
||||
|
||||
/// FindBetterChain - Walk up chain skipping non-aliasing memory nodes, looking
|
||||
/// for a better chain (aliasing node.)
|
||||
/// Walk up chain skipping non-aliasing memory nodes, looking for a better chain
|
||||
/// (aliasing node.)
|
||||
SDValue DAGCombiner::FindBetterChain(SDNode *N, SDValue OldChain) {
|
||||
SmallVector<SDValue, 8> Aliases; // Ops for replacing token factor.
|
||||
|
||||
@ -11964,11 +11951,9 @@ SDValue DAGCombiner::FindBetterChain(SDNode *N, SDValue OldChain) {
|
||||
return DAG.getNode(ISD::TokenFactor, SDLoc(N), MVT::Other, Aliases);
|
||||
}
|
||||
|
||||
// SelectionDAG::Combine - This is the entry point for the file.
|
||||
//
|
||||
/// This is the entry point for the file.
|
||||
void SelectionDAG::Combine(CombineLevel Level, AliasAnalysis &AA,
|
||||
CodeGenOpt::Level OptLevel) {
|
||||
/// run - This is the main entry point to this class.
|
||||
///
|
||||
/// This is the main entry point to this class.
|
||||
DAGCombiner(*this, AA, OptLevel).Run(Level);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user