Esempio n. 1
0
CodeExtractor::CodeExtractor(DominatorTree &DT, Loop &L, bool AggregateArgs,
                             BlockFrequencyInfo *BFI,
                             BranchProbabilityInfo *BPI)
    : DT(&DT), AggregateArgs(AggregateArgs || AggregateArgsOpt), BFI(BFI),
      BPI(BPI), AllowVarArgs(false),
      Blocks(buildExtractionBlockSet(L.getBlocks(), &DT,
                                     /* AllowVarArgs */ false)) {}
Esempio n. 2
0
RegionExtractor::RegionExtractor(DominatorTree &DT, Loop &L,
                                 std::string regionName, bool profileApp,
                                 bool pcere, bool AggregateArgs)
    : DT(&DT), AggregateArgs(AggregateArgs || AggregateArgsOpt), Separator("_"),
      LoopFileInfos(RegionsFile),
      Blocks(buildExtractionBlockSet(L.getBlocks())), NumExitBlocks(~0U),
      RegionName(regionName), ProfileApp(profileApp), Pcere(pcere) {

  if (regionName.empty())
    RegionName = "all";
}
Esempio n. 3
0
 // Visit all loads the loop L, and for those that, after complete loop
 // unrolling, would have a constant address and it will point to a known
 // constant initializer, record its base address for future use.  It is used
 // when we estimate number of potentially simplified instructions.
 void FindConstFoldableLoads() {
   for (auto BB : L->getBlocks()) {
     for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
       if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
         if (!LI->isSimple())
           continue;
         Value *AddrOp = LI->getPointerOperand();
         const SCEV *S = SE.getSCEV(AddrOp);
         FindConstantPointers Visitor(L, SE);
         SCEVTraversal<FindConstantPointers> T(Visitor);
         T.visitAll(S);
         if (Visitor.IndexIsConstant && Visitor.LoadCanBeConstantFolded) {
           LoadBaseAddresses[LI] = Visitor.BaseAddress;
         }
       }
     }
   }
 }
Esempio n. 4
0
CodeExtractor::CodeExtractor(DominatorTree &DT, Loop &L, bool AggregateArgs,
                             BlockFrequencyInfo *BFI,
                             BranchProbabilityInfo *BPI)
    : DT(&DT), AggregateArgs(AggregateArgs || AggregateArgsOpt), BFI(BFI),
      BPI(BPI), Blocks(buildExtractionBlockSet(L.getBlocks(), &DT)),
      NumExitBlocks(~0U) {}
Esempio n. 5
0
CodeExtractor::CodeExtractor(DominatorTree &DT, Loop &L, bool AggregateArgs)
  : DT(&DT), AggregateArgs(AggregateArgs||AggregateArgsOpt),
    Blocks(buildExtractionBlockSet(L.getBlocks())), NumExitBlocks(~0U) {}