[PATCH] D106418: [Attributor][NFC] Add a const argument isAssumedHeapToStack
Giorgis Georgakoudis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 20 19:49:08 PDT 2021
ggeorgakoudis created this revision.
Herald added subscribers: ormris, okura, jdoerfert, kuter, uenoku, hiraditya.
Herald added a reviewer: uenoku.
Herald added a reviewer: homerdin.
ggeorgakoudis requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added subscribers: llvm-commits, bbn.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106418
Files:
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Index: llvm/lib/Transforms/IPO/AttributorAttributes.cpp
===================================================================
--- llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -5714,6 +5714,13 @@
return false;
}
+ bool isAssumedHeapToStack(const CallBase &CB) const override {
+ if (isValidState())
+ if (AllocationInfo *AI = AllocationInfos.lookup(&CB))
+ return AI->Status != AllocationInfo::INVALID;
+ return false;
+ }
+
ChangeStatus manifest(Attributor &A) override {
assert(getState().isValidState() &&
"Attempted to manifest an invalid state!");
Index: llvm/include/llvm/Transforms/IPO/Attributor.h
===================================================================
--- llvm/include/llvm/Transforms/IPO/Attributor.h
+++ llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -3538,6 +3538,7 @@
/// Returns true if HeapToStack conversion is assumed to be possible.
virtual bool isAssumedHeapToStack(CallBase &CB) const = 0;
+ virtual bool isAssumedHeapToStack(const CallBase &CB) const = 0;
/// Create an abstract attribute view for the position \p IRP.
static AAHeapToStack &createForPosition(const IRPosition &IRP, Attributor &A);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106418.360347.patch
Type: text/x-patch
Size: 1258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210721/4201408c/attachment.bin>
More information about the llvm-commits
mailing list