110 changes: 55 additions & 55 deletions llvm/test/CodeGen/X86/GlobalISel/irtranslator-callingconv.ll

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion llvm/test/CodeGen/X86/ipra-reg-usage.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
target triple = "x86_64-unknown-unknown"
declare void @bar1()
define preserve_allcc void @foo()#0 {
; CHECK: foo Clobbered Registers: CS DS EFLAGS EIP EIZ ES FPSW FS GS IP RIP RIZ SS BND0 BND1 BND2 BND3 CR0 CR1 CR2 CR3 CR4 CR5 CR6 CR7 CR8 CR9 CR10 CR11 CR12 CR13 CR14 CR15 DR0 DR1 DR2 DR3 DR4 DR5 DR6 DR7 DR8 DR9 DR10 DR11 DR12 DR13 DR14 DR15 FP0 FP1 FP2 FP3 FP4 FP5 FP6 FP7 K0 K1 K2 K3 K4 K5 K6 K7 MM0 MM1 MM2 MM3 MM4 MM5 MM6 MM7 R11 ST0 ST1 ST2 ST3 ST4 ST5 ST6 ST7 XMM16 XMM17 XMM18 XMM19 XMM20 XMM21 XMM22 XMM23 XMM24 XMM25 XMM26 XMM27 XMM28 XMM29 XMM30 XMM31 YMM0 YMM1 YMM2 YMM3 YMM4 YMM5 YMM6 YMM7 YMM8 YMM9 YMM10 YMM11 YMM12 YMM13 YMM14 YMM15 YMM16 YMM17 YMM18 YMM19 YMM20 YMM21 YMM22 YMM23 YMM24 YMM25 YMM26 YMM27 YMM28 YMM29 YMM30 YMM31 ZMM0 ZMM1 ZMM2 ZMM3 ZMM4 ZMM5 ZMM6 ZMM7 ZMM8 ZMM9 ZMM10 ZMM11 ZMM12 ZMM13 ZMM14 ZMM15 ZMM16 ZMM17 ZMM18 ZMM19 ZMM20 ZMM21 ZMM22 ZMM23 ZMM24 ZMM25 ZMM26 ZMM27 ZMM28 ZMM29 ZMM30 ZMM31 R11B R11D R11W
; CHECK: foo Clobbered Registers: CS DS EFLAGS EIP EIZ ES FPSW FS GS IP RIP RIZ SS SSP BND0 BND1 BND2 BND3 CR0 CR1 CR2 CR3 CR4 CR5 CR6 CR7 CR8 CR9 CR10 CR11 CR12 CR13 CR14 CR15 DR0 DR1 DR2 DR3 DR4 DR5 DR6 DR7 DR8 DR9 DR10 DR11 DR12 DR13 DR14 DR15 FP0 FP1 FP2 FP3 FP4 FP5 FP6 FP7 K0 K1 K2 K3 K4 K5 K6 K7 MM0 MM1 MM2 MM3 MM4 MM5 MM6 MM7 R11 ST0 ST1 ST2 ST3 ST4 ST5 ST6 ST7 XMM16 XMM17 XMM18 XMM19 XMM20 XMM21 XMM22 XMM23 XMM24 XMM25 XMM26 XMM27 XMM28 XMM29 XMM30 XMM31 YMM0 YMM1 YMM2 YMM3 YMM4 YMM5 YMM6 YMM7 YMM8 YMM9 YMM10 YMM11 YMM12 YMM13 YMM14 YMM15 YMM16 YMM17 YMM18 YMM19 YMM20 YMM21 YMM22 YMM23 YMM24 YMM25 YMM26 YMM27 YMM28 YMM29 YMM30 YMM31 ZMM0 ZMM1 ZMM2 ZMM3 ZMM4 ZMM5 ZMM6 ZMM7 ZMM8 ZMM9 ZMM10 ZMM11 ZMM12 ZMM13 ZMM14 ZMM15 ZMM16 ZMM17 ZMM18 ZMM19 ZMM20 ZMM21 ZMM22 ZMM23 ZMM24 ZMM25 ZMM26 ZMM27 ZMM28 ZMM29 ZMM30 ZMM31 R11B R11D R11W
call void @bar1()
call void @bar2()
ret void
Expand Down
24 changes: 12 additions & 12 deletions llvm/test/CodeGen/X86/movtopush.mir
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
...
---
# CHECK-LABEL: test9
# CHECK: ADJCALLSTACKDOWN32 16, 0, 16, implicit-def dead %esp, implicit-def dead %eflags, implicit %esp
# CHECK: ADJCALLSTACKDOWN32 16, 0, 16, implicit-def dead %esp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %esp, implicit %ssp
# CHECK-NEXT: PUSH32i8 4, implicit-def %esp, implicit %esp
# CHECK-NEXT: PUSH32i8 3, implicit-def %esp, implicit %esp
# CHECK-NEXT: PUSH32i8 2, implicit-def %esp, implicit %esp
# CHECK-NEXT: PUSH32i8 1, implicit-def %esp, implicit %esp
# CHECK-NEXT: CALLpcrel32 @good, csr_32, implicit %esp, implicit-def %esp
# CHECK-NEXT: ADJCALLSTACKUP32 16, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit %esp
# CHECK-NEXT: ADJCALLSTACKDOWN32 20, 0, 20, implicit-def dead %esp, implicit-def dead %eflags, implicit %esp
# CHECK-NEXT: CALLpcrel32 @good, csr_32, implicit %esp, implicit %ssp, implicit-def %esp, implicit-def %ssp
# CHECK-NEXT: ADJCALLSTACKUP32 16, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %esp, implicit %ssp
# CHECK-NEXT: ADJCALLSTACKDOWN32 20, 0, 20, implicit-def dead %esp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %esp, implicit %ssp
# CHECK-NEXT: %1:gr32 = MOV32rm %stack.2.s, 1, _, 0, _ :: (load 4 from %stack.2.s, align 8)
# CHECK-NEXT: %2:gr32 = MOV32rm %stack.2.s, 1, _, 4, _ :: (load 4 from %stack.2.s + 4)
# CHECK-NEXT: %4:gr32 = LEA32r %stack.0.p, 1, _, 0, _
Expand All @@ -50,8 +50,8 @@
# CHECK-NEXT: PUSH32i8 6, implicit-def %esp, implicit %esp
# CHECK-NEXT: PUSH32r %2, implicit-def %esp, implicit %esp
# CHECK-NEXT: PUSH32r %1, implicit-def %esp, implicit %esp
# CHECK-NEXT: CALLpcrel32 @struct, csr_32, implicit %esp, implicit-def %esp
# CHECK-NEXT: ADJCALLSTACKUP32 20, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit %esp
# CHECK-NEXT: CALLpcrel32 @struct, csr_32, implicit %esp, implicit %ssp, implicit-def %esp, implicit-def %ssp
# CHECK-NEXT: ADJCALLSTACKUP32 20, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %esp, implicit %ssp
# CHECK-NEXT: RET 0
name: test9
alignment: 0
Expand Down Expand Up @@ -99,15 +99,15 @@ stack:
constants:
body: |
bb.0.entry:
ADJCALLSTACKDOWN32 16, 0, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit %esp
ADJCALLSTACKDOWN32 16, 0, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %esp, implicit %ssp
%0 = COPY %esp
MOV32mi %0, 1, _, 12, _, 4 :: (store 4 into stack + 12)
MOV32mi %0, 1, _, 8, _, 3 :: (store 4 into stack + 8)
MOV32mi %0, 1, _, 4, _, 2 :: (store 4 into stack + 4)
MOV32mi %0, 1, _, 0, _, 1 :: (store 4 into stack)
CALLpcrel32 @good, csr_32, implicit %esp, implicit-def %esp
ADJCALLSTACKUP32 16, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit %esp
ADJCALLSTACKDOWN32 20, 0, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit %esp
CALLpcrel32 @good, csr_32, implicit %esp, implicit %ssp, implicit-def %esp, implicit-def %ssp
ADJCALLSTACKUP32 16, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %esp, implicit %ssp
ADJCALLSTACKDOWN32 20, 0, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %esp, implicit %ssp
%1 = MOV32rm %stack.2.s, 1, _, 0, _ :: (load 4 from %stack.2.s, align 8)
%2 = MOV32rm %stack.2.s, 1, _, 4, _ :: (load 4 from %stack.2.s + 4)
%3 = COPY %esp
Expand All @@ -118,8 +118,8 @@ body: |
%5 = LEA32r %stack.1.q, 1, _, 0, _
MOV32mr %3, 1, _, 12, _, killed %5 :: (store 4 into stack + 12)
MOV32mi %3, 1, _, 8, _, 6 :: (store 4 into stack + 8)
CALLpcrel32 @struct, csr_32, implicit %esp, implicit-def %esp
ADJCALLSTACKUP32 20, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit %esp
CALLpcrel32 @struct, csr_32, implicit %esp, implicit %ssp, implicit-def %esp, implicit-def %ssp,
ADJCALLSTACKUP32 20, 0, implicit-def dead %esp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %esp, implicit %ssp
RET 0
...
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/X86/tail-call-conditional.mir
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ body: |
; CHECK-NEXT: %rdi = COPY %rsi
; CHECK-NEXT: %rsi = COPY %rax
; CHECK-NEXT: CMP64ri8 %rax, 9, implicit-def %eflags
; CHECK-NEXT: TCRETURNdi64cc @f1, 0, 3, csr_64, implicit %rsp, implicit %eflags, implicit %rsp, implicit %rdi, implicit %rsi, implicit %rax, implicit-def %rax, implicit %sil, implicit-def %sil, implicit %si, implicit-def %si, implicit %esi, implicit-def %esi, implicit %rsi, implicit-def %rsi, implicit %dil, implicit-def %dil, implicit %di, implicit-def %di, implicit %edi, implicit-def %edi, implicit %rdi, implicit-def %rdi, implicit %ah, implicit-def %ah, implicit %al, implicit-def %al, implicit %ax, implicit-def %ax, implicit %eax, implicit-def %eax
; CHECK-NEXT: TCRETURNdi64cc @f1, 0, 3, csr_64, implicit %rsp, implicit %eflags, implicit %ssp, implicit %rsp, implicit %rdi, implicit %rsi, implicit %rax, implicit-def %rax, implicit %sil, implicit-def %sil, implicit %si, implicit-def %si, implicit %esi, implicit-def %esi, implicit %rsi, implicit-def %rsi, implicit %dil, implicit-def %dil, implicit %di, implicit-def %di, implicit %edi, implicit-def %edi, implicit %rdi, implicit-def %rdi, implicit %ah, implicit-def %ah, implicit %al, implicit-def %al, implicit %ax, implicit-def %ax, implicit %eax, implicit-def %eax
bb.1:
successors: %bb.2, %bb.3
Expand Down
106 changes: 106 additions & 0 deletions llvm/test/CodeGen/X86/x32-cet-intrinsics.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+shstk -mattr=+ibt | FileCheck %s

