[PATCH] D90640: [LoopFlatten] Widen the IV

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 12:53:00 PST 2020


SjoerdMeijer created this revision.
SjoerdMeijer added reviewers: dmgreen, samparker, sanwou01, fhahn, ostannard.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
SjoerdMeijer requested review of this revision.

Widen the IV to the widest available and legal integer type, which makes this transformations always safe so that we can skip overflow checks.

Motivation is to let this pass trigger on 64-bit targets too, and this is the last patch in a serie to achieve this: D90402 <https://reviews.llvm.org/D90402> moves pass LoopFlatten to just before IndVarSimplify so that IVs are not already widened, D90421 <https://reviews.llvm.org/D90421> factors out widening from IndVarSimplify into LoopUtils so that we can also use it in LoopFlatten, and D90408 <https://reviews.llvm.org/D90408> is a refactoring in LoopFlatten to make it easier to reuse and rediscover loop components again after widening.


https://reviews.llvm.org/D90640

Files:
  llvm/include/llvm/Transforms/Utils/LoopUtils.h
  llvm/lib/Transforms/Scalar/LoopFlatten.cpp
  llvm/test/Transforms/LoopFlatten/widen-iv.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90640.302378.patch
Type: text/x-patch
Size: 19500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201102/8a49523b/attachment-0001.bin>


More information about the llvm-commits mailing list