本文整理汇总了C++中machinebasicblock::const_instr_iterator::mayLoad方法的典型用法代码示例。如果您正苦于以下问题:C++ const_instr_iterator::mayLoad方法的具体用法?C++ const_instr_iterator::mayLoad怎么用?C++ const_instr_iterator::mayLoad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类machinebasicblock::const_instr_iterator
的用法示例。
在下文中一共展示了const_instr_iterator::mayLoad方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getMemType
PatmosII::MemType PatmosInstrInfo::getMemType(const MachineInstr *MI) const {
assert(MI->mayLoad() || MI->mayStore());
if (MI->isBundle()) {
// find mem instruction in bundle (does not need to be the first
// instruction, they might be sorted later!)
MachineBasicBlock::const_instr_iterator II = MI; ++II;
while (II->isInsideBundle() && !II->mayLoad() && !II->mayStore()) {
++II;
}
return getMemType(II);
}
// FIXME: Maybe there is a better way to get this info directly from
// the instruction definitions in the .td files
using namespace Patmos;
unsigned opc = MI->getOpcode();
switch (opc) {
case LWS: case LHS: case LBS: case LHUS: case LBUS:
case SWS: case SHS: case SBS:
return PatmosII::MEM_S;
case LWL: case LHL: case LBL: case LHUL: case LBUL:
case SWL: case SHL: case SBL:
return PatmosII::MEM_L;
case LWC: case LHC: case LBC: case LHUC: case LBUC:
case SWC: case SHC: case SBC:
return PatmosII::MEM_C;
case LWM: case LHM: case LBM: case LHUM: case LBUM:
case SWM: case SHM: case SBM:
return PatmosII::MEM_M;
default: llvm_unreachable("Unexpected memory access instruction!");
}
}