define void @test_incsspd(i32 %a) local_unnamed_addr {
; CHECK-LABEL: test_incsspd:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: incsspd %eax
; CHECK-NEXT: retl
entry:
tail call void @llvm.x86.incsspd(i32 %a)
ret void
}

declare void @llvm.x86.incsspd(i32)

define i32 @test_rdsspd(i32 %a) {
; CHECK-LABEL: test_rdsspd:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: rdsspd %eax
; CHECK-NEXT: retl
entry:
%0 = call i32 @llvm.x86.rdsspd(i32 %a)
ret i32 %0
}

declare i32 @llvm.x86.rdsspd(i32)

define void @test_saveprevssp() {
; CHECK-LABEL: test_saveprevssp:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: saveprevssp
; CHECK-NEXT: retl
entry:
tail call void @llvm.x86.saveprevssp()
ret void
}

declare void @llvm.x86.saveprevssp()

define void @test_rstorssp(i8* %__p) {
; CHECK-LABEL: test_rstorssp:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: rstorssp (%eax)
; CHECK-NEXT: retl
entry:
tail call void @llvm.x86.rstorssp(i8* %__p)
ret void
}

declare void @llvm.x86.rstorssp(i8*)

define void @test_wrssd(i32 %a, i8* %__p) {
; CHECK-LABEL: test_wrssd:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
; CHECK-NEXT: wrssd %eax, (%ecx)
; CHECK-NEXT: retl
entry:
tail call void @llvm.x86.wrssd(i32 %a, i8* %__p)
ret void
}

