[PATCH] D44983: [LoopUnroll] Only peel if a predicate becomes known in the loop body.

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 03:14:47 PDT 2018


mkazantsev added a comment.

I am not sure about the heuristic in general. This patch says that we peel out first `K` iterations if starting from `K + 1`th iteration the predicate becomes known false. But isn't in even more profitable to peel out `K+1`th iteration because the predicate that was trivially true on first iterations (and thus we could base optimizations on it) will be trivially false, and it will STILL allow you to base some optimizations on it.

I think a better approach would be to peel out another iteration if we know that `Pred` is true on it OR if we know that `Pred` is false. Either will allow us to simplify the peeled code. Please correct me if I'm wrong with my reasoning.

I am not sure what problem you are fighting in this patch.


https://reviews.llvm.org/D44983





More information about the llvm-commits mailing list