[llvm] 1a6cebb - [PM] Fix new PM to perform SpeculativeExecution as in old PM

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 05:21:17 PDT 2020


Author: dfukalov
Date: 2020-06-30T15:21:04+03:00
New Revision: 1a6cebb4d12c744699e23624f8afda5cbe216fe6

URL: https://github.com/llvm/llvm-project/commit/1a6cebb4d12c744699e23624f8afda5cbe216fe6
DIFF: https://github.com/llvm/llvm-project/commit/1a6cebb4d12c744699e23624f8afda5cbe216fe6.diff

LOG: [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

Added: 
    

Modified: 
    llvm/lib/Passes/PassBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 7bdeb4d3a028..58510609cf5e 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());


        


More information about the llvm-commits mailing list