[PATCH] IndVarSimplify does not check if loop invariant expansion can trap

David Majnemer david.majnemer at gmail.com
Tue Jun 4 04:22:05 PDT 2013


IndVarSimplify is willing to move divide instructions outside of their loop
bodies if they are invariant of the loop. However, it may not be safe to
expand them if we do not know if they can trap.

The attached patch checks to see if it is not safe to expand the
instruction and skips doing so if this would be the case.

This fixes PR16041.

Testcase by Rafael Ávila de Espíndola.

-- 
David Majnemer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130604/ac9239ee/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR16041.diff
Type: application/octet-stream
Size: 1548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130604/ac9239ee/attachment.obj>


More information about the llvm-commits mailing list