1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -passes=indvars -S < %s | FileCheck %s
4 target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9"
5 target triple = "amdgcn--amdpal"
7 define void @f(ptr addrspace(7) %arg) {
8 ; CHECK-LABEL: define void @f
9 ; CHECK-SAME: (ptr addrspace(7) [[ARG:%.*]]) {
11 ; CHECK-NEXT: br label [[BB1:%.*]]
13 ; CHECK-NEXT: br i1 false, label [[BB2:%.*]], label [[BB1]]
15 ; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr addrspace(7) [[ARG]], i32 8
16 ; CHECK-NEXT: br label [[BB3:%.*]]
18 ; CHECK-NEXT: [[I4:%.*]] = load i32, ptr addrspace(7) [[SCEVGEP]], align 4
19 ; CHECK-NEXT: br label [[BB3]]
24 %i = getelementptr i32, ptr addrspace(7) %arg, i32 2
25 br i1 false, label %bb2, label %bb1
29 %i4 = load i32, ptr addrspace(7) %i, align 4
33 define void @f2(<2 x ptr addrspace(7)> %arg) {
34 ; CHECK-LABEL: define void @f2
35 ; CHECK-SAME: (<2 x ptr addrspace(7)> [[ARG:%.*]]) {
37 ; CHECK-NEXT: br label [[BB1:%.*]]
39 ; CHECK-NEXT: [[P:%.*]] = extractelement <2 x ptr addrspace(7)> [[ARG]], i32 0
40 ; CHECK-NEXT: [[I:%.*]] = getelementptr i32, ptr addrspace(7) [[P]], i32 2
41 ; CHECK-NEXT: br i1 false, label [[BB2:%.*]], label [[BB1]]
43 ; CHECK-NEXT: [[I_LCSSA:%.*]] = phi ptr addrspace(7) [ [[I]], [[BB1]] ]
44 ; CHECK-NEXT: br label [[BB3:%.*]]
46 ; CHECK-NEXT: [[I4:%.*]] = load i32, ptr addrspace(7) [[I_LCSSA]], align 4
47 ; CHECK-NEXT: br label [[BB3]]
52 %p = extractelement <2 x ptr addrspace(7)> %arg, i32 0
53 %i = getelementptr i32, ptr addrspace(7) %p, i32 2
54 br i1 false, label %bb2, label %bb1
58 %i4 = load i32, ptr addrspace(7) %i, align 4