From 50d2d2143ed2b16bba4056b604dd3ebc5ee378d2 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Sun, 29 May 2016 00:41:17 +0000 Subject: [PATCH] [PM] Reassociate: cache analyses more aggressively. While here, add a FIXME for setPreserveCFG(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271159 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/Reassociate.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 6b761c5bec7..75f646d1d43 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -2227,8 +2227,13 @@ PreservedAnalyses ReassociatePass::run(Function &F) { RankMap.clear(); ValueRankMap.clear(); - if (MadeChange) - return PreservedAnalyses::none(); + if (MadeChange) { + // FIXME: Reassociate should also 'preserve the CFG'. + // The new pass manager has currently no way to do it. + auto PA = PreservedAnalyses(); + PA.preserve(); + return PA; + } return PreservedAnalyses::all(); }