diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:09:07 +0000 | 
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:09:07 +0000 | 
| commit | 571945e6affd20b19264ec22495da418d0fbdbb4 (patch) | |
| tree | 076117cdf3579003f07cad4cdf0593347ce58150 /lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
| parent | 06f9d4012fb8acea3e9861d5722b5965dbb724d9 (diff) | |
Notes
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 46 | 
1 files changed, 2 insertions, 44 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 68bc2d6306b2..10261691517a 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -911,7 +911,7 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,                                            TargetLoweringOpt &TLO,                                            unsigned Depth) const {    unsigned BitWidth = DemandedMask.getBitWidth(); -  assert(Op.getValueSizeInBits() == BitWidth && +  assert(Op.getValueType().getScalarType().getSizeInBits() == BitWidth &&           "Mask size mismatches value type size!");    APInt NewMask = DemandedMask;    DebugLoc dl = Op.getDebugLoc(); @@ -1240,7 +1240,7 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,        // demand the input sign bit.        APInt HighBits = APInt::getHighBitsSet(BitWidth, ShAmt);        if (HighBits.intersects(NewMask)) -        InDemandedMask |= APInt::getSignBit(VT.getSizeInBits()); +        InDemandedMask |= APInt::getSignBit(VT.getScalarType().getSizeInBits());        if (SimplifyDemandedBits(Op.getOperand(0), InDemandedMask,                                 KnownZero, KnownOne, TLO, Depth+1)) @@ -2184,48 +2184,6 @@ bool TargetLowering::isGAPlusOffset(SDNode *N, GlobalValue* &GA,  } -/// isConsecutiveLoad - Return true if LD is loading 'Bytes' bytes from a  -/// location that is 'Dist' units away from the location that the 'Base' load  -/// is loading from. -bool TargetLowering::isConsecutiveLoad(LoadSDNode *LD, LoadSDNode *Base,  -                                       unsigned Bytes, int Dist,  -                                       const MachineFrameInfo *MFI) const { -  if (LD->getChain() != Base->getChain()) -    return false; -  EVT VT = LD->getValueType(0); -  if (VT.getSizeInBits() / 8 != Bytes) -    return false; - -  SDValue Loc = LD->getOperand(1); -  SDValue BaseLoc = Base->getOperand(1); -  if (Loc.getOpcode() == ISD::FrameIndex) { -    if (BaseLoc.getOpcode() != ISD::FrameIndex) -      return false; -    int FI  = cast<FrameIndexSDNode>(Loc)->getIndex(); -    int BFI = cast<FrameIndexSDNode>(BaseLoc)->getIndex(); -    int FS  = MFI->getObjectSize(FI); -    int BFS = MFI->getObjectSize(BFI); -    if (FS != BFS || FS != (int)Bytes) return false; -    return MFI->getObjectOffset(FI) == (MFI->getObjectOffset(BFI) + Dist*Bytes); -  } -  if (Loc.getOpcode() == ISD::ADD && Loc.getOperand(0) == BaseLoc) { -    ConstantSDNode *V = dyn_cast<ConstantSDNode>(Loc.getOperand(1)); -    if (V && (V->getSExtValue() == Dist*Bytes)) -      return true; -  } - -  GlobalValue *GV1 = NULL; -  GlobalValue *GV2 = NULL; -  int64_t Offset1 = 0; -  int64_t Offset2 = 0; -  bool isGA1 = isGAPlusOffset(Loc.getNode(), GV1, Offset1); -  bool isGA2 = isGAPlusOffset(BaseLoc.getNode(), GV2, Offset2); -  if (isGA1 && isGA2 && GV1 == GV2) -    return Offset1 == (Offset2 + Dist*Bytes); -  return false; -} - -  SDValue TargetLowering::  PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const {    // Default implementation: no optimization.  | 
