1 ; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s 2 3 ; Check that store is post-incremented. 4 ; CHECK: memuh(r{{[0-9]+}} + {{ *}}#6{{ *}}) 5 ; CHECK: combine(r{{[0-9]+}}{{ *}},{{ *}}r{{[0-9]+}}{{ *}}) 6 ; CHECK: vaddh 7 8 target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32" 9 target triple = "hexagon" 10 11 define void @matrix_add_const(i32 %N, i16* nocapture %A, i16 signext %val) #0 { 12 entry: 13 %cmp5 = icmp eq i32 %N, 0 14 br i1 %cmp5, label %for.end, label %polly.cond 15 16 for.end.loopexit: ; preds = %polly.stmt.for.body29 17 br label %for.end 18 19 for.end: ; preds = %for.end.loopexit, %polly.loop_header24.preheader, %entry 20 ret void 21 22 polly.cond: ; preds = %entry 23 %0 = icmp sgt i32 %N, 3 24 br i1 %0, label %polly.then, label %polly.loop_header24.preheader 25 26 polly.then: ; preds = %polly.cond 27 %1 = add i32 %N, -1 28 %leftover_lb = and i32 %1, -4 29 %2 = icmp sgt i32 %leftover_lb, 0 30 br i1 %2, label %polly.loop_body.lr.ph, label %polly.loop_header24.preheader 31 32 polly.loop_body.lr.ph: ; preds = %polly.then 33 %3 = insertelement <4 x i16> undef, i16 %val, i32 0 34 %4 = insertelement <4 x i16> %3, i16 %val, i32 1 35 %5 = insertelement <4 x i16> %4, i16 %val, i32 2 36 %6 = insertelement <4 x i16> %5, i16 %val, i32 3 37 br label %polly.loop_body 38 39 polly.loop_header24.preheader.loopexit: ; preds = %polly.loop_body 40 br label %polly.loop_header24.preheader 41 42 polly.loop_header24.preheader: ; preds = %polly.loop_header24.preheader.loopexit, %polly.then, %polly.cond 43 %polly.loopiv27.ph = phi i32 [ 0, %polly.cond ], [ %leftover_lb, %polly.then ], [ %leftover_lb, %polly.loop_header24.preheader.loopexit ] 44 %7 = icmp slt i32 %polly.loopiv27.ph, %N 45 br i1 %7, label %polly.stmt.for.body29.preheader, label %for.end 46 47 polly.stmt.for.body29.preheader: ; preds = %polly.loop_header24.preheader 48 br label %polly.stmt.for.body29 49 50 polly.loop_body: ; preds = %polly.loop_body.lr.ph, %polly.loop_body 51 %p_arrayidx.phi = phi i16* [ %A, %polly.loop_body.lr.ph ], [ %p_arrayidx.inc, %polly.loop_body ] 52 %polly.loopiv34 = phi i32 [ 0, %polly.loop_body.lr.ph ], [ %polly.next_loopiv, %polly.loop_body ] 53 %polly.next_loopiv = add nsw i32 %polly.loopiv34, 4 54 %vector_ptr = bitcast i16* %p_arrayidx.phi to <4 x i16>* 55 %_p_vec_full = load <4 x i16>, <4 x i16>* %vector_ptr, align 2 56 %addp_vec = add <4 x i16> %_p_vec_full, %6 57 store <4 x i16> %addp_vec, <4 x i16>* %vector_ptr, align 2 58 %8 = icmp slt i32 %polly.next_loopiv, %leftover_lb 59 %p_arrayidx.inc = getelementptr i16, i16* %p_arrayidx.phi, i32 4 60 br i1 %8, label %polly.loop_body, label %polly.loop_header24.preheader.loopexit 61 62 polly.stmt.for.body29: ; preds = %polly.stmt.for.body29.preheader, %polly.stmt.for.body29 63 %polly.loopiv2733 = phi i32 [ %polly.next_loopiv28, %polly.stmt.for.body29 ], [ %polly.loopiv27.ph, %polly.stmt.for.body29.preheader ] 64 %polly.next_loopiv28 = add nsw i32 %polly.loopiv2733, 1 65 %p_arrayidx30 = getelementptr i16, i16* %A, i32 %polly.loopiv2733 66 %_p_scalar_ = load i16, i16* %p_arrayidx30, align 2 67 %p_add = add i16 %_p_scalar_, %val 68 store i16 %p_add, i16* %p_arrayidx30, align 2 69 %exitcond = icmp eq i32 %polly.next_loopiv28, %N 70 br i1 %exitcond, label %for.end.loopexit, label %polly.stmt.for.body29 71 } 72 73 attributes #0 = { nounwind "fp-contract-model"="standard" "no-frame-pointer-elim-non-leaf" "realign-stack" "relocation-model"="static" "ssp-buffers-size"="8" } 74