File: loadrri.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (66 lines) | stat: -rw-r--r-- 2,618 bytes parent folder | download | duplicates (7)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
; RUN: llc < %s -mtriple=ve | FileCheck %s

%struct.data = type { [4 x i8] }

;;; Check basic usage of rri format load instructions.
;;; Our target is DAG selection mechanism for LD1BSXrri.
;;; We prepared following three styles.
;;;   1. LD1BSXrri with %reg1 + %reg2
;;;   2. LD1BSXrri with %frame-index + %reg
;;;   3. LD1BSXrri with %reg + %frame-index

; Function Attrs: norecurse nounwind readonly
define signext i8 @func_rr(%struct.data* nocapture readonly %0, i32 signext %1) {
; CHECK-LABEL: func_rr:
; CHECK:       # %bb.0:
; CHECK-NEXT:    sll %s1, %s1, 2
; CHECK-NEXT:    ld1b.sx %s0, (%s1, %s0)
; CHECK-NEXT:    b.l.t (, %s10)
  %3 = sext i32 %1 to i64
  %4 = getelementptr inbounds %struct.data, %struct.data* %0, i64 %3, i32 0, i64 0
  %5 = load i8, i8* %4, align 1
  ret i8 %5
}

; Function Attrs: nounwind
define signext i8 @func_fr(%struct.data* readonly %0, i32 signext %1) {
; CHECK-LABEL: func_fr:
; CHECK:       .LBB{{[0-9]+}}_2:
; CHECK-NEXT:    sll %s1, %s1, 2
; CHECK-NEXT:    ldl.sx %s0, (%s1, %s0)
; CHECK-NEXT:    stl %s0, 8(%s1, %s11)
; CHECK-NEXT:    ld1b.sx %s0, 8(%s1, %s11)
; CHECK-NEXT:    adds.l %s11, 48, %s11
; CHECK-NEXT:    b.l.t (, %s10)
  %3 = alloca [10 x %struct.data], align 1
  %4 = getelementptr inbounds [10 x %struct.data], [10 x %struct.data]* %3, i64 0, i64 0, i32 0, i64 0
  call void @llvm.lifetime.start.p0i8(i64 40, i8* nonnull %4)
  %5 = sext i32 %1 to i64
  %6 = getelementptr inbounds [10 x %struct.data], [10 x %struct.data]* %3, i64 0, i64 %5, i32 0, i64 0
  %7 = getelementptr inbounds %struct.data, %struct.data* %0, i64 %5, i32 0, i64 0
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 %6, i8* align 1 %7, i64 4, i1 true)
  %8 = load volatile i8, i8* %6, align 1
  call void @llvm.lifetime.end.p0i8(i64 40, i8* nonnull %4)
  ret i8 %8
}

declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg)
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)

%"basic_string" = type { %union.anon.3, [23 x i8] }
%union.anon.3 = type { i8 }

define signext i8 @func_rf(i8* readonly %0, i64 %1, i32 signext %2) {
; CHECK-LABEL: func_rf:
; CHECK:       .LBB{{[0-9]+}}_2:
; CHECK-NEXT:    ld1b.sx %s0, 8(%s1, %s11)
; CHECK-NEXT:    adds.l %s11, 32, %s11
; CHECK-NEXT:    b.l.t (, %s10)
  %buf = alloca %"basic_string", align 8

  %sub631 = add nsw i64 %1, -1
  %add.ptr.i = getelementptr inbounds %"basic_string", %"basic_string"* %buf, i64 0, i32 1, i64 %sub631
  %ret = load i8, i8* %add.ptr.i, align 1
  ret i8 %ret
}