declare void @llvm.x86.wrssd(i32, i8*)

define void @test_wrussd(i32 %a, i8* %__p) {
; CHECK-LABEL: test_wrussd:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
; CHECK-NEXT: wrussd %eax, (%ecx)
; CHECK-NEXT: retl
entry:
tail call void @llvm.x86.wrussd(i32 %a, i8* %__p)
ret void
}

declare void @llvm.x86.wrussd(i32, i8*)

define void @test_setssbsy() {
; CHECK-LABEL: test_setssbsy:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: setssbsy
; CHECK-NEXT: retl
entry:
tail call void @llvm.x86.setssbsy()
ret void
}

declare void @llvm.x86.setssbsy()

define void @test_clrssbsy(i8* %__p) {
; CHECK-LABEL: test_clrssbsy:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: clrssbsy (%eax)
; CHECK-NEXT: retl
entry:
tail call void @llvm.x86.clrssbsy(i8* %__p)
ret void
}

declare void @llvm.x86.clrssbsy(i8* %__p)
150 changes: 150 additions & 0 deletions llvm/test/CodeGen/X86/x64-cet-intrinsics.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+shstk -mattr=+ibt | FileCheck %s

define void @test_incsspd(i32 %a) local_unnamed_addr {
; CHECK-LABEL: test_incsspd:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: incsspd %edi
; CHECK-NEXT: retq
entry:
tail call void @llvm.x86.incsspd(i32 %a)
ret void
}

