Skip to content

Commit b034329

Browse files
tmparkigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 3279638
Improve static analysis Improve static analysis
1 parent c7ba5a8 commit b034329

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,9 @@ bool EmitPass::runOnFunction(llvm::Function& F)
11501150
};
11511151

11521152
if (IGC_IS_FLAG_ENABLED(StaticProfileGuidedSpillCostAnalysis) &&
1153-
llvmInst->isTerminator() && hasBlockFreq(llvmInst)) {
1153+
llvmInst->isTerminator()) {
1154+
IGC_ASSERT(hasBlockFreq(
1155+
llvmInst)); // terminator should have freeq info
11541156
auto getFreqDigit = [&](Instruction *inst) {
11551157
MDNode *mn_digits =
11561158
llvmInst->getMetadata("stats.blockFrequency.digits");

IGC/common/igc_flags.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,9 @@ DECLARE_IGC_REGKEY(DWORD, ParameterForColdFuncThreshold, 80, "C/10-STD fo
648648
DECLARE_IGC_REGKEY(bool, ControlUnitSize, false, "Control compilation unit size by unit trimming", true)
649649
DECLARE_IGC_REGKEY(DWORD, ExpandedUnitSizeThreshold, 50000, "Trimming target of compilation unit size", true)
650650
DECLARE_IGC_REGKEY(DWORD, PrintControlUnitSize, 0, "Print information about unit trimming", true)
651-
DECLARE_IGC_REGKEY(bool, StaticProfileGuidedSpillCostAnalysis, true, "Use static profile information to estimate spill cost", true)
651+
DECLARE_IGC_REGKEY(bool, StaticProfileGuidedSpillCostAnalysis, false, "Use static profile information to estimate spill cost", true)
652652
DECLARE_IGC_REGKEY(DWORD, StaticProfileGuidedSpillCostAnalysisScale, 4, "Scale adjustment for static profile guided spill cost analysis", true)
653-
DECLARE_IGC_REGKEY(DWORD, StaticProfileGuidedSpillCostAnalysisFunc, 0, "Spill cost function where 0 is based on a new spill cost and 1 the existing one", true)
653+
DECLARE_IGC_REGKEY(DWORD, StaticProfileGuidedSpillCostAnalysisFunc, 2, "Normalization factor for too low frequency lower than C/1000", true)
654654
DECLARE_IGC_REGKEY(DWORD, PrintStaticProfileGuidedSpillCostAnalysis, 0, "Print debug messages for profile embedding", true)
655655
DECLARE_IGC_REGKEY(bool, EnableConstantPromotion, true, "Enable global constant data to register promotion", false)
656656
DECLARE_IGC_REGKEY(bool, AllowNonLoopConstantPromotion, false, "Allows promotion for constants not in loop (e.g. used once)", false)

visa/FrequencyInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ void FrequencyInfo::computeFreqSpillCosts(GlobalRA &gra,
299299
if (costFunc == 1) {
300300
metric = 2;
301301
// address or flag variables
302-
spillCost = std::sqrt((float)refFreqDouble) * refCount * refCount *
302+
spillCost = (float)std::sqrt(refFreqDouble) * refCount * refCount *
303303
byteSize * // 1.0f * refCount * refCount * byteSize *
304304
(float)sqrt(byteSize) /
305305
((float)sqrt(degree) * (float)(sqrt(sqrt(numRows))));

0 commit comments

Comments
 (0)