forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SystemZ] Add support for llvm.readcyclecounter
The llvm.readcyclecounter intrinsic can be implemented via the STORE CLOCK FAST (STCKF) instruction.
- Loading branch information
Showing
5 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc < %s -mtriple=s390x-ibm-linux | FileCheck %s | ||
|
||
; Verify that we correctly lower ISD::READCYCLECOUNTER. | ||
|
||
define i64 @test_builtin_readcyclecounter1() { | ||
; CHECK-LABEL: test_builtin_readcyclecounter1: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: aghi %r15, -168 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 328 | ||
; CHECK-NEXT: stckf 160(%r15) | ||
; CHECK-NEXT: lg %r2, 160(%r15) | ||
; CHECK-NEXT: aghi %r15, 168 | ||
; CHECK-NEXT: br %r14 | ||
%1 = tail call i64 @llvm.readcyclecounter() | ||
ret i64 %1 | ||
} | ||
|
||
define void @test_builtin_readcyclecounter2(ptr %ptr) { | ||
; CHECK-LABEL: test_builtin_readcyclecounter2: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: stckf 0(%r2) | ||
; CHECK-NEXT: br %r14 | ||
%1 = tail call i64 @llvm.readcyclecounter() | ||
store i64 %1, ptr %ptr | ||
ret void | ||
} |