[PATCH] D21513: [CFLAA] Try to be less conservative on more functions

Jia Chen via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 19 17:53:04 PDT 2016


grievejia created this revision.
grievejia added reviewers: george.burgess.iv, hfinkel.
grievejia added a subscriber: llvm-commits.

I've changed the criteria of marking a function f external from "f->hasLocalLinkage()" to "f->isInterposable()". I think the former is overly conservative since it only handles functions with internal or private linkage type, yet all we want for non-external functions is that they can't be overwritten while linking. If my thought turns out to be wrong, I'm happy to switch it back.

http://reviews.llvm.org/D21513

Files:
  lib/Analysis/CFLAliasAnalysis.cpp

Index: lib/Analysis/CFLAliasAnalysis.cpp
===================================================================
--- lib/Analysis/CFLAliasAnalysis.cpp
+++ lib/Analysis/CFLAliasAnalysis.cpp
@@ -368,7 +368,7 @@
   }
 
   static bool isFunctionExternal(Function *Fn) {
-    return Fn->isDeclaration() || !Fn->hasLocalLinkage();
+    return Fn->isDeclaration() || Fn->isInterposable();
   }
 
   bool tryInterproceduralAnalysis(CallSite CS,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21513.61231.patch
Type: text/x-patch
Size: 433 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160620/6b3c9880/attachment.bin>


More information about the llvm-commits mailing list