aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_cfg.cpp
Commit message (Collapse)AuthorAgeFilesLines
* i965/cfg: Document cur_* variables.Matt Turner2013-12-041-2/+5
| | | | Reviewed-by: Eric Anholt <[email protected]>
* i965/cfg: Remove ip & cur from brw_cfg.Matt Turner2013-12-041-17/+16
| | | | Reviewed-by: Eric Anholt <[email protected]>
* i965/cfg: Clean up cfg_t constructors.Matt Turner2013-12-041-12/+1
| | | | | | | parent_mem_ctx was unused since db47074a, so remove the two wrappers around create() and make create() the constructor. Reviewed-by: Eric Anholt <[email protected]>
* i965/cfg: Throw out confusing make_list method.Matt Turner2013-12-041-13/+7
| | | | | | | make_list is just a one-line wrapper and was confusingly called by NULL objects. E.g., cur_if == NULL; cur_if->make_list(mem_ctx). Reviewed-by: Eric Anholt <[email protected]>
* i965/cfg: Include only needed headers.Matt Turner2013-12-041-1/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* i965/cfg: Remove unnecessary endif_stack.Matt Turner2013-12-041-3/+1
| | | | | | Unnecessary since last commit. Reviewed-by: Eric Anholt <[email protected]>
* i965/cfg: Rework to make IF & ELSE blocks flow into ENDIF.Matt Turner2013-12-041-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we made the basic block following an ENDIF instruction a successor of the basic blocks ending with IF and ELSE. The PRM says that IF and ELSE instructions jump *to* the ENDIF, rather than over it. This should be immaterial to dataflow analysis, except for if, break, endif sequences: START B1 <-B0 <-B9 0x00000100: cmp.g.f0(8) null g15<8,8,1>F g4<0,1,0>F 0x00000110: (+f0) if(8) 0 0 null 0x00000000UD END B1 ->B2 ->B4 START B2 <-B1 break 0x00000120: break(8) 0 0 null 0D END B2 ->B10 START B3 0x00000130: endif(8) 2 null 0x00000002UD END B3 ->B4 The ENDIF block would have no parents, so dataflow analysis would generate incorrect results, preventing copy propagation from eliminating some instructions. This patch changes the CFG to make ENDIF start rather than end basic blocks, so that it can be the jump target of the IF and ELSE instructions. It helps three programs (including two fs8/fs16 pairs). total instructions in shared programs: 1561126 -> 1561060 (-0.00%) instructions in affected programs: 837 -> 771 (-7.89%) More importantly, it allows copy propagation to handle more cases. Disabling the register_coalesce() pass before this patch hurts 58 programs, while afterward it only hurts 11 programs. Reviewed-by: Eric Anholt <[email protected]>
* i965/cfg: Keep pointers to IF/ELSE/ENDIF instructions in the cfg.Matt Turner2013-12-041-3/+28
| | | | | | | Useful for finding the associated control flow instructions, given a block ending in one. Reviewed-by: Eric Anholt <[email protected]>
* i965/cfg: Add code to dump blocks and cfg.Matt Turner2013-12-041-0/+34
| | | | Reviewed-by: Eric Anholt <[email protected]>
* i965: Handle deallocation of some private ralloc contexts explicitly.Francisco Jerez2013-10-291-1/+1
| | | | | | | | | These ralloc contexts belong to a specific object and are being deallocated manually from the class destructor. Now that we've hooked up destructors to ralloc there's no reason for them to be children of any other context, and doing so might to lead to double frees under some circumstances. The class destructor has all the responsibility of freeing class memory resources now.
* i965: Initialize all member variables of cfg_t on construction.Francisco Jerez2013-10-011-0/+1
| | | | | | | | | | | | | The cfg_t object relies on the memory allocator zeroing out its contents before it's initialized, which is quite an unusual practice in the C++ world because it ties objects to some specific allocation scheme, and gives unpredictable results when an object is created with a different allocator -- Stack allocation, array allocation, or aggregation inside a different object are some of the useful possibilities that come to my mind. Initialize all fields from the constructor and stop using the zeroing allocator. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Initialize all member variables of bblock_t on construction.Francisco Jerez2013-10-011-1/+2
| | | | | | | | | | | | | | | The bblock_t object relies on the memory allocator zeroing out its contents before it's initialized, which is quite an unusual practice in the C++ world because it ties objects to some specific allocation scheme, and gives unpredictable results when an object is created with a different allocator -- Stack allocation, array allocation, or aggregation inside a different object are some of the useful possibilities that come to my mind. Initialize all fields from the constructor and stop using the zeroing allocator. v2: Use zero initialization for numeric types instead of default construction. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Make it possible to create a cfg_t without a backend_visitor.Kenneth Graunke2012-11-261-3/+14
| | | | | | | | | | All we really need is a memory context and the instruction list; passing a backend_visitor is just convenient at times. This will be necessary two patches from now. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Make the cfg reusable from the VS.Eric Anholt2012-10-171-10/+10
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Share the predicate field between FS and VS.Eric Anholt2012-10-171-2/+2
| | | | | | | Note that BRW_PREDICATE_NONE is 0 and BRW_PREDICATE_NORMAL is 1, so that's a lot like the true/false we had in the FS before. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Rename fs_cfg types to not mention fs.Eric Anholt2012-10-171-22/+22
| | | | | | | | fs_bblock_link -> bblock_link fs_bblock -> bblock_t (to avoid conflicting with all the fs_bblock *bblock) fs_cfg -> cfg_t (to avoid conflicting with all the fs_cfg *cfg) Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Move brw_fs_cfg.* to brw_cfg.*.Eric Anholt2012-10-171-0/+250
Reviewed-by: Kenneth Graunke <[email protected]>