[PATCH] D49049: [LSR] If no Use is interesting, early return.

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 6 17:46:38 PDT 2018


timshen created this revision.
timshen added a reviewer: sanjoy.
Herald added subscribers: bixia, hiraditya, jlebar.

By looking at the callers of getUse(), we can see that even though
IVUsers may offer uses, but they may not be interesting to
LSR. It's possible that none of them is interesting.


https://reviews.llvm.org/D49049

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
@@ -5400,7 +5400,9 @@
   CollectFixupsAndInitialFormulae();
   CollectLoopInvariantFixupsAndFormulae();
 
-  assert(!Uses.empty() && "IVUsers reported at least one use");
+  if (Uses.empty())
+    return;
+
   LLVM_DEBUG(dbgs() << "LSR found " << Uses.size() << " uses:\n";
              print_uses(dbgs()));
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49049.154473.patch
Type: text/x-patch
Size: 544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180707/66b67c23/attachment.bin>


More information about the llvm-commits mailing list