Skip to content

Commit cc942d4

Browse files
committed
Land HIP standard parallelization
Cherry-picked and tweaked as needed from several upstream patches Change-Id: Ie494b7a1451e2d1c105c75785254557e6674e7b9
1 parent 49ca7b2 commit cc942d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1349
-34
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ def err_drv_no_asan_rt_lib : Error<
7373
def err_drv_no_hip_runtime : Error<
7474
"cannot find HIP runtime; provide its path via '--rocm-path', or pass "
7575
"'-nogpuinc' to build without HIP runtime">;
76+
def err_drv_no_hipstdpar_lib : Error<
77+
"cannot find HIP Standard Parallelism Acceleration library; provide it via "
78+
"'--hipstdpar-path'">;
79+
def err_drv_no_hipstdpar_thrust_lib : Error<
80+
"cannot find rocThrust, which is required by the HIP Standard Parallelism "
81+
"Acceleration library; provide it via "
82+
"'--hipstdpar-thrust-path'">;
83+
def err_drv_no_hipstdpar_prim_lib : Error<
84+
"cannot find rocPrim, which is required by the HIP Standard Parallelism "
85+
"Acceleration library; provide it via '--hipstdpar-prim-path'">;
7686

7787
def err_drv_no_hipspv_device_lib : Error<
7888
"cannot find HIP device library%select{| for %1}0; provide its path via "

