1 # Test cases where MVC is used for spill slots that end up being out of range.
2 # RUN: %python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
4 # There are 8 usable call-saved GPRs, two of which are needed for the base
5 # registers. The first 160 bytes of the frame are needed for the ABI
6 # call frame, and a further 8 bytes are needed for the emergency spill slot.
7 # That means we will have at least one out-of-range slot if:
9 # count == (4096 - 168) / 8 + 6 + 1 == 498
11 # Add in some extra room and check both %r15+4096 (the first out-of-range slot)
15 # CHECK: lay [[REG:%r[0-5]]], 4096(%r15)
16 # CHECK: mvc 0(8,[[REG]]), {{[0-9]+}}({{%r[0-9]+}})
17 # CHECK: brasl %r14, foo@PLT
18 # CHECK: lay [[REG:%r[0-5]]], 4096(%r15)
19 # CHECK: mvc {{[0-9]+}}(8,{{%r[0-9]+}}), 8([[REG]])
22 from __future__
import print_function
26 print("declare void @foo()")
28 print("define void @f1(i64 *%base0, i64 *%base1) {")
30 for i
in range(count
):
31 print(" %%ptr%d = getelementptr i64, i64 *%%base%d, i64 %d" % (i
, i
% 2, i
/ 2))
32 print(" %%val%d = load i64 , i64 *%%ptr%d" % (i
, i
))
35 print(" call void @foo()")
38 for i
in range(count
):
39 print(" store i64 %%val%d, i64 *%%ptr%d" % (i
, i
))