HomeFreeBSD

module/zfs: simplify ddt_stat_add() loop

Description

module/zfs: simplify ddt_stat_add() loop

LLVM's Polly (ISL to be precise) is unhappy with the loop from
ddt_stat_add():

CC [M]  fs/zfs/zfs/ddt.o

../lib/External/isl/isl_schedule_node.c:2470: cannot insert node
between set or sequence node and its filter children

(building with the custom patch which adds Polly support to Kbuild)

The mentioned loop is rather suboptimal. All that we need is to just
treat ddt_stat_t as an array of u64 and perform 1:1 addition or
substraction. This can be done in simpler for-loop with the
determined index and bounds. Compiler will expand d_end - d into
a number of ddt_stat_t fields at compile time.
This prevents Polly from failing on this file.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Closes #12253

Details

Provenance
Alexander <solbjorn@users.noreply.github.com>Authored on Jun 29 2021, 2:26 PM
GitHub <noreply@github.com>Committed on Jun 29 2021, 2:26 PM
Parents
rG5b7053a9a5a6: Avoid 64bit division in multilist index functions
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG6a19dea7f68e: module/zfs: simplify ddt_stat_add() loop (authored by Alexander <solbjorn@users.noreply.github.com>).Jun 29 2021, 2:26 PM