[llvm-commits] [llvm] r139535 - in /llvm/trunk/test/Transforms/IndVarSimplify: addrec-gep.ll preserve-gep-loop-variant.ll preserve-gep-nested.ll preserve-gep-remainder.ll preserve-gep.ll

Andrew Trick atrick at apple.com
Mon Sep 12 13:26:34 PDT 2011


Author: atrick
Date: Mon Sep 12 15:26:34 2011
New Revision: 139535

URL: http://llvm.org/viewvc/llvm-project?rev=139535&view=rev
Log:
Conditionalize indvars tests that rely on SCEV expansion of geps,
which is relevant with canonical IVs. Anything else being checked by
these tests is already covered by early CSE.

Modified:
    llvm/trunk/test/Transforms/IndVarSimplify/addrec-gep.ll
    llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll
    llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-nested.ll
    llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll
    llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep.ll

Modified: llvm/trunk/test/Transforms/IndVarSimplify/addrec-gep.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/addrec-gep.ll?rev=139535&r1=139534&r2=139535&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/addrec-gep.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/addrec-gep.ll Mon Sep 12 15:26:34 2011
@@ -1,8 +1,8 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: grep getelementptr %t | count 1
-; RUN: grep {mul .*, 37}  %t | count 1
-; RUN: grep {add .*, 5203}  %t | count 1
-; RUN: not grep cast %t
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
+; CHECK: getelementptr
+; CHECK: mul {{.*}}, 37
+; CHECK: add {{.*}}, 5203
+; CHECK-NOT: cast
 
 ; This test tests several things. The load and store should use the
 ; same address instead of having it computed twice, and SCEVExpander should

Modified: llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll?rev=139535&r1=139534&r2=139535&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll Mon Sep 12 15:26:34 2011
@@ -1,7 +1,7 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: not grep inttoptr %t
-; RUN: not grep ptrtoint %t
-; RUN: grep scevgep %t
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
+; CHECK-NOT: {{inttoptr|ptrtoint}}
+; CHECK: scevgep
+; CHECK-NOT: {{inttoptr|ptrtoint}}
 target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128-n:32:64"
 
 ; Indvars shouldn't need inttoptr/ptrtoint to expand an address here.

Modified: llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-nested.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-nested.ll?rev=139535&r1=139534&r2=139535&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-nested.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-nested.ll Mon Sep 12 15:26:34 2011
@@ -1,15 +1,16 @@
-; RUN: opt < %s -indvars -S > %t
-; Exactly one getelementptr for each load+store.
-; RUN: grep getelementptr %t | count 6
-; Each getelementptr using %struct.Q* %s as a base and not i8*.
-; RUN: grep {getelementptr \[%\]struct\\.Q\\* \[%\]s,} %t | count 6
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
 ; No explicit integer multiplications!
-; RUN: not grep {= mul} %t
 ; No i8* arithmetic or pointer casting anywhere!
-; RUN: not grep {i8\\*} %t
-; RUN: not grep bitcast %t
-; RUN: not grep inttoptr %t
-; RUN: not grep ptrtoint %t
+; CHECK-NOT: = {{= mul|i8\*|bitcast|inttoptr|ptrtoint}}
+; Exactly one getelementptr for each load+store.
+; Each getelementptr using %struct.Q* %s as a base and not i8*.
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK: getelementptr %struct.Q* %s,
+; CHECK-NOT: = {{= mul|i8\*|bitcast|inttoptr|ptrtoint}}
 
 ; FIXME: This test should pass with or without TargetData. Until opt
 ; supports running tests without targetdata, just hardware this in.

Modified: llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll?rev=139535&r1=139534&r2=139535&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll Mon Sep 12 15:26:34 2011
@@ -1,5 +1,5 @@
-; RUN: opt < %s -indvars -S \
-; RUN:   | grep {\[%\]p.2.ip.1 = getelementptr \\\[3 x \\\[3 x double\\\]\\\]\\* \[%\]p, i64 2, i64 \[%\]tmp, i64 1}
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
+; CHECK: %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %tmp, i64 1
 target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128-n:32:64"
 
 ; Indvars shouldn't expand this to

Modified: llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep.ll?rev=139535&r1=139534&r2=139535&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep.ll Mon Sep 12 15:26:34 2011
@@ -1,7 +1,7 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: not grep ptrtoint %t
-; RUN: not grep inttoptr %t
-; RUN: grep getelementptr %t | count 1
+; RUN: opt < %s -indvars -S -enable-iv-rewrite | FileCheck %s
+; CHECK-NOT: {{ptrtoint|inttoptr}}
+; CHECK: getelementptr
+; CHECK-NOT: {{ptrtoint|inttoptr|getelementptr}}
 
 ; Indvars shouldn't leave getelementptrs expanded out as
 ; inttoptr+ptrtoint in its output in common cases.





More information about the llvm-commits mailing list