Skip to content

Commit 63cefea

Browse files
agrabezhigcbot
authored andcommitted
Changing default value for -unroll-partial-threshold LLVM option
Reducing default value for unroll-partial-threshold
1 parent 47ba614 commit 63cefea

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

IGC/AdaptorOCL/dllInterfaceCompute.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,20 @@ bool TranslateBuildSPMD(
11771177
llvm::cl::ParseCommandLineOptions(sizeof(args) / sizeof(args[0]), args);
11781178
}
11791179
}
1180+
// Reduce default unroll-partial-threshold value to 100.
1181+
// The aggressive partial unroll lead to performance issues due to increase
1182+
// of register pressure and code divergency. The reduced partial unroll
1183+
// threshold value fixes these performance defects.
1184+
llvm::StringRef partialUnrollFlag = "-unroll-partial-threshold=100";
1185+
auto partialUnrollSwitch = optionsMap.find(partialUnrollFlag.trim("-=100"));
1186+
if (partialUnrollSwitch != optionsMap.end())
1187+
{
1188+
if (partialUnrollSwitch->getValue()->getNumOccurrences() == 0)
1189+
{
1190+
const char* const args[] = { "igc", partialUnrollFlag.data() };
1191+
llvm::cl::ParseCommandLineOptions(sizeof(args) / sizeof(args[0]), args);
1192+
}
1193+
}
11801194
}
11811195

11821196
if (IGC_IS_FLAG_ENABLED(QualityMetricsEnable))

0 commit comments

Comments
 (0)