summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-05-12 01:17:38 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-05-12 01:17:38 +0000
commite0aa414acf9bb455376df4579e244dcca1434e1f (patch)
tree8104efd7ced9cab63a9c566a3dcf0fe886eb3756 /llvm/test/CodeGen
parentfe7bba4ee416ffcc1a5439700b230aa94c106957 (diff)
downloadbcm5719-llvm-e0aa414acf9bb455376df4579e244dcca1434e1f.tar.gz
bcm5719-llvm-e0aa414acf9bb455376df4579e244dcca1434e1f.zip
All llvm.deoptimize declarations must use the same calling convention
This new verifier rule lets us unambigously pick a calling convention when creating a new declaration for `@llvm.experimental.deoptimize.<ty>`. It is also congruent with our lowering strategy -- since all calls to `@llvm.experimental.deoptimize` are lowered to calls to `__llvm_deoptimize`, it is reasonable to enforce a unique calling convention. Some of the tests that were breaking this verifier rule have had to be split up into different .ll files. The inliner was violating this rule as well, and has been fixed to avoid producing invalid IR. llvm-svn: 269261
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/deopt-intrinsic-cconv.ll34
-rw-r--r--llvm/test/CodeGen/X86/deopt-intrinsic.ll25
2 files changed, 34 insertions, 25 deletions
diff --git a/llvm/test/CodeGen/X86/deopt-intrinsic-cconv.ll b/llvm/test/CodeGen/X86/deopt-intrinsic-cconv.ll
new file mode 100644
index 00000000000..8e240f8901d
--- /dev/null
+++ b/llvm/test/CodeGen/X86/deopt-intrinsic-cconv.ll
@@ -0,0 +1,34 @@
+; RUN: llc < %s | FileCheck %s
+; RUN: llc -debug-only=stackmaps < %s 2>&1 | FileCheck --check-prefix=STACKMAPS %s
+; REQUIRES: asserts
+
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.11.0"
+
+declare webkit_jscc i64 @llvm.experimental.deoptimize.i64(...)
+
+define i64 @caller_1() {
+; CHECK-LABEL: _caller_1:
+; CHECK-NEXT: {{.+cfi.+}}
+; CHECK-NEXT: ##{{.+}}
+; CHECK-NEXT: pushq %rax
+; CHECK-NEXT: {{Ltmp[0-9]+}}:
+; CHECK-NEXT: {{.+cfi.+}}
+; CHECK-NEXT: movl $1140457472, (%rsp) ## imm = 0x43FA0000
+; CHECK-NEXT: movl $42, %eax
+; CHECK-NEXT: callq ___llvm_deoptimize
+; CHECK-NEXT: {{Ltmp[0-9]+}}:
+
+entry:
+ %v = call webkit_jscc i64(...) @llvm.experimental.deoptimize.i64(i32 42, float 500.0) [ "deopt"(i32 3) ]
+ ret i64 %v
+}
+
+; STACKMAPS: Stack Maps: callsites:
+; STACKMAPS-NEXT: Stack Maps: callsite 2882400015
+; STACKMAPS-NEXT: Stack Maps: has 4 locations
+; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 12 [encoding: .byte 4, .byte 8, .short 0, .int 12]
+; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 8, .short 0, .int 0]
+; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 8, .short 0, .int 1]
+; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 3 [encoding: .byte 4, .byte 8, .short 0, .int 3]
+; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
diff --git a/llvm/test/CodeGen/X86/deopt-intrinsic.ll b/llvm/test/CodeGen/X86/deopt-intrinsic.ll
index 008075bfeae..ceed2d24882 100644
--- a/llvm/test/CodeGen/X86/deopt-intrinsic.ll
+++ b/llvm/test/CodeGen/X86/deopt-intrinsic.ll
@@ -7,7 +7,6 @@ target triple = "x86_64-apple-macosx10.11.0"
declare i32 @llvm.experimental.deoptimize.i32(...)
declare i8 @llvm.experimental.deoptimize.i8(...)
-declare webkit_jscc i64 @llvm.experimental.deoptimize.i64(...)
define i32 @caller_0() {
; CHECK-LABEL: _caller_0:
@@ -40,23 +39,6 @@ entry:
ret i8 %v
}
-define i64 @caller_2() {
-; CHECK-LABEL: _caller_2:
-; CHECK-NEXT: {{.+cfi.+}}
-; CHECK-NEXT: ##{{.+}}
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: {{Ltmp[0-9]+}}:
-; CHECK-NEXT: {{.+cfi.+}}
-; CHECK-NEXT: movl $1140457472, (%rsp) ## imm = 0x43FA0000
-; CHECK-NEXT: movl $42, %eax
-; CHECK-NEXT: callq ___llvm_deoptimize
-; CHECK-NEXT: {{Ltmp[0-9]+}}:
-
-entry:
- %v = call webkit_jscc i64(...) @llvm.experimental.deoptimize.i64(i32 42, float 500.0) [ "deopt"(i32 3) ]
- ret i64 %v
-}
-
; STACKMAPS: Stack Maps: callsites:
; STACKMAPS-NEXT: Stack Maps: callsite 2882400015
; STACKMAPS-NEXT: Stack Maps: has 4 locations
@@ -72,10 +54,3 @@ entry:
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 8, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 1 [encoding: .byte 4, .byte 8, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
-; STACKMAPS-NEXT: Stack Maps: callsite 2882400015
-; STACKMAPS-NEXT: Stack Maps: has 4 locations
-; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 12 [encoding: .byte 4, .byte 8, .short 0, .int 12]
-; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 8, .short 0, .int 0]
-; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 8, .short 0, .int 1]
-; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 3 [encoding: .byte 4, .byte 8, .short 0, .int 3]
-; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
OpenPOWER on IntegriCloud