diff options
| author | Shuxin Yang <shuxin.llvm@gmail.com> | 2013-10-23 17:28:19 +0000 |
|---|---|---|
| committer | Shuxin Yang <shuxin.llvm@gmail.com> | 2013-10-23 17:28:19 +0000 |
| commit | e4fb375995def5029b94b5af708dd181be36ca01 (patch) | |
| tree | 0aeb1e181522138b9b4899031276aa82e4648e7e /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
| parent | 2ea0f2cdaef1d5c8a01acb2a9d9437215a0e0e00 (diff) | |
| download | llvm-e4fb375995def5029b94b5af708dd181be36ca01.zip llvm-e4fb375995def5029b94b5af708dd181be36ca01.tar.gz llvm-e4fb375995def5029b94b5af708dd181be36ca01.tar.bz2 | |
Use address-taken to disambiguate global variable and indirect memops.
Major steps include:
1). introduces a not-addr-taken bit-field in GlobalVariable
2). GlobalOpt pass sets "not-address-taken" if it proves a global varirable
dosen't have its address taken.
3). AA use this info for disambiguation.
llvm-svn: 193251
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
| -rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index b082ba6..4f631b9 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -616,11 +616,13 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, Vals.push_back(GV->hasSection() ? SectionMap[GV->getSection()] : 0); if (GV->isThreadLocal() || GV->getVisibility() != GlobalValue::DefaultVisibility || - GV->hasUnnamedAddr() || GV->isExternallyInitialized()) { + GV->hasUnnamedAddr() || GV->isExternallyInitialized() || + !GV->AddressMaybeTaken()) { Vals.push_back(getEncodedVisibility(GV)); Vals.push_back(getEncodedThreadLocalMode(GV)); Vals.push_back(GV->hasUnnamedAddr()); Vals.push_back(GV->isExternallyInitialized()); + Vals.push_back(GV->AddressMaybeTaken()); } else { AbbrevToUse = SimpleGVarAbbrev; } |
