From 7031f19aca51bd1ba98bdb73e09e41d526940fe2 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 31 May 2019 18:29:57 -0400
Subject: [PATCH] P4 to Git Change 1790483 by msearles@aoc-1666-2 on 2019/05/31
18:06:01
SWDEV-187169 - Hotel Lobby scene takes long time to compile
Patch authored by Valery Pykhtin.
Remove " -mllvm -amdgpu-early-inline-all", from the options passed
to the compiler; option interferes with function call support.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#44 edit
---
rocclr/runtime/device/devprogram.cpp | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/rocclr/runtime/device/devprogram.cpp b/rocclr/runtime/device/devprogram.cpp
index b87626f868..499bee36b3 100644
--- a/rocclr/runtime/device/devprogram.cpp
+++ b/rocclr/runtime/device/devprogram.cpp
@@ -42,6 +42,12 @@
typedef llvm::AMDGPU::HSAMD::Kernel::Arg::Metadata KernelArgMD;
#endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
+#ifdef EARLY_INLINE
+#define AMDGPU_EARLY_INLINE_ALL_OPTION " -mllvm -amdgpu-early-inline-all"
+#else
+#define AMDGPU_EARLY_INLINE_ALL_OPTION
+#endif
+
namespace device {
// ================================================================================================
@@ -687,7 +693,7 @@ bool Program::compileImplLC(const std::string& sourceCode,
driverOptions.append(ProcessOptions(options));
// Set whole program mode
- driverOptions.append(" -mllvm -amdgpu-early-inline-all -mllvm -amdgpu-prelink");
+ driverOptions.append(AMDGPU_EARLY_INLINE_ALL_OPTION " -mllvm -amdgpu-prelink");
if (!device().settings().enableWgpMode_) {
driverOptions.append(" -mcumode");
@@ -830,7 +836,7 @@ bool Program::compileImplLC(const std::string& sourceCode,
driverOptions.append(ProcessOptions(options));
// Set whole program mode
- driverOptions.append(" -mllvm -amdgpu-early-inline-all -mllvm -amdgpu-prelink");
+ driverOptions.append(AMDGPU_EARLY_INLINE_ALL_OPTION " -mllvm -amdgpu-prelink");
// Find the temp folder for the OS
std::string tempFolder = amd::Os::getTempPath();
@@ -1525,7 +1531,7 @@ bool Program::linkImplLC(amd::option::Options* options) {
}
// Set whole program mode
- codegenOptions.append(" -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all");
+ codegenOptions.append(" -mllvm -amdgpu-internalize-symbols" AMDGPU_EARLY_INLINE_ALL_OPTION);
if (!device().settings().enableWgpMode_) {
codegenOptions.append(" -mcumode");
@@ -1757,7 +1763,7 @@ bool Program::linkImplLC(amd::option::Options* options) {
// Force object code v2.
codegenOptions.append(" -mno-code-object-v3");
// Set whole program mode
- codegenOptions.append(" -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all");
+ codegenOptions.append(" -mllvm -amdgpu-internalize-symbols" AMDGPU_EARLY_INLINE_ALL_OPTION);
if (!device().settings().enableWgpMode_) {
codegenOptions.append(" -mcumode");