ifuzz/gen: speed up instruction deduplication

Takes 2.7s instead of 6.8s now.
This commit is contained in:
Dmitry Vyukov 2017-01-11 20:16:35 +01:00
parent b8e1000d66
commit 437a8a0b20

View File

@ -137,11 +137,11 @@ func main() {
var deduped []*ifuzz.Insn
nextInsn:
for i, insn := range insns {
for _, insn := range insns {
mod0 := insn.Mod
for j := 0; j < i; j++ {
insn1 := insns[j]
if insn.Mod == 3 && insn1.Mod == -3 || insn.Mod == -3 && insn1.Mod == 3 {
for j := len(deduped) - 1; j >= 0; j-- {
insn1 := deduped[j]
if insn.Mod == 3 && insn1.Mod == -3 || insn.Mod == -3 && insn1.Mod == 3 || insn1.Mod == -1 {
insn.Mod = insn1.Mod
}
if reflect.DeepEqual(insn, insn1) {