1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32I %s
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV64I %s
7 ; Verify that we lower @llvm.readsteadycounter() correctly.
9 declare i64 @llvm.readsteadycounter()
11 define i64 @test_builtin_readsteadycounter() nounwind {
12 ; RV32I-LABEL: test_builtin_readsteadycounter:
14 ; RV32I-NEXT: .LBB0_1: # =>This Inner Loop Header: Depth=1
15 ; RV32I-NEXT: rdtimeh a1
16 ; RV32I-NEXT: rdtime a0
17 ; RV32I-NEXT: rdtimeh a2
18 ; RV32I-NEXT: bne a1, a2, .LBB0_1
19 ; RV32I-NEXT: # %bb.2:
22 ; RV64I-LABEL: test_builtin_readsteadycounter:
24 ; RV64I-NEXT: rdtime a0
26 %1 = tail call i64 @llvm.readsteadycounter()