Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for findIndVar (0.13 sec)

  1. test/fixedbugs/issue63955.go

    package j
    
    func f(try func() int, shouldInc func() bool, N func(int) int) {
    	var n int
    loop: // we want to have 3 preds here, the function entry and both gotos
    	if v := try(); v == 42 || v == 1337 { // the two || are to trick findIndVar
    		if n < 30 { // this aims to be the matched block
    			if shouldInc() {
    				n++
    				goto loop
    			}
    			n = N(n) // try to prevent some block joining
    			goto loop
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 07 17:37:47 UTC 2023
    - 578 bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ssa/loopbce.go

    		inc = nxt.Args[1]
    	} else if nxt.Args[1] == ind { // nxt = inc + ind
    		inc = nxt.Args[0]
    	} else {
    		panic("unreachable") // one of the cases must be true from the above.
    	}
    
    	return
    }
    
    // findIndVar finds induction variables in a function.
    //
    // Look for variables and blocks that satisfy the following
    //
    //	 loop:
    //	   ind = (Phi min nxt),
    //	   if ind < max
    //	     then goto enter_loop
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 07 17:37:47 UTC 2023
    - 11.8K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ssa/prove.go

    	}
    }
    
    // addLocalInductiveFacts adds inductive facts when visiting b, where
    // b is a join point in a loop. In contrast with findIndVar, this
    // depends on facts established for b, which is why it happens when
    // visiting b.
    //
    // TODO: It would be nice to combine this with findIndVar.
    func addLocalInductiveFacts(ft *factsTable, b *Block) {
    	// This looks for a specific pattern of induction:
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:30:21 UTC 2024
    - 48.9K bytes
    - Viewed (0)
  4. test/prove.go

    func constsuffix(s string) bool {
    	return suffix(s, "abc") // ERROR "Proved IsSliceInBounds$"
    }
    
    // oforuntil tests the pattern created by OFORUNTIL blocks. These are
    // handled by addLocalInductiveFacts rather than findIndVar.
    func oforuntil(b []int) {
    	i := 0
    	if len(b) > i {
    	top:
    		println(b[i]) // ERROR "Induction variable: limits \[0,\?\), increment 1$" "Proved IsInBounds$"
    		i++
    		if i < len(b) {
    			goto top
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 23 00:02:36 UTC 2024
    - 21.2K bytes
    - Viewed (0)
Back to top