1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

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.

llvm-svn: 139535
This commit is contained in:
Andrew Trick 2011-09-12 20:26:34 +00:00
parent 047d3de417
commit bf1bc9a077
5 changed files with 26 additions and 25 deletions

View 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

View 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.

View 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.

View 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

View 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.