From 1a6cebb4d12c744699e23624f8afda5cbe216fe6 Mon Sep 17 00:00:00 2001 From: dfukalov Date: Mon, 29 Jun 2020 03:43:26 +0300 Subject: [PATCH] [PM] Fix new PM to perform SpeculativeExecution as in old PM Summary: Old PM runs SpeculativeExecutionPass for targets that have divergent branches. It uses `createSpeculativeExecutionIfHasBranchDivergencePass` that creates the pass with `OnlyIfDivergentTarget=true`, whereas new PM just created the pass with default `OnlyIfDivergentTarget=fase` so it unexpectedly runs and causes buildbot test fails. Reviewers: chandlerc, arsenm Reviewed By: arsenm Subscribers: wdng, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D82735 --- llvm/lib/Passes/PassBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index 7bdeb4d..5851060 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -584,7 +584,7 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level, } // Speculative execution if the target has divergent branches; otherwise nop. - FPM.addPass(SpeculativeExecutionPass()); + FPM.addPass(SpeculativeExecutionPass(/* OnlyIfDivergentTarget =*/true)); // Optimize based on known information about branches, and cleanup afterward. FPM.addPass(JumpThreadingPass()); -- 2.7.4