32 #include "tce_config.h"
41 #include <llvm/CodeGen/MachineFunction.h>
42 #include <llvm/IR/Function.h>
49 const llvm::MachineFunction& MF_) : MF(MF_), markersFound_(
false) {
51 for (MachineFunction::const_iterator i =
MF.begin();
53 for (MachineBasicBlock::const_iterator j = i->begin();
55 const llvm::MachineInstr& mi = *j;
69 const llvm::MachineInstr& start,
unsigned id) {
70 const llvm::MachineBasicBlock* mbb = start.getParent();
72 for (MachineBasicBlock::const_iterator i = &start;
75 const llvm::MachineInstr* mi = &*i;
80 if (mi->isCall() && !mi->isInlineAsm())
return;
83 std::cerr <<
"### PRA: propagating region id " <<
id <<
" to ";
88 for (MachineBasicBlock::const_succ_iterator i = mbb->succ_begin();
89 i != mbb->succ_end(); ++i) {
90 const llvm::MachineBasicBlock* child = *i;
91 const llvm::MachineInstr* first = &child->front();
109 for (MachineFunction::const_iterator i =
MF.begin();
110 i !=
MF.end(); i++) {
111 for (MachineBasicBlock::const_iterator j = i->begin();
112 j != i->end(); j++) {
113 const llvm::MachineInstr& mi = *j;
130 if (!I.isInlineAsm())
return false;
131 unsigned numDefs = 0;
132 while (I.getOperand(numDefs).isReg() &&
133 I.getOperand(numDefs).isDef())
135 TCEString opName = I.getOperand(numDefs).getSymbolName();
141 if (!I.isInlineAsm())
return false;
143 unsigned numDefs = 0;
144 while (I.getOperand(numDefs).isReg() &&
145 I.getOperand(numDefs).isDef())
147 TCEString opName = I.getOperand(numDefs).getSymbolName();
155 unsigned numDefs = 0;
156 while (I.getOperand(numDefs).isReg() &&
157 I.getOperand(numDefs).isDef())
160 TCEString opName = I.getOperand(numDefs).getSymbolName();