当前位置: 首页>>代码示例>>C++>>正文


C++ PassManagerBase类代码示例

本文整理汇总了C++中PassManagerBase的典型用法代码示例。如果您正苦于以下问题:C++ PassManagerBase类的具体用法?C++ PassManagerBase怎么用?C++ PassManagerBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PassManagerBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addAddDiscriminatorsPass

static void addAddDiscriminatorsPass(const PassManagerBuilder &Builder,
                                     PassManagerBase &PM) {
    PM.add(createAddDiscriminatorsPass());
}
开发者ID:NextGenIntelligence,项目名称:cheerp-clang,代码行数:4,代码来源:BackendUtil.cpp

示例2: addInstSelector

// Pass Pipeline Configuration
bool ARMTargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
  PM.add(createARMISelDag(*this));
  return false;
}
开发者ID:bratsche,项目名称:llvm,代码行数:5,代码来源:ARMTargetMachine.cpp

示例3: addCodeEmitter

bool MipsTargetMachine::addCodeEmitter(PassManagerBase &PM,
                                       JITCodeEmitter &JCE) {
  // Machine code emitter pass for Mips.
  PM.add(createMipsJITCodeEmitterPass(*this, JCE));
  return false;
}
开发者ID:Abocer,项目名称:android-4.2_r1,代码行数:6,代码来源:MipsTargetMachine.cpp

示例4:

bool MSP430TargetMachine::addPreEmitPass(PassManagerBase &PM,
                                         CodeGenOpt::Level OptLevel) {
  // Must run branch selection immediately preceding the asm printer.
  PM.add(createMSP430BranchSelectionPass());
  return false;
}
开发者ID:RCSL-HKUST,项目名称:heterosim,代码行数:6,代码来源:MSP430TargetMachine.cpp

示例5: addPreEmitPass

// Implemented by targets that want to run passes immediately before
// machine code is emitted. return true if -print-machineinstrs should
// print out the code after the passes.
bool MBlazeTargetMachine::addPreEmitPass(PassManagerBase &PM,
                                         CodeGenOpt::Level OptLevel) {
  PM.add(createMBlazeDelaySlotFillerPass(*this));
  return true;
}
开发者ID:Sciumo,项目名称:llvm,代码行数:8,代码来源:MBlazeTargetMachine.cpp

示例6: LLVMRustAddPass

extern "C" void
LLVMRustAddPass(LLVMPassManagerRef PM, Pass *pass) {
    assert(pass);
    PassManagerBase *pm = unwrap(PM);
    pm->add(pass);
}
开发者ID:1989tianlong,项目名称:rust,代码行数:6,代码来源:PassWrapper.cpp

示例7: addLTOOptimizationPasses

