1 ; RUN: llc -mtriple=armv8-eabi -verify-machineinstrs %s -o /dev/null
3 ; This test ensures that Loop Strength Reduction will
4 ; not create an Add Reccurence Expression if not all
5 ; its operands are loop invariants.
7 define void @add_rec_expr() {
12 %c.0 = phi i32 [ 0, %entry ], [ %inc.0, %loop0 ]
13 %inc.0 = add nuw i32 %c.0, 1
14 br i1 undef, label %loop0, label %bb1
17 %mul.0 = mul i32 %c.0, %c.0
18 %gelptr.0 = getelementptr inbounds i16, i16* undef, i32 %mul.0
22 %inc.1 = phi i32 [ %inc.2, %bb4 ], [ 0, %bb1 ]
23 %mul.1 = mul i32 %inc.1, %c.0
27 %add.0 = add i32 undef, %mul.1
28 %gelptr.1 = getelementptr inbounds i16, i16* %gelptr.0, i32 %add.0
29 store i16 undef, i16* %gelptr.1, align 2
33 %inc.2 = add nuw i32 %inc.1, 1