Debian Codegraph @

llvm/test/CodeGen/PowerPC/ldst-align.ll

raw
1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \
3 ; RUN: -stop-after=finalize-isel -verify-machineinstrs | FileCheck %s
4 define i64 @load(ptr %p) {
5 ; CHECK-LABEL: name: load
6 ; CHECK: bb.0.entry:
7 ; CHECK: liveins: $x3
8 ; CHECK: [[COPY:%[0-9]+]]:g8rc_and_g8rc_nox0 = COPY $x3
9 ; CHECK: [[LD:%[0-9]+]]:g8rc = LD 24, [[COPY]] :: (load (s64) from %ir.arrayidx, align 2)
10 ; CHECK: $x3 = COPY [[LD]]
11 ; CHECK: BLR8 implicit $lr8, implicit $rm, implicit $x3
12 entry:
13 %arrayidx = getelementptr inbounds i64, ptr %p, i64 3
14 %0 = load i64, ptr %arrayidx, align 2
15 ret i64 %0
16 }
17
18 define void @store(ptr %p) {
19 ; CHECK-LABEL: name: store
20 ; CHECK: bb.0.entry:
21 ; CHECK: liveins: $x3
22 ; CHECK: [[COPY:%[0-9]+]]:g8rc_and_g8rc_nox0 = COPY $x3
23 ; CHECK: [[LI8_:%[0-9]+]]:g8rc = LI8 9
24 ; CHECK: STD killed [[LI8_]], 16, [[COPY]] :: (store (s64) into %ir.arrayidx, align 1)
25 ; CHECK: BLR8 implicit $lr8, implicit $rm
26 entry:
27 %arrayidx = getelementptr inbounds i64, ptr %p, i64 2
28 store i64 9, ptr %arrayidx, align 1
29 ret void
30 }
31
32 define void @store_aligned(ptr %p) {
33 ; CHECK-LABEL: name: store_aligned
34 ; CHECK: bb.0.entry:
35 ; CHECK: liveins: $x3
36 ; CHECK: [[COPY:%[0-9]+]]:g8rc_and_g8rc_nox0 = COPY $x3
37 ; CHECK: [[LI8_:%[0-9]+]]:g8rc = LI8 9
38 ; CHECK: STD killed [[LI8_]], 16, [[COPY]] :: (store (s64) into %ir.arrayidx, align 4)
39 ; CHECK: BLR8 implicit $lr8, implicit $rm
40 entry:
41 %arrayidx = getelementptr inbounds i64, ptr %p, i64 2
42 store i64 9, ptr %arrayidx, align 4
43 ret void
44 }