[llvm] [GVNSink] Fix non-determinisms by using Depth-First ordering (PR #90995)
    Eli Friedman via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri May  3 14:32:48 PDT 2024
    
    
  
================
@@ -886,8 +919,12 @@ void GVNSink::sinkLastInstruction(ArrayRef<BasicBlock *> Blocks,
 } // end anonymous namespace
 
 PreservedAnalyses GVNSinkPass::run(Function &F, FunctionAnalysisManager &AM) {
-  GVNSink G;
+  auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
+  GVNSink G(&DT);
   if (!G.run(F))
     return PreservedAnalyses::all();
+
+  // PHI nodes get inserted which haven't been added to the Dominator Tree.
----------------
efriedma-quic wrote:
That seems like something you could measure pretty easily.
https://github.com/llvm/llvm-project/pull/90995
    
    
More information about the llvm-commits
mailing list