Ignore:
Timestamp:
Jul 13, 2015, 2:11:13 PM (4 years ago)
Author:
cameron
Message:

Upgrade LLVM to 3.6.1

Location:
icGREP/icgrep-devel/llvm-3.6.1.src
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/llvm-3.6.1.src/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

    r4574 r4664  
    34003400    } else {
    34013401      Ty = cast<SequentialType>(Ty)->getElementType();
     3402      MVT PtrTy = DAG.getTargetLoweringInfo().getPointerTy(AS);
     3403      unsigned PtrSize = PtrTy.getSizeInBits();
     3404      APInt ElementSize(PtrSize, DL->getTypeAllocSize(Ty));
    34023405
    34033406      // If this is a constant subscript, handle it quickly.
    3404       const TargetLowering &TLI = DAG.getTargetLoweringInfo();
    3405       if (const ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
    3406         if (CI->isZero()) continue;
    3407         uint64_t Offs =
    3408             DL->getTypeAllocSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
    3409         SDValue OffsVal;
    3410         EVT PTy = TLI.getPointerTy(AS);
    3411         unsigned PtrBits = PTy.getSizeInBits();
    3412         if (PtrBits < 64)
    3413           OffsVal = DAG.getNode(ISD::TRUNCATE, getCurSDLoc(), PTy,
    3414                                 DAG.getConstant(Offs, MVT::i64));
    3415         else
    3416           OffsVal = DAG.getConstant(Offs, PTy);
    3417 
    3418         N = DAG.getNode(ISD::ADD, getCurSDLoc(), N.getValueType(), N,
    3419                         OffsVal);
     3407      if (const auto *CI = dyn_cast<ConstantInt>(Idx)) {
     3408        if (CI->isZero())
     3409          continue;
     3410        APInt Offs = ElementSize * CI->getValue().sextOrTrunc(PtrSize);
     3411        SDValue OffsVal = DAG.getConstant(Offs, PtrTy);
     3412        N = DAG.getNode(ISD::ADD, getCurSDLoc(), N.getValueType(), N, OffsVal);
    34203413        continue;
    34213414      }
    34223415
    34233416      // N = N + Idx * ElementSize;
    3424       APInt ElementSize =
    3425           APInt(TLI.getPointerSizeInBits(AS), DL->getTypeAllocSize(Ty));
    34263417      SDValue IdxN = getValue(Idx);
    34273418
     
    57285719    Entry.setAttributes(&CS, i - CS.arg_begin() + 1);
    57295720    Args.push_back(Entry);
     5721
     5722    // If we have an explicit sret argument that is an Instruction, (i.e., it
     5723    // might point to function-local memory), we can't meaningfully tail-call.
     5724    if (Entry.isSRet && isa<Instruction>(V))
     5725      isTailCall = false;
    57305726  }
    57315727
     
    73547350    CLI.getArgs().insert(CLI.getArgs().begin(), Entry);
    73557351    CLI.RetTy = Type::getVoidTy(CLI.RetTy->getContext());
     7352
     7353    // sret demotion isn't compatible with tail-calls, since the sret argument
     7354    // points into the callers stack frame.
     7355    CLI.IsTailCall = false;
    73567356  } else {
    73577357    for (unsigned I = 0, E = RetTys.size(); I != E; ++I) {
     
    76397639    Flags.setSRet();
    76407640    MVT RegisterVT = TLI->getRegisterType(*DAG.getContext(), ValueVTs[0]);
    7641     ISD::InputArg RetArg(Flags, RegisterVT, ValueVTs[0], true, 0, 0);
     7641    ISD::InputArg RetArg(Flags, RegisterVT, ValueVTs[0], true,
     7642                         ISD::InputArg::NoArgIndex, 0);
    76427643    Ins.push_back(RetArg);
    76437644  }
Note: See TracChangeset for help on using the changeset viewer.