[PATCH] D47974: [SimplifyIndVars] Ignore dead users

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 8 23:06:03 PDT 2018


mkazantsev created this revision.
mkazantsev added reviewers: reames, etherzhhb, greened, sanjoy.

IndVarSimplify sometimes makes transforms basing on users that are trivially dead. In particular,
if DCE wasn't run before it, there may be a dead `sext/zext` in loop that will trigger widening
transforms, however it makes no sense to do it.

This patch teaches IndVarsSimplify ignore the mist trivial cases of that.


https://reviews.llvm.org/D47974

Files:
  lib/Transforms/Utils/SimplifyIndVar.cpp
  test/Analysis/ScalarEvolution/2012-05-29-MulAddRec.ll
  test/Analysis/ScalarEvolution/guards.ll
  test/Transforms/IndVarSimplify/2011-09-10-widen-nsw.ll
  test/Transforms/IndVarSimplify/iv-widen.ll
  test/Transforms/IndVarSimplify/lftr-reuse.ll
  test/Transforms/IndVarSimplify/loop-invariant-conditions.ll
  test/Transforms/IndVarSimplify/no-iv-rewrite.ll
  test/Transforms/IndVarSimplify/pr25578.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47974.150608.patch
Type: text/x-patch
Size: 8106 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180609/fd65a593/attachment.bin>


More information about the llvm-commits mailing list