ir_optimization.h revision 8f2214f4892acb994d13531d555196bd8f242dad
16255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt/* 26255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * Copyright © 2010 Intel Corporation 36255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * 46255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * Permission is hereby granted, free of charge, to any person obtaining a 56255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * copy of this software and associated documentation files (the "Software"), 66255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * to deal in the Software without restriction, including without limitation 76255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * the rights to use, copy, modify, merge, publish, distribute, sublicense, 86255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * and/or sell copies of the Software, and to permit persons to whom the 96255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * Software is furnished to do so, subject to the following conditions: 106255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * 116255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * The above copyright notice and this permission notice (including the next 126255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * paragraph) shall be included in all copies or substantial portions of the 136255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * Software. 146255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * 156255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 166255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 176255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 186255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 196255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 206255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 216255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * DEALINGS IN THE SOFTWARE. 226255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt */ 236255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt 246255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt 256255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt/** 26832aad989e3d319a8aaac046aa49df25da134d82Eric Anholt * \file ir_optimization.h 276255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * 286255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt * Prototypes for optimization passes to be called by the compiler and drivers. 296255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt */ 306255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholt 31e591c4625cae63660c5000fbab366e40fe154ab0Luca Barbieribool do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iterations); 322f4fe151681a6f6afe1d452eece6cf4144f44e49Eric Anholt 33832aad989e3d319a8aaac046aa49df25da134d82Eric Anholtbool do_algebraic(exec_list *instructions); 34bdd9b1f3ffa2a195d983816adfeca20480256119Eric Anholtbool do_constant_folding(exec_list *instructions); 3565122e9e8038488e8c586eb609e434a90188de27Eric Anholtbool do_constant_variable(exec_list *instructions); 3665122e9e8038488e8c586eb609e434a90188de27Eric Anholtbool do_constant_variable_unlinked(exec_list *instructions); 37bdd9b1f3ffa2a195d983816adfeca20480256119Eric Anholtbool do_copy_propagation(exec_list *instructions); 388bebbeb7c5b26ec9166a4644a2c051238d18509bEric Anholtbool do_constant_propagation(exec_list *instructions); 3966d4c65ee2c311ea0c71c39a28456d0c11798d6bEric Anholtbool do_dead_code(exec_list *instructions); 406255a1f4c6425aa311c90e9dc7fca41c34e8dc2bEric Anholtbool do_dead_code_local(exec_list *instructions); 4166d4c65ee2c311ea0c71c39a28456d0c11798d6bEric Anholtbool do_dead_code_unlinked(exec_list *instructions); 422e853ca23c8670246dd4efcee0706f68097652f7Eric Anholtbool do_dead_functions(exec_list *instructions); 439a0e421983edc31371440c08687fa2bb2207924dEric Anholtbool do_div_to_mul_rcp(exec_list *instructions); 44bc4034b243975089c06c4415d4e26edaaaec7a46Eric Anholtbool do_explog_to_explog2(exec_list *instructions); 45bdd9b1f3ffa2a195d983816adfeca20480256119Eric Anholtbool do_function_inlining(exec_list *instructions); 463361cbac2a883818efeb2b3e27405eeefce60f63Luca Barbieribool do_lower_jumps(exec_list *instructions, bool pull_out_jumps = true, bool lower_sub_return = true, bool lower_main_return = false, bool lower_continue = false, bool lower_break = false); 47bdd9b1f3ffa2a195d983816adfeca20480256119Eric Anholtbool do_if_simplification(exec_list *instructions); 4829ce44ad2b8d37ea54923f1d1856b44ef26903e5Eric Anholtbool do_if_to_cond_assign(exec_list *instructions); 496d8a0a0aadaafbab02dffcf7f89eb0210dd37b2eEric Anholtbool do_mat_op_to_vec(exec_list *instructions); 508a1f186cc55979bb9df0a88b48da8d81460c3e7cEric Anholtbool do_mod_to_fract(exec_list *instructions); 518f8cdbfba43550d0b8985fb087961864e4cd92b6Eric Anholtbool do_noop_swizzle(exec_list *instructions); 527f7eaf0285d011f7cc7e1a63133184a50b24ecaaEric Anholtbool do_structure_splitting(exec_list *instructions); 535854d4583c6e8885185e12a0636f77489a62e24cEric Anholtbool do_sub_to_add_neg(exec_list *instructions); 5449a5d5c4f5bf6e8d6ba344e8496d1d1fa0b4586dEric Anholtbool do_swizzle_swizzle(exec_list *instructions); 55784695442c415cf0be882434a25671ecfb635d34Eric Anholtbool do_tree_grafting(exec_list *instructions); 56a36334be02cb0a2b834667116bfeb680bf365857Eric Anholtbool do_vec_index_to_cond_assign(exec_list *instructions); 57b145e903694fa932ab1e0d955e889555193ab604Eric Anholtbool do_vec_index_to_swizzle(exec_list *instructions); 58547131ac8750acabd030972fc768705c13d19ef7Ian Romanickbool lower_noise(exec_list *instructions); 598f2214f4892acb994d13531d555196bd8f242dadIan Romanickbool optimize_redundant_jumps(exec_list *instructions); 60