[PATCH] D39995: [SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering
    Mandeep Singh Grang via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Nov 14 10:04:35 PST 2017
    
    
  
mgrang added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:9551
               [](const CaseCluster &a, const CaseCluster &b) {
-      return a.Prob > b.Prob;
     });
----------------
fhahn wrote:
> I might be missing something but could we still end up with multiple clusters where `a.Prob == b.Prob && a.Low == b.Low` ? Then the order of those nodes would still be non-deterministic, no?
@fhahn Thanks! I am not sure if we two clusters can have the same Low. How about I add another predicate a.High < b.High?
The fallback option is to simply change this to use std::stable_sort but I wanted to avoid this if we can simply get by adding stronger predicates.
Repository:
  rL LLVM
https://reviews.llvm.org/D39995
    
    
More information about the llvm-commits
mailing list