File: codegenprepare-splitstore.ll

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8~deb9u3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 733,456 kB
  • sloc: cpp: 3,776,651; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; ruby: 156
file content (22 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
; Test that CodeGenPrepare respects endianness when splitting a store.
;
; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -force-split-store < %s  | FileCheck %s

define void @fun(i16* %Src, i16* %Dst) {
; CHECK-LABEL: # %bb.0:
; CHECK:       lh   %r0, 0(%r2)
; CHECK-NEXT:  stc  %r0, 1(%r3)
; CHECK-NEXT:  srl  %r0, 8
; CHECK-NEXT:  stc  %r0, 0(%r3)
; CHECK-NEXT:  br   %r14
  %1 = load i16, i16* %Src
  %2 = trunc i16 %1 to i8
  %3 = lshr i16 %1, 8
  %4 = trunc i16 %3 to i8
  %5 = zext i8 %2 to i16
  %6 = zext i8 %4 to i16
  %7 = shl nuw i16 %6, 8
  %8 = or i16 %7, %5
  store i16 %8, i16* %Dst
  ret void
}