1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/CodeGen/SystemZ/bswap-08.ll
Ulrich Weigand 461d4b06db [SystemZ] Fix truncstore + bswap codegen bug
SystemZTargetLowering::combineSTORE contains code to transform a
combination of STORE + BSWAP into a STRV type instruction.

This transformation is correct for regular stores, but not for
truncating stores.  The routine neglected to check for that case.

Fixes a miscompilation of llvm-objcopy with clang, which caused
test suite failures in the SystemZ multistage build bot.

llvm-svn: 313669
2017-09-19 20:50:05 +00:00

18 lines
390 B
LLVM

; Verify that truncating stores do not use STRV
;
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
declare i64 @llvm.bswap.i64(i64)
define void @f1(i32* %x, i64* %y) {
; CHECK-LABEL: f1:
; CHECK-NOT: strv
; CHECK: br %r14
%a = load i64, i64* %y, align 8
%b = tail call i64 @llvm.bswap.i64(i64 %a)
%conv = trunc i64 %b to i32
store i32 %conv, i32* %x, align 4
ret void
}