2018-10-20 01:31:11 +08:00
|
|
|
; RUN: llc -march=hexagon < %s | FileCheck %s
|
2012-11-15 04:38:48 +08:00
|
|
|
|
|
|
|
; Check that post-increment load instructions are being generated.
|
2018-03-07 03:07:21 +08:00
|
|
|
; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}++#4)
|
2012-11-15 04:38:48 +08:00
|
|
|
|
2018-10-20 01:31:11 +08:00
|
|
|
define i32 @f0(i32* nocapture %a0, i16* nocapture %a1, i32 %a2) #0 {
|
|
|
|
b0:
|
|
|
|
br label %b1
|
2012-11-15 04:38:48 +08:00
|
|
|
|
2018-10-20 01:31:11 +08:00
|
|
|
b1: ; preds = %b1, %b0
|
|
|
|
%v0 = phi i32 [ %v11, %b1 ], [ 10, %b0 ]
|
|
|
|
%v1 = phi i32* [ %a0, %b0 ], [ %v9, %b1 ]
|
|
|
|
%v2 = phi i16* [ %a1, %b0 ], [ %v10, %b1 ]
|
|
|
|
%v3 = phi i32 [ 0, %b0 ], [ %v8, %b1 ]
|
|
|
|
%v4 = load i32, i32* %v1, align 4
|
|
|
|
%v5 = load i16, i16* %v2, align 2
|
|
|
|
%v6 = sext i16 %v5 to i32
|
|
|
|
%v7 = add i32 %v4, %v3
|
|
|
|
%v8 = add i32 %v7, %v6
|
|
|
|
%v9 = getelementptr i32, i32* %v1, i32 1
|
|
|
|
%v10 = getelementptr i16, i16* %v2, i32 1
|
|
|
|
%v11 = add i32 %v0, -1
|
|
|
|
%v12 = icmp eq i32 %v11, 0
|
|
|
|
br i1 %v12, label %b2, label %b1
|
2012-11-15 04:38:48 +08:00
|
|
|
|
2018-10-20 01:31:11 +08:00
|
|
|
b2: ; preds = %b1
|
|
|
|
ret i32 %v8
|
2012-11-15 04:38:48 +08:00
|
|
|
}
|
|
|
|
|
2018-10-20 01:31:11 +08:00
|
|
|
attributes #0 = { nounwind "target-cpu"="hexagonv5" }
|