[PATCH] D13088: [InlineCost] Adjust inlining cost for implicit null checks
Chen Li via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 20:48:19 PDT 2015
chenli created this revision.
chenli added reviewers: reames, chandlerc.
chenli added a subscriber: llvm-commits.
Implicit null checks act like unconditional branches, and their inlining cost should be free.
http://reviews.llvm.org/D13088
Files:
lib/Analysis/InlineCost.cpp
Index: lib/Analysis/InlineCost.cpp
===================================================================
--- lib/Analysis/InlineCost.cpp
+++ lib/Analysis/InlineCost.cpp
@@ -602,6 +602,11 @@
disableSROA(CostIt);
}
+ // Implicit null checks act as unconditional branches, and
+ // they should be free. See the comments in visitBranchInst.
+ if (I.getMetadata(LLVMContext::MD_make_implicit))
+ return true;
+
return false;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13088.35460.patch
Type: text/x-patch
Size: 442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150923/9ec9e745/attachment.bin>
More information about the llvm-commits
mailing list