clang/include/clang/Basic/LangOptions.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ ENUM_LANGOPT(SYCLVersion , SYCLMajorVersion, 2, SYCL_None, "Version of the SYCL
286286

287287
LANGOPT(HIPUseNewLaunchAPI, 1, 0, "Use new kernel launching API for HIP")
288288
LANGOPT(OffloadUniformBlock, 1, 0, "Assume that kernels are launched with uniform block sizes (default true for CUDA/HIP and false otherwise)")
289+
LANGOPT(HIPStdPar, 1, 0, "Enable Standard Parallel Algorithm Acceleration for HIP (experimental)")
290+
LANGOPT(HIPStdParInterposeAlloc, 1, 0, "Replace allocations / deallocations with HIP RT calls when Standard Parallel Algorithm Acceleration for HIP is enabled (Experimental)")
289291

290292
LANGOPT(SizedDeallocation , 1, 0, "sized deallocation")
291293
LANGOPT(AlignedAllocation , 1, 0, "aligned allocation")

clang/include/clang/Driver/Options.td

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,32 @@ def rocm_path_EQ : Joined<["--"], "rocm-path=">, Group<i_Group>,
10661066
HelpText<"ROCm installation path, used for finding and automatically linking required bitcode libraries.">;
10671067
def hip_path_EQ : Joined<["--"], "hip-path=">, Group<i_Group>,
10681068
HelpText<"HIP runtime installation path, used for finding HIP version and adding HIP include path.">;
1069+
def hipstdpar : Flag<["--"], "hipstdpar">,
1070+
Flags<[CoreOption, CC1Option]>,
1071+
Group<CompileOnly_Group>,
1072+
HelpText<"Enable HIP acceleration for standard parallel algorithms">,
1073+
MarshallingInfoFlag<LangOpts<"HIPStdPar">>;
1074+
def hipstdpar_interpose_alloc : Flag<["--"], "hipstdpar-interpose-alloc">,
1075+
Flags<[CoreOption, CC1Option]>,
1076+
Group<CompileOnly_Group>,
1077+
HelpText<"Replace all memory allocation / deallocation calls with "
1078+
"hipManagedMalloc / hipFree equivalents">,
1079+
MarshallingInfoFlag<LangOpts<"HIPStdParInterposeAlloc">>;
1080+
// TODO: use MarshallingInfo here
1081+
def hipstdpar_path_EQ : Joined<["--"], "hipstdpar-path=">, Group<i_Group>,
1082+
HelpText<
1083+
"HIP Standard Parallel Algorithm Acceleration library path, used for "
1084+
"finding and implicitly including the library header">;
1085+
def hipstdpar_thrust_path_EQ : Joined<["--"], "hipstdpar-thrust-path=">,
1086+
Group<i_Group>,
1087+
HelpText<
1088+
"rocThrust path, required by the HIP Standard Parallel Algorithm "
1089+
"Acceleration library, used to implicitly include the rocThrust library">;
1090+
def hipstdpar_prim_path_EQ : Joined<["--"], "hipstdpar-prim-path=">,
1091+
Group<i_Group>,
1092+
HelpText<
1093+
"rocPrim path, required by the HIP Standard Parallel Algorithm "
1094+
"Acceleration library, used to implicitly include the rocPrim library">;
10691095
def amdgpu_arch_tool_EQ : Joined<["--"], "amdgpu-arch-tool=">, Group<i_Group>,
10701096
HelpText<"Tool used for detecting AMD GPU arch in the system.">;
10711097
def nvptx_arch_tool_EQ : Joined<["--"], "nvptx-arch-tool=">, Group<i_Group>,
@@ -2832,36 +2858,36 @@ def fopenmp_target_xteam_reduction_blocksize_EQ : Joined<["-"], "fopenmp-target-
28322858
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
28332859
def fopenmp_target_fast : Flag<["-"], "fopenmp-target-fast">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
28342860
def fno_openmp_target_fast : Flag<["-"], "fno-openmp-target-fast">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2835-
def fopenmp_target_ignore_env_vars : Flag<["-"], "fopenmp-target-ignore-env-vars">, Group<f_Group>,
2836-
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2861+
def fopenmp_target_ignore_env_vars : Flag<["-"], "fopenmp-target-ignore-env-vars">, Group<f_Group>,
2862+
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
28372863
HelpText<"Assert that device related environment variables can be ignored while generating code">,
28382864
MarshallingInfoFlag<LangOpts<"OpenMPTargetIgnoreEnvVars">>;
2839-
def fno_openmp_target_ignore_env_vars : Flag<["-"], "fno-openmp-target-ignore-env-vars">, Group<f_Group>,
2840-
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2865+
def fno_openmp_target_ignore_env_vars : Flag<["-"], "fno-openmp-target-ignore-env-vars">, Group<f_Group>,
2866+
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
28412867
HelpText<"Assert that device related environment variables cannot be ignored while generating code">,
28422868
MarshallingInfoFlag<LangOpts<"OpenMPTargetIgnoreEnvVars">>;
2843-
def fopenmp_target_big_jump_loop : Flag<["-"], "fopenmp-target-big-jump-loop">, Group<f_Group>,
2844-
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2869+
def fopenmp_target_big_jump_loop : Flag<["-"], "fopenmp-target-big-jump-loop">, Group<f_Group>,
2870+
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
28452871
HelpText<"Use the big-jump-loop code generation technique if possible">,
28462872
MarshallingInfoFlag<LangOpts<"OpenMPTargetBigJumpLoop">>;
2847-
def fno_openmp_target_big_jump_loop : Flag<["-"], "fno-openmp-target-big-jump-loop">, Group<f_Group>,
2848-
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2873+
def fno_openmp_target_big_jump_loop : Flag<["-"], "fno-openmp-target-big-jump-loop">, Group<f_Group>,
2874+
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
28492875
HelpText<"Do not use the big-jump-loop code generation technique">,
28502876
MarshallingInfoFlag<LangOpts<"OpenMPTargetBigJumpLoop">>;
2851-
def fopenmp_target_no_loop : Flag<["-"], "fopenmp-target-no-loop">, Group<f_Group>,
2852-
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2877+
def fopenmp_target_no_loop : Flag<["-"], "fopenmp-target-no-loop">, Group<f_Group>,
2878+
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
28532879
HelpText<"Use the no-loop code generation technique if possible">,
28542880
MarshallingInfoFlag<LangOpts<"OpenMPTargetNoLoop">>;
2855-
def fno_openmp_target_no_loop : Flag<["-"], "fno-openmp-target-no-loop">, Group<f_Group>,
2856-
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2881+
def fno_openmp_target_no_loop : Flag<["-"], "fno-openmp-target-no-loop">, Group<f_Group>,
2882+
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
28572883
HelpText<"Do not use the no-loop code generation technique">,
28582884
MarshallingInfoFlag<LangOpts<"OpenMPTargetNoLoop">>;
2859-
def fopenmp_target_xteam_reduction : Flag<["-"], "fopenmp-target-xteam-reduction">, Group<f_Group>,
2860-
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2885+
def fopenmp_target_xteam_reduction : Flag<["-"], "fopenmp-target-xteam-reduction">, Group<f_Group>,
2886+
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
28612887
HelpText<"Use the cross-team code generation technique if possible">,
28622888
MarshallingInfoFlag<LangOpts<"OpenMPTargetXteamReduction">>;
2863-
def fno_openmp_target_xteam_reduction : Flag<["-"], "fno-openmp-target-xteam-reduction">, Group<f_Group>,
2864-
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2889+
def fno_openmp_target_xteam_reduction : Flag<["-"], "fno-openmp-target-xteam-reduction">, Group<f_Group>,
2890+
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
28652891
HelpText<"Do not use the cross-team reduction code generation technique">,
28662892
MarshallingInfoFlag<LangOpts<"OpenMPTargetXteamReduction">>;
28672893
def fopenmp_force_usm : Flag<["-"], "fopenmp-force-usm">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
#include "llvm/Transforms/Scalar/EarlyCSE.h"
7878
#include "llvm/Transforms/Scalar/GVN.h"
7979
#include "llvm/Transforms/Scalar/JumpThreading.h"
80+
#include "llvm/Transforms/HipStdPar/HipStdPar.h"
8081
#include "llvm/Transforms/Utils/Debugify.h"
8182
#include "llvm/Transforms/Utils/EntryExitInstrumenter.h"
8283
#include "llvm/Transforms/Utils/ModuleUtils.h"
@@ -1093,6 +1094,10 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
10931094
TheModule->addModuleFlag(Module::Error, "UnifiedLTO", uint32_t(1));
10941095
}
10951096

