Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 77 for Deadcode (0.42 sec)

  1. src/cmd/vet/testdata/deadcode/deadcode.go

    // Copyright 2013 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // This file contains tests for the dead code checker.
    
    package deadcode
    
    func _() int {
    	print(1)
    	return 2
    	println() // ERROR "unreachable code"
    	return 3
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 20 15:46:42 UTC 2019
    - 320 bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ssa/deadcode.go

    			}
    		}
    	}
    
    	return
    }
    
    // deadcode removes dead code from f.
    func deadcode(f *Func) {
    	// deadcode after regalloc is forbidden for now. Regalloc
    	// doesn't quite generate legal SSA which will lead to some
    	// required moves being eliminated. See the comment at the
    	// top of regalloc.go for details.
    	if f.RegAlloc != nil {
    		f.Fatalf("deadcode after regalloc")
    	}
    
    	// Find reachable blocks.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 00:29:01 UTC 2023
    - 9.2K bytes
    - Viewed (0)
  3. src/cmd/link/internal/ld/deadcode.go

    		if exportsIdx != 0 {
    			relocs := d.ldr.Relocs(exportsIdx)
    			for i := 0; i < relocs.Count(); i++ {
    				d.mark(relocs.At(i).Sym(), 0)
    			}
    		}
    	}
    
    	if d.ctxt.Debugvlog > 1 {
    		d.ctxt.Logf("deadcode start names: %v\n", names)
    	}
    
    	for _, name := range names {
    		// Mark symbol as a data/ABI0 symbol.
    		d.mark(d.ldr.Lookup(name, 0), 0)
    		if abiInternalVer != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 14:52:41 UTC 2024
    - 19K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/compile.go

    	{name: "late lower", fn: lateLower, required: true},
    	{name: "lowered deadcode for cse", fn: deadcode}, // deadcode immediately before CSE avoids CSE making dead values live again
    	{name: "lowered cse", fn: cse},
    	{name: "elim unread autos", fn: elimUnreadAutos},
    	{name: "tighten tuple selectors", fn: tightenTupleSelectors, required: true},
    	{name: "lowered deadcode", fn: deadcode, required: true},
    	{name: "checkLower", fn: checkLower, required: true},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 14:55:18 UTC 2024
    - 18.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/ssa/deadcode_test.go

    			Exit("mem")),
    		// dead loop
    		Bloc("deadblock",
    			// dead value in dead block
    			Valu("deadval", OpConstBool, c.config.Types.Bool, 1, nil),
    			If("deadval", "deadblock", "exit")))
    
    	CheckFunc(fun.f)
    	Deadcode(fun.f)
    	CheckFunc(fun.f)
    
    	for _, b := range fun.f.Blocks {
    		if b == fun.blocks["deadblock"] {
    			t.Errorf("dead block not removed")
    		}
    		for _, v := range b.Values {
    			if v == fun.values["deadval"] {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 23:01:51 UTC 2017
    - 3.5K bytes
    - Viewed (0)
  6. src/cmd/link/internal/ld/testdata/deadcode/globalmap.go

    package main
    
    import "os"
    
    // Too small to trigger deadcode (currently)
    var small = map[string]int{"foo": 1}
    
    // Has side effects, which prevent deadcode
    var effect = map[string]int{"foo": os.Getpid()}
    
    // Large and side-effect free
    var large = map[string]int{
    	"11": 1, "12": 2, "13": 3, "14": 4, "15": 5, "16": 6, "17": 7, "18": 8, "19": 9, "110": 10,
    	"21": 1, "22": 2, "23": 3, "24": 4, "25": 5, "26": 6, "27": 7, "28": 8, "29": 9, "210": 10,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 06 20:56:47 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/ssa/nilcheck_test.go

    		Bloc("extra",
    			Goto("exit")),
    		Bloc("exit",
    			Exit("mem")))
    
    	CheckFunc(fun.f)
    	nilcheckelim(fun.f)
    
    	// clean up the removed nil check
    	fuse(fun.f, fuseTypePlain)
    	deadcode(fun.f)
    
    	CheckFunc(fun.f)
    	for _, b := range fun.f.Blocks {
    		if b == fun.blocks["secondCheck"] && isNilCheck(b) {
    			t.Errorf("secondCheck was not eliminated")
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 12.3K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssa/branchelim_test.go

    					Exit("retstore")))
    
    			CheckFunc(fun.f)
    			branchelim(fun.f)
    			CheckFunc(fun.f)
    			Deadcode(fun.f)
    			CheckFunc(fun.f)
    
    			if data.ok {
    
    				if len(fun.f.Blocks) != 1 {
    					t.Fatalf("expected 1 block after branchelim and deadcode; found %d", len(fun.f.Blocks))
    				}
    				if fun.values["phi"].Op != OpCondSelect {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 24 15:51:15 UTC 2018
    - 5.2K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/ssa/passbm_test.go

    func BenchmarkCSEPassBlock(b *testing.B)      { benchFnBlock(b, cse, genFunction) }
    func BenchmarkDeadcodePass(b *testing.B)      { benchFnPass(b, deadcode, blockCount, genFunction) }
    func BenchmarkDeadcodePassBlock(b *testing.B) { benchFnBlock(b, deadcode, genFunction) }
    
    func multi(f *Func) {
    	cse(f)
    	dse(f)
    	deadcode(f)
    }
    func BenchmarkMultiPass(b *testing.B)      { benchFnPass(b, multi, blockCount, genFunction) }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/ssa/export_test.go

    	"cmd/internal/obj"
    	"cmd/internal/obj/arm64"
    	"cmd/internal/obj/s390x"
    	"cmd/internal/obj/x86"
    	"cmd/internal/src"
    	"cmd/internal/sys"
    )
    
    var CheckFunc = checkFunc
    var Opt = opt
    var Deadcode = deadcode
    var Copyelim = copyelim
    
    var testCtxts = map[string]*obj.Link{
    	"amd64": obj.Linknew(&x86.Linkamd64),
    	"s390x": obj.Linknew(&s390x.Links390x),
    	"arm64": obj.Linknew(&arm64.Linkarm64),
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 21:19:39 UTC 2024
    - 3.2K bytes
    - Viewed (0)
Back to top