diff options
| author | Arthur Eubanks <aeubanks@google.com> | 2021-10-06 11:35:27 -0700 |
|---|---|---|
| committer | Arthur Eubanks <aeubanks@google.com> | 2021-10-06 11:38:11 -0700 |
| commit | 569346f27418e4cdde95e0f803fb2799049a53d1 (patch) | |
| tree | 0fd151547773f2a2325e0efc88ae92016078c926 /llvm/lib/CodeGen/SafeStack.cpp | |
| parent | 1b76312e98a22bee08cb29519ed735553cfc5640 (diff) | |
Revert "Reland [IR] Increase max alignment to 4GB"
This reverts commit 8d64314ffea55f2ad94c1b489586daa8ce30f451.
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SafeStack.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index e1d11c36e1a9..94add920f284 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -147,7 +147,7 @@ class SafeStack { /// /// 16 seems like a reasonable upper bound on the alignment of objects that we /// might expect to appear on the stack on most common targets. - static constexpr uint64_t StackAlignment = 16; + enum { StackAlignment = 16 }; /// Return the value of the stack canary. Value *getStackGuard(IRBuilder<> &IRB, Function &F); @@ -544,7 +544,8 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack( Size = 1; // Don't create zero-sized stack objects. // Ensure the object is properly aligned. - uint64_t Align = std::max(DL.getPrefTypeAlignment(Ty), AI->getAlignment()); + unsigned Align = + std::max((unsigned)DL.getPrefTypeAlignment(Ty), AI->getAlignment()); SSL.addObject(AI, Size, Align, ClColoring ? SSC.getLiveRange(AI) : NoColoringRange); @@ -675,9 +676,9 @@ void SafeStack::moveDynamicAllocasToUnsafeStack( SP = IRB.CreateSub(SP, Size); // Align the SP value to satisfy the AllocaInst, type and stack alignments. - uint64_t Align = - std::max(std::max(DL.getPrefTypeAlignment(Ty), AI->getAlignment()), - StackAlignment); + unsigned Align = std::max( + std::max((unsigned)DL.getPrefTypeAlignment(Ty), AI->getAlignment()), + (unsigned)StackAlignment); assert(isPowerOf2_32(Align)); Value *NewTop = IRB.CreateIntToPtr( |
