1; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl --show-mc-encoding -verify-machineinstrs | FileCheck %s 2declare i32 @llvm.x86.rdpkru() 3declare void @llvm.x86.wrpkru(i32) 4 5define void @test_x86_wrpkru(i32 %src) { 6; CHECK-LABEL: test_x86_wrpkru: 7; CHECK: ## BB#0: 8; CHECK-NEXT: xorl %ecx, %ecx 9; CHECK-NEXT: xorl %edx, %edx 10; CHECK-NEXT: movl %edi, %eax 11; CHECK-NEXT: wrpkru 12; CHECK-NEXT: retq 13 call void @llvm.x86.wrpkru(i32 %src) 14 ret void 15} 16 17define i32 @test_x86_rdpkru() { 18; CHECK-LABEL: test_x86_rdpkru: 19; CHECK: ## BB#0: 20; CHECK-NEXT: xorl %ecx, %ecx 21; CHECK-NEXT: rdpkru 22; CHECK-NEXT: retq 23 %res = call i32 @llvm.x86.rdpkru() 24 ret i32 %res 25} 26