Skip to content

Commit 2b896e3

Browse files
committed
Revert "[Attributor] Enable heap-to-stack of any size"
This reverts commit 51bd42e.
1 parent 1bee549 commit 2b896e3

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5166,25 +5166,13 @@ ChangeStatus AAHeapToStackImpl::updateImpl(Attributor &A) {
51665166
}
51675167

51685168
if (IsMalloc) {
5169-
if (MaxHeapToStackSize == -1) {
5170-
if (UsesCheck(I) || FreeCheck(I)) {
5171-
MallocCalls.insert(&I);
5172-
return true;
5173-
}
5174-
}
51755169
if (auto *Size = dyn_cast<ConstantInt>(I.getOperand(0)))
51765170
if (Size->getValue().ule(MaxHeapToStackSize))
51775171
if (UsesCheck(I) || FreeCheck(I)) {
51785172
MallocCalls.insert(&I);
51795173
return true;
51805174
}
51815175
} else if (IsAlignedAllocLike && isa<ConstantInt>(I.getOperand(0))) {
5182-
if (MaxHeapToStackSize == -1) {
5183-
if (UsesCheck(I) || FreeCheck(I)) {
5184-
MallocCalls.insert(&I);
5185-
return true;
5186-
}
5187-
}
51885176
// Only if the alignment and sizes are constant.
51895177
if (auto *Size = dyn_cast<ConstantInt>(I.getOperand(1)))
51905178
if (Size->getValue().ule(MaxHeapToStackSize))
@@ -5193,12 +5181,6 @@ ChangeStatus AAHeapToStackImpl::updateImpl(Attributor &A) {
51935181
return true;
51945182
}
51955183
} else if (IsCalloc) {
5196-
if (MaxHeapToStackSize == -1) {
5197-
if (UsesCheck(I) || FreeCheck(I)) {
5198-
MallocCalls.insert(&I);
5199-
return true;
5200-
}
5201-
}
52025184
bool Overflow = false;
52035185
if (auto *Num = dyn_cast<ConstantInt>(I.getOperand(0)))
52045186
if (auto *Size = dyn_cast<ConstantInt>(I.getOperand(1)))

llvm/test/Transforms/Attributor/lowerheap.ll

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)