@@ -83,8 +83,6 @@ namespace {
8383 bool AllowNegativeSymPtrsForLoad = false ;
8484 bool AllowVector8LoadStore = false ;
8585
86- unsigned Limit = IGC_GET_FLAG_VALUE(MemOptWindowSize);
87-
8886 // Map of profit vector lengths per scalar type. Each entry specifies the
8987 // profit vector length of a given scalar type.
9088 // NOTE: Prepare the profit vector lengths in the *DESCENDING* order.
@@ -523,8 +521,6 @@ bool MemOpt::runOnFunction(Function& F) {
523521 CGC = getAnalysis<CodeGenContextWrapper>().getCodeGenContext ();
524522 TLI = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI ();
525523
526-
527-
528524 if (ProfitVectorLengths.empty ())
529525 buildProfitVectorLengths (F);
530526
@@ -641,6 +637,7 @@ bool MemOpt::removeRedBlockRead(GenIntrinsicInst* LeadingBlockRead,
641637 TrivialMemRefListTy& ToOpt, unsigned & sg_size)
642638{
643639 MemRefListTy::iterator MI = aMI;
640+ const unsigned Limit = IGC_GET_FLAG_VALUE (MemOptWindowSize);
644641 const unsigned windowEnd = Limit + MI->second ;
645642 auto ME = MemRefs.end ();
646643
@@ -1212,6 +1209,7 @@ bool MemOpt::mergeLoad(LoadInst* LeadingLoad,
12121209 // List of instructions need dependency check.
12131210 SmallVector<Instruction*, 8 > CheckList;
12141211
1212+ const unsigned Limit = IGC_GET_FLAG_VALUE (MemOptWindowSize);
12151213 // Given the Start position of the Window is MI->second,
12161214 // the End postion of the Window is "limit + Windows' start".
12171215 const unsigned windowEnd = Limit + MI->second ;
@@ -1565,6 +1563,7 @@ bool MemOpt::mergeStore(StoreInst* LeadingStore,
15651563 // List of instructions need dependency check.
15661564 SmallVector<Instruction*, 8 > CheckList;
15671565
1566+ const unsigned Limit = IGC_GET_FLAG_VALUE (MemOptWindowSize);
15681567 // Given the Start position of the Window is MI->second,
15691568 // the End postion of the Window is "limit + Windows' start".
15701569 const unsigned windowEnd = Limit + MI->second ;
0 commit comments