From 3c8eb3ec8edfe1ee3ef8ba59e588c7f4dc8d813a Mon Sep 17 00:00:00 2001 From: foreman Date: Sun, 13 Aug 2017 15:35:34 -0400 Subject: [PATCH] P4 to Git Change 1446561 by smekhano@stas-mwamba-rocm on 2017/08/13 15:22:24 SWDEV-127767 - COmplib: process -fuse-native option with LC Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.cpp#41 edit --- rocclr/compiler/lib/utils/options.cpp | 7 +++++++ rocclr/runtime/device/pal/palcompiler.cpp | 2 +- rocclr/runtime/device/rocm/roccompiler.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rocclr/compiler/lib/utils/options.cpp b/rocclr/compiler/lib/utils/options.cpp index fa67675cdc..490b29f1c8 100644 --- a/rocclr/compiler/lib/utils/options.cpp +++ b/rocclr/compiler/lib/utils/options.cpp @@ -896,6 +896,13 @@ processOption(int OptDescTableIx, Options& Opts, const std::string& Value, } break; +#if defined(WITH_LIGHTNING_COMPILER) + case OID_OptUseNative: + Opts.llvmOptions.append(" -mllvm -amdgpu-use-native="); + Opts.llvmOptions.append(sval); + break; +#endif + case OID_WFComma: case OID_WBComma: case OID_WHComma: diff --git a/rocclr/runtime/device/pal/palcompiler.cpp b/rocclr/runtime/device/pal/palcompiler.cpp index ddeb6045e5..17de21fdd5 100644 --- a/rocclr/runtime/device/pal/palcompiler.cpp +++ b/rocclr/runtime/device/pal/palcompiler.cpp @@ -260,7 +260,7 @@ bool LightningProgram::compileImpl(const std::string& sourceCode, driverOptions.append(hsailOptions(options)); // Set whole program mode - driverOptions.append(" -mllvm -amdgpu-early-inline-all"); + driverOptions.append(" -mllvm -amdgpu-early-inline-all -mllvm -amdgpu-prelink"); // Find the temp folder for the OS std::string tempFolder = amd::Os::getEnvironment("TEMP"); diff --git a/rocclr/runtime/device/rocm/roccompiler.cpp b/rocclr/runtime/device/rocm/roccompiler.cpp index e70bc6f640..da821ae1ab 100644 --- a/rocclr/runtime/device/rocm/roccompiler.cpp +++ b/rocclr/runtime/device/rocm/roccompiler.cpp @@ -100,7 +100,7 @@ bool HSAILProgram::compileImpl_LC(const std::string& sourceCode, driverOptions.append(options->llvmOptions); // Set whole program mode - driverOptions.append(" -mllvm -amdgpu-early-inline-all"); + driverOptions.append(" -mllvm -amdgpu-early-inline-all -mllvm -amdgpu-prelink"); driverOptions.append(preprocessorOptions(options));