Documentation
¶
Index ¶
- Constants
- func AnalyzeSCEV(info *LoopInfo)
- func CountLoops(loops []*Loop) int
- func FormatSCEV(s SCEV, r Renamer, label func(*SCEVAddRec) string) string
- type IVType
- type InductionVariable
- type Loop
- type LoopInfo
- type Renamer
- type SCEV
- type SCEVAddRec
- func (s *SCEVAddRec) EvaluateAt(k *big.Int, cache map[SCEV]*big.Int) *big.Int
- func (s *SCEVAddRec) IsLoopInvariant(loop *Loop) bool
- func (s *SCEVAddRec) Name() string
- func (s *SCEVAddRec) Parent() *ssa.Function
- func (s *SCEVAddRec) Pos() token.Pos
- func (s *SCEVAddRec) Referrers() *[]ssa.Instruction
- func (s *SCEVAddRec) String() string
- func (s *SCEVAddRec) StringWithRenamer(r Renamer) string
- func (s *SCEVAddRec) Type() types.Type
- type SCEVConstant
- func (s *SCEVConstant) EvaluateAt(k *big.Int, cache map[SCEV]*big.Int) *big.Int
- func (s *SCEVConstant) IsLoopInvariant(loop *Loop) bool
- func (s *SCEVConstant) Name() string
- func (s *SCEVConstant) Parent() *ssa.Function
- func (s *SCEVConstant) Pos() token.Pos
- func (s *SCEVConstant) Referrers() *[]ssa.Instruction
- func (s *SCEVConstant) String() string
- func (s *SCEVConstant) StringWithRenamer(r Renamer) string
- func (s *SCEVConstant) Type() types.Type
- type SCEVGenericExpr
- func (s *SCEVGenericExpr) EvaluateAt(k *big.Int, cache map[SCEV]*big.Int) *big.Int
- func (s *SCEVGenericExpr) IsLoopInvariant(loop *Loop) bool
- func (s *SCEVGenericExpr) Name() string
- func (s *SCEVGenericExpr) Parent() *ssa.Function
- func (s *SCEVGenericExpr) Pos() token.Pos
- func (s *SCEVGenericExpr) Referrers() *[]ssa.Instruction
- func (s *SCEVGenericExpr) String() string
- func (s *SCEVGenericExpr) StringWithRenamer(r Renamer) string
- func (s *SCEVGenericExpr) Type() types.Type
- type SCEVMax
- func (s *SCEVMax) EvaluateAt(k *big.Int, cache map[SCEV]*big.Int) *big.Int
- func (s *SCEVMax) IsLoopInvariant(loop *Loop) bool
- func (s *SCEVMax) Name() string
- func (s *SCEVMax) Parent() *ssa.Function
- func (s *SCEVMax) Pos() token.Pos
- func (s *SCEVMax) Referrers() *[]ssa.Instruction
- func (s *SCEVMax) String() string
- func (s *SCEVMax) StringWithRenamer(r Renamer) string
- func (s *SCEVMax) Type() types.Type
- type SCEVUnknown
- func (s *SCEVUnknown) EvaluateAt(k *big.Int, cache map[SCEV]*big.Int) *big.Int
- func (s *SCEVUnknown) IsLoopInvariant(loop *Loop) bool
- func (s *SCEVUnknown) Name() string
- func (s *SCEVUnknown) Parent() *ssa.Function
- func (s *SCEVUnknown) Pos() token.Pos
- func (s *SCEVUnknown) Referrers() *[]ssa.Instruction
- func (s *SCEVUnknown) String() string
- func (s *SCEVUnknown) StringWithRenamer(r Renamer) string
- func (s *SCEVUnknown) Type() types.Type
Constants ¶
View Source
const MaxSCEVDepth = 100
Variables ¶
This section is empty.
Functions ¶
func AnalyzeSCEV ¶
func AnalyzeSCEV(info *LoopInfo)
func CountLoops ¶
func FormatSCEV ¶
func FormatSCEV(s SCEV, r Renamer, label func(*SCEVAddRec) string) string
FormatSCEV renders s like StringWithRenamer, but passes every recurrence to label, whose result is appended to it. StringWithRenamer prints {start, +, step} alone, so the induction variables of two nested loops -- or the same recurrence in int8 and int64 -- render identically; label lets the caller attach the loop identity and type. A nil label behaves like StringWithRenamer. SCEV implementations other than this package's render through their own StringWithRenamer.
Types ¶
type InductionVariable ¶
type Loop ¶
type Loop struct {
Header *ssa.BasicBlock
// Latch is the source of the loop's first back edge in block order,
// which can be the header itself. A loop with several back edges (a
// continue in a for without a post statement) has more latches; Blocks
// holds the body of all of them.
Latch *ssa.BasicBlock
Blocks map[*ssa.BasicBlock]bool
Exits []*ssa.BasicBlock
Parent *Loop
Children []*Loop
Inductions map[*ssa.Phi]*InductionVariable
TripCount SCEV
SCEVCache map[ssa.Value]SCEV
}
type LoopInfo ¶
func DetectLoops ¶
type SCEV ¶
type SCEV interface {
ssa.Value
EvaluateAt(k *big.Int, cache map[SCEV]*big.Int) *big.Int
IsLoopInvariant(loop *Loop) bool
String() string
StringWithRenamer(r Renamer) string
}
func SCEVFromConst ¶
type SCEVAddRec ¶
type SCEVAddRec struct {
Start SCEV
Step SCEV
Loop *Loop
// IntType is the integer type the recurrence is evaluated in, when known.
// Wraparound makes {1, +, 8} in int8 and in int64 different sequences.
IntType types.Type
}
func (*SCEVAddRec) EvaluateAt ¶
func (*SCEVAddRec) IsLoopInvariant ¶
func (s *SCEVAddRec) IsLoopInvariant(loop *Loop) bool
func (*SCEVAddRec) Name ¶
func (s *SCEVAddRec) Name() string
func (*SCEVAddRec) Parent ¶
func (s *SCEVAddRec) Parent() *ssa.Function
func (*SCEVAddRec) Pos ¶
func (s *SCEVAddRec) Pos() token.Pos
func (*SCEVAddRec) Referrers ¶
func (s *SCEVAddRec) Referrers() *[]ssa.Instruction
func (*SCEVAddRec) String ¶
func (s *SCEVAddRec) String() string
func (*SCEVAddRec) StringWithRenamer ¶
func (s *SCEVAddRec) StringWithRenamer(r Renamer) string
func (*SCEVAddRec) Type ¶
func (s *SCEVAddRec) Type() types.Type
type SCEVConstant ¶
func (*SCEVConstant) EvaluateAt ¶
func (*SCEVConstant) IsLoopInvariant ¶
func (s *SCEVConstant) IsLoopInvariant(loop *Loop) bool
func (*SCEVConstant) Name ¶
func (s *SCEVConstant) Name() string
func (*SCEVConstant) Parent ¶
func (s *SCEVConstant) Parent() *ssa.Function
func (*SCEVConstant) Pos ¶
func (s *SCEVConstant) Pos() token.Pos
func (*SCEVConstant) Referrers ¶
func (s *SCEVConstant) Referrers() *[]ssa.Instruction
func (*SCEVConstant) String ¶
func (s *SCEVConstant) String() string
func (*SCEVConstant) StringWithRenamer ¶
func (s *SCEVConstant) StringWithRenamer(r Renamer) string
func (*SCEVConstant) Type ¶
func (s *SCEVConstant) Type() types.Type
type SCEVGenericExpr ¶
func (*SCEVGenericExpr) EvaluateAt ¶
func (*SCEVGenericExpr) IsLoopInvariant ¶
func (s *SCEVGenericExpr) IsLoopInvariant(loop *Loop) bool
func (*SCEVGenericExpr) Name ¶
func (s *SCEVGenericExpr) Name() string
func (*SCEVGenericExpr) Parent ¶
func (s *SCEVGenericExpr) Parent() *ssa.Function
func (*SCEVGenericExpr) Pos ¶
func (s *SCEVGenericExpr) Pos() token.Pos
func (*SCEVGenericExpr) Referrers ¶
func (s *SCEVGenericExpr) Referrers() *[]ssa.Instruction
func (*SCEVGenericExpr) String ¶
func (s *SCEVGenericExpr) String() string
func (*SCEVGenericExpr) StringWithRenamer ¶
func (s *SCEVGenericExpr) StringWithRenamer(r Renamer) string
func (*SCEVGenericExpr) Type ¶
func (s *SCEVGenericExpr) Type() types.Type
type SCEVMax ¶
func (*SCEVMax) EvaluateAt ¶
func (*SCEVMax) IsLoopInvariant ¶
func (*SCEVMax) Referrers ¶
func (s *SCEVMax) Referrers() *[]ssa.Instruction
func (*SCEVMax) StringWithRenamer ¶
type SCEVUnknown ¶
func (*SCEVUnknown) EvaluateAt ¶
func (*SCEVUnknown) IsLoopInvariant ¶
func (s *SCEVUnknown) IsLoopInvariant(loop *Loop) bool
func (*SCEVUnknown) Name ¶
func (s *SCEVUnknown) Name() string
func (*SCEVUnknown) Parent ¶
func (s *SCEVUnknown) Parent() *ssa.Function
func (*SCEVUnknown) Pos ¶
func (s *SCEVUnknown) Pos() token.Pos
func (*SCEVUnknown) Referrers ¶
func (s *SCEVUnknown) Referrers() *[]ssa.Instruction
func (*SCEVUnknown) String ¶
func (s *SCEVUnknown) String() string
func (*SCEVUnknown) StringWithRenamer ¶
func (s *SCEVUnknown) StringWithRenamer(r Renamer) string
func (*SCEVUnknown) Type ¶
func (s *SCEVUnknown) Type() types.Type
Click to show internal directories.
Click to hide internal directories.