[PATCH] D63686: [LFTR] Fix post-inc pointer IV with truncated exit count (PR41998)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 22 03:11:11 PDT 2019


nikic created this revision.
nikic added reviewers: reames, sanjoy.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

Fixes https://bugs.llvm.org/show_bug.cgi?id=41998. Usually when we have a truncated exit count we'll truncate the IV when comparing against the limit, in which case exit count overflow in post-inc form doesn't matter. However, for pointer IVs we don't do that, so we have to be careful about incrementing the IV in the wide type.

I'm fixing this by removing the IVCount variable (which was ExitCount or ExitCount+1) and replacing it with a UsePostInc flag, and then moving the actual limit adjustment to the individual cases (which are pointer IV where we add to the wide type, integer IV where we add to the narrow type and constant integer IV where we add to the wide type).


Repository:
  rL LLVM

https://reviews.llvm.org/D63686

Files:
  llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
  llvm/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
  llvm/test/Transforms/IndVarSimplify/lftr-pr41998.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63686.206116.patch
Type: text/x-patch
Size: 10977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190622/91b14038/attachment-0001.bin>


More information about the llvm-commits mailing list