diff options
author | Jason Ekstrand <[email protected]> | 2019-06-20 16:29:30 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-07-10 00:20:59 +0000 |
commit | 6455fa9710614450ae659a28854d972330b58303 (patch) | |
tree | c06cdacbf86076072deef6a823e0b9d108bc7ab9 /src/compiler/nir/nir_loop_analyze.c | |
parent | 268ad47c1115be8a8444d8e0e40af71623f9d281 (diff) |
nir/loop_analyze: Use new eval_const_* helpers in test_iterations
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_loop_analyze.c')
-rw-r--r-- | src/compiler/nir/nir_loop_analyze.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c index 435a0f987ee..480ed791cfe 100644 --- a/src/compiler/nir/nir_loop_analyze.c +++ b/src/compiler/nir/nir_loop_analyze.c @@ -664,14 +664,12 @@ test_iterations(int32_t iter_int, nir_const_value *step, /* Multiple the iteration count we are testing by the number of times we * step the induction variable each iteration. */ - nir_const_value *mul_src[2] = { &iter_src, step }; - nir_const_value mul_result; - nir_eval_const_opcode(mul_op, &mul_result, 1, bit_size, mul_src); + nir_const_value mul_result = + eval_const_binop(mul_op, bit_size, iter_src, *step); /* Add the initial value to the accumulated induction variable total */ - nir_const_value *add_src[2] = { &mul_result, initial }; - nir_const_value add_result; - nir_eval_const_opcode(add_op, &add_result, 1, bit_size, add_src); + nir_const_value add_result = + eval_const_binop(add_op, bit_size, mul_result, *initial); nir_const_value *src[2]; src[limit_rhs ? 0 : 1] = &add_result; |