Skip to content
  • Francisco Jerez's avatar
    intel/cfg: Represent divergent control flow paths caused by non-uniform loop execution. · 4d1959e6
    Francisco Jerez authored
    
    
    This addresses a long-standing back-end compiler bug that could lead
    to cross-channel data corruption in loops executed non-uniformly.  In
    some cases live variables extending through a loop divergence point
    (e.g. a non-uniform break) into a convergence point (e.g. the end of
    the loop) wouldn't be considered live along all physical control flow
    paths the SIMD thread could possibly have taken in between due to some
    channels remaining in the loop for additional iterations.
    
    This patch fixes the problem by extending the CFG with physical edges
    that don't exist in the idealized non-vectorized program, but
    represent valid control flow paths the SIMD EU may take due to the
    divergence of logical threads.  This makes sense because the i965 IR
    is explicitly SIMD, and it's not uncommon for instructions to have an
    influence on neighboring channels (e.g. a force_writemask_all header
    setup), so the behavior of the SIMD thread as a whole needs to be
    considered.
    
    No changes in shader-db.
    
    Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
    Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
    4d1959e6