declare void @llvm.x86.incsspd(i32)

define void @test_incsspq(i32 %a) local_unnamed_addr {
; CHECK-LABEL: test_incsspq:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: movslq %edi, %rax
; CHECK-NEXT: incsspq %rax
; CHECK-NEXT: retq
entry:
%conv.i = sext i32 %a to i64
tail call void @llvm.x86.incsspq(i64 %conv.i)
ret void
}

declare void @llvm.x86.incsspq(i64)

define i32 @test_rdsspd(i32 %a) {
; CHECK-LABEL: test_rdsspd:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: rdsspd %edi
; CHECK-NEXT: movl %edi, %eax
; CHECK-NEXT: retq
entry:
%0 = call i32 @llvm.x86.rdsspd(i32 %a)
ret i32 %0
}

declare i32 @llvm.x86.rdsspd(i32)

define i64 @test_rdsspq(i64 %a) {
; CHECK-LABEL: test_rdsspq:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: rdsspq %rdi
; CHECK-NEXT: movq %rdi, %rax
; CHECK-NEXT: retq
entry:
%0 = call i64 @llvm.x86.rdsspq(i64 %a)
ret i64 %0
}

declare i64 @llvm.x86.rdsspq(i64)

define void @test_saveprevssp() {
; CHECK-LABEL: test_saveprevssp:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: saveprevssp
; CHECK-NEXT: retq
entry:
tail call void @llvm.x86.saveprevssp()
ret void
}

declare void @llvm.x86.saveprevssp()

define void @test_rstorssp(i8* %__p) {
; CHECK-LABEL: test_rstorssp:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: rstorssp (%rdi)
; CHECK-NEXT: retq
entry:
tail call void @llvm.x86.rstorssp(i8* %__p)
ret void
}

declare void @llvm.x86.rstorssp(i8*)

define void @test_wrssd(i32 %a, i8* %__p) {
; CHECK-LABEL: test_wrssd:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: wrssd %edi, (%rsi)
; CHECK-NEXT: retq
entry:
tail call void @llvm.x86.wrssd(i32 %a, i8* %__p)
ret void
}

declare void @llvm.x86.wrssd(i32, i8*)

define void @test_wrssq(i64 %a, i8* %__p) {
; CHECK-LABEL: test_wrssq:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: wrssq %rdi, (%rsi)
; CHECK-NEXT: retq
entry:
tail call void @llvm.x86.wrssq(i64 %a, i8* %__p)
ret void
}

declare void @llvm.x86.wrssq(i64, i8*)

define void @test_wrussd(i32 %a, i8* %__p) {
; CHECK-LABEL: test_wrussd:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: wrussd %edi, (%rsi)
; CHECK-NEXT: retq
entry:
tail call void @llvm.x86.wrussd(i32 %a, i8* %__p)
ret void
}

declare void @llvm.x86.wrussd(i32, i8*)

define void @test_wrussq(i64 %a, i8* %__p) {
; CHECK-LABEL: test_wrussq:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: wrussq %rdi, (%rsi)
; CHECK-NEXT: retq
entry:
tail call void @llvm.x86.wrussq(i64 %a, i8* %__p)
ret void
}

declare void @llvm.x86.wrussq(i64, i8*)

