From 13f385908c79b0ca4873fc95cf8159da5f8aec2f Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 22 Dec 2015 13:15:33 -0500
Subject: [PATCH] P4 to Git Change 1222955 by smekhano@stas-rampitec-hsa on
2015/12/22 13:06:59
SWDEV-80173 - remove the opt level adjustment based on the function size
Since it only limits the llvm backend, but not optimizer or SC it really hurts the compile time.
A huge unoptimized hsail after inlining and no backend optimizations goes to the SC with overwhelming results.
A proper way of addressing these issues is to keep inlining reasonable.
Testing: smoke, precheckin
Reviewed by Evgeny Mankov
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/codegen.cpp#65 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Transforms/IPO/AMDInline.cpp#3 edit
---
.../compiler/lib/backends/common/codegen.cpp | 21 -------------------
1 file changed, 21 deletions(-)
diff --git a/rocclr/compiler/lib/backends/common/codegen.cpp b/rocclr/compiler/lib/backends/common/codegen.cpp
index d99f64983b..8fe5a76ac6 100644
--- a/rocclr/compiler/lib/backends/common/codegen.cpp
+++ b/rocclr/compiler/lib/backends/common/codegen.cpp
@@ -42,24 +42,6 @@
using namespace amdcl;
using namespace llvm;
-/*! Function that modifies the code gen level based on the
- * function size threshhold.
- */
-static CodeGenOpt::Level
-AdjustCGOptLevel(Module& M, CodeGenOpt::Level OrigOLvl)
-{
- const unsigned int FuncSizeThreshold = 10000;
- if (OrigOLvl == CodeGenOpt::None)
- return OrigOLvl;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
- Function *F = (Function *)I;
- if (F->size() > FuncSizeThreshold) {
- return CodeGenOpt::None;
- }
- }
- return OrigOLvl;
-}
-
//!--------------------------------------------------------------------------!//
// JIT Memory manager
//!--------------------------------------------------------------------------!//
@@ -506,9 +488,6 @@ llvmCodeGen(
break;
};
- // If there is a very big function, lower the optimization level.
- OLvl = AdjustCGOptLevel(mod, OLvl);
-
// Adjust the triple to match (if known), otherwise stick with the
// module/host triple.
Triple::ArchType Type = Triple::getArchTypeForLLVMName(MArch);