1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=hexagon -mcpu=hexagonv5 -enable-pipeliner -pipeliner-max-stages=2 < %s 2*9880d681SAndroid Build Coastguard Worker; REQUIRES: asserts 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker; This tests check that a dependence is created between a Phi and it's uses. 5*9880d681SAndroid Build Coastguard Worker; An assert occurs if the Phi dependences are not correct. 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Workerdefine void @test1(i32* %f2, i32 %nc) { 8*9880d681SAndroid Build Coastguard Workerentry: 9*9880d681SAndroid Build Coastguard Worker %i.011 = add i32 %nc, -1 10*9880d681SAndroid Build Coastguard Worker %cmp12 = icmp sgt i32 %i.011, 1 11*9880d681SAndroid Build Coastguard Worker br i1 %cmp12, label %for.body.preheader, label %for.end 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Workerfor.body.preheader: 14*9880d681SAndroid Build Coastguard Worker %0 = add i32 %nc, -2 15*9880d681SAndroid Build Coastguard Worker %scevgep = getelementptr i32, i32* %f2, i32 %0 16*9880d681SAndroid Build Coastguard Worker %sri = load i32, i32* %scevgep, align 4 17*9880d681SAndroid Build Coastguard Worker %scevgep15 = getelementptr i32, i32* %f2, i32 %i.011 18*9880d681SAndroid Build Coastguard Worker %sri16 = load i32, i32* %scevgep15, align 4 19*9880d681SAndroid Build Coastguard Worker br label %for.body 20*9880d681SAndroid Build Coastguard Worker 21*9880d681SAndroid Build Coastguard Workerfor.body: 22*9880d681SAndroid Build Coastguard Worker %i.014 = phi i32 [ %i.0, %for.body ], [ %i.011, %for.body.preheader ] 23*9880d681SAndroid Build Coastguard Worker %i.0.in13 = phi i32 [ %i.014, %for.body ], [ %nc, %for.body.preheader ] 24*9880d681SAndroid Build Coastguard Worker %sr = phi i32 [ %1, %for.body ], [ %sri, %for.body.preheader ] 25*9880d681SAndroid Build Coastguard Worker %sr17 = phi i32 [ %sr, %for.body ], [ %sri16, %for.body.preheader ] 26*9880d681SAndroid Build Coastguard Worker %arrayidx = getelementptr inbounds i32, i32* %f2, i32 %i.014 27*9880d681SAndroid Build Coastguard Worker %sub1 = add nsw i32 %i.0.in13, -3 28*9880d681SAndroid Build Coastguard Worker %arrayidx2 = getelementptr inbounds i32, i32* %f2, i32 %sub1 29*9880d681SAndroid Build Coastguard Worker %1 = load i32, i32* %arrayidx2, align 4 30*9880d681SAndroid Build Coastguard Worker %sub3 = sub nsw i32 %sr17, %1 31*9880d681SAndroid Build Coastguard Worker store i32 %sub3, i32* %arrayidx, align 4 32*9880d681SAndroid Build Coastguard Worker %i.0 = add nsw i32 %i.014, -1 33*9880d681SAndroid Build Coastguard Worker %cmp = icmp sgt i32 %i.0, 1 34*9880d681SAndroid Build Coastguard Worker br i1 %cmp, label %for.body, label %for.end.loopexit 35*9880d681SAndroid Build Coastguard Worker 36*9880d681SAndroid Build Coastguard Workerfor.end.loopexit: 37*9880d681SAndroid Build Coastguard Worker br label %for.end 38*9880d681SAndroid Build Coastguard Worker 39*9880d681SAndroid Build Coastguard Workerfor.end: 40*9880d681SAndroid Build Coastguard Worker ret void 41*9880d681SAndroid Build Coastguard Worker} 42*9880d681SAndroid Build Coastguard Worker 43