Skip to content

Commit f1051d5

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.6-beta.1 [skip ci]
1 parent 370d4f0 commit f1051d5

File tree

5 files changed

+6
-18
lines changed

5 files changed

+6
-18
lines changed

llvm/lib/IR/Metadata.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,15 +1306,13 @@ MDNode *MDNode::getMergedCalleeTypeMetadata(LLVMContext &Ctx, MDNode *A,
13061306
MDNode *B) {
13071307
SmallVector<Metadata *, 8> AB;
13081308
SmallSet<Metadata *, 8> MergedCallees;
1309-
auto AddUniqueCallees = [&](llvm::MDNode *N) {
1309+
auto AddUniqueCallees = [&AB, &MergedCallees](llvm::MDNode *N) {
13101310
if (!N)
13111311
return;
13121312
for (const MDOperand &Op : N->operands()) {
13131313
Metadata *MD = Op.get();
1314-
if (!MergedCallees.contains(MD)) {
1315-
MergedCallees.insert(MD);
1314+
if (MergedCallees.insert(MD).second)
13161315
AB.push_back(MD);
1317-
}
13181316
}
13191317
};
13201318
AddUniqueCallees(A);

llvm/lib/IR/Verifier.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5100,11 +5100,7 @@ void Verifier::visitCallsiteMetadata(Instruction &I, MDNode *MD) {
51005100
void Verifier::visitCalleeTypeMetadata(Instruction &I, MDNode *MD) {
51015101
Check(isa<CallBase>(I), "!callee_type metadata should only exist on calls",
51025102
&I);
5103-
CallBase *CB = cast<CallBase>(&I);
5104-
Check(CB->isIndirectCall(),
5105-
"!callee_type metadata should only exist on indirect function calls",
5106-
&I);
5107-
for (const auto &Op : MD->operands()) {
5103+
for (const MDOperand &Op : MD->operands()) {
51085104
Check(isa<MDNode>(Op.get()),
51095105
"The callee_type metadata must be a list of type metadata nodes");
51105106
auto *TypeMD = cast<MDNode>(Op.get());

llvm/test/Transforms/Inline/drop-callee-type-metadata.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;; Test if the callee_type metadata is dropped when it is
22
;; is mapped to a direct function call from an indirect call during inlining.
33

4-
; RUN: opt < %s -passes="inline" -disable-verify -S | FileCheck %s
4+
; RUN: opt -passes="inline" -S < %s | FileCheck %s
55

66
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) local_unnamed_addr !type !0 {
77
entry:

llvm/test/Transforms/InstCombine/drop-callee-type-metadata.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;; Test if the callee_type metadata is dropped when it is attached
22
;; to a direct function call during instcombine.
33

4-
; RUN: opt < %s -passes="instcombine" -disable-verify -S | FileCheck %s
4+
; RUN: opt -passes="instcombine" -S < %s | FileCheck %s
55

66
define i32 @_Z3barv() local_unnamed_addr !type !3 {
77
entry:

llvm/test/Verifier/callee-type-metadata.ll

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,9 @@ entry:
1414
;; callee_type metdata is a type metadata instead of a list of type metadata nodes.
1515
; CHECK: The callee_type metadata must be a list of type metadata nodes
1616
%call2 = call i32 %fptr(i8 signext %x_val), !callee_type !0
17-
;; callee_type metdata is a list of non "gneralized" type metadata.
17+
;; callee_type metdata must be a list of "generalized" type metadata.
1818
; CHECK: Only generalized type metadata can be part of the callee_type metadata list
1919
%call3 = call i32 %fptr(i8 signext %x_val), !callee_type !4
20-
;; callee_type metadata should not be part of a direct call.
21-
; CHECK: !callee_type metadata should only exist on indirect function calls
22-
%call_direct = call i32 @_Z3barc(i8 signext %x_val), !callee_type !1
23-
;; callee_type metadata should not be part of a direct call.
24-
; CHECK: !callee_type metadata should only exist on indirect function calls
25-
%call_direct_wrong_signature = call i32 @_Z3barc(i8 signext %x_val), !callee_type !4
2620
ret i32 %call
2721
}
2822

0 commit comments

Comments
 (0)