From 9e25d5d2ce0e123b7a5c2e192420656b8336628c Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Fri, 13 Jul 2018 23:40:00 +0000 Subject: [LSR] If no Use is interesting, early return. Summary: 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. Reviewers: sanjoy Subscribers: jlebar, hiraditya, bixia, llvm-commits Differential Revision: https://reviews.llvm.org/D49049 llvm-svn: 337072 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp') diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 03429e9698a..fa83b48210b 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -5400,7 +5400,9 @@ LSRInstance::LSRInstance(Loop *L, IVUsers &IU, ScalarEvolution &SE, 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())); -- cgit v1.2.3