Add more comments explaining ghost instructions.
This commit is contained in:
committed by
Benjamin Bouvier
parent
26da67b394
commit
997424a4c5
@@ -166,6 +166,8 @@ impl<'a> Context<'a> {
|
||||
while let Some(inst) = self.cur.next_inst() {
|
||||
self.cur.use_srcloc(inst);
|
||||
if !self.cur.func.dfg[inst].opcode().is_ghost() {
|
||||
// This is an instruction which either has an encoding or carries ABI-related
|
||||
// register allocation constraints.
|
||||
let enc = self.cur.func.encodings[inst];
|
||||
let constraints = self.encinfo.operand_constraints(enc);
|
||||
if self.visit_inst(inst, constraints, tracker, &mut regs) {
|
||||
@@ -175,7 +177,7 @@ impl<'a> Context<'a> {
|
||||
self.cur.goto_inst(inst);
|
||||
}
|
||||
} else {
|
||||
// This is a ghost instruction with no encoding.
|
||||
// This is a ghost instruction with no encoding and no extra constraints.
|
||||
let (_throughs, kills) = tracker.process_ghost(inst);
|
||||
self.process_ghost_kills(kills, &mut regs);
|
||||
}
|
||||
|
||||
@@ -126,10 +126,14 @@ impl<'a> Context<'a> {
|
||||
// visit_ebb_header() places us at the first interesting instruction in the EBB.
|
||||
while let Some(inst) = self.cur.current_inst() {
|
||||
if !self.cur.func.dfg[inst].opcode().is_ghost() {
|
||||
// This instruction either has an encoding or has ABI constraints, so visit it to
|
||||
// insert spills and fills as needed.
|
||||
let encoding = self.cur.func.encodings[inst];
|
||||
self.visit_inst(ebb, inst, encoding, tracker);
|
||||
tracker.drop_dead(inst);
|
||||
} else {
|
||||
// This is a ghost instruction with no encoding and no extra constraints, so we can
|
||||
// just skip over it.
|
||||
self.cur.next_inst();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user