Dangeti Tharun kumar via llvm-dev
2019-Dec-14 14:23 UTC
[llvm-dev] reg getInductionVariable
Hi, The function getInductionVariable mandates the loop to be in "SimplifyForm". Loop::getInductionVariable(ScalarEvolution &SE) { if (!isLoopSimplifyForm()) return nullptr; ... ... } bool Loop::isLoopSimplifyForm() { return getLoopPreheader() && getLoopLatch() && hasDedicatedExits(); } /// Return true if no exit block for the loop has a predecessor that is /// outside the loop. bool hasDedicatedExits() const; Is it necessary for the loop to have *DedicatedExists *to find the induction variable? Can this condition be relaxed? -- Regards, DTharun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191214/dea94035/attachment.html>
On 12/14, Dangeti Tharun kumar via llvm-dev wrote:> The function getInductionVariable mandates the loop to be in "SimplifyForm". > > Is it necessary for the loop to have *DedicatedExists *to find the > induction variable? > Can this condition be relaxed?Potentially, but it is often simpler to force simplified form. If need dedicated exists, split the exiting edges of a loop. That will create dedicated exist blocks. Cheers, Johannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 228 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191214/d574f843/attachment.sig>