1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=s390x-ibm-linux | FileCheck %s
4 ; Verify that we correctly lower ISD::READCYCLECOUNTER.
6 define i64 @test_builtin_readcyclecounter1() {
7 ; CHECK-LABEL: test_builtin_readcyclecounter1:
9 ; CHECK-NEXT: aghi %r15, -168
10 ; CHECK-NEXT: .cfi_def_cfa_offset 328
11 ; CHECK-NEXT: stckf 160(%r15)
12 ; CHECK-NEXT: lg %r2, 160(%r15)
13 ; CHECK-NEXT: aghi %r15, 168
15 %1 = tail call i64 @llvm.readcyclecounter()
19 define void @test_builtin_readcyclecounter2(ptr %ptr) {
20 ; CHECK-LABEL: test_builtin_readcyclecounter2:
22 ; CHECK-NEXT: stckf 0(%r2)
24 %1 = tail call i64 @llvm.readcyclecounter()
25 store i64 %1, ptr %ptr