[PATCH] D26877: Minor fixes in Loop Strength Reduction

Evgeny Stupachenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 06:38:41 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0c4300fac7e0: Fix LSR best register search algorithm. (authored by evstupac).
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D26877?vs=78784&id=223554#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D26877/new/

https://reviews.llvm.org/D26877

Files:
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp


Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -4178,9 +4178,10 @@
     for (const SCEV *Reg : RegUses) {
       if (Taken.count(Reg))
         continue;
-      if (!Best)
+      if (!Best) {
         Best = Reg;
-      else {
+        BestNum = RegUses.getUsedByIndices(Reg).count();
+      } else {
         unsigned Count = RegUses.getUsedByIndices(Reg).count();
         if (Count > BestNum) {
           Best = Reg;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26877.223554.patch
Type: text/x-patch
Size: 610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191007/5ff94385/attachment.bin>


More information about the llvm-commits mailing list