1097+
if (LangOpts.HIPStdPar && !LangOpts.CUDAIsDevice &&
1098+
LangOpts.HIPStdParInterposeAlloc)
1099+
MPM.addPass(HipStdParAllocationInterpositionPass());
1100+
10961101
// Now that we have all of the passes ready, run them.
10971102
{
10981103
PrettyStackTraceString CrashInfo("Optimizer");

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,6 +2251,19 @@ static Value *tryUseTestFPKind(CodeGenFunction &CGF, unsigned BuiltinID,
22512251
return nullptr;
22522252
}
22532253

2254+
static RValue EmitHipStdParUnsupportedBuiltin(CodeGenFunction *CGF,
2255+
const FunctionDecl *FD) {
2256+
auto Name = FD->getNameAsString() + "__hipstdpar_unsupported";
2257+
auto FnTy = CGF->CGM.getTypes().GetFunctionType(FD);
2258+
auto UBF = CGF->CGM.getModule().getOrInsertFunction(Name, FnTy);
2259+
2260+
SmallVector<Value *, 16> Args;
2261+
for (auto &&FormalTy : FnTy->params())
2262+
Args.push_back(llvm::PoisonValue::get(FormalTy));
2263+
2264+
return RValue::get(CGF->Builder.CreateCall(UBF, Args));
2265+
}
2266+
22542267
RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
22552268
const CallExpr *E,
22562269
ReturnValueSlot ReturnValue) {
@@ -5537,6 +5550,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
55375550
llvm_unreachable("Bad evaluation kind in EmitBuiltinExpr");
55385551
}
55395552

5553+
if (getLangOpts().HIPStdPar && getLangOpts().CUDAIsDevice)
5554+
return EmitHipStdParUnsupportedBuiltin(this, FD);
5555+
55405556
ErrorUnsupported(E, "builtin function");
55415557

