intel: Fixes -Werror,-Wbitwise-instead-of-logical for clang-15 in brw_nir_lower_shade...
authorYonggang Luo <luoyonggang@gmail.com>
Fri, 4 Nov 2022 11:26:45 +0000 (19:26 +0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 17 Nov 2022 23:17:40 +0000 (23:17 +0000)
error message:
error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19527>

src/intel/compiler/brw_nir_lower_shader_calls.c

index 5bcc1f1..9faccb6 100644 (file)
@@ -286,16 +286,16 @@ lower_shader_call_instr(struct nir_builder *b, nir_instr *instr, void *data)
 bool
 brw_nir_lower_shader_calls(nir_shader *shader, struct brw_bs_prog_key *key)
 {
-   return
-      nir_shader_instructions_pass(shader,
-                                   lower_shader_trace_ray_instr,
-                                   nir_metadata_none,
-                                   key) |
-      nir_shader_instructions_pass(shader,
-                                   lower_shader_call_instr,
-                                   nir_metadata_block_index |
-                                   nir_metadata_dominance,
-                                   NULL);
+   bool a = nir_shader_instructions_pass(shader,
+                                         lower_shader_trace_ray_instr,
+                                         nir_metadata_none,
+                                         key);
+   bool b = nir_shader_instructions_pass(shader,
+                                         lower_shader_call_instr,
+                                         nir_metadata_block_index |
+                                         nir_metadata_dominance,
+                                         NULL);
+   return a || b;
 }
 
 /** Creates a trivial return shader