1
2
3
4
5 package ssa
6
7
8 func lower(f *Func) {
9
10 applyRewrite(f, f.Config.lowerBlock, f.Config.lowerValue, removeDeadValues)
11 }
12
13
14 func checkLower(f *Func) {
15
16
17
18 for _, b := range f.Blocks {
19 for _, v := range b.Values {
20 if !opcodeTable[v.Op].generic {
21 continue
22 }
23 switch v.Op {
24 case OpSP, OpSB, OpInitMem, OpArg, OpArgIntReg, OpArgFloatReg, OpPhi, OpVarDef, OpVarKill, OpVarLive, OpKeepAlive, OpSelect0, OpSelect1, OpSelectN, OpConvert, OpInlMark:
25 continue
26 case OpMakeResult:
27 if b.Controls[0] == v {
28 continue
29 }
30 case OpGetG:
31 if f.Config.hasGReg {
32
33 continue
34 }
35 }
36 s := "not lowered: " + v.String() + ", " + v.Op.String() + " " + v.Type.SimpleString()
37
38 for _, a := range v.Args {
39 s += " " + a.Type.SimpleString()
40 }
41 f.Fatalf("%s", s)
42 }
43 }
44 }
45
View as plain text