• Bas Nieuwenhuizen's avatar
    amd/llvm: Fix divergent descriptor indexing. (v3) · b83c9aca
    Bas Nieuwenhuizen authored
    There are multiple LLVM passes that very much move the
    intrinsic using the descriptor outside of the loop, defeating
    the entire point of creating the loop.
    Defeat the optimizer by  splitting the break into a separate
    if-statement and putting an optimization barrier on the bool
    in between.
    v2: Move from a callback based system to begin/end loop.
        This does not make it significantly less intrusive but
        is a bit nicer with all the extra struct and callback
    v3: Deal with non-divergent values in divergent path.
    Closes: #2160
    Fixes: 028ce527
     "radv: Add non-uniform indexing lowering."
    Reviewed-by: Samuel Pitoiset's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
    Tested-by: Marge Bot <!4109>
    Part-of: <!4109>