func RequiredISAExtensions(fn *ir.Function) error {
	set := map[string]bool{}
	for _, i := range fn.Instructions() {
		for _, isa := range i.ISA {
			set[isa] = true
		}
	}
	if len(set) == 0 {
		return nil
	}
	for isa := range set {
		fn.ISA = append(fn.ISA, isa)
	}
	sort.Strings(fn.ISA)
	return nil
}
RequiredISAExtensions determines ISA extensions required for the given
function. Populates the ISA field.
package pass
import (
	"sort"
	"github.com/mmcloughlin/avo/ir"
)