Skip to content
  • Connor Abbott's avatar
    ac,radeonsi: Always mark buffer stores as inaccessiblememonly · 3bf8981c
    Connor Abbott authored
    
    
    inaccessiblememonly means that it doesn't modify memory accesible via
    normal LLVM pointers. This lets LLVM's dead store elimination, memcpy
    forwarding, etc. ignore functions with this attribute. We don't
    represent descriptors as pointers, so this property is always true of
    buffer and image stores. There are plans to represent descriptors via
    pointers, but this just means that now nothing is inaccessiblememonly,
    as LLVM will then understand loads/stores via its usual alias analysis.
    
    Radeonsi was mistakenly only setting it if the driver could prove that
    there were no reads, and then it was cargo-culted into ac_llvm_build
    and ac_llvm_to_nir. Rip it out of everything.
    
    statistics with nir enabled:
    
    Totals from affected shaders:
    SGPRS: 152 -> 152 (0.00 %)
    VGPRS: 128 -> 132 (3.12 %)
    Spilled SGPRs: 0 -> 0 (0.00 %)
    Spilled VGPRs: 0 -> 0 (0.00 %)
    Private memory VGPRs: 0 -> 0 (0.00 %)
    Scratch size: 0 -> 0 (0.00 %) dwords per thread
    Code Size: 9324 -> 9244 (-0.86 %) bytes
    LDS: 2 -> 2 (0.00 %) blocks
    Max Waves: 17 -> 17 (0.00 %)
    Wait states: 0 -> 0 (0.00 %)
    
    The only difference was a manhattan31 shader.
    
    Acked-by: default avatarTimothy Arceri <tarceri@itsqueeze.com>
    Acked-by: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
    Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
    3bf8981c