[llvm] r292060 - [PM] Clean up the testing for IVUsers, especially with the new PM.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 15 01:29:27 PST 2017


Author: chandlerc
Date: Sun Jan 15 03:29:27 2017
New Revision: 292060

URL: http://llvm.org/viewvc/llvm-project?rev=292060&view=rev
Log:
[PM] Clean up the testing for IVUsers, especially with the new PM.

First, I've moved a test of IVUsers from the LSR tree to a dedicated
IVUsers test directory. I've also simplified its RUN line now that the
new pass manager's loop PM is providing analyses on their own.

No functionality changed, but it makes subsequent changes cleaner.

Added:
    llvm/trunk/test/Analysis/IVUsers/
    llvm/trunk/test/Analysis/IVUsers/quadradic-exit-value.ll
      - copied, changed from r292058, llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll
Removed:
    llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll
Modified:
    llvm/trunk/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll
    llvm/trunk/test/Analysis/ScalarEvolution/2012-05-18-LoopPredRecurse.ll
    llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll

Copied: llvm/trunk/test/Analysis/IVUsers/quadradic-exit-value.ll (from r292058, llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/IVUsers/quadradic-exit-value.ll?p2=llvm/trunk/test/Analysis/IVUsers/quadradic-exit-value.ll&p1=llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll&r1=292058&r2=292060&rev=292060&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll (original)
+++ llvm/trunk/test/Analysis/IVUsers/quadradic-exit-value.ll Sun Jan 15 03:29:27 2017
@@ -1,5 +1,12 @@
+; This test ensures that IVUsers works correctly in the legacy pass manager
+; without LCSSA and in the specific ways that some of its users (LSR) require.
+;
+; FIXME: We need some way to match the precision here in the new PM where loop
+; passes *always* work on LCSSA. This should stop using a different set of
+; checks at that point.
+
 ; RUN: opt < %s -analyze -iv-users | FileCheck %s
-; RUN: opt -passes='function(require<scalar-evolution>,loop(print<ivusers>))' -S < %s 2>&1| FileCheck %s
+; RUN: opt < %s -disable-output -passes='print<ivusers>' 2>&1 | FileCheck %s
 
 ; Provide legal integer types.
 target datalayout = "n8:16:32:64"

Modified: llvm/trunk/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll?rev=292060&r1=292059&r2=292060&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll (original)
+++ llvm/trunk/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll Sun Jan 15 03:29:27 2017
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -analyze -iv-users
+; RUN: opt < %s -passes='print<ivusers>'
 ; PR9633: Tests that SCEV handles the mul.i2 recurrence being folded to
 ; constant zero.
 

Modified: llvm/trunk/test/Analysis/ScalarEvolution/2012-05-18-LoopPredRecurse.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2012-05-18-LoopPredRecurse.ll?rev=292060&r1=292059&r2=292060&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/2012-05-18-LoopPredRecurse.ll (original)
+++ llvm/trunk/test/Analysis/ScalarEvolution/2012-05-18-LoopPredRecurse.ll Sun Jan 15 03:29:27 2017
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -iv-users -S -disable-output
+; RUN: opt < %s -passes='require<ivusers>' -S -disable-output
 ;
 ; PR12868: Infinite recursion:
 ; getUDivExpr()->getZeroExtendExpr()->isLoopBackedgeGuardedBy()

Modified: llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll?rev=292060&r1=292059&r2=292060&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll (original)
+++ llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll Sun Jan 15 03:29:27 2017
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -iv-users
+; RUN: opt < %s -passes='require<ivusers>'
 ; PR4538
 
 ; ModuleID = 'bugpoint-reduced-simplified.bc'

Removed: llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll?rev=292059&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll (original)
+++ llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll (removed)
@@ -1,54 +0,0 @@
-; RUN: opt < %s -analyze -iv-users | FileCheck %s
-; RUN: opt -passes='function(require<scalar-evolution>,loop(print<ivusers>))' -S < %s 2>&1| FileCheck %s
-
-; Provide legal integer types.
-target datalayout = "n8:16:32:64"
-
-; The value of %r is dependent on a polynomial iteration expression.
-;
-; CHECK-LABEL: IV Users for loop %foo.loop
-; CHECK: {1,+,3,+,2}<%foo.loop>
-define i64 @foo(i64 %n) {
-entry:
-  br label %foo.loop
-
-foo.loop:
-  %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %foo.loop ]
-  %indvar.next = add i64 %indvar, 1
-  %c = icmp eq i64 %indvar.next, %n
-  br i1 %c, label %exit, label %foo.loop
-
-exit:
-  %r = mul i64 %indvar.next, %indvar.next
-  ret i64 %r
-}
-
-; PR15470: LSR miscompile. The test2 function should return '1'.
-;
-; SCEV does not know how to denormalize chained recurrences, so make
-; sure they aren't marked as post-inc users.
-;
-; CHECK-LABEL: IV Users for loop %test2.loop
-; CHECK: %sext.us = {0,+,(16777216 + (-16777216 * %sub.us))<nuw><nsw>,+,33554432}<%test2.loop> in %f = ashr i32 %sext.us, 24
-define i32 @test2() {
-entry:
-  br label %test2.loop
-
-test2.loop:
-  %inc1115.us = phi i32 [ 0, %entry ], [ %inc11.us, %test2.loop ]
-  %inc11.us = add nsw i32 %inc1115.us, 1
-  %cmp.us = icmp slt i32 %inc11.us, 2
-  br i1 %cmp.us, label %test2.loop, label %for.end
-
-for.end:
-  %tobool.us = icmp eq i32 %inc1115.us, 0
-  %sub.us = select i1 %tobool.us, i32 0, i32 0
-  %mul.us = shl i32 %inc1115.us, 24
-  %sub.cond.us = sub nsw i32 %inc1115.us, %sub.us
-  %sext.us = mul i32 %mul.us, %sub.cond.us
-  %f = ashr i32 %sext.us, 24
-  br label %exit
-
-exit:
-  ret i32 %f
-}




More information about the llvm-commits mailing list