define void @test_setssbsy() {
; CHECK-LABEL: test_setssbsy:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: setssbsy
; CHECK-NEXT: retq
entry:
tail call void @llvm.x86.setssbsy()
ret void
}

declare void @llvm.x86.setssbsy()

define void @test_clrssbsy(i8* %__p) {
; CHECK-LABEL: test_clrssbsy:
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: clrssbsy (%rdi)
; CHECK-NEXT: retq
entry:
tail call void @llvm.x86.clrssbsy(i8* %__p)
ret void
}

declare void @llvm.x86.clrssbsy(i8* %__p)
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ body: |
DBG_VALUE debug-use %2, debug-use _, !23, !DIExpression(), debug-location !32
%3 = MOV32rm %rip, 1, _, @bar + 4, _, debug-location !33 :: (dereferenceable load 4 from `i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 1)`, !tbaa !28)
DBG_VALUE debug-use %3, debug-use _, !24, !DIExpression(), debug-location !34
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit %rsp, debug-location !35
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !35
%edi = COPY %2, debug-location !35
%esi = COPY %3, debug-location !35
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit killed %edi, implicit killed %esi, implicit-def %rsp, debug-location !35
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit %rsp, debug-location !35
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %ssp, implicit killed %edi, implicit killed %esi, implicit-def %rsp, debug-location !35
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !35
%eax = MOV32r0 implicit-def dead %eflags, debug-location !36
RET 0, killed %eax, debug-location !36
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/DebugInfo/MIR/X86/live-debug-vars-unused-arg.mir
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ body: |
DBG_VALUE debug-use %2, debug-use _, !23, !DIExpression(), debug-location !32
%3 = MOV32rm %rip, 1, _, @bar + 4, _, debug-location !33 :: (dereferenceable load 4 from `i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 1)`, !tbaa !28)
DBG_VALUE debug-use %3, debug-use _, !24, !DIExpression(), debug-location !34
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit %rsp, debug-location !35
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !35
%edi = COPY %2, debug-location !35
%esi = COPY %3, debug-location !35
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit killed %edi, implicit killed %esi, implicit-def %rsp, debug-location !35
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit %rsp, debug-location !35
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %ssp, implicit killed %edi, implicit killed %esi, implicit-def %rsp, debug-location !35
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !35
%eax = MOV32r0 implicit-def dead %eflags, debug-location !36
RET 0, killed %eax, debug-location !36
Expand Down
12 changes: 6 additions & 6 deletions llvm/test/DebugInfo/X86/live-debug-vars-dse.mir
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ body: |
%0 = COPY %ecx
MOV32mr %stack.0.x.addr, 1, _, 0, _, %0 :: (store 4 into %ir.x.addr)
DBG_VALUE %stack.0.x.addr, 0, !13, !DIExpression(), debug-location !14
ADJCALLSTACKDOWN64 32, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit %rsp, debug-location !15
ADJCALLSTACKDOWN64 32, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !15
%1 = LEA64r %stack.0.x.addr, 1, _, 0, _
%rcx = COPY %1, debug-location !15
CALL64pcrel32 @escape, csr_win64, implicit %rsp, implicit %rcx, implicit-def %rsp, debug-location !15
ADJCALLSTACKUP64 32, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit %rsp, debug-location !15
CALL64pcrel32 @escape, csr_win64, implicit %rsp, implicit %ssp, implicit %rcx, implicit-def %rsp, implicit-def %ssp, debug-location !15
ADJCALLSTACKUP64 32, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !15
DBG_VALUE 1, debug-use _, !13, !DIExpression(), debug-location !16
MOV32mi %rip, 1, _, @global, _, 1, debug-location !17 :: (store 4 into @global)
DBG_VALUE %stack.0.x.addr, 0, !13, !DIExpression(), debug-location !18
MOV32mi %stack.0.x.addr, 1, _, 0, _, 2, debug-location !18 :: (store 4 into %ir.x.addr)
ADJCALLSTACKDOWN64 32, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit %rsp, debug-location !19
ADJCALLSTACKDOWN64 32, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !19
%rcx = COPY %1, debug-location !19
CALL64pcrel32 @escape, csr_win64, implicit %rsp, implicit %rcx, implicit-def %rsp, debug-location !19
ADJCALLSTACKUP64 32, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit %rsp, debug-location !19
CALL64pcrel32 @escape, csr_win64, implicit %rsp, implicit %ssp, implicit %rcx, implicit-def %rsp, implicit-def %ssp, debug-location !19
ADJCALLSTACKUP64 32, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !19
RET 0, debug-location !20
...
169 changes: 169 additions & 0 deletions llvm/test/MC/X86/cet-encoding.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
// RUN: llvm-mc -triple x86_64-unknown-unknown -mattr=+shstk --show-encoding %s | FileCheck %s

