Create live ranges for dead defs.
When the liveness pass implements dead code elimination, missing live ranges can be used to indicate unused values that it may be possible to remove. But even then, we may have to keep dead defs around if the instruction has side effects or other live defs.
This commit is contained in:
@@ -304,6 +304,13 @@ impl Liveness {
|
||||
// TODO: Resolve value aliases while we're visiting instructions?
|
||||
for ebb in func.layout.ebbs() {
|
||||
for inst in func.layout.ebb_insts(ebb) {
|
||||
// Make sure we have created live ranges for dead defs.
|
||||
// TODO: When we implement DCE, we can use the absence of a live range to indicate
|
||||
// an unused value.
|
||||
for def in func.dfg.inst_results(inst) {
|
||||
get_or_create(&mut self.ranges, def, func, recipe_constraints);
|
||||
}
|
||||
|
||||
// The instruction encoding is used to compute affinities.
|
||||
let recipe = func.encodings[inst].recipe();
|
||||
// Iterator of constraints, one per value operand.
|
||||
|
||||
Reference in New Issue
Block a user