1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-unknown-unknown -mattr=+ptwrite | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+ptwrite | FileCheck %s --check-prefix=X86_64
5 define void @test_ptwrite(i32 %value) {
6 ; X86-LABEL: test_ptwrite:
7 ; X86: # %bb.0: # %entry
8 ; X86-NEXT: ptwritel {{[0-9]+}}(%esp)
11 ; X86_64-LABEL: test_ptwrite:
12 ; X86_64: # %bb.0: # %entry
13 ; X86_64-NEXT: ptwritel %edi
16 call void @llvm.x86.ptwrite32(i32 %value)
20 define void @test_ptwrite2(i32 %x) {
21 ; X86-LABEL: test_ptwrite2:
22 ; X86: # %bb.0: # %entry
23 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
25 ; X86-NEXT: ptwritel %eax
28 ; X86_64-LABEL: test_ptwrite2:
29 ; X86_64: # %bb.0: # %entry
30 ; X86_64-NEXT: incl %edi
31 ; X86_64-NEXT: ptwritel %edi
34 %value = add i32 %x, 1
35 call void @llvm.x86.ptwrite32(i32 %value)
39 define void @test_ptwrite32p(ptr %pointer) {
40 ; X86-LABEL: test_ptwrite32p:
41 ; X86: # %bb.0: # %entry
42 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
43 ; X86-NEXT: ptwritel (%eax)
46 ; X86_64-LABEL: test_ptwrite32p:
47 ; X86_64: # %bb.0: # %entry
48 ; X86_64-NEXT: ptwritel (%rdi)
51 %value = load i32, ptr %pointer, align 4
52 call void @llvm.x86.ptwrite32(i32 %value)
56 declare void @llvm.x86.ptwrite32(i32)