[PATCH] D44515: [IRCE] Change min value safety check

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 15 05:58:58 PDT 2018


samparker created this revision.
samparker added reviewers: sanjoy, mkazantsev.

CanBeMin is currently used which will report true for any unknown values, but often a check is performed outside the loop which covers this situation:

  
  for (int i = 0; i < N; ++i)
    ...
  
  if (N > 0)
    for (int i = 0; i < N; ++i)
      ...


So I've add 'LoopGuardedAgainstMin' which reports whether the loop is guarded by a greater than the minimum check, which then allows loop with a variable count to be optimised. And also enable SGT to be converted to UGT, which has lead me to change one of the tests. Another one of the existing tests has been changed because I believe that the range metadata was preventing the test from performing as desired.


https://reviews.llvm.org/D44515

Files:
  lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
  test/Transforms/IRCE/eq_ne.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44515.138538.patch
Type: text/x-patch
Size: 5515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180315/5942ceec/attachment.bin>


More information about the llvm-commits mailing list