// There should be no critical edges at this point.
foreach (BasicBlock *bb, function->basicBlocks) {
- const int id = bb->statements.last()->id;
MoveMapping moves;
foreach (BasicBlock *successor, bb->out) {
foreach (Stmt *s, successor->statements) {
if (Phi *phi = s->asPhi()) {
moves.add(clone(phi->d->incoming[inIdx], function),
- clone(phi->targetTemp, function)->asTemp(), id);
+ clone(phi->targetTemp, function)->asTemp());
} else {
break;
}
return usages;
}
-void MoveMapping::add(Expr *from, Temp *to, int id) {
+void MoveMapping::add(Expr *from, Temp *to) {
if (Temp *t = from->asTemp()) {
if (overlappingStorage(*t, *to)) {
// assignments like fp1 = fp1 or var{&1} = double{&1} can safely be skipped.
}
}
- Move m(from, to, id);
+ Move m(from, to);
if (_moves.contains(m))
return;
_moves.append(m);
foreach (const Move &m, _moves) {
V4IR::Move *move = function->New<V4IR::Move>();
move->init(m.to, m.from);
- move->id = m.id;
move->swap = m.needsSwap;
bb->statements.insert(insertionPoint++, move);
}
struct Move {
Expr *from;
Temp *to;
- int id;
bool needsSwap;
- Move(Expr *from, Temp *to, int id)
- : from(from), to(to), id(id), needsSwap(false)
+ Move(Expr *from, Temp *to)
+ : from(from), to(to), needsSwap(false)
{}
bool operator==(const Move &other) const
static Moves sourceUsages(Expr *e, const Moves &moves);
public:
- void add(Expr *from, Temp *to, int id = 0);
+ void add(Expr *from, Temp *to);
void order();
void insertMoves(BasicBlock *bb, Function *function, bool atEnd) const;