diff options
author | Ian Romanick <[email protected]> | 2016-08-30 17:49:24 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-10-04 16:53:31 -0700 |
commit | 5854de99b2735988f1fd7c08f367b4a8e58b270e (patch) | |
tree | 9fad096d319b67ecbf067143fca87a21e0f3fd6e /src/compiler/glsl/lower_shared_reference.cpp | |
parent | c01f2bfc6c7abfbbb66b9d91a81b96518285ccf1 (diff) |
glsl: Track a unique intrinsic ID with each intrinsic function
text data bss dec hex filename
6037483 283160 28608 6349251 60e1c3 lib64/i965_dri.so before
6038043 283160 28608 6349811 60e3f3 lib64/i965_dri.so after
Signed-off-by: Ian Romanick <[email protected]>
Acked-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/compiler/glsl/lower_shared_reference.cpp')
-rw-r--r-- | src/compiler/glsl/lower_shared_reference.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/glsl/lower_shared_reference.cpp b/src/compiler/glsl/lower_shared_reference.cpp index 091f4027320..49ee3774c68 100644 --- a/src/compiler/glsl/lower_shared_reference.cpp +++ b/src/compiler/glsl/lower_shared_reference.cpp @@ -285,6 +285,7 @@ lower_shared_reference_visitor::shared_store(void *mem_ctx, assert(sig); sig->replace_parameters(&sig_params); sig->is_intrinsic = true; + sig->intrinsic_id = ir_intrinsic_shared_store; ir_function *f = new(mem_ctx) ir_function("__intrinsic_store_shared"); f->add_signature(sig); @@ -312,6 +313,7 @@ lower_shared_reference_visitor::shared_load(void *mem_ctx, assert(sig); sig->replace_parameters(&sig_params); sig->is_intrinsic = true; + sig->intrinsic_id = ir_intrinsic_shared_load; ir_function *f = new(mem_ctx) ir_function("__intrinsic_load_shared"); f->add_signature(sig); @@ -406,6 +408,10 @@ lower_shared_reference_visitor::lower_shared_atomic_intrinsic(ir_call *ir) sig->replace_parameters(&sig_params); sig->is_intrinsic = true; + assert(ir->callee->intrinsic_id >= ir_intrinsic_generic_load); + assert(ir->callee->intrinsic_id <= ir_intrinsic_generic_atomic_comp_swap); + sig->intrinsic_id = MAP_INTRINSIC_TO_TYPE(ir->callee->intrinsic_id, shared); + char func_name[64]; sprintf(func_name, "%s_shared", ir->callee_name()); ir_function *f = new(mem_ctx) ir_function(func_name); |