brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 42e8d9f Raw
44 lines · python
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 %s3 4# There are 8 usable call-saved GPRs, two of which are needed for the base5# registers.  The first 160 bytes of the frame are needed for the ABI6# 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:8#9#    count == (4096 - 168) / 8 + 6 + 1 == 49810#11# Add in some extra room and check both %r15+4096 (the first out-of-range slot)12# and %r15+4104.13#14# CHECK: f1: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@PLT18# CHECK: lay [[REG:%r[0-5]]], 4096(%r15)19# CHECK: mvc {{[0-9]+}}(8,{{%r[0-9]+}}), 8([[REG]])20# CHECK: br %r1421 22from __future__ import print_function23 24count = 50025 26print("declare void @foo()")27print("")28print("define void @f1(i64 *%base0, i64 *%base1) {")29 30for 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))33    print("")34 35print("  call void @foo()")36print("")37 38for i in range(count):39    print("  store i64 %%val%d, i64 *%%ptr%d" % (i, i))40 41print("")42print("  ret void")43print("}")44