mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Add the ability to "intern" FoldingSetNodeID data into a
BumpPtrAllocator-allocated region to allow it to be stored in a more compact form and to avoid the need for a non-trivial destructor call. Use this new mechanism in ScalarEvolution instead of FastFoldingSetNode to avoid leaking memory in the case where a FoldingSetNodeID uses heap storage, and to reduce overall memory usage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -49,7 +49,11 @@ namespace llvm {
|
||||
/// are opaque objects that the client is not allowed to do much with
|
||||
/// directly.
|
||||
///
|
||||
class SCEV : public FastFoldingSetNode {
|
||||
class SCEV : public FoldingSetNode {
|
||||
/// FastID - A reference to an Interned FoldingSetNodeID for this node.
|
||||
/// The ScalarEvolution's BumpPtrAllocator holds the data.
|
||||
FoldingSetNodeIDRef FastID;
|
||||
|
||||
// The SCEV baseclass this node corresponds to
|
||||
const unsigned short SCEVType;
|
||||
|
||||
@@ -64,11 +68,14 @@ namespace llvm {
|
||||
protected:
|
||||
virtual ~SCEV();
|
||||
public:
|
||||
explicit SCEV(const FoldingSetNodeID &ID, unsigned SCEVTy) :
|
||||
FastFoldingSetNode(ID), SCEVType(SCEVTy), SubclassData(0) {}
|
||||
explicit SCEV(const FoldingSetNodeIDRef ID, unsigned SCEVTy) :
|
||||
FastID(ID), SCEVType(SCEVTy), SubclassData(0) {}
|
||||
|
||||
unsigned getSCEVType() const { return SCEVType; }
|
||||
|
||||
/// Profile - FoldingSet support.
|
||||
void Profile(FoldingSetNodeID& ID) { ID = FastID; }
|
||||
|
||||
/// isLoopInvariant - Return true if the value of this SCEV is unchanging in
|
||||
/// the specified loop.
|
||||
virtual bool isLoopInvariant(const Loop *L) const = 0;
|
||||
|
Reference in New Issue
Block a user