[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:27:43 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL355174: [ConstantHoisting] Call cleanup() in ConstantHoistingPass::runImpl to avoid… (authored by MaskRay, committed by ).

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58589/new/

https://reviews.llvm.org/D58589

Files:
  llvm/trunk/include/llvm/Transforms/Scalar/ConstantHoisting.h
  llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp
  llvm/trunk/test/Transforms/ConstantHoisting/X86/phi.ll


Index: llvm/trunk/include/llvm/Transforms/Scalar/ConstantHoisting.h
===================================================================
--- llvm/trunk/include/llvm/Transforms/Scalar/ConstantHoisting.h
+++ llvm/trunk/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)
Index: llvm/trunk/test/Transforms/ConstantHoisting/X86/phi.ll
===================================================================
--- llvm/trunk/test/Transforms/ConstantHoisting/X86/phi.ll
+++ llvm/trunk/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: llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp
+++ llvm/trunk/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;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58589.188846.patch
Type: text/x-patch
Size: 1598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190301/89c8f485/attachment.bin>


More information about the llvm-commits mailing list