diff options
author | Connor Abbott <[email protected]> | 2019-06-04 13:02:31 +0200 |
---|---|---|
committer | Connor Abbott <[email protected]> | 2019-06-19 14:08:28 +0200 |
commit | a1c737927c0d96f26ce487930aa9a2ed323814c9 (patch) | |
tree | e5a1de6ef6eaf87e9c51d317a45ec8c2353b87b7 /src/compiler/nir/nir_instr_set.c | |
parent | 6fc83c253f5b6eacf9497558173c1b01262facb9 (diff) |
nir: Add a helper to determine if an intrinsic can be reordered
This is simple now, but we're going to be adding a few more conditions
to this later.
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_instr_set.c')
-rw-r--r-- | src/compiler/nir/nir_instr_set.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/compiler/nir/nir_instr_set.c b/src/compiler/nir/nir_instr_set.c index 1a6a7ab7743..7707b83f489 100644 --- a/src/compiler/nir/nir_instr_set.c +++ b/src/compiler/nir/nir_instr_set.c @@ -756,12 +756,8 @@ instr_can_rewrite(nir_instr *instr) case nir_instr_type_load_const: case nir_instr_type_phi: return true; - case nir_instr_type_intrinsic: { - const nir_intrinsic_info *info = - &nir_intrinsic_infos[nir_instr_as_intrinsic(instr)->intrinsic]; - return (info->flags & NIR_INTRINSIC_CAN_ELIMINATE) && - (info->flags & NIR_INTRINSIC_CAN_REORDER); - } + case nir_instr_type_intrinsic: + return nir_intrinsic_can_reorder(nir_instr_as_intrinsic(instr)); case nir_instr_type_call: case nir_instr_type_jump: case nir_instr_type_ssa_undef: |