diff options
author | Eric Anholt <eric@anholt.net> | 2010-04-14 17:03:03 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-04-14 17:05:13 -0700 |
commit | 5ba94206083fcd678febd6cac0231f35c0f1b77a (patch) | |
tree | 79311ea6e69d971c8a8c34a7624da4a9f203b2c1 /ir_if_simplification.h | |
parent | 60be7626b829af7e1d07330b9a88468924ba350e (diff) |
Add an ir_if simplification pass.
This is relatively simple at the moment, recognizing only constant
values, and not (for example) values that are restricted to a range
that make the branching constant. However, it does remove 59 lines
from the printout of CorrectParse2.vert.
Diffstat (limited to 'ir_if_simplification.h')
-rw-r--r-- | ir_if_simplification.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ir_if_simplification.h b/ir_if_simplification.h new file mode 100644 index 0000000000..84b09ef0fd --- /dev/null +++ b/ir_if_simplification.h @@ -0,0 +1,31 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file ir_if_simplification.h + * + * Moves constant branches of if statements out to the surrounding + * instruction stream. + */ + +bool do_if_simplification(exec_list *instructions); |