aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorevgeny <eleviant@accesssoftek.com>2020-01-15 19:29:01 +0300
committerevgeny <eleviant@accesssoftek.com>2020-01-15 19:29:01 +0300
commit10cadee5ce86e80d7486855199d329951f38af01 (patch)
tree9af9164ab50e8b7cee108cbe50f0473e9b1fd09c /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent3f3017e162ec4208399dcf633c99bdac788c06fd (diff)
downloadllvm-10cadee5ce86e80d7486855199d329951f38af01.zip
llvm-10cadee5ce86e80d7486855199d329951f38af01.tar.gz
llvm-10cadee5ce86e80d7486855199d329951f38af01.tar.bz2
[ThinLTO] Always import constants
This patch imports constant variables even when they can't be internalized (which results in promotion). This offers some extra constant folding opportunities. Differential revision: https://reviews.llvm.org/D70404
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 3346441..1eefb1b 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -986,7 +986,8 @@ static GlobalValueSummary::GVFlags getDecodedGVSummaryFlags(uint64_t RawFlags,
// Decode the flags for GlobalVariable in the summary
static GlobalVarSummary::GVarFlags getDecodedGVarFlags(uint64_t RawFlags) {
return GlobalVarSummary::GVarFlags((RawFlags & 0x1) ? true : false,
- (RawFlags & 0x2) ? true : false);
+ (RawFlags & 0x2) ? true : false,
+ (RawFlags & 0x4) ? true : false);
}
static GlobalValue::VisibilityTypes getDecodedVisibility(unsigned Val) {
@@ -5965,7 +5966,8 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
uint64_t RawFlags = Record[1];
unsigned RefArrayStart = 2;
GlobalVarSummary::GVarFlags GVF(/* ReadOnly */ false,
- /* WriteOnly */ false);
+ /* WriteOnly */ false,
+ /* Constant */ false);
auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
if (Version >= 5) {
GVF = getDecodedGVarFlags(Record[2]);
@@ -6101,7 +6103,8 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
uint64_t RawFlags = Record[2];
unsigned RefArrayStart = 3;
GlobalVarSummary::GVarFlags GVF(/* ReadOnly */ false,
- /* WriteOnly */ false);
+ /* WriteOnly */ false,
+ /* Constant */ false);
auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
if (Version >= 5) {
GVF = getDecodedGVarFlags(Record[3]);