[PATCH] D39230: [LoopUnrolling] Do not expand unsafe expressions in IndVarSimplify

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 04:50:18 PDT 2017


mkazantsev created this revision.

When using SCEVExpander, passes are obliged to make sure that what they request
to expand is safe in terms of expander. We are going to enforce this adding an assert
that it is safe to expand what we request.

This patch makes sure that we only expand what is safe to expand in IndVarSimplify,
in particular that we don't expand division by potential zero.


https://reviews.llvm.org/D39230

Files:
  lib/Transforms/Scalar/IndVarSimplify.cpp
  test/Transforms/IndVarSimplify/2017-10-24_unsafe_division.ll
  test/Transforms/IndVarSimplify/udiv.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39230.120043.patch
Type: text/x-patch
Size: 6303 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171024/e053f42f/attachment.bin>


More information about the llvm-commits mailing list