Conditionalize indvars tests that rely on SCEV expansion of geps,
authorAndrew Trick <atrick@apple.com>
Mon, 12 Sep 2011 20:26:34 +0000 (20:26 +0000)
committerAndrew Trick <atrick@apple.com>
Mon, 12 Sep 2011 20:26:34 +0000 (20:26 +0000)
which is relevant with canonical IVs. Anything else being checked by
these tests is already covered by early CSE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139535 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/IndVarSimplify/addrec-gep.ll
test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll
test/Transforms/IndVarSimplify/preserve-gep-nested.ll
test/Transforms/IndVarSimplify/preserve-gep-remainder.ll
test/Transforms/IndVarSimplify/preserve-gep.ll

index 58cba6057045de19c1c97bb33b7556c517a25d98..9e8b5289640cd3b3dc69bdd13a85a35d4d1a27f0 100644 (file)
@@ -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
index 26f05c4b1ee913ece18d8f5d2323ed940791fccb..66a1ab526f3b587484223c05a174b29dac37132a 100644 (file)
@@ -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.
index b41de5828a9ddc10ca5dea7514fd565ffc8d7dc5..613e30f7705b9ae13a4f53fb36d081d5cd10f744 100644 (file)
@@ -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.
index ca0c3999276024bee64a769bcfbcb541ab9b192d..a4b1d78b85d930c904c234e7b466612a73816cb1 100644 (file)
@@ -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
index 82eda0386e7fd0439c0cf853dda811e10b7cea73..f970826abc5c99b736ecf299c371d04878df9f94 100644 (file)
@@ -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.