[llvm-dev] canonical form loops

Sjoerd Meijer via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 26 13:56:18 PDT 2020


Quick question to see if I haven't missed anything: I would like convert counting down loops, i.e. loops with a constant -1 step value, to counting up loops, because the vectoriser is able to better deal with these loops (see e.g. D76838 that I was discussing today with Ayal). It looks like LoopSimplifyCFG and IndVarSimplify don't do this. So was just curious if I haven't missed anything here or in another pass I haven't yet considered. I was perhaps also expecting this to be the canonical form of loops, but couldn't find any evidence of that in [1] or in source-code.
The obvious follow-up question is if there would be any objections to adding this to e.g. LoopSimplifyCFG, and adding LoopSimplifyCFG to the optimisation pipeline just before the vectoriser.


[1] https://llvm.org/docs/LoopTerminology.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200326/ecc075e6/attachment.html>

More information about the llvm-dev mailing list