From 5272c3b1e1035b67b7741d54000d91438a5b4ef8 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Thu, 14 Dec 2017 21:38:03 -0600 Subject: [PATCH] Simplify CFG between IndVarSimplify and LoopIdiomRecognize This ensures that information is properly propagated when IndVarSimplify removes an overflow check. --- lib/Transforms/IPO/PassManagerBuilder.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Transforms/IPO/PassManagerBuilder.cpp b/lib/Transforms/IPO/PassManagerBuilder.cpp index 260b2283b311..69159445d135 100644 --- a/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -315,6 +315,7 @@ void PassManagerBuilder::addFunctionSimplificationPasses( MPM.add(createCFGSimplificationPass()); addInstructionCombiningPass(MPM); MPM.add(createIndVarSimplifyPass()); // Canonicalize indvars + MPM.add(createCFGSimplificationPass()); // Clean up after IndVarSimplify. MPM.add(createLoopIdiomPass()); // Recognize idioms like memset. MPM.add(createLoopDeletionPass()); // Delete dead loops if (EnableLoopInterchange) {