Skip to content

Commit 3279638

Browse files
tmparkigcbot
authored andcommitted
Improve static analysis
Improve static analysis
1 parent c7383a5 commit 3279638

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

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

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

IGC/common/igc_flags.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,9 @@ DECLARE_IGC_REGKEY(DWORD, ParameterForColdFuncThreshold, 80, "C/10-STD fo
646646
DECLARE_IGC_REGKEY(bool, ControlUnitSize, false, "Control compilation unit size by unit trimming", true)
647647
DECLARE_IGC_REGKEY(DWORD, ExpandedUnitSizeThreshold, 50000, "Trimming target of compilation unit size", true)
648648
DECLARE_IGC_REGKEY(DWORD, PrintControlUnitSize, 0, "Print information about unit trimming", true)
649-
DECLARE_IGC_REGKEY(bool, StaticProfileGuidedSpillCostAnalysis, false, "Use static profile information to estimate spill cost", true)
649+
DECLARE_IGC_REGKEY(bool, StaticProfileGuidedSpillCostAnalysis, true, "Use static profile information to estimate spill cost", true)
650650
DECLARE_IGC_REGKEY(DWORD, StaticProfileGuidedSpillCostAnalysisScale, 4, "Scale adjustment for static profile guided spill cost analysis", true)
651-
DECLARE_IGC_REGKEY(DWORD, StaticProfileGuidedSpillCostAnalysisFunc, 2, "Normalization factor for too low frequency lower than C/1000", true)
651+
DECLARE_IGC_REGKEY(DWORD, StaticProfileGuidedSpillCostAnalysisFunc, 0, "Spill cost function where 0 is based on a new spill cost and 1 the existing one", true)
652652
DECLARE_IGC_REGKEY(DWORD, PrintStaticProfileGuidedSpillCostAnalysis, 0, "Print debug messages for profile embedding", true)
653653
DECLARE_IGC_REGKEY(bool, EnableConstantPromotion, true, "Enable global constant data to register promotion", false)
654654
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 = (float)std::sqrt(refFreqDouble) * refCount * refCount *
302+
spillCost = std::sqrt((float)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)