diff options
author | Ian Romanick <[email protected]> | 2016-07-18 17:38:19 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-08-30 16:28:03 -0700 |
commit | aee9ab7de7079d849ed28519fe4e9de7e8eb96e0 (patch) | |
tree | 96859eaffe8957e3b8aa1b8106f05cc578fb4746 /src/compiler | |
parent | dd574be54c5b6769a6a1a7d939759dc25b6b97bd (diff) |
glsl: Replace most assertions with unreachable()
text data bss dec hex filename
7669233 277176 28624 7975033 79b079 i965_dri.so before generated code
7647081 277176 28624 7952881 7959f1 i965_dri.so before this commit
7669289 277176 28624 7975089 79b0b1 i965_dri.so with this commit
Looking at the generated assembly, it appears that some of changes made
in the generated code prevent some loops from being unrolled. Removing
the default cases (via unreachable()) allows these loops to unroll again.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/ir_expression_operation.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/compiler/glsl/ir_expression_operation.py b/src/compiler/glsl/ir_expression_operation.py index d5a06f864eb..43ba46e4086 100644 --- a/src/compiler/glsl/ir_expression_operation.py +++ b/src/compiler/glsl/ir_expression_operation.py @@ -103,7 +103,7 @@ constant_template_common = mako.template.Template("""\ break; % endfor default: - assert(0); + unreachable("invalid type"); } } break;""") @@ -134,7 +134,7 @@ constant_template_vector_scalar = mako.template.Template("""\ break; % endfor default: - assert(0); + unreachable("invalid type"); } } break;""") @@ -157,7 +157,7 @@ constant_template_mul = mako.template.Template("""\ break; % endfor default: - assert(0); + unreachable("invalid type"); } } } else { @@ -215,7 +215,7 @@ constant_template_horizontal = mako.template.Template("""\ break; % endfor default: - assert(0); + unreachable("invalid type"); } break;""") @@ -232,7 +232,7 @@ constant_template_vector_extract = mako.template.Template("""\ break; % endfor default: - assert(0); + unreachable("invalid type"); } break; }""") @@ -251,8 +251,7 @@ constant_template_vector_insert = mako.template.Template("""\ break; % endfor default: - assert(!"Should not get here."); - break; + unreachable("invalid type"); } break; }""") @@ -268,7 +267,7 @@ constant_template_vector = mako.template.Template("""\ break; % endfor default: - assert(0); + unreachable("invalid type"); } } break;""") @@ -292,7 +291,7 @@ constant_template_lrp = mako.template.Template("""\ break; % endfor default: - assert(0); + unreachable("invalid type"); } } break; @@ -311,7 +310,7 @@ constant_template_csel = mako.template.Template("""\ break; % endfor default: - assert(0); + unreachable("invalid type"); } } break;""") |