diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp --- a/llvm/lib/Analysis/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/GlobalsModRef.cpp @@ -61,10 +61,10 @@ class GlobalsAAResult::FunctionInfo { typedef SmallDenseMap GlobalInfoMapType; - /// Build a wrapper struct that has 8-byte alignment. All heap allocations + /// Build a wrapper struct that has 16-byte alignment. All heap allocations /// should provide this much alignment at least, but this makes it clear we /// specifically rely on this amount of alignment. - struct alignas(8) AlignedMap { + struct alignas(16) AlignedMap { AlignedMap() {} AlignedMap(const AlignedMap &Arg) : Map(Arg.Map) {} GlobalInfoMapType Map; @@ -76,7 +76,7 @@ static inline AlignedMap *getFromVoidPointer(void *P) { return (AlignedMap *)P; } - enum { NumLowBitsAvailable = 3 }; + enum { NumLowBitsAvailable = 4 }; static_assert(alignof(AlignedMap) >= (1 << NumLowBitsAvailable), "AlignedMap insufficiently aligned to have enough low bits."); }; @@ -84,17 +84,16 @@ /// The bit that flags that this function may read any global. This is /// chosen to mix together with ModRefInfo bits. /// FIXME: This assumes ModRefInfo lattice will remain 4 bits! - /// It overlaps with ModRefInfo::Must bit! /// FunctionInfo.getModRefInfo() masks out everything except ModRef so - /// this remains correct, but the Must info is lost. - enum { MayReadAnyGlobal = 4 }; + /// this remains correct. + enum { MayReadAnyGlobal = 8 }; /// Checks to document the invariants of the bit packing here. - static_assert((MayReadAnyGlobal & static_cast(ModRefInfo::MustModRef)) == + static_assert((MayReadAnyGlobal & static_cast(ModRefInfo::ModRef)) == 0, "ModRef and the MayReadAnyGlobal flag bits overlap."); static_assert(((MayReadAnyGlobal | - static_cast(ModRefInfo::MustModRef)) >> + static_cast(ModRefInfo::ModRef)) >> AlignedMapPointerTraits::NumLowBitsAvailable) == 0, "Insufficient low bits to store our flag and ModRef info."); @@ -144,7 +143,7 @@ /// Adds new \c ModRefInfo for this function to its state. void addModRefInfo(ModRefInfo NewMRI) { - Info.setInt(Info.getInt() | static_cast(setMust(NewMRI))); + Info.setInt(Info.getInt() | static_cast(NewMRI)); } /// Returns whether this function may read any global variable, and we don't @@ -198,12 +197,12 @@ } private: - /// All of the information is encoded into a single pointer, with a three bit - /// integer in the low three bits. The high bit provides a flag for when this - /// function may read any global. The low two bits are the ModRefInfo. And + /// All of the information is encoded into a single pointer, with a four bit + /// integer in the low four bits. The high bit provides a flag for when this + /// function may read any global. The low three bits are the ModRefInfo. And /// the pointer, when non-null, points to a map from GlobalValue to /// ModRefInfo specific to that GlobalValue. - PointerIntPair Info; + PointerIntPair Info; }; void GlobalsAAResult::DeletionCallbackHandle::deleted() {