void PassManagerBuilder::addLTOOptimizationPasses(PassManagerBase &PM) {
  // Provide AliasAnalysis services for optimizations.
  addInitialAliasAnalysisPasses(PM);

  // Propagate constants at call sites into the functions they call.  This
  // opens opportunities for globalopt (and inlining) by substituting function
  // pointers passed as arguments to direct uses of functions.
  PM.add(createIPSCCPPass());

  // Now that we internalized some globals, see if we can hack on them!
  PM.add(createGlobalOptimizerPass());

  // Linking modules together can lead to duplicated global constants, only
  // keep one copy of each constant.
  PM.add(createConstantMergePass());

  // Remove unused arguments from functions.
  PM.add(createDeadArgEliminationPass());

  // Reduce the code after globalopt and ipsccp.  Both can open up significant
  // simplification opportunities, and both can propagate functions through
  // function pointers.  When this happens, we often have to resolve varargs
  // calls, etc, so let instcombine do this.
  PM.add(createInstructionCombiningPass());
  addExtensionsToPM(EP_Peephole, PM);

  // Inline small functions
  bool RunInliner = Inliner;
  if (RunInliner) {
    PM.add(Inliner);
    Inliner = nullptr;
  }

  PM.add(createPruneEHPass());   // Remove dead EH info.

  // Optimize globals again if we ran the inliner.
  if (RunInliner)
    PM.add(createGlobalOptimizerPass());
  PM.add(createGlobalDCEPass()); // Remove dead functions.

  // If we didn't decide to inline a function, check to see if we can
  // transform it to pass arguments by value instead of by reference.
  PM.add(createArgumentPromotionPass());

  // The IPO passes may leave cruft around.  Clean up after them.
  PM.add(createInstructionCombiningPass());
  addExtensionsToPM(EP_Peephole, PM);
  PM.add(createJumpThreadingPass());

  // Break up allocas
  if (UseNewSROA)
    PM.add(createSROAPass());
  else
    PM.add(createScalarReplAggregatesPass());

  // Run a few AA driven optimizations here and now, to cleanup the code.
  PM.add(createFunctionAttrsPass()); // Add nocapture.
  PM.add(createGlobalsModRefPass()); // IP alias analysis.

  PM.add(createLICMPass());                 // Hoist loop invariants.
  if (EnableMLSM)
    PM.add(createMergedLoadStoreMotionPass()); // Merge ld/st in diamonds.
  PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies.
  PM.add(createMemCpyOptPass());            // Remove dead memcpys.

  // Nuke dead stores.
  PM.add(createDeadStoreEliminationPass());

  // More loops are countable; try to optimize them.
  PM.add(createIndVarSimplifyPass());
  PM.add(createLoopDeletionPass());
  PM.add(createLoopVectorizePass(true, LoopVectorize));

  // More scalar chains could be vectorized due to more alias information
  if (RunSLPAfterLoopVectorization)
    if (SLPVectorize)
      PM.add(createSLPVectorizerPass()); // Vectorize parallel scalar chains.

  // After vectorization, assume intrinsics may tell us more about pointer
  // alignments.
  PM.add(createAlignmentFromAssumptionsPass());

  if (LoadCombine)
    PM.add(createLoadCombinePass());

  // Cleanup and simplify the code after the scalar optimizations.
  PM.add(createInstructionCombiningPass());
  addExtensionsToPM(EP_Peephole, PM);

  PM.add(createJumpThreadingPass());

  // Delete basic blocks, which optimization passes may have killed.
  PM.add(createCFGSimplificationPass());

  // Now that we have optimized the program, discard unreachable functions.
  PM.add(createGlobalDCEPass());

  // FIXME: this is profitable (for compiler time) to do at -O0 too, but
  // currently it damages debug info.
  if (MergeFunctions)
//.........这里部分代码省略.........
开发者ID:MessiahAndrw,项目名称:Perception,代码行数:101,代码来源:PassManagerBuilder.cpp

示例8: addPostRegAlloc

bool MipsTargetMachine::
addPostRegAlloc(PassManagerBase &PM) {
  PM.add(createMipsExpandPseudoPass(*this));
  return true;
}
开发者ID:CartBlanche,项目名称:llvm,代码行数:5,代码来源:MipsTargetMachine.cpp

示例9: addInstSelector

// Install an instruction selector pass using
// the ISelDag to gen Mips code.
bool MipsTargetMachine::
addInstSelector(PassManagerBase &PM)
{
  PM.add(createMipsISelDag(*this));
  return false;
}
开发者ID:CartBlanche,项目名称:llvm,代码行数:8,代码来源:MipsTargetMachine.cpp

示例10: addPostInlineCheerpPasses

static void addPostInlineCheerpPasses(const PassManagerBuilder &Builder,
                                      PassManagerBase &PM) {
    //Memory intrinsic on structs should be decomposed
    PM.add(createStructMemFuncLowering());
}
开发者ID:NextGenIntelligence,项目名称:cheerp-clang,代码行数:5,代码来源:BackendUtil.cpp

示例11: addPreEmitPass

// Implemented by targets that want to run passes immediately before
// machine code is emitted. return true if -print-machineinstrs should
// print out the code after the passes.
bool MipsTargetMachine::
addPreEmitPass(PassManagerBase &PM)
{
  PM.add(createMipsDelaySlotFillerPass(*this));
  return true;
}
开发者ID:CartBlanche,项目名称:llvm,代码行数:9,代码来源:MipsTargetMachine.cpp

示例12: addThreadSanitizerPass

static void addThreadSanitizerPass(const PassManagerBuilder &Builder,
                                   PassManagerBase &PM) {
    PM.add(createThreadSanitizerPass());
}
开发者ID:NextGenIntelligence,项目名称:cheerp-clang,代码行数:4,代码来源:BackendUtil.cpp

示例13: addAddressSanitizerPasses

static void addAddressSanitizerPasses(const PassManagerBuilder &Builder,
                                      PassManagerBase &PM) {
    PM.add(createAddressSanitizerFunctionPass());
    PM.add(createAddressSanitizerModulePass());
}
开发者ID:NextGenIntelligence,项目名称:cheerp-clang,代码行数:5,代码来源:BackendUtil.cpp

示例14: addBoundsCheckingPass

static void addBoundsCheckingPass(const PassManagerBuilder &Builder,
                                  PassManagerBase &PM) {
    PM.add(createBoundsCheckingPass());
}
开发者ID:NextGenIntelligence,项目名称:cheerp-clang,代码行数:4,代码来源:BackendUtil.cpp

示例15:

bool X86TargetMachine::addPostRegAlloc(PassManagerBase &PM,
                                       CodeGenOpt::Level OptLevel) {
  PM.add(createX86FloatingPointStackifierPass());
  return true;  // -print-machineinstr should print after this.
}
开发者ID:Killfrra,项目名称:llvm-kernel,代码行数:5,代码来源:X86TargetMachine.cpp


注:本文中的PassManagerBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。