55425558
// Unknown builtin, for now just dump it out and return undef.
@@ -5547,6 +5563,16 @@ static Value *EmitTargetArchBuiltinExpr(CodeGenFunction *CGF,
55475563
unsigned BuiltinID, const CallExpr *E,
55485564
ReturnValueSlot ReturnValue,
55495565
llvm::Triple::ArchType Arch) {
5566+
// When compiling in HipStdPar mode we have to be conservative in rejecting
5567+
// target specific features in the FE, and defer the possible error to the
5568+
// AcceleratorCodeSelection pass, wherein iff an unsupported target builtin is
5569+
// referenced by an accelerator executable function, we emit an error.
5570+
// Returning nullptr here leads to the builtin being handled in
5571+
// EmitStdParUnsupportedBuiltin.
5572+
if (CGF->getLangOpts().HIPStdPar && CGF->getLangOpts().CUDAIsDevice &&
5573+
Arch != CGF->getTarget().getTriple().getArch())
5574+
return nullptr;
5575+
55505576
switch (Arch) {
55515577
case llvm::Triple::arm:
55525578
case llvm::Triple::armeb:

clang/lib/CodeGen/CGStmt.cpp

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2979,6 +2979,24 @@ EmitAsmStores(CodeGenFunction &CGF, const AsmStmt &S,
29792979
}
29802980
}
29812981

2982+
static void EmitHipStdParUnsupportedAsm(CodeGenFunction *CGF,
2983+
const AsmStmt &S) {
2984+
constexpr auto Name = "__ASM__hipstdpar_unsupported";
2985+
2986+
StringRef Asm;
2987+
if (auto GCCAsm = dyn_cast<GCCAsmStmt>(&S))
2988+
Asm = GCCAsm->getAsmString()->getString();
2989+
2990+
auto &Ctx = CGF->CGM.getLLVMContext();
2991+
2992+
auto StrTy = llvm::ConstantDataArray::getString(Ctx, Asm);
2993+
auto FnTy = llvm::FunctionType::get(llvm::Type::getVoidTy(Ctx),
2994+
{StrTy->getType()}, false);
2995+
auto UBF = CGF->CGM.getModule().getOrInsertFunction(Name, FnTy);
2996+
2997+
CGF->Builder.CreateCall(UBF, {StrTy});
2998+
}
2999+
29823000
void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
29833001
// Pop all cleanup blocks at the end of the asm statement.
29843002
CodeGenFunction::RunCleanupsScope Cleanups(*this);
@@ -2990,27 +3008,38 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
29903008
SmallVector<TargetInfo::ConstraintInfo, 4> OutputConstraintInfos;
29913009
SmallVector<TargetInfo::ConstraintInfo, 4> InputConstraintInfos;
29923010

2993-
for (unsigned i = 0, e = S.getNumOutputs(); i != e; i++) {
3011+
bool IsHipStdPar = getLangOpts().HIPStdPar && getLangOpts().CUDAIsDevice;
3012+
bool IsValidTargetAsm = true;
3013+
for (unsigned i = 0, e = S.getNumOutputs(); i != e && IsValidTargetAsm; i++) {
29943014
StringRef Name;
29953015
if (const GCCAsmStmt *GAS = dyn_cast<GCCAsmStmt>(&S))
29963016
Name = GAS->getOutputName(i);
29973017
TargetInfo::ConstraintInfo Info(S.getOutputConstraint(i), Name);
29983018
bool IsValid = getTarget().validateOutputConstraint(Info); (void)IsValid;
2999-
assert(IsValid && "Failed to parse output constraint");
3019+
if (IsHipStdPar && !IsValid)
3020+
IsValidTargetAsm = false;
3021+
else
3022+
assert(IsValid && "Failed to parse output constraint");
30003023
OutputConstraintInfos.push_back(Info);
30013024
}
30023025

3003-
for (unsigned i = 0, e = S.getNumInputs(); i != e; i++) {
3026+
for (unsigned i = 0, e = S.getNumInputs(); i != e && IsValidTargetAsm; i++) {
30043027
StringRef Name;
30053028
if (const GCCAsmStmt *GAS = dyn_cast<GCCAsmStmt>(&S))
30063029
Name = GAS->getInputName(i);
30073030
TargetInfo::ConstraintInfo Info(S.getInputConstraint(i), Name);
30083031
bool IsValid =
30093032
getTarget().validateInputConstraint(OutputConstraintInfos, Info);
3010-
assert(IsValid && "Failed to parse input constraint"); (void)IsValid;
3033+
if (IsHipStdPar && !IsValid)
3034+
IsValidTargetAsm = false;
3035+
else
3036+
assert(IsValid && "Failed to parse input constraint");
30113037
InputConstraintInfos.push_back(Info);
30123038
}
30133039

3040+
if (!IsValidTargetAsm)
3041+
return EmitHipStdParUnsupportedAsm(this, S);
3042+
30143043
std::string Constraints;
30153044

30163045
std::vector<LValue> ResultRegDests;

clang/lib/CodeGen/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set(LLVM_LINK_COMPONENTS
1111
Extensions
1212
FrontendHLSL
1313
FrontendOpenMP
14+
HIPStdPar
1415
IPO
1516
IRPrinter
1617
IRReader

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,10 +2571,15 @@ void CodeGenFunction::checkTargetFeatures(SourceLocation Loc,
25712571
std::string MissingFeature;
25722572
llvm::StringMap<bool> CallerFeatureMap;
25732573
CGM.getContext().getFunctionFeatureMap(CallerFeatureMap, FD);
2574+
// When compiling in HipStdPar mode we have to be conservative in rejecting
2575+
// target specific features in the FE, and defer the possible error to the
2576+
// AcceleratorCodeSelection pass, wherein iff an unsupported target builtin is
2577+
// referenced by an accelerator executable function, we emit an error.
2578+
bool IsHipStdPar = getLangOpts().HIPStdPar && getLangOpts().CUDAIsDevice;
25742579
if (BuiltinID) {
25752580
StringRef FeatureList(CGM.getContext().BuiltinInfo.getRequiredFeatures(BuiltinID));
25762581
if (!Builtin::evaluateRequiredTargetFeatures(
2577-
FeatureList, CallerFeatureMap)) {
2582+
FeatureList, CallerFeatureMap) && !IsHipStdPar) {
25782583
CGM.getDiags().Report(Loc, diag::err_builtin_needs_feature)
25792584
<< TargetDecl->getDeclName()
25802585
<< FeatureList;
@@ -2607,7 +2612,7 @@ void CodeGenFunction::checkTargetFeatures(SourceLocation Loc,
26072612
return false;
26082613
}
26092614
return true;
2610-
}))
2615+
}) && !IsHipStdPar)
26112616
CGM.getDiags().Report(Loc, diag::err_function_needs_feature)
26122617
<< FD->getDeclName() << TargetDecl->getDeclName() << MissingFeature;
26132618
} else if (!FD->isMultiVersion() && FD->hasAttr<TargetAttr>()) {
@@ -2616,7 +2621,8 @@ void CodeGenFunction::checkTargetFeatures(SourceLocation Loc,
26162621

26172622
for (const auto &F : CalleeFeatureMap) {
26182623
if (F.getValue() && (!CallerFeatureMap.lookup(F.getKey()) ||
2619-
!CallerFeatureMap.find(F.getKey())->getValue()))
2624+
!CallerFeatureMap.find(F.getKey())->getValue()) &&
2625+
!IsHipStdPar)
26202626
CGM.getDiags().Report(Loc, diag::err_function_needs_feature)
26212627
<< FD->getDeclName() << TargetDecl->getDeclName() << F.getKey();
26222628
}

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3556,7 +3556,10 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
35563556
!Global->hasAttr<CUDAConstantAttr>() &&
35573557
!Global->hasAttr<CUDASharedAttr>() &&
35583558
!Global->getType()->isCUDADeviceBuiltinSurfaceType() &&
3559-
!Global->getType()->isCUDADeviceBuiltinTextureType())
3559+
!Global->getType()->isCUDADeviceBuiltinTextureType() &&
3560+
!(LangOpts.HIPStdPar &&
3561+
isa<FunctionDecl>(Global) &&
3562+
!Global->hasAttr<CUDAHostAttr>()))
35603563
return;
35613564
} else {
35623565
// We need to emit host-side 'shadows' for all global

clang/lib/Driver/Driver.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,8 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
921921
[](std::pair<types::ID, const llvm::opt::Arg *> &I) {
922922
return types::isHIP(I.first);
923923
}) ||
924-
C.getInputArgs().hasArg(options::OPT_hip_link);
924+
C.getInputArgs().hasArg(options::OPT_hip_link) ||
925+
C.getInputArgs().hasArg(options::OPT_hipstdpar);
925926
if (IsCuda && IsHIP) {
926927
Diag(clang::diag::err_drv_mix_cuda_hip);
927928
return;
@@ -3077,6 +3078,10 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
30773078
}
30783079
}
30793080

3081+
if ((Ty == types::TY_C || Ty == types::TY_CXX) &&
3082+
Args.hasArgNoClaim(options::OPT_hipstdpar))
3083+
Ty = types::TY_HIP;
3084+
30803085
if (DiagnoseInputExistence(Args, Value, Ty, /*TypoCorrect=*/true))
30813086
Inputs.push_back(std::make_pair(Ty, A));
30823087

@@ -4510,6 +4515,11 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args,
45104515
phases::ID FinalPhase = getFinalPhase(Args, &FinalPhaseArg);
45114516

45124517
if (FinalPhase == phases::Link) {
4518+
if (Args.hasArgNoClaim(options::OPT_hipstdpar)) {
4519+
Args.AddFlagArg(nullptr, getOpts().getOption(options::OPT_hip_link));
4520+
Args.AddFlagArg(nullptr,
4521+
getOpts().getOption(options::OPT_frtlib_add_rpath));
4522+
}
45134523
// Emitting LLVM while linking disabled except in HIPAMD Toolchain
45144524
if (Args.hasArg(options::OPT_emit_llvm) && !Args.hasArg(options::OPT_hip_link))
45154525
Diag(clang::diag::err_drv_emit_llvm_link);

0 commit comments

Comments
 (0)