[PATCH] D35107: Re-enable "[IndVars] Canonicalize comparisons between non-negative values and indvars"

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 23:18:54 PDT 2017


mkazantsev created this revision.

The patch was reverted due to a bug. The bug was that if the IV is the 2nd operand of the icmp
instruction, then the "Pred" variable gets swapped and differs from the instruction's predicate.
In this patch we use the original predicate to do the transformation.

Also added a test case that exercises this situation.


https://reviews.llvm.org/D35107

Files:
  lib/Transforms/Utils/SimplifyIndVar.cpp
  test/Analysis/ScalarEvolution/guards.ll
  test/Transforms/IndVarSimplify/canonicalize-cmp.ll
  test/Transforms/IndVarSimplify/eliminate-comparison.ll
  test/Transforms/IndVarSimplify/widen-loop-comp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35107.105588.patch
Type: text/x-patch
Size: 5841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170707/5f952648/attachment.bin>


More information about the llvm-commits mailing list