// CHECK: incsspd %r13d
// CHECK: # encoding: [0xf3,0x41,0x0f,0xae,0xed]
incsspd %r13d

// CHECK: incsspq %r15
// CHECK: # encoding: [0xf3,0x49,0x0f,0xae,0xef]
incsspq %r15

// CHECK: rdsspq %r15
// CHECK: # encoding: [0xf3,0x49,0x0f,0x1e,0xcf]
rdsspq %r15

// CHECK: rdsspd %r13d
// CHECK: # encoding: [0xf3,0x41,0x0f,0x1e,0xcd]
rdsspd %r13d

// CHECK: saveprevssp
// CHECK: # encoding: [0xf3,0x0f,0x01,0xea]
saveprevssp

// CHECK: rstorssp 485498096
// CHECK: # encoding: [0xf3,0x0f,0x01,0x2c,0x25,0xf0,0x1c,0xf0,0x1c]
rstorssp 485498096

// CHECK: rstorssp (%rdx)
// CHECK: # encoding: [0xf3,0x0f,0x01,0x2a]
rstorssp (%rdx)

// CHECK: rstorssp 64(%rdx)
// CHECK: # encoding: [0xf3,0x0f,0x01,0x6a,0x40]
rstorssp 64(%rdx)

// CHECK: rstorssp 64(%rdx,%rax)
// CHECK: # encoding: [0xf3,0x0f,0x01,0x6c,0x02,0x40]
rstorssp 64(%rdx,%rax)

// CHECK: rstorssp 64(%rdx,%rax,4)
// CHECK: # encoding: [0xf3,0x0f,0x01,0x6c,0x82,0x40]
rstorssp 64(%rdx,%rax,4)

// CHECK: rstorssp -64(%rdx,%rax,4)
// CHECK: # encoding: [0xf3,0x0f,0x01,0x6c,0x82,0xc0]
rstorssp -64(%rdx,%rax,4)

// CHECK: wrssq %r15, 485498096
// CHECK: # encoding: [0x4c,0x0f,0x38,0xf6,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
wrssq %r15, 485498096

// CHECK: wrssq %r15, (%rdx)
// CHECK: # encoding: [0x4c,0x0f,0x38,0xf6,0x3a]
wrssq %r15, (%rdx)

// CHECK: wrssq %r15, 64(%rdx)
// CHECK: # encoding: [0x4c,0x0f,0x38,0xf6,0x7a,0x40]
wrssq %r15, 64(%rdx)

// CHECK: wrssq %r15, 64(%rdx,%rax)
// CHECK: # encoding: [0x4c,0x0f,0x38,0xf6,0x7c,0x02,0x40]
wrssq %r15, 64(%rdx,%rax)

// CHECK: wrssq %r15, 64(%rdx,%rax,4)
// CHECK: # encoding: [0x4c,0x0f,0x38,0xf6,0x7c,0x82,0x40]
wrssq %r15, 64(%rdx,%rax,4)

// CHECK: wrssq %r15, -64(%rdx,%rax,4)
// CHECK: # encoding: [0x4c,0x0f,0x38,0xf6,0x7c,0x82,0xc0]
wrssq %r15, -64(%rdx,%rax,4)

// CHECK: wrssd %r13d, 485498096
// CHECK: # encoding: [0x44,0x0f,0x38,0xf6,0x2c,0x25,0xf0,0x1c,0xf0,0x1c]
wrssd %r13d, 485498096

// CHECK: wrssd %r13d, (%rdx)
// CHECK: # encoding: [0x44,0x0f,0x38,0xf6,0x2a]
wrssd %r13d, (%rdx)

// CHECK: wrssd %r13d, 64(%rdx)
// CHECK: # encoding: [0x44,0x0f,0x38,0xf6,0x6a,0x40]
wrssd %r13d, 64(%rdx)

// CHECK: wrssd %r13d, 64(%rdx,%rax)
// CHECK: # encoding: [0x44,0x0f,0x38,0xf6,0x6c,0x02,0x40]
wrssd %r13d, 64(%rdx,%rax)

