aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SafeStack.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2021-10-06 10:21:17 -0700
committerArthur Eubanks <aeubanks@google.com>2021-10-06 10:21:35 -0700
commit72cf8b60445441635745ee65ff0c1f9c1a4418fe (patch)
treed7206cd9a3f2cbaa0fa6d6ec387eb082412c90ca /llvm/lib/CodeGen/SafeStack.cpp
parent2130117f92e51df73ac8c4b7e37f7f89178a89f2 (diff)
downloadllvm-72cf8b60445441635745ee65ff0c1f9c1a4418fe.zip
llvm-72cf8b60445441635745ee65ff0c1f9c1a4418fe.tar.gz
llvm-72cf8b60445441635745ee65ff0c1f9c1a4418fe.tar.bz2
Revert "[IR] Increase max alignment to 4GB"
This reverts commit df84c1fe78130a86445d57563dea742e1b85156a. Breaks some bots
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
-rw-r--r--llvm/lib/CodeGen/SafeStack.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp
index e1d11c3..94add92 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(