summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-10-30 05:40:44 +0000
committerTeresa Johnson <tejohnson@google.com>2016-10-30 05:40:44 +0000
commitbf28c8fa453a576164633be31eee75b3ac258db2 (patch)
treef50d17d127fa3acdabc1180d34305af15abd4f50 /llvm/include
parent3bc8abdffc648cf1ff17edfed6fcb155b52e823f (diff)
downloadbcm5719-llvm-bf28c8fa453a576164633be31eee75b3ac258db2.tar.gz
bcm5719-llvm-bf28c8fa453a576164633be31eee75b3ac258db2.zip
[ThinLTO] Use per-summary flag to prevent exporting locals used in inline asm
Summary: Instead of using the workaround of suppressing the entire index for modules that call inline asm that may reference locals, use the NoRename flag on the summary for any locals in the llvm.used set, and add a reference edge from any functions containing inline asm. This avoids issues from having no summaries despite the module defining global values, which was preventing more aggressive index-based optimization. It will be followed by a subsequent patch to make a similar fix for local references in module level asm (to fix PR30610). Reviewers: mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26121 llvm-svn: 285513
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h5
-rw-r--r--llvm/include/llvm/IR/ModuleSummaryIndex.h4
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
index c8adc3bf81a..617c3d8f17a 100644
--- a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
+++ b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
@@ -70,11 +70,6 @@ public:
// object for the module, to be written to bitcode or LLVM assembly.
//
ModulePass *createModuleSummaryIndexWrapperPass();
-
-/// Returns true if \p M is eligible for ThinLTO promotion.
-///
-/// Currently we check if it has any any InlineASM that uses an internal symbol.
-bool moduleCanBeRenamedForThinLTO(const Module &M);
}
#endif
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h
index 1ceb9eb32cb..b3775904e75 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndex.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h
@@ -194,6 +194,10 @@ public:
/// possibly referenced from inline assembly, etc).
bool noRename() const { return Flags.NoRename; }
+ /// Flag that this global value cannot be renamed (in a specific section,
+ /// possibly referenced from inline assembly, etc).
+ void setNoRename() { Flags.NoRename = true; }
+
/// Record a reference from this global value to the global value identified
/// by \p RefGUID.
void addRefEdge(GlobalValue::GUID RefGUID) { RefEdgeList.push_back(RefGUID); }
OpenPOWER on IntegriCloud