From 83bcc68afa1907f1e86321f25a72342f0c9a714f Mon Sep 17 00:00:00 2001 From: Fedor Sergeev Date: Thu, 14 Dec 2017 10:36:31 +0000 Subject: [PM][InstCombine] fixing omission of AliasAnalysis in new-pass-manager's version of InstCombine Summary: Passing AliasAnalysis results instead of nullptr appears to work just fine. A couple new-pass-manager tests updated to align with new order of analyses. Reviewers: chandlerc, spatel, craig.topper Reviewed By: chandlerc Subscribers: mehdi_amini, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D41203 llvm-svn: 320687 --- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp') diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index f272f8273d1..b332e75c7fe 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -3276,8 +3276,8 @@ PreservedAnalyses InstCombinePass::run(Function &F, auto *LI = AM.getCachedResult(F); - // FIXME: The AliasAnalysis is not yet supported in the new pass manager - if (!combineInstructionsOverFunction(F, Worklist, nullptr, AC, TLI, DT, ORE, + auto *AA = &AM.getResult(F); + if (!combineInstructionsOverFunction(F, Worklist, AA, AC, TLI, DT, ORE, ExpensiveCombines, LI)) // No changes, all analyses are preserved. return PreservedAnalyses::all(); @@ -3286,6 +3286,7 @@ PreservedAnalyses InstCombinePass::run(Function &F, PreservedAnalyses PA; PA.preserveSet(); PA.preserve(); + PA.preserve(); PA.preserve(); return PA; } -- cgit v1.2.3