<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Yes, I mean these 2. <br>
    </p>
    <pre class="moz-signature" cols="72">-------------
Best regards,
Alexey Bataev</pre>
    <div class="moz-cite-prefix">04.01.2018 16:02, Jonas Hahnfeld пишет:<br>
    </div>
    <blockquote type="cite"
      cite="mid:537578ef1c6165ec885c802553ba5bb2@hahnjo.de">You mean
      r321818 and r321820? I skipped them because they are for NVPTX and
      target directives which aren't fully functional in 6.0 anyway,
      right?
      <br>
      Or patches in the future?
      <br>
      <br>
      Am 2018-01-04 21:58, schrieb Alexey Bataev:
      <br>
      <blockquote type="cite">Hi Jonas, I don't think it is necessary.
        It is better to backport my 2
        <br>
        next patches with bug fixes.
        <br>
        <br>
        Best regards,
        <br>
        Alexey
        <br>
        <br>
        04.01.2018 15:54, Jonas Hahnfeld пишет:
        <br>
        <br>
        <blockquote type="cite">Hi Alexey,
          <br>
          <br>
          should this change be backported to 6.0?
          <br>
          <br>
          Regards,
          <br>
          Jonas
          <br>
          <br>
          Am 2018-01-04 20:45, schrieb Alexey Bataev via cfe-commits:
          <br>
          <br>
          <blockquote type="cite">Author: abataev
            <br>
            Date: Thu Jan  4 11:45:16 2018
            <br>
            New Revision: 321816
            <br>
            <br>
            URL:
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
<a class="moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%3Frev%3D321816%26view%3Drev&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=g3DdxRoQ%2B8RbIORsLLfEJAAP4Zn2Orsshr6PwIthnQw%3D&reserved=0">https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%3Frev%3D321816%26view%3Drev&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=g3DdxRoQ%2B8RbIORsLLfEJAAP4Zn2Orsshr6PwIthnQw%3D&reserved=0</a>
        <br>
        <blockquote type="cite">
          <blockquote type="cite">Log:
            <br>
            [OPENMP] Add debug info for generated functions.
            <br>
            <br>
            Most of the generated functions for the OpenMP were
            generated with
            <br>
            <br>
            disabled debug info. Patch fixes this for better user
            experience.
            <br>
            <br>
            Modified:
            <br>
            cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
            <br>
            cfe/trunk/lib/CodeGen/CGOpenMPRuntime.h
            <br>
            cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
            <br>
            cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.h
            <br>
            cfe/trunk/test/OpenMP/target_parallel_debug_codegen.cpp
            <br>
            <br>
            Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
            <br>
            URL:
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
<a class="moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Flib%2FCodeGen%2FCGOpenMPRuntime.cpp%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=2ppjOPjnpev4zlt1Fh6ByuYdotTiSr0Z1WyvBa8WWHo%3D&reserved=0">https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Flib%2FCodeGen%2FCGOpenMPRuntime.cpp%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=2ppjOPjnpev4zlt1Fh6ByuYdotTiSr0Z1WyvBa8WWHo%3D&reserved=0</a>
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
==============================================================================
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            --- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)
            <br>
            +++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Thu Jan  4
            11:45:16
            <br>
            2018
            <br>
            @@ -1216,7 +1216,8 @@
            emitCombinerOrInitializer(CodeGenModule
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            // Map "T omp_in;" variable to "*omp_in_parm" value in all
            <br>
            expressions.
            <br>
            // Map "T omp_out;" variable to "*omp_out_parm" value in all
            <br>
            expressions.
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FnInfo,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FnInfo,
            Args,
            <br>
            In->getLocation(),
            <br>
            +                    Out->getLocation());
            <br>
            CodeGenFunction::OMPPrivateScope Scope(CGF);
            <br>
            Address AddrIn = CGF.GetAddrOfLocalVar(&OmpInParm);
            <br>
            Scope.addPrivate(In, [&CGF, AddrIn, PtrTy]() ->
            Address {
            <br>
            @@ -2383,7 +2384,8 @@ llvm::Function
            *CGOpenMPRuntime::emitThr
            <br>
            // threadprivate copy of the variable VD
            <br>
            CodeGenFunction CtorCGF(CGM);
            <br>
            FunctionArgList Args;
            <br>
            -      ImplicitParamDecl Dst(CGM.getContext(),
            <br>
            CGM.getContext().VoidPtrTy,
            <br>
            +      ImplicitParamDecl Dst(CGM.getContext(),
            /*DC=*/nullptr,
            <br>
            Loc,
            <br>
            +                            /*Id=*/nullptr,
            <br>
            CGM.getContext().VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            Args.push_back(&Dst);
            <br>
            <br>
            @@ -2393,13 +2395,13 @@ llvm::Function
            *CGOpenMPRuntime::emitThr
            <br>
            auto Fn = CGM.CreateGlobalInitOrDestructFunction(
            <br>
            FTy, ".__kmpc_global_ctor_.", FI, Loc);
            <br>
            CtorCGF.StartFunction(GlobalDecl(),
            <br>
            CGM.getContext().VoidPtrTy, Fn, FI,
            <br>
            -                            Args, SourceLocation());
            <br>
            +                            Args, Loc, Loc);
            <br>
            auto ArgVal = CtorCGF.EmitLoadOfScalar(
            <br>
            CtorCGF.GetAddrOfLocalVar(&Dst), /*Volatile=*/false,
            <br>
            CGM.getContext().VoidPtrTy, Dst.getLocation());
            <br>
            Address Arg = Address(ArgVal, VDAddr.getAlignment());
            <br>
            -      Arg = CtorCGF.Builder.CreateElementBitCast(Arg,
            <br>
            -
            <br>
            CtorCGF.ConvertTypeForMem(ASTTy));
            <br>
            +      Arg = CtorCGF.Builder.CreateElementBitCast(
            <br>
            +          Arg, CtorCGF.ConvertTypeForMem(ASTTy));
            <br>
            CtorCGF.EmitAnyExprToMem(Init, Arg,
            <br>
            Init->getType().getQualifiers(),
            <br>
            /*IsInitializer=*/true);
            <br>
            ArgVal = CtorCGF.EmitLoadOfScalar(
            <br>
            @@ -2414,7 +2416,8 @@ llvm::Function
            *CGOpenMPRuntime::emitThr
            <br>
            // of the variable VD
            <br>
            CodeGenFunction DtorCGF(CGM);
            <br>
            FunctionArgList Args;
            <br>
            -      ImplicitParamDecl Dst(CGM.getContext(),
            <br>
            CGM.getContext().VoidPtrTy,
            <br>
            +      ImplicitParamDecl Dst(CGM.getContext(),
            /*DC=*/nullptr,
            <br>
            Loc,
            <br>
            +                            /*Id=*/nullptr,
            <br>
            CGM.getContext().VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            Args.push_back(&Dst);
            <br>
            <br>
            @@ -2425,7 +2428,7 @@ llvm::Function
            *CGOpenMPRuntime::emitThr
            <br>
            FTy, ".__kmpc_global_dtor_.", FI, Loc);
            <br>
            auto NL = ApplyDebugLocation::CreateEmpty(DtorCGF);
            <br>
            DtorCGF.StartFunction(GlobalDecl(),
            <br>
            CGM.getContext().VoidTy,
            <br>
            Fn, FI, Args,
            <br>
            -                            SourceLocation());
            <br>
            +                            Loc, Loc);
            <br>
            // Create a scope with an artificial location for the body
            <br>
            of
            <br>
            this function.
            <br>
            auto AL = ApplyDebugLocation::CreateArtificial(DtorCGF);
            <br>
            auto ArgVal = DtorCGF.EmitLoadOfScalar(
            <br>
            @@ -2469,7 +2472,7 @@ llvm::Function
            *CGOpenMPRuntime::emitThr
            <br>
            FunctionArgList ArgList;
            <br>
            InitCGF.StartFunction(GlobalDecl(),
            <br>
            CGM.getContext().VoidTy,
            <br>
            InitFunction,
            <br>
            <br>
            CGM.getTypes().arrangeNullaryFunction(), ArgList,
            <br>
            -                            Loc);
            <br>
            +                            Loc, Loc);
            <br>
            emitThreadPrivateVarInit(InitCGF, VDAddr, Ctor, CopyCtor,
            <br>
            Dtor, Loc);
            <br>
            InitCGF.FinishFunction();
            <br>
            return InitFunction;
            <br>
            @@ -2783,12 +2786,15 @@ static Address
            emitAddrOfVarFromArray(Co
            <br>
            static llvm::Value *emitCopyprivateCopyFunction(
            <br>
            CodeGenModule &CGM, llvm::Type *ArgsType,
            <br>
            ArrayRef<const Expr *> CopyprivateVars,
            ArrayRef<const Expr
            <br>
            *> DestExprs,
            <br>
            -    ArrayRef<const Expr *> SrcExprs,
            ArrayRef<const Expr *>
            <br>
            AssignmentOps) {
            <br>
            +    ArrayRef<const Expr *> SrcExprs,
            ArrayRef<const Expr *>
            <br>
            AssignmentOps,
            <br>
            +    SourceLocation Loc) {
            <br>
            auto &C = CGM.getContext();
            <br>
            // void copy_func(void *LHSArg, void *RHSArg);
            <br>
            FunctionArgList Args;
            <br>
            -  ImplicitParamDecl LHSArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            -  ImplicitParamDecl RHSArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl LHSArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr, C.VoidPtrTy,
            <br>
            +                           ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl RHSArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr, C.VoidPtrTy,
            <br>
            +                           ImplicitParamDecl::Other);
            <br>
            Args.push_back(&LHSArg);
            <br>
            Args.push_back(&RHSArg);
            <br>
            auto &CGFI =
            <br>
            CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy,
            Args);
            <br>
            @@ -2797,7 +2803,7 @@ static llvm::Value
            *emitCopyprivateCopyF
            <br>
            ".omp.copyprivate.copy_func", &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, CGFI);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI, Args,
            Loc,
            <br>
            Loc);
            <br>
            // Dest = (void*[n])(LHSArg);
            <br>
            // Src = (void*[n])(RHSArg);
            <br>
            Address LHS(CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(
            <br>
            @@ -2888,7 +2894,7 @@ void
            CGOpenMPRuntime::emitSingleRegion(C
            <br>
            // threads in the corresponding parallel region.
            <br>
            auto *CpyFn = emitCopyprivateCopyFunction(
            <br>
            CGM,
            <br>
CGF.ConvertTypeForMem(CopyprivateArrayTy)->getPointerTo(),
            <br>
            -        CopyprivateVars, SrcExprs, DstExprs,
            AssignmentOps);
            <br>
            +        CopyprivateVars, SrcExprs, DstExprs, AssignmentOps,
            Loc);
            <br>
            <br>
            auto *BufSize = CGF.getTypeSize(CopyprivateArrayTy);
            <br>
            Address CL =
            <br>
            <br>
CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(CopyprivateList,
            <br>
            @@ -3399,11 +3405,13 @@
            createOffloadingBinaryDescriptorFunction
            <br>
            Args.push_back(&DummyPtr);
            <br>
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            +  // Disable debug info for global (de-)initializer because
            they
            <br>
            are
            <br>
            not part of
            <br>
            +  // some particular construct.
            <br>
            +  CGF.disableDebugInfo();
            <br>
            auto &FI =
            <br>
            CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy,
            Args);
            <br>
            auto FTy = CGM.getTypes().GetFunctionType(FI);
            <br>
            -  auto *Fn =
            <br>
            -      CGM.CreateGlobalInitOrDestructFunction(FTy, Name, FI,
            <br>
            SourceLocation());
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FI, Args,
            <br>
            SourceLocation());
            <br>
            +  auto *Fn = CGM.CreateGlobalInitOrDestructFunction(FTy,
            Name,
            <br>
            FI);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FI, Args);
            <br>
            Codegen(CGF);
            <br>
            CGF.FinishFunction();
            <br>
            return Fn;
            <br>
            @@ -3411,7 +3419,6 @@
            createOffloadingBinaryDescriptorFunction
            <br>
            <br>
            llvm::Function *
            <br>
CGOpenMPRuntime::createOffloadingBinaryDescriptorRegistration() {
            <br>
            <br>
            -
            <br>
            // If we don't have entries or if we are emitting code for
            the
            <br>
            device, we
            <br>
            // don't need to do anything.
            <br>
            if (CGM.getLangOpts().OpenMPIsDevice ||
            <br>
            OffloadEntriesInfoManager.empty())
            <br>
            @@ -3945,7 +3952,8 @@ emitProxyTaskFunction(CodeGenModule
            &CGM
            <br>
            ".omp_task_entry.",
            <br>
            &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*D=*/nullptr, TaskEntry,
            <br>
            TaskEntryFnInfo);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  CGF.StartFunction(GlobalDecl(), KmpInt32Ty, TaskEntry,
            <br>
            TaskEntryFnInfo, Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), KmpInt32Ty, TaskEntry,
            <br>
            TaskEntryFnInfo, Args,
            <br>
            +                    Loc, Loc);
            <br>
            <br>
            // TaskFunction(gtid, tt->task_data.part_id,
            &tt->privates,
            <br>
            task_privates_map,
            <br>
            // tt,
            <br>
            @@ -4045,9 +4053,8 @@ static llvm::Value
            *emitDestructorsFunct
            <br>
            CGM.SetInternalFunctionAttributes(/*D=*/nullptr,
            DestructorFn,
            <br>
            DestructorFnInfo);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  CGF.disableDebugInfo();
            <br>
            CGF.StartFunction(GlobalDecl(), KmpInt32Ty, DestructorFn,
            <br>
            DestructorFnInfo,
            <br>
            -                    Args);
            <br>
            +                    Args, Loc, Loc);
            <br>
            <br>
            LValue Base = CGF.EmitLoadOfPointerLValue(
            <br>
            CGF.GetAddrOfLocalVar(&TaskTypeArg),
            <br>
            @@ -4139,9 +4146,8 @@
            emitTaskPrivateMappingFunction(CodeGenMo
            <br>
TaskPrivatesMap->removeFnAttr(llvm::Attribute::OptimizeNone);
            <br>
TaskPrivatesMap->addFnAttr(llvm::Attribute::AlwaysInline);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  CGF.disableDebugInfo();
            <br>
            CGF.StartFunction(GlobalDecl(), C.VoidTy, TaskPrivatesMap,
            <br>
            -                    TaskPrivatesMapFnInfo, Args);
            <br>
            +                    TaskPrivatesMapFnInfo, Args, Loc, Loc);
            <br>
            <br>
            // *privi = &.privates.privi;
            <br>
            LValue Base = CGF.EmitLoadOfPointerLValue(
            <br>
            @@ -4322,8 +4328,8 @@ emitTaskDupFunction(CodeGenModule
            &CGM,
            <br>
            ".omp_task_dup.", &CGM.getModule());
            <br>
            <br>
            CGM.SetInternalFunctionAttributes(/*D=*/nullptr, TaskDup,
            <br>
            TaskDupFnInfo);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  CGF.disableDebugInfo();
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, TaskDup,
            <br>
            TaskDupFnInfo, Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, TaskDup,
            <br>
            TaskDupFnInfo, Args, Loc,
            <br>
            +                    Loc);
            <br>
            <br>
            LValue TDBase = CGF.EmitLoadOfPointerLValue(
            <br>
            CGF.GetAddrOfLocalVar(&DstArg),
            <br>
            @@ -4943,15 +4949,17 @@ static void
            emitReductionCombiner(CodeGe
            <br>
            }
            <br>
            <br>
            llvm::Value *CGOpenMPRuntime::emitReductionFunction(
            <br>
            -    CodeGenModule &CGM, llvm::Type *ArgsType,
            ArrayRef<const Expr
            <br>
            *> Privates,
            <br>
            -    ArrayRef<const Expr *> LHSExprs,
            ArrayRef<const Expr *>
            <br>
            RHSExprs,
            <br>
            -    ArrayRef<const Expr *> ReductionOps) {
            <br>
            +    CodeGenModule &CGM, SourceLocation Loc, llvm::Type
            *ArgsType,
            <br>
            <br>
            +    ArrayRef<const Expr *> Privates,
            ArrayRef<const Expr *>
            <br>
            LHSExprs,
            <br>
            +    ArrayRef<const Expr *> RHSExprs,
            ArrayRef<const Expr *>
            <br>
            ReductionOps) {
            <br>
            auto &C = CGM.getContext();
            <br>
            <br>
            // void reduction_func(void *LHSArg, void *RHSArg);
            <br>
            FunctionArgList Args;
            <br>
            -  ImplicitParamDecl LHSArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            -  ImplicitParamDecl RHSArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl LHSArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr, C.VoidPtrTy,
            <br>
            +                           ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl RHSArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr, C.VoidPtrTy,
            <br>
            +                           ImplicitParamDecl::Other);
            <br>
            Args.push_back(&LHSArg);
            <br>
            Args.push_back(&RHSArg);
            <br>
            auto &CGFI =
            <br>
            CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy,
            Args);
            <br>
            @@ -4960,7 +4968,7 @@ llvm::Value
            *CGOpenMPRuntime::emitReduct
            <br>
            ".omp.reduction.reduction_func", &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, CGFI);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI, Args,
            Loc,
            <br>
            Loc);
            <br>
            <br>
            // Dst = (void*[n])(LHSArg);
            <br>
            // Src = (void*[n])(RHSArg);
            <br>
            @@ -5149,8 +5157,8 @@ void
            CGOpenMPRuntime::emitReduction(Code
            <br>
            <br>
            // 2. Emit reduce_func().
            <br>
            auto *ReductionFn = emitReductionFunction(
            <br>
            -      CGM,
            <br>
            CGF.ConvertTypeForMem(ReductionArrayTy)->getPointerTo(),
            Privates,
            <br>
            <br>
            -      LHSExprs, RHSExprs, ReductionOps);
            <br>
            +      CGM, Loc,
            <br>
            CGF.ConvertTypeForMem(ReductionArrayTy)->getPointerTo(),
            <br>
            +      Privates, LHSExprs, RHSExprs, ReductionOps);
            <br>
            <br>
            // 3. Create static kmp_critical_name lock = { 0 };
            <br>
            auto *Lock = getCriticalRegionLock(".reduction");
            <br>
            @@ -5365,7 +5373,8 @@ static llvm::Value
            *emitReduceInitFuncti
            <br>
            ReductionCodeGen &RCG,
            <br>
            unsigned N) {
            <br>
            auto &C = CGM.getContext();
            <br>
            FunctionArgList Args;
            <br>
            -  ImplicitParamDecl Param(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl Param(C, /*DC=*/nullptr, Loc,
            /*Id=*/nullptr,
            <br>
            C.VoidPtrTy,
            <br>
            +                          ImplicitParamDecl::Other);
            <br>
            Args.emplace_back(&Param);
            <br>
            auto &FnInfo =
            <br>
            CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy,
            <br>
            Args);
            <br>
            @@ -5374,8 +5383,7 @@ static llvm::Value
            *emitReduceInitFuncti
            <br>
            ".red_init.",
            <br>
            &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn,
            FnInfo);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  CGF.disableDebugInfo();
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FnInfo,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FnInfo,
            Args,
            <br>
            Loc, Loc);
            <br>
            Address PrivateAddr = CGF.EmitLoadOfPointer(
            <br>
            CGF.GetAddrOfLocalVar(&Param),
            <br>
            C.getPointerType(C.VoidPtrTy).castAs<PointerType>());
            <br>
            @@ -5435,8 +5443,10 @@ static llvm::Value
            *emitReduceCombFuncti
            <br>
            auto *LHSVD =
            cast<VarDecl>(cast<DeclRefExpr>(LHS)->getDecl());
            <br>
            <br>
            auto *RHSVD =
            cast<VarDecl>(cast<DeclRefExpr>(RHS)->getDecl());
            <br>
            <br>
            FunctionArgList Args;
            <br>
            -  ImplicitParamDecl ParamInOut(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            -  ImplicitParamDecl ParamIn(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ParamInOut(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                               C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ParamIn(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            C.VoidPtrTy,
            <br>
            +                            ImplicitParamDecl::Other);
            <br>
            Args.emplace_back(&ParamInOut);
            <br>
            Args.emplace_back(&ParamIn);
            <br>
            auto &FnInfo =
            <br>
            @@ -5446,8 +5456,7 @@ static llvm::Value
            *emitReduceCombFuncti
            <br>
            ".red_comb.",
            <br>
            &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn,
            FnInfo);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  CGF.disableDebugInfo();
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FnInfo,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FnInfo,
            Args,
            <br>
            Loc, Loc);
            <br>
            llvm::Value *Size = nullptr;
            <br>
            // If the size of the reduction item is non-constant, load
            it
            <br>
            from global
            <br>
            // threadprivate variable.
            <br>
            @@ -5506,7 +5515,8 @@ static llvm::Value
            *emitReduceFiniFuncti
            <br>
            return nullptr;
            <br>
            auto &C = CGM.getContext();
            <br>
            FunctionArgList Args;
            <br>
            -  ImplicitParamDecl Param(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl Param(C, /*DC=*/nullptr, Loc,
            /*Id=*/nullptr,
            <br>
            C.VoidPtrTy,
            <br>
            +                          ImplicitParamDecl::Other);
            <br>
            Args.emplace_back(&Param);
            <br>
            auto &FnInfo =
            <br>
            CGM.getTypes().arrangeBuiltinFunctionDeclaration(C.VoidTy,
            <br>
            Args);
            <br>
            @@ -5515,8 +5525,7 @@ static llvm::Value
            *emitReduceFiniFuncti
            <br>
            ".red_fini.",
            <br>
            &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn,
            FnInfo);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  CGF.disableDebugInfo();
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FnInfo,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, FnInfo,
            Args,
            <br>
            Loc, Loc);
            <br>
            Address PrivateAddr = CGF.EmitLoadOfPointer(
            <br>
            CGF.GetAddrOfLocalVar(&Param),
            <br>
            C.getPointerType(C.VoidPtrTy).castAs<PointerType>());
            <br>
            <br>
            Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.h
            <br>
            URL:
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
<a class="moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Flib%2FCodeGen%2FCGOpenMPRuntime.h%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=9ULj5fjX4dJY8HK4muYuuyx1qObSdR%2BEyhUOz%2FDN%2Bvo%3D&reserved=0">https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Flib%2FCodeGen%2FCGOpenMPRuntime.h%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=9ULj5fjX4dJY8HK4muYuuyx1qObSdR%2BEyhUOz%2FDN%2Bvo%3D&reserved=0</a>
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
==============================================================================
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            --- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.h (original)
            <br>
            +++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.h Thu Jan  4
            11:45:16
            <br>
            2018
            <br>
            @@ -1048,7 +1048,8 @@ public:
            <br>
            /// \param RHSExprs List of RHS in \a ReductionOps reduction
            <br>
            operations.
            <br>
            /// \param ReductionOps List of reduction operations in form
            <br>
            'LHS binop RHS'
            <br>
            /// or 'operator binop(LHS, RHS)'.
            <br>
            -  llvm::Value *emitReductionFunction(CodeGenModule
            &CGM,
            <br>
            llvm::Type *ArgsType,
            <br>
            +  llvm::Value *emitReductionFunction(CodeGenModule
            &CGM,
            <br>
            SourceLocation Loc,
            <br>
            +                                     llvm::Type *ArgsType,
            <br>
            ArrayRef<const Expr *>
            <br>
            Privates,
            <br>
            ArrayRef<const Expr *>
            <br>
            LHSExprs,
            <br>
            ArrayRef<const Expr *>
            <br>
            RHSExprs,
            <br>
            <br>
            Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
            <br>
            URL:
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
<a class="moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Flib%2FCodeGen%2FCGOpenMPRuntimeNVPTX.cpp%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=yD%2BjGSEyCFMT4V6IBEyy%2BYKVSXg2yqtJixYBH3FQGMw%3D&reserved=0">https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Flib%2FCodeGen%2FCGOpenMPRuntimeNVPTX.cpp%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=yD%2BjGSEyCFMT4V6IBEyy%2BYKVSXg2yqtJixYBH3FQGMw%3D&reserved=0</a>
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
==============================================================================
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            --- cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
            (original)
            <br>
            +++ cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp Thu Jan 
            4
            <br>
            11:45:16 2018
            <br>
            @@ -250,8 +250,8 @@ static llvm::Value *getMasterThreadID(Co
            <br>
            }
            <br>
            <br>
CGOpenMPRuntimeNVPTX::WorkerFunctionState::WorkerFunctionState(
            <br>
            -    CodeGenModule &CGM)
            <br>
            -    : WorkerFn(nullptr), CGFI(nullptr) {
            <br>
            +    CodeGenModule &CGM, SourceLocation Loc)
            <br>
            +    : WorkerFn(nullptr), CGFI(nullptr), Loc(Loc) {
            <br>
            createWorkerFunction(CGM);
            <br>
            }
            <br>
            <br>
            @@ -297,28 +297,28 @@ void
            CGOpenMPRuntimeNVPTX::emitGenericKe
            <br>
            ExecutionModeRAII ModeRAII(CurrentExecutionMode,
            <br>
            <br>
            CGOpenMPRuntimeNVPTX::ExecutionMode::Generic);
            <br>
            EntryFunctionState EST;
            <br>
            -  WorkerFunctionState WST(CGM);
            <br>
            +  WorkerFunctionState WST(CGM, D.getLocStart());
            <br>
            Work.clear();
            <br>
            WrapperFunctionsMap.clear();
            <br>
            <br>
            // Emit target region as a standalone region.
            <br>
            class NVPTXPrePostActionTy : public PrePostActionTy {
            <br>
            -    CGOpenMPRuntimeNVPTX &RT;
            <br>
            CGOpenMPRuntimeNVPTX::EntryFunctionState &EST;
            <br>
            CGOpenMPRuntimeNVPTX::WorkerFunctionState &WST;
            <br>
            <br>
            public:
            <br>
            -    NVPTXPrePostActionTy(CGOpenMPRuntimeNVPTX &RT,
            <br>
            -                        
            CGOpenMPRuntimeNVPTX::EntryFunctionState
            <br>
            &EST,
            <br>
            +   
            NVPTXPrePostActionTy(CGOpenMPRuntimeNVPTX::EntryFunctionState
            <br>
            &EST,
            <br>
            <br>
            CGOpenMPRuntimeNVPTX::WorkerFunctionState &WST)
            <br>
            -        : RT(RT), EST(EST), WST(WST) {}
            <br>
            +        : EST(EST), WST(WST) {}
            <br>
            void Enter(CodeGenFunction &CGF) override {
            <br>
            -      RT.emitGenericEntryHeader(CGF, EST, WST);
            <br>
            +      static_cast<CGOpenMPRuntimeNVPTX
            <br>
            &>(CGF.CGM.getOpenMPRuntime())
            <br>
            +          .emitGenericEntryHeader(CGF, EST, WST);
            <br>
            }
            <br>
            void Exit(CodeGenFunction &CGF) override {
            <br>
            -      RT.emitGenericEntryFooter(CGF, EST);
            <br>
            +      static_cast<CGOpenMPRuntimeNVPTX
            <br>
            &>(CGF.CGM.getOpenMPRuntime())
            <br>
            +          .emitGenericEntryFooter(CGF, EST);
            <br>
            }
            <br>
            -  } Action(*this, EST, WST);
            <br>
            +  } Action(EST, WST);
            <br>
            CodeGen.setAction(Action);
            <br>
            emitTargetOutlinedFunctionHelper(D, ParentName, OutlinedFn,
            <br>
            OutlinedFnID,
            <br>
            IsOffloadEntry, CodeGen);
            <br>
            @@ -347,7 +347,7 @@ void CGOpenMPRuntimeNVPTX::emitGenericEn
            <br>
            Bld.CreateCondBr(IsWorker, WorkerBB, MasterCheckBB);
            <br>
            <br>
            CGF.EmitBlock(WorkerBB);
            <br>
            -  emitCall(CGF, WST.WorkerFn);
            <br>
            +  emitOutlinedFunctionCall(CGF, WST.Loc, WST.WorkerFn);
            <br>
            CGF.EmitBranch(EST.ExitBB);
            <br>
            <br>
            CGF.EmitBlock(MasterCheckBB);
            <br>
            @@ -479,8 +479,8 @@ void CGOpenMPRuntimeNVPTX::emitWorkerFun
            <br>
            ASTContext &Ctx = CGM.getContext();
            <br>
            <br>
            CodeGenFunction CGF(CGM, /*suppressNewContext=*/true);
            <br>
            -  CGF.disableDebugInfo();
            <br>
            -  CGF.StartFunction(GlobalDecl(), Ctx.VoidTy, WST.WorkerFn,
            <br>
            *WST.CGFI, {});
            <br>
            +  CGF.StartFunction(GlobalDecl(), Ctx.VoidTy, WST.WorkerFn,
            <br>
            *WST.CGFI, {},
            <br>
            +                    WST.Loc, WST.Loc);
            <br>
            emitWorkerLoop(CGF, WST);
            <br>
            CGF.FinishFunction();
            <br>
            }
            <br>
            @@ -571,8 +571,9 @@ void CGOpenMPRuntimeNVPTX::emitWorkerLoo
            <br>
            Address Capture = CGF.EmitLoadOfPointer(SharedArgs,
            <br>
            Ctx.getPointerType(
            <br>
            <br>
Ctx.getPointerType(Ctx.VoidPtrTy)).castAs<PointerType>());
            <br>
            -    emitCall(CGF, W, {Bld.getInt16(/*ParallelLevel=*/0),
            <br>
            -        getMasterThreadID(CGF), Capture.getPointer()});
            <br>
            +    emitOutlinedFunctionCall(CGF, WST.Loc, W,
            <br>
            +                            
            {Bld.getInt16(/*ParallelLevel=*/0),
            <br>
            +                              getMasterThreadID(CGF),
            <br>
            Capture.getPointer()});
            <br>
            <br>
            // Go to end of parallel region.
            <br>
            CGF.EmitBranch(TerminateBB);
            <br>
            @@ -1319,27 +1320,31 @@ static void emitReductionListCopy(
            <br>
            ///    local = local @ remote
            <br>
            ///  else
            <br>
            ///    local = remote
            <br>
            -static llvm::Value *
            <br>
            -emitReduceScratchpadFunction(CodeGenModule &CGM,
            <br>
            -                             ArrayRef<const Expr *>
            Privates,
            <br>
            -                             QualType ReductionArrayTy,
            <br>
            llvm::Value
            <br>
            *ReduceFn) {
            <br>
            +static llvm::Value *emitReduceScratchpadFunction(
            <br>
            +    CodeGenModule &CGM, ArrayRef<const Expr *>
            Privates,
            <br>
            +    QualType ReductionArrayTy, llvm::Value *ReduceFn,
            <br>
            SourceLocation Loc) {
            <br>
            auto &C = CGM.getContext();
            <br>
            auto Int32Ty = C.getIntTypeForBitwidth(32, /* Signed */
            true);
            <br>
            <br>
            // Destination of the copy.
            <br>
            -  ImplicitParamDecl ReduceListArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ReduceListArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                                  C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            // Base address of the scratchpad array, with each element
            <br>
            storing a
            <br>
            // Reduce list per team.
            <br>
            -  ImplicitParamDecl ScratchPadArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ScratchPadArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                                  C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            // A source index into the scratchpad array.
            <br>
            -  ImplicitParamDecl IndexArg(C, Int32Ty,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl IndexArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr, Int32Ty,
            <br>
            +                             ImplicitParamDecl::Other);
            <br>
            // Row width of an element in the scratchpad array,
            typically
            <br>
            // the number of teams.
            <br>
            -  ImplicitParamDecl WidthArg(C, Int32Ty,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl WidthArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr, Int32Ty,
            <br>
            +                             ImplicitParamDecl::Other);
            <br>
            // If should_reduce == 1, then it's load AND reduce,
            <br>
            // If should_reduce == 0 (or otherwise), then it only loads
            (+
            <br>
            copy).
            <br>
            // The latter case is used for initialization.
            <br>
            -  ImplicitParamDecl ShouldReduceArg(C, Int32Ty,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ShouldReduceArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                                    Int32Ty,
            <br>
            ImplicitParamDecl::Other);
            <br>
            <br>
            FunctionArgList Args;
            <br>
            Args.push_back(&ReduceListArg);
            <br>
            @@ -1354,10 +1359,7 @@
            emitReduceScratchpadFunction(CodeGenModu
            <br>
            "_omp_reduction_load_and_reduce", &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*DC=*/nullptr, Fn, CGFI);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  // We don't need debug information in this function as
            nothing
            <br>
            here refers to
            <br>
            -  // user code.
            <br>
            -  CGF.disableDebugInfo();
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI, Args,
            Loc,
            <br>
            Loc);
            <br>
            <br>
            auto &Bld = CGF.Builder;
            <br>
            <br>
            @@ -1421,7 +1423,8 @@
            emitReduceScratchpadFunction(CodeGenModu
            <br>
            ReduceListAddr.getPointer(), CGF.VoidPtrTy);
            <br>
            llvm::Value *RemoteDataPtr =
            <br>
            Bld.CreatePointerBitCastOrAddrSpaceCast(
            <br>
            RemoteReduceList.getPointer(), CGF.VoidPtrTy);
            <br>
            -  CGF.EmitCallOrInvoke(ReduceFn, {LocalDataPtr,
            RemoteDataPtr});
            <br>
            +  CGM.getOpenMPRuntime().emitOutlinedFunctionCall(
            <br>
            +      CGF, Loc, ReduceFn, {LocalDataPtr, RemoteDataPtr});
            <br>
            Bld.CreateBr(MergeBB);
            <br>
            <br>
            CGF.EmitBlock(ElseBB);
            <br>
            @@ -1445,22 +1448,27 @@
            emitReduceScratchpadFunction(CodeGenModu
            <br>
            ///
            <br>
            static llvm::Value *emitCopyToScratchpad(CodeGenModule
            &CGM,
            <br>
            ArrayRef<const Expr *>
            <br>
            Privates,
            <br>
            -                                         QualType
            <br>
            ReductionArrayTy) {
            <br>
            +                                         QualType
            <br>
            ReductionArrayTy,
            <br>
            +                                         SourceLocation
            Loc) {
            <br>
            <br>
            auto &C = CGM.getContext();
            <br>
            auto Int32Ty = C.getIntTypeForBitwidth(32, /* Signed */
            true);
            <br>
            <br>
            // Source of the copy.
            <br>
            -  ImplicitParamDecl ReduceListArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ReduceListArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                                  C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            // Base address of the scratchpad array, with each element
            <br>
            storing a
            <br>
            // Reduce list per team.
            <br>
            -  ImplicitParamDecl ScratchPadArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ScratchPadArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                                  C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            // A destination index into the scratchpad array, typically
            the
            <br>
            team
            <br>
            // identifier.
            <br>
            -  ImplicitParamDecl IndexArg(C, Int32Ty,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl IndexArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr, Int32Ty,
            <br>
            +                             ImplicitParamDecl::Other);
            <br>
            // Row width of an element in the scratchpad array,
            typically
            <br>
            // the number of teams.
            <br>
            -  ImplicitParamDecl WidthArg(C, Int32Ty,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl WidthArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr, Int32Ty,
            <br>
            +                             ImplicitParamDecl::Other);
            <br>
            <br>
            FunctionArgList Args;
            <br>
            Args.push_back(&ReduceListArg);
            <br>
            @@ -1474,10 +1482,7 @@ static llvm::Value
            *emitCopyToScratchpad
            <br>
            "_omp_reduction_copy_to_scratchpad", &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*DC=*/nullptr, Fn, CGFI);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  // We don't need debug information in this function as
            nothing
            <br>
            here refers to
            <br>
            -  // user code.
            <br>
            -  CGF.disableDebugInfo();
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI, Args,
            Loc,
            <br>
            Loc);
            <br>
            <br>
            auto &Bld = CGF.Builder;
            <br>
            <br>
            @@ -1534,17 +1539,19 @@ static llvm::Value
            *emitCopyToScratchpad
            <br>
            ///     sync
            <br>
            static llvm::Value *emitInterWarpCopyFunction(CodeGenModule
            &CGM,
            <br>
            <br>
            ArrayRef<const Expr
            <br>
            *> Privates,
            <br>
            -                                              QualType
            <br>
            ReductionArrayTy) {
            <br>
            +                                              QualType
            <br>
            ReductionArrayTy,
            <br>
            +                                             
            SourceLocation Loc)
            <br>
            {
            <br>
            auto &C = CGM.getContext();
            <br>
            auto &M = CGM.getModule();
            <br>
            <br>
            // ReduceList: thread local Reduce list.
            <br>
            // At the stage of the computation when this function is
            <br>
            called, partially
            <br>
            // aggregated values reside in the first lane of every
            active
            <br>
            warp.
            <br>
            -  ImplicitParamDecl ReduceListArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ReduceListArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                                  C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            // NumWarps: number of warps active in the parallel region.
            <br>
            This could
            <br>
            // be smaller than 32 (max warps in a CTA) for partial block
            <br>
            reduction.
            <br>
            -  ImplicitParamDecl NumWarpsArg(C,
            <br>
            +  ImplicitParamDecl NumWarpsArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            C.getIntTypeForBitwidth(32, /*
            <br>
            Signed */ true),
            <br>
            ImplicitParamDecl::Other);
            <br>
            FunctionArgList Args;
            <br>
            @@ -1557,10 +1564,7 @@ static llvm::Value
            *emitInterWarpCopyFun
            <br>
            "_omp_reduction_inter_warp_copy_func",
            &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*DC=*/nullptr, Fn, CGFI);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  // We don't need debug information in this function as
            nothing
            <br>
            here refers to
            <br>
            -  // user code.
            <br>
            -  CGF.disableDebugInfo();
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI, Args,
            Loc,
            <br>
            Loc);
            <br>
            <br>
            auto &Bld = CGF.Builder;
            <br>
            <br>
            @@ -1781,21 +1785,23 @@ static llvm::Value
            *emitInterWarpCopyFun
            <br>
            ///   (2k+1)th thread is ignored in the value aggregation.
            <br>
            Therefore
            <br>
            ///   we copy the Reduce list from the (2k+1)th lane to
            (k+1)th
            <br>
            lane so
            <br>
            ///   that the contiguity assumption still holds.
            <br>
            -static llvm::Value *
            <br>
            -emitShuffleAndReduceFunction(CodeGenModule &CGM,
            <br>
            -                             ArrayRef<const Expr *>
            Privates,
            <br>
            -                             QualType ReductionArrayTy,
            <br>
            llvm::Value
            <br>
            *ReduceFn) {
            <br>
            +static llvm::Value *emitShuffleAndReduceFunction(
            <br>
            +    CodeGenModule &CGM, ArrayRef<const Expr *>
            Privates,
            <br>
            +    QualType ReductionArrayTy, llvm::Value *ReduceFn,
            <br>
            SourceLocation Loc) {
            <br>
            auto &C = CGM.getContext();
            <br>
            <br>
            // Thread local Reduce list used to host the values of data
            to
            <br>
            be reduced.
            <br>
            -  ImplicitParamDecl ReduceListArg(C, C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ReduceListArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                                  C.VoidPtrTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            // Current lane id; could be logical.
            <br>
            -  ImplicitParamDecl LaneIDArg(C, C.ShortTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl LaneIDArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            C.ShortTy,
            <br>
            +                              ImplicitParamDecl::Other);
            <br>
            // Offset of the remote source lane relative to the current
            <br>
            lane.
            <br>
            -  ImplicitParamDecl RemoteLaneOffsetArg(C, C.ShortTy,
            <br>
            -
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl RemoteLaneOffsetArg(C, /*DC=*/nullptr,
            Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                                        C.ShortTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            // Algorithm version.  This is expected to be known at
            compile
            <br>
            time.
            <br>
            -  ImplicitParamDecl AlgoVerArg(C, C.ShortTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl AlgoVerArg(C, /*DC=*/nullptr, Loc,
            <br>
            /*Id=*/nullptr,
            <br>
            +                               C.ShortTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            FunctionArgList Args;
            <br>
            Args.push_back(&ReduceListArg);
            <br>
            Args.push_back(&LaneIDArg);
            <br>
            @@ -1808,10 +1814,7 @@
            emitShuffleAndReduceFunction(CodeGenModu
            <br>
            "_omp_reduction_shuffle_and_reduce_func",
            <br>
            &CGM.getModule());
            <br>
            CGM.SetInternalFunctionAttributes(/*D=*/nullptr, Fn, CGFI);
            <br>
            CodeGenFunction CGF(CGM);
            <br>
            -  // We don't need debug information in this function as
            nothing
            <br>
            here refers to
            <br>
            -  // user code.
            <br>
            -  CGF.disableDebugInfo();
            <br>
            -  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI,
            Args);
            <br>
            +  CGF.StartFunction(GlobalDecl(), C.VoidTy, Fn, CGFI, Args,
            Loc,
            <br>
            Loc);
            <br>
            <br>
            auto &Bld = CGF.Builder;
            <br>
            <br>
            @@ -1898,7 +1901,8 @@
            emitShuffleAndReduceFunction(CodeGenModu
            <br>
            LocalReduceList.getPointer(), CGF.VoidPtrTy);
            <br>
            llvm::Value *RemoteReduceListPtr =
            <br>
            Bld.CreatePointerBitCastOrAddrSpaceCast(
            <br>
            RemoteReduceList.getPointer(), CGF.VoidPtrTy);
            <br>
            -  CGF.EmitCallOrInvoke(ReduceFn, {LocalReduceListPtr,
            <br>
            RemoteReduceListPtr});
            <br>
            +  CGM.getOpenMPRuntime().emitOutlinedFunctionCall(
            <br>
            +      CGF, Loc, ReduceFn, {LocalReduceListPtr,
            <br>
            RemoteReduceListPtr});
            <br>
            Bld.CreateBr(MergeBB);
            <br>
            <br>
            CGF.EmitBlock(ElseBB);
            <br>
            @@ -2228,8 +2232,8 @@ void
            CGOpenMPRuntimeNVPTX::emitReduction
            <br>
            <br>
            // 2. Emit reduce_func().
            <br>
            auto *ReductionFn = emitReductionFunction(
            <br>
            -      CGM,
            <br>
            CGF.ConvertTypeForMem(ReductionArrayTy)->getPointerTo(),
            Privates,
            <br>
            <br>
            -      LHSExprs, RHSExprs, ReductionOps);
            <br>
            +      CGM, Loc,
            <br>
            CGF.ConvertTypeForMem(ReductionArrayTy)->getPointerTo(),
            <br>
            +      Privates, LHSExprs, RHSExprs, ReductionOps);
            <br>
            <br>
            // 4. Build res = __kmpc_reduce{_nowait}(<gtid>,
            <n>,
            <br>
            sizeof(RedList),
            <br>
            // RedList, shuffle_reduce_func, interwarp_copy_func);
            <br>
            @@ -2239,9 +2243,9 @@ void
            CGOpenMPRuntimeNVPTX::emitReduction
            <br>
            ReductionList.getPointer(), CGF.VoidPtrTy);
            <br>
            <br>
            auto *ShuffleAndReduceFn = emitShuffleAndReduceFunction(
            <br>
            -      CGM, Privates, ReductionArrayTy, ReductionFn);
            <br>
            +      CGM, Privates, ReductionArrayTy, ReductionFn, Loc);
            <br>
            auto *InterWarpCopyFn =
            <br>
            -      emitInterWarpCopyFunction(CGM, Privates,
            ReductionArrayTy);
            <br>
            <br>
            +      emitInterWarpCopyFunction(CGM, Privates,
            ReductionArrayTy,
            <br>
            Loc);
            <br>
            <br>
            llvm::Value *Res = nullptr;
            <br>
            if (ParallelReduction) {
            <br>
            @@ -2259,9 +2263,9 @@ void
            CGOpenMPRuntimeNVPTX::emitReduction
            <br>
            <br>
            if (TeamsReduction) {
            <br>
            auto *ScratchPadCopyFn =
            <br>
            -        emitCopyToScratchpad(CGM, Privates,
            ReductionArrayTy);
            <br>
            +        emitCopyToScratchpad(CGM, Privates,
            ReductionArrayTy,
            <br>
            Loc);
            <br>
            auto *LoadAndReduceFn = emitReduceScratchpadFunction(
            <br>
            -        CGM, Privates, ReductionArrayTy, ReductionFn);
            <br>
            +        CGM, Privates, ReductionArrayTy, ReductionFn, Loc);
            <br>
            <br>
            llvm::Value *Args[] = {ThreadId,
            <br>
            CGF.Builder.getInt32(RHSExprs.size()),
            <br>
            <br>
            @@ -2422,10 +2426,15 @@ llvm::Function
            *CGOpenMPRuntimeNVPTX::cr
            <br>
            Ctx.getIntTypeForBitwidth(/*DestWidth=*/32,
            <br>
            /*Signed=*/false);
            <br>
            QualType Int32PtrQTy = Ctx.getPointerType(Int32QTy);
            <br>
            QualType VoidPtrPtrQTy = Ctx.getPointerType(Ctx.VoidPtrTy);
            <br>
            -  ImplicitParamDecl ParallelLevelArg(Ctx, Int16QTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            -  ImplicitParamDecl WrapperArg(Ctx, Int32QTy,
            <br>
            ImplicitParamDecl::Other);
            <br>
            -  ImplicitParamDecl SharedArgsList(Ctx, VoidPtrPtrQTy,
            <br>
            -      ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl ParallelLevelArg(Ctx, /*DC=*/nullptr,
            <br>
            D.getLocStart(),
            <br>
            +                                     /*Id=*/nullptr,
            Int16QTy,
            <br>
            +                                    
            ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl WrapperArg(Ctx, /*DC=*/nullptr,
            <br>
            D.getLocStart(),
            <br>
            +                               /*Id=*/nullptr, Int32QTy,
            <br>
            +                               ImplicitParamDecl::Other);
            <br>
            +  ImplicitParamDecl SharedArgsList(Ctx, /*DC=*/nullptr,
            <br>
            D.getLocStart(),
            <br>
            +                                   /*Id=*/nullptr,
            VoidPtrPtrQTy,
            <br>
            <br>
            +                                  
            ImplicitParamDecl::Other);
            <br>
            WrapperArgs.emplace_back(&ParallelLevelArg);
            <br>
            WrapperArgs.emplace_back(&WrapperArg);
            <br>
            WrapperArgs.emplace_back(&SharedArgsList);
            <br>
            @@ -2440,7 +2449,8 @@ llvm::Function
            *CGOpenMPRuntimeNVPTX::cr
            <br>
            Fn->setLinkage(llvm::GlobalValue::InternalLinkage);
            <br>
            <br>
            CodeGenFunction CGF(CGM, /*suppressNewContext=*/true);
            <br>
            -  CGF.StartFunction(GlobalDecl(), Ctx.VoidTy, Fn, CGFI,
            <br>
            WrapperArgs);
            <br>
            +  CGF.StartFunction(GlobalDecl(), Ctx.VoidTy, Fn, CGFI,
            <br>
            WrapperArgs,
            <br>
            +                    D.getLocStart(), D.getLocStart());
            <br>
            <br>
            const auto *RD = CS.getCapturedRecordDecl();
            <br>
            auto CurField = RD->field_begin();
            <br>
            @@ -2489,7 +2499,7 @@ llvm::Function
            *CGOpenMPRuntimeNVPTX::cr
            <br>
            Args.emplace_back(Arg);
            <br>
            }
            <br>
            <br>
            -  emitCall(CGF, OutlinedParallelFn, Args);
            <br>
            +  emitOutlinedFunctionCall(CGF, D.getLocStart(),
            <br>
            OutlinedParallelFn, Args);
            <br>
            CGF.FinishFunction();
            <br>
            return Fn;
            <br>
            }
            <br>
            <br>
            Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.h
            <br>
            URL:
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
<a class="moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Flib%2FCodeGen%2FCGOpenMPRuntimeNVPTX.h%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=8q%2F2IpesrmjFhNMuynt92WrL2WGAC7Ojviosu%2Bp9VH4%3D&reserved=0">https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Flib%2FCodeGen%2FCGOpenMPRuntimeNVPTX.h%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=8q%2F2IpesrmjFhNMuynt92WrL2WGAC7Ojviosu%2Bp9VH4%3D&reserved=0</a>
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
==============================================================================
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            --- cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.h (original)
            <br>
            +++ cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.h Thu Jan  4
            <br>
            11:45:16 2018
            <br>
            @@ -36,8 +36,9 @@ private:
            <br>
            public:
            <br>
            llvm::Function *WorkerFn;
            <br>
            const CGFunctionInfo *CGFI;
            <br>
            +    SourceLocation Loc;
            <br>
            <br>
            -    WorkerFunctionState(CodeGenModule &CGM);
            <br>
            +    WorkerFunctionState(CodeGenModule &CGM,
            SourceLocation Loc);
            <br>
            <br>
            private:
            <br>
            void createWorkerFunction(CodeGenModule &CGM);
            <br>
            <br>
            Modified:
            cfe/trunk/test/OpenMP/target_parallel_debug_codegen.cpp
            <br>
            URL:
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
<a class="moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Ftest%2FOpenMP%2Ftarget_parallel_debug_codegen.cpp%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=siASjNxr19H1DzRg8PevnLyG%2BoyBlM2EfA8AGdijjW0%3D&reserved=0">https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fcfe%2Ftrunk%2Ftest%2FOpenMP%2Ftarget_parallel_debug_codegen.cpp%3Frev%3D321816%26r1%3D321815%26r2%3D321816%26view%3Ddiff&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=siASjNxr19H1DzRg8PevnLyG%2BoyBlM2EfA8AGdijjW0%3D&reserved=0</a>
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
==============================================================================
        <br>
        <blockquote type="cite">
          <blockquote type="cite">
            <br>
            --- cfe/trunk/test/OpenMP/target_parallel_debug_codegen.cpp
            <br>
            (original)
            <br>
            +++ cfe/trunk/test/OpenMP/target_parallel_debug_codegen.cpp
            Thu
            <br>
            Jan  4
            <br>
            11:45:16 2018
            <br>
            @@ -116,8 +116,8 @@ int main() {
            <br>
            // CHECK: !DILocalVariable(name: ".bound_tid.",
            <br>
            // CHECK-SAME: DIFlagArtificial
            <br>
            // CHECK: !DILocalVariable(name: "c",
            <br>
            -// CHECK-SAMEi-NOT: DIFlagArtificial
            <br>
            +// CHECK-SAME: line: 11
            <br>
            // CHECK: !DILocalVariable(name: "a",
            <br>
            -// CHECK-SAMEi-NOT: DIFlagArtificial
            <br>
            +// CHECK-SAME: line: 9
            <br>
            // CHECK: !DILocalVariable(name: "b",
            <br>
            -// CHECK-SAMEi-NOT: DIFlagArtificial
            <br>
            +// CHECK-SAME: line: 10
            <br>
            <br>
            _______________________________________________
            <br>
            cfe-commits mailing list
            <br>
            <a class="moz-txt-link-abbreviated" href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
<a class="moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fcfe-commits&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=2y6Ln%2FGNGg3I6IsOdiGlJinTN2vpuPSjx1YB6MnbLSU%3D&reserved=0">https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fcfe-commits&data=02%7C01%7C%7Ceb0f898e6fe040bc1a4208d553b566ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636506960925164662&sdata=2y6Ln%2FGNGg3I6IsOdiGlJinTN2vpuPSjx1YB6MnbLSU%3D&reserved=0</a>
        <br>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>