Index: lib/Transforms/Scalar/ConstantHoisting.cpp =================================================================== --- lib/Transforms/Scalar/ConstantHoisting.cpp +++ lib/Transforms/Scalar/ConstantHoisting.cpp @@ -947,6 +947,8 @@ // Cleanup dead instructions. deleteDeadCastInst(); + releaseMemory(); + return MadeChange; } 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"