1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; NOTE: clwb is available in Skylake Server, not available in the newer
3; NOTE: Cannon Lake arch, but available again in the newer Ice Lake arch.
4; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=clwb | FileCheck %s
5; RUN: llc < %s -mtriple=i686-apple-darwin -mcpu=skx | FileCheck %s
6; RUN: not --crash llc < %s -mtriple=i686-apple-darwin -mcpu=cannonlake 2>&1 | FileCheck %s --check-prefix=CNL
7; RUN: llc < %s -mtriple=i686-apple-darwin -mcpu=icelake-server | FileCheck %s
8; RUN: llc < %s -mtriple=i686-apple-darwin -mcpu=tigerlake | FileCheck %s
9
10; CNL: LLVM ERROR: Cannot select: intrinsic %llvm.x86.clwb
11
12define void @clwb(i8* %p) nounwind {
13; CHECK-LABEL: clwb:
14; CHECK:       ## %bb.0:
15; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %eax
16; CHECK-NEXT:    clwb (%eax)
17; CHECK-NEXT:    retl
18  tail call void @llvm.x86.clwb(i8* %p)
19  ret void
20}
21declare void @llvm.x86.clwb(i8*) nounwind
22