2018-01-19 20:06:49 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=x86-64 -mattr=+rdpid | FileCheck %s --check-prefix=CHECK --check-prefix=GENERIC
|
2018-04-11 02:59:13 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=icelake-client | FileCheck %s --check-prefix=CHECK --check-prefix=ICELAKE
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=icelake-server | FileCheck %s --check-prefix=CHECK --check-prefix=ICELAKE
|
2018-01-19 20:06:49 +08:00
|
|
|
|
|
|
|
define i32 @test_rdpid() {
|
|
|
|
; GENERIC-LABEL: test_rdpid:
|
|
|
|
; GENERIC: # %bb.0:
|
|
|
|
; GENERIC-NEXT: rdpid %rax # sched: [100:0.33]
|
2018-02-01 06:04:26 +08:00
|
|
|
; GENERIC-NEXT: # kill: def $eax killed $eax killed $rax
|
2018-01-19 20:06:49 +08:00
|
|
|
; GENERIC-NEXT: retq # sched: [1:1.00]
|
|
|
|
;
|
|
|
|
; ICELAKE-LABEL: test_rdpid:
|
|
|
|
; ICELAKE: # %bb.0:
|
|
|
|
; ICELAKE-NEXT: rdpid %rax # sched: [100:0.25]
|
2018-02-01 06:04:26 +08:00
|
|
|
; ICELAKE-NEXT: # kill: def $eax killed $eax killed $rax
|
2018-01-19 20:06:49 +08:00
|
|
|
; ICELAKE-NEXT: retq # sched: [7:1.00]
|
|
|
|
%1 = tail call i32 @llvm.x86.rdpid()
|
|
|
|
ret i32 %1
|
|
|
|
}
|
|
|
|
declare i32 @llvm.x86.rdpid()
|