Skip to content

Commit 52a4b6c

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

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

llvm/lib/IR/Metadata.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,11 +1305,13 @@ static void addRange(SmallVectorImpl<ConstantInt *> &EndPoints,
13051305

13061306
MDNode *MDNode::getMergedCalleeTypeMetadata(LLVMContext &Ctx, MDNode *A,
13071307
MDNode *B) {
1308+
// Drop the callee_type metadata if either of the call instructions do not
1309+
// have it.
1310+
if (!A || !B)
1311+
return nullptr;
13081312
SmallVector<Metadata *, 8> AB;
13091313
SmallPtrSet<Metadata *, 8> MergedCallees;
13101314
auto AddUniqueCallees = [&AB, &MergedCallees](MDNode *N) {
1311-
if (!N)
1312-
return;
13131315
for (Metadata *MD : N->operands()) {
13141316
if (MergedCallees.insert(MD).second)
13151317
AB.push_back(MD);

llvm/lib/Transforms/Utils/Local.cpp

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3080,7 +3080,13 @@ static void combineMetadata(Instruction *K, const Instruction *J,
30803080
case LLVMContext::MD_mmra:
30813081
case LLVMContext::MD_memprof:
30823082
case LLVMContext::MD_callsite:
3083+
break;
30833084
case LLVMContext::MD_callee_type:
3085+
if (!AAOnly) {
3086+
K->setMetadata(
3087+
LLVMContext::MD_callee_type,
3088+
MDNode::getMergedCalleeTypeMetadata(K->getContext(), KMD, JMD));
3089+
}
30843090
break;
30853091
case LLVMContext::MD_align:
30863092
if (!AAOnly && (DoesKMove || !K->hasMetadata(LLVMContext::MD_noundef)))
@@ -3157,20 +3163,6 @@ static void combineMetadata(Instruction *K, const Instruction *J,
31573163
MDNode::getMergedCallsiteMetadata(KCallSite, JCallSite));
31583164
}
31593165

3160-
// Merge callee_type metadata.
3161-
if (!AAOnly) {
3162-
auto *JCalleeType = J->getMetadata(LLVMContext::MD_callee_type);
3163-
auto *KCalleeType = K->getMetadata(LLVMContext::MD_callee_type);
3164-
// Drop the callee_type metadata if either of the call instructions do not
3165-
// have it.
3166-
if (JCalleeType && KCalleeType) {
3167-
K->setMetadata(LLVMContext::MD_callee_type,
3168-
MDNode::getMergedCalleeTypeMetadata(
3169-
K->getContext(), KCalleeType, JCalleeType));
3170-
} else
3171-
K->setMetadata(LLVMContext::MD_callee_type, nullptr);
3172-
}
3173-
31743166
// Merge prof metadata.
31753167
// Handle separately to support cases where only one instruction has the
31763168
// metadata.

0 commit comments

Comments
 (0)