[PATCH] D58589: [ConstantHoisting] Call cleanup() in ConstantHoistingPass::runImpl to avoid dangling elements in ConstIntInfoVec for new PM
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 28 21:11:18 PST 2019
MaskRay updated this revision to Diff 188845.
MaskRay retitled this revision from "[ConstantHoisting] Inline releaseMemory() into ConstantHoistingPass::runImpl to avoid dangling elements in ConstIntInfoVec for new PM" to "[ConstantHoisting] Call cleanup() in ConstantHoistingPass::runImpl to avoid dangling elements in ConstIntInfoVec for new PM".
MaskRay edited the summary of this revision.
MaskRay added a comment.
Rename releaseMemory() to cleanup() as wmi suggested.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58589/new/
https://reviews.llvm.org/D58589
Files:
include/llvm/Transforms/Scalar/ConstantHoisting.h
lib/Transforms/Scalar/ConstantHoisting.cpp
test/Transforms/ConstantHoisting/X86/phi.ll
Index: test/Transforms/ConstantHoisting/X86/phi.ll
===================================================================
--- test/Transforms/ConstantHoisting/X86/phi.ll
+++ test/Transforms/ConstantHoisting/X86/phi.ll
@@ -1,4 +1,5 @@
; RUN: opt -S -consthoist < %s | FileCheck %s
+; RUN: opt -S -passes=consthoist < %s | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9.0"
Index: lib/Transforms/Scalar/ConstantHoisting.cpp
===================================================================
--- lib/Transforms/Scalar/ConstantHoisting.cpp
+++ lib/Transforms/Scalar/ConstantHoisting.cpp
@@ -114,8 +114,6 @@
AU.addRequired<TargetTransformInfoWrapperPass>();
}
- void releaseMemory() override { Impl.releaseMemory(); }
-
private:
ConstantHoistingPass Impl;
};
@@ -947,6 +945,8 @@
// Cleanup dead instructions.
deleteDeadCastInst();
+ cleanup();
+
return MadeChange;
}
Index: include/llvm/Transforms/Scalar/ConstantHoisting.h
===================================================================
--- include/llvm/Transforms/Scalar/ConstantHoisting.h
+++ include/llvm/Transforms/Scalar/ConstantHoisting.h
@@ -126,7 +126,7 @@
bool runImpl(Function &F, TargetTransformInfo &TTI, DominatorTree &DT,
BlockFrequencyInfo *BFI, BasicBlock &Entry);
- void releaseMemory() {
+ void cleanup() {
ClonedCastMap.clear();
ConstIntCandVec.clear();
for (auto MapEntry : ConstGEPCandMap)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58589.188845.patch
Type: text/x-patch
Size: 1499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190301/edada815/attachment.bin>
More information about the llvm-commits
mailing list