File: llvm.memset.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (40 lines) | stat: -rw-r--r-- 1,842 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -global-isel -mtriple=amdgcn-- -verify-machineinstrs -mem-intrinsic-expand-size=3 %s -o - | FileCheck -check-prefix=LOOP %s
; RUN: llc -global-isel -mtriple=amdgcn-- -verify-machineinstrs -mem-intrinsic-expand-size=5 %s -o - | FileCheck -check-prefix=UNROLL %s

declare void @llvm.memset.p1.i32(ptr addrspace(1), i8, i32, i1)

define amdgpu_cs void @memset_p1i8(ptr addrspace(1) %dst, i8 %val) {
; LOOP-LABEL: memset_p1i8:
; LOOP:       ; %bb.0: ; %loadstoreloop.preheader
; LOOP-NEXT:    s_mov_b64 s[4:5], 0
; LOOP-NEXT:    s_mov_b32 s2, 0
; LOOP-NEXT:    s_mov_b32 s3, 0xf000
; LOOP-NEXT:    s_mov_b64 s[0:1], 0
; LOOP-NEXT:    v_mov_b32_e32 v3, s4
; LOOP-NEXT:    v_mov_b32_e32 v4, s5
; LOOP-NEXT:  .LBB0_1: ; %loadstoreloop
; LOOP-NEXT:    ; =>This Inner Loop Header: Depth=1
; LOOP-NEXT:    v_add_i32_e32 v5, vcc, v0, v3
; LOOP-NEXT:    v_addc_u32_e32 v6, vcc, v1, v4, vcc
; LOOP-NEXT:    v_add_i32_e32 v3, vcc, 1, v3
; LOOP-NEXT:    v_addc_u32_e32 v4, vcc, 0, v4, vcc
; LOOP-NEXT:    v_cmp_gt_u32_e32 vcc, 4, v3
; LOOP-NEXT:    buffer_store_byte v2, v[5:6], s[0:3], 0 addr64
; LOOP-NEXT:    s_cbranch_vccnz .LBB0_1
; LOOP-NEXT:  ; %bb.2: ; %split
; LOOP-NEXT:    s_endpgm
;
; UNROLL-LABEL: memset_p1i8:
; UNROLL:       ; %bb.0:
; UNROLL-NEXT:    s_mov_b32 s2, 0
; UNROLL-NEXT:    s_mov_b32 s3, 0xf000
; UNROLL-NEXT:    s_mov_b64 s[0:1], 0
; UNROLL-NEXT:    buffer_store_byte v2, v[0:1], s[0:3], 0 addr64
; UNROLL-NEXT:    buffer_store_byte v2, v[0:1], s[0:3], 0 addr64 offset:1
; UNROLL-NEXT:    buffer_store_byte v2, v[0:1], s[0:3], 0 addr64 offset:2
; UNROLL-NEXT:    buffer_store_byte v2, v[0:1], s[0:3], 0 addr64 offset:3
; UNROLL-NEXT:    s_endpgm
  call void @llvm.memset.p1.i32(ptr addrspace(1) %dst, i8 %val, i32 4, i1 false)
  ret void
}