2019-01-14 18:55:55 +08:00
|
|
|
; RUN: llc -verify-machineinstrs -mtriple=arm64-apple-ios7.0 -frame-pointer=all -o - %s | FileCheck %s
|
2013-01-31 20:12:40 +08:00
|
|
|
|
|
|
|
; When generating DAG selection tables, TableGen used to only flag an
|
|
|
|
; instruction as needing a chain on its own account if it had a built-in pattern
|
|
|
|
; which used the chain. This meant that the AArch64 load/stores weren't
|
|
|
|
; recognised and so both loads from %locvar below were coalesced into a single
|
|
|
|
; LS8_LDR instruction (same operands other than the non-existent chain) and the
|
|
|
|
; increment was lost at return.
|
|
|
|
|
|
|
|
; This was obviously a Bad Thing.
|
|
|
|
|
|
|
|
declare void @bar(i8*)
|
|
|
|
|
|
|
|
define i64 @test_chains() {
|
2014-05-24 20:50:23 +08:00
|
|
|
; CHECK-LABEL: test_chains:
|
2013-01-31 20:12:40 +08:00
|
|
|
|
|
|
|
%locvar = alloca i8
|
|
|
|
|
|
|
|
call void @bar(i8* %locvar)
|
2014-04-16 19:53:07 +08:00
|
|
|
; CHECK: bl {{_?bar}}
|
2013-01-31 20:12:40 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%inc.1 = load i8, i8* %locvar
|
2013-01-31 20:12:40 +08:00
|
|
|
%inc.2 = zext i8 %inc.1 to i64
|
|
|
|
%inc.3 = add i64 %inc.2, 1
|
|
|
|
%inc.4 = trunc i64 %inc.3 to i8
|
|
|
|
store i8 %inc.4, i8* %locvar
|
2014-04-16 19:53:07 +08:00
|
|
|
|
2014-05-24 20:50:23 +08:00
|
|
|
; CHECK: ldurb {{w[0-9]+}}, [x29, [[LOCADDR:#-?[0-9]+]]]
|
2018-10-10 22:15:52 +08:00
|
|
|
; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, #1
|
2015-12-23 00:36:16 +08:00
|
|
|
; CHECK: sturb w[[STRVAL:[0-9]+]], [x29, [[LOCADDR]]]
|
2018-10-10 22:15:52 +08:00
|
|
|
; CHECK: and x0, x[[STRVAL]], #0xff
|
2013-01-31 20:12:40 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%ret.1 = load i8, i8* %locvar
|
2013-01-31 20:12:40 +08:00
|
|
|
%ret.2 = zext i8 %ret.1 to i64
|
|
|
|
ret i64 %ret.2
|
2014-05-24 20:50:23 +08:00
|
|
|
; CHECK: ret
|
2013-01-31 20:12:40 +08:00
|
|
|
}
|