Optimizer: add InstructionRange.init(begin:,ends:) API

This commit is contained in:
Erik Eckstein
2024-12-09 19:50:53 +01:00
parent b4ba750481
commit 1fcfa11713

View File

@@ -59,6 +59,11 @@ struct InstructionRange : CustomStringConvertible, NoReflectionChildren {
self.inExclusiveRange.insert(beginInst)
}
init<S: Sequence>(begin beginInst: Instruction, ends: S, _ context: some Context) where S.Element: Instruction {
self = InstructionRange(begin: beginInst, context)
insert(contentsOf: ends)
}
init(for value: Value, _ context: some Context) {
self = InstructionRange(begin: InstructionRange.beginningInstruction(for: value), context)
}