]> granicus.if.org Git - llvm/commit
[ConstantHoisting] Call cleanup() in ConstantHoistingPass::runImpl to avoid dangling...
authorFangrui Song <maskray@google.com>
Fri, 1 Mar 2019 05:27:01 +0000 (05:27 +0000)
committerFangrui Song <maskray@google.com>
Fri, 1 Mar 2019 05:27:01 +0000 (05:27 +0000)
commitb1f04183c4bc5ea04aaa7338bd2948c86abc175f
treefd1abecf096f8638a6beb4b5f745a3479cd31cb8
parent78b4cefc3c1a10be4e1d38aa9ddf47b9d1a3c3c7
[ConstantHoisting] Call cleanup() in ConstantHoistingPass::runImpl to avoid dangling elements in ConstIntInfoVec for new PM

Summary:
ConstIntInfoVec contains elements extracted from the previous function.
In new PM, releaseMemory() is not called and the dangling elements can
cause segfault in findConstantInsertionPoint.

Rename releaseMemory() to cleanup() to deliver the idea that it is
mandatory and call cleanup() in ConstantHoistingPass::runImpl to fix
this.

Reviewers: ormris, zzheng, dmgreen, wmi

Reviewed By: ormris, wmi

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58589

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355174 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Scalar/ConstantHoisting.h
lib/Transforms/Scalar/ConstantHoisting.cpp
test/Transforms/ConstantHoisting/X86/phi.ll