Skip to content

[Bitcode][Asm] Read metadata value from operand bundles in and out #89649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions llvm/test/Bitcode/2021-07-22-Metadata-Operand-Bundles.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; This test ensures that we get a metadata operand bundle value in and out.
; RUN: llvm-as < %s | llvm-dis | FileCheck %s

declare void @callee()

; CHECK-LABEL: call_with_operand_bundle(
define void @call_with_operand_bundle() {
; CHECK: call void @op_bundle_callee() [ "op_type"(metadata !"metadata_string") ]
call void @callee() [ "op_type"(metadata !"metadata_string") ]

ret void
}
21 changes: 21 additions & 0 deletions llvm/test/Bitcode/compatibility.ll
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,14 @@ define void @call_with_operand_bundle4(ptr %ptr) {
ret void
}

define void @call_with_operand_bundle5(ptr %ptr) {
; CHECK-LABEL: call_with_operand_bundle5(
entry:
call void @op_bundle_callee_0() [ "foo"(metadata !"metadata_string") ]
; CHECK: call void @op_bundle_callee_0() [ "foo"(metadata !"metadata_string") ]
ret void
}

; Invoke versions of the above tests:


Expand Down Expand Up @@ -1914,6 +1922,19 @@ normal:
ret void
}

define void @invoke_with_operand_bundle5(ptr %ptr) personality i8 3 {
; CHECK-LABEL: @invoke_with_operand_bundle5(
entry:
invoke void @op_bundle_callee_0() [ "foo"(metadata !"metadata_string") ] to label %normal unwind label %exception
; CHECK: invoke void @op_bundle_callee_0() [ "foo"(metadata !"metadata_string") ]

exception:
%cleanup = landingpad i8 cleanup
br label %normal
normal:
ret void
}

declare void @vaargs_func(...)
define void @invoke_with_operand_bundle_vaarg(ptr %ptr) personality i8 3 {
; CHECK-LABEL: @invoke_with_operand_bundle_vaarg(
Expand Down
20 changes: 20 additions & 0 deletions llvm/test/Bitcode/operand-bundles.ll
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ define void @f4(i32* %ptr) {

; Invoke versions of the above tests:

define void @f5(i32* %ptr) {
; CHECK-LABEL: @f5(
entry:
call void @callee0() [ "foo"(metadata !"metadata_string") ]
; CHECK: call void @callee0() [ "foo"(metadata !"metadata_string") ]
ret void
}

define void @g0(i32* %ptr) personality i8 3 {
; CHECK-LABEL: @g0(
Expand Down Expand Up @@ -150,3 +157,16 @@ exception:
normal:
ret void
}

define void @g5(i32* %ptr) personality i8 3 {
; CHECK-LABEL: @g5(
entry:
invoke void @callee0() [ "foo"(metadata !"metadata_string") ] to label %normal unwind label %exception
; CHECK: invoke void @callee0() [ "foo"(metadata !"metadata_string") ]

exception:
%cleanup = landingpad i8 cleanup
br label %normal
normal:
ret void
}