Skip to content

Commit 11ac81d

Browse files
committed
Simplify merging code
1 parent 133e8d7 commit 11ac81d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

llvm/lib/Analysis/MemoryProfileInfo.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,22 +349,18 @@ template <> uint64_t CallStack<MDNode, MDNode::op_iterator>::back() const {
349349
}
350350

351351
MDNode *MDNode::getMergedMemProfMetadata(MDNode *A, MDNode *B) {
352-
if (!(A && B)) {
353-
return A ? A : B;
354-
}
355-
356352
// TODO: Support more sophisticated merging, such as selecting the one with
357353
// more bytes allocated, or implement support for carrying multiple allocation
358354
// leaf contexts. For now, keep the first one.
359-
return A;
355+
if (A)
356+
return A;
357+
return B;
360358
}
361359

362360
MDNode *MDNode::getMergedCallsiteMetadata(MDNode *A, MDNode *B) {
363-
if (!(A && B)) {
364-
return A ? A : B;
365-
}
366-
367361
// TODO: Support more sophisticated merging, which will require support for
368362
// carrying multiple contexts. For now, keep the first one.
369-
return A;
363+
if (A)
364+
return A;
365+
return B;
370366
}

0 commit comments

Comments
 (0)