[PATCH] D151403: [LoopPeel] Peel iterations based on and, or conditions
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 25 12:25:30 PDT 2023
nikic added a comment.
In D151403#4372790 <https://reviews.llvm.org/D151403#4372790>, @caojoshua wrote:
>> I believe we should explicitly *not* peel such cases. Peeling is an aggressive transform that trades code size for potential simplification opportunities. If the peeled comparison is not used as a branch or select condition, we likely will not get any worthwhile simplification out of it. There is not much value in making a function argument constant true/false, at least not at this pipeline position.
>>
>> If we did want to peel such cases, then the way to do that would be to forget about branches, selects, and/ors completely and simply peel all icmps.
>
> There is value in making an argument of a and/or constant, since it always folds the and/or in peeled loops. This would be similar to peeling select conditions. We won't necessarily eliminate any branches in the loop, but we can at least fold the select/and/or instruction.
Yes, we can fold away a single instruction. Is that worth duplicating the loop N times? I don't think so. Now, if we can fold the whole and/or tree to true/false and remove a branch based on that, that's going to be worthwhile...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151403/new/
https://reviews.llvm.org/D151403
More information about the llvm-commits
mailing list