[PATCH] D86630: [ArgumentPromotion]: Copy function annotation after promoting arguments
Ettore Tiotto via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 08:01:28 PDT 2020
etiotto updated this revision to Diff 288335.
etiotto added a comment.
Fix quotes in profile.ll
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86630/new/
https://reviews.llvm.org/D86630
Files:
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/test/Transforms/ArgumentPromotion/profile.ll
Index: llvm/test/Transforms/ArgumentPromotion/profile.ll
===================================================================
--- llvm/test/Transforms/ArgumentPromotion/profile.ll
+++ llvm/test/Transforms/ArgumentPromotion/profile.ll
@@ -15,9 +15,9 @@
ret void
}
-define internal void @promote_i32_ptr(i32* %xp) {
+define internal void @promote_i32_ptr(i32* %xp) !prof !1 {
; CHECK-LABEL: define {{[^@]+}}@promote_i32_ptr
-; CHECK-SAME: (i32 [[XP_VAL:%.*]])
+; CHECK-SAME: (i32 [[XP_VAL:%.*]]) !prof !1
; CHECK-NEXT: call void @use_i32(i32 [[XP_VAL]])
; CHECK-NEXT: ret void
;
@@ -29,3 +29,4 @@
declare void @use_i32(i32)
!0 = !{!"branch_weights", i32 30}
+!1 = !{!"function_entry_count", i64 100}
Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
===================================================================
--- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -215,6 +215,7 @@
Function *NF = Function::Create(NFTy, F->getLinkage(), F->getAddressSpace(),
F->getName());
NF->copyAttributesFrom(F);
+ NF->copyMetadata(F, 0);
// Patch the pointer to LLVM function in debug info descriptor.
NF->setSubprogram(F->getSubprogram());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86630.288335.patch
Type: text/x-patch
Size: 1256 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200827/d7f65ed6/attachment.bin>
More information about the llvm-commits
mailing list