[PATCH] D58589: [ConstantHoisting] Inline releaseMemory() into ConstantHoistingPass::runImpl to avoid dangling elements in ConstIntInfoVec for new PM

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 27 14:51:07 PST 2019


wmi added inline comments.


================
Comment at: lib/Transforms/Scalar/ConstantHoisting.cpp:950
 
+  releaseMemory();
+
----------------
MaskRay wrote:
> ormris wrote:
> > ormris wrote:
> > > If this only happens in the new pass manager, could this call be moved to ::run? That way, the legacy pass manager doesn't call this function twice.
> > s/::run/ConstantHoistingPass::run/g
> Thanks! I think maybe it makes more sense to delete releaseMemory() and inline it into the end of runImpl. I've updated the patch to do that.
nit: why you feel it is better to inline it? It seems better to me to extract those cleanups into a function.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58589





More information about the llvm-commits mailing list