[PATCH] D118808: Loop Strength Reduce - Optimize unused IVs to final values in the exit block with SCEV

Zaara Syeda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 2 09:21:11 PST 2022


syzaara created this revision.
syzaara added reviewers: bmahjour, Whitney.
syzaara added a project: LoopOptWG.
Herald added subscribers: javed.absar, hiraditya.
syzaara requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Loop strength reduce sometimes optimizes away all uses of an induction variable from a loop but leaves the IV increments. When the only remaining use of the IV is the PHI in the exit block, this patch will use SCEV to replace the exit block PHI with the final value of the IV to skip the updates in each loop iteration.


https://reviews.llvm.org/D118808

Files:
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
  llvm/test/Transforms/LoopStrengthReduce/remove_scev_indvars.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118808.405304.patch
Type: text/x-patch
Size: 4893 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220202/b00921db/attachment.bin>


More information about the llvm-commits mailing list