// CHECK: wrssd %r13d, 64(%rdx,%rax,4)
// CHECK: # encoding: [0x44,0x0f,0x38,0xf6,0x6c,0x82,0x40]
wrssd %r13d, 64(%rdx,%rax,4)

// CHECK: wrssd %r13d, -64(%rdx,%rax,4)
// CHECK: # encoding: [0x44,0x0f,0x38,0xf6,0x6c,0x82,0xc0]
wrssd %r13d, -64(%rdx,%rax,4)

// CHECK: wrussd %r13d, 485498096
// CHECK: # encoding: [0x66,0x44,0x0f,0x38,0xf5,0x2c,0x25,0xf0,0x1c,0xf0,0x1c]
wrussd %r13d, 485498096

// CHECK: wrussd %r13d, (%rdx)
// CHECK: # encoding: [0x66,0x44,0x0f,0x38,0xf5,0x2a]
wrussd %r13d, (%rdx)

// CHECK: wrussd %r13d, 64(%rdx)
// CHECK: # encoding: [0x66,0x44,0x0f,0x38,0xf5,0x6a,0x40]
wrussd %r13d, 64(%rdx)

// CHECK: wrussd %r13d, 64(%rdx,%rax)
// CHECK: # encoding: [0x66,0x44,0x0f,0x38,0xf5,0x6c,0x02,0x40]
wrussd %r13d, 64(%rdx,%rax)

// CHECK: wrussd %r13d, 64(%rdx,%rax,4)
// CHECK: # encoding: [0x66,0x44,0x0f,0x38,0xf5,0x6c,0x82,0x40]
wrussd %r13d, 64(%rdx,%rax,4)

// CHECK: wrussd %r13d, -64(%rdx,%rax,4)
// CHECK: # encoding: [0x66,0x44,0x0f,0x38,0xf5,0x6c,0x82,0xc0]
wrussd %r13d, -64(%rdx,%rax,4)

// CHECK: wrussq %r15, 485498096
// CHECK: # encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
wrussq %r15, 485498096

// CHECK: wrussq %r15, (%rdx)
// CHECK: # encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x3a]
wrussq %r15, (%rdx)

// CHECK: wrussq %r15, 64(%rdx)
// CHECK: # encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x7a,0x40]
wrussq %r15, 64(%rdx)

// CHECK: wrussq %r15, 64(%rdx,%rax)
// CHECK: # encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x7c,0x02,0x40]
wrussq %r15, 64(%rdx,%rax)

// CHECK: wrussq %r15, 64(%rdx,%rax,4)
// CHECK: # encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x7c,0x82,0x40]
wrussq %r15, 64(%rdx,%rax,4)

// CHECK: wrussq %r15, -64(%rdx,%rax,4)
// CHECK: # encoding: [0x66,0x4c,0x0f,0x38,0xf5,0x7c,0x82,0xc0]
wrussq %r15, -64(%rdx,%rax,4)

// CHECK: clrssbsy 485498096
// CHECK: # encoding: [0xf3,0x0f,0xae,0x34,0x25,0xf0,0x1c,0xf0,0x1c]
clrssbsy 485498096

// CHECK: clrssbsy (%rdx)
// CHECK: # encoding: [0xf3,0x0f,0xae,0x32]
clrssbsy (%rdx)

// CHECK: clrssbsy 64(%rdx)
// CHECK: # encoding: [0xf3,0x0f,0xae,0x72,0x40]
clrssbsy 64(%rdx)

// CHECK: clrssbsy 64(%rdx,%rax)
// CHECK: # encoding: [0xf3,0x0f,0xae,0x74,0x02,0x40]
clrssbsy 64(%rdx,%rax)

// CHECK: clrssbsy 64(%rdx,%rax,4)
// CHECK: # encoding: [0xf3,0x0f,0xae,0x74,0x82,0x40]
clrssbsy 64(%rdx,%rax,4)

// CHECK: clrssbsy -64(%rdx,%rax,4)
// CHECK: # encoding: [0xf3,0x0f,0xae,0x74,0x82,0xc0]
clrssbsy -64(%rdx,%rax,4)

// CHECK: setssbsy
// CHECK: # encoding: [0xf3,0x0f,0x01,0xe8]
setssbsy