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


C++ MachineBasicBlock::instr_rend方法代码示例

本文整理汇总了C++中MachineBasicBlock::instr_rend方法的典型用法代码示例。如果您正苦于以下问题:C++ MachineBasicBlock::instr_rend方法的具体用法?C++ MachineBasicBlock::instr_rend怎么用?C++ MachineBasicBlock::instr_rend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MachineBasicBlock的用法示例。


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

示例1: findDelayInstr

bool Filler::findDelayInstr(MachineBasicBlock &MBB,
                            MachineBasicBlock::instr_iterator Slot,
                            MachineBasicBlock::instr_iterator &Filler) {
  SmallSet<unsigned, 32> RegDefs;
  SmallSet<unsigned, 32> RegUses;

  insertDefsUses(Slot, RegDefs, RegUses);

  bool SawLoad = false;
  bool SawStore = false;

  for (MachineBasicBlock::reverse_instr_iterator I = ++Slot.getReverse();
       I != MBB.instr_rend(); ++I) {
    // skip debug value
    if (I->isDebugValue())
      continue;

    // Convert to forward iterator.
    MachineBasicBlock::instr_iterator FI = I.getReverse();

    if (I->hasUnmodeledSideEffects() || I->isInlineAsm() || I->isLabel() ||
        FI == LastFiller || I->isPseudo())
      break;

    if (delayHasHazard(FI, SawLoad, SawStore, RegDefs, RegUses)) {
      insertDefsUses(FI, RegDefs, RegUses);
      continue;
    }
    Filler = FI;
    return true;
  }
  return false;
}
开发者ID:bharadwajy,项目名称:checkedc-llvm,代码行数:33,代码来源:LanaiDelaySlotFiller.cpp

示例2: findDelayInstr

bool Filler::findDelayInstr(MachineBasicBlock &MBB,
                            InstrIter slot,
                            InstrIter &Filler) {
  SmallSet<unsigned, 32> RegDefs;
  SmallSet<unsigned, 32> RegUses;

  insertDefsUses(slot, RegDefs, RegUses);

  bool sawLoad = false;
  bool sawStore = false;

  for (ReverseInstrIter I(slot); I != MBB.instr_rend(); ++I) {
    // skip debug value
    if (I->isDebugValue())
      continue;


    // Convert to forward iterator.
    InstrIter FI(llvm::next(I).base());

    if (I->hasUnmodeledSideEffects()
        || I->isInlineAsm()
        || I->isLabel()
        || FI == LastFiller
        || I->isPseudo()
        //
        // Should not allow:
        // ERET, DERET or WAIT, PAUSE. Need to add these to instruction
        // list. TBD.
        )
      break;

    if (delayHasHazard(FI, sawLoad, sawStore, RegDefs, RegUses)) {
      insertDefsUses(FI, RegDefs, RegUses);
      continue;
    }

    Filler = FI;
    return true;
  }

  return false;
}
开发者ID:guoqingzhang,项目名称:llvm-coffee,代码行数:43,代码来源:CoffeeCLDelaySlotFiller.cpp


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