Skip to content
  • Roland Scheidegger's avatar
    gallivm: only fetch pointers to constant buffers once · 8a9f5ecd
    Roland Scheidegger authored
    In 1d35f772
    
     support for multiple constant
    buffers was introduced. This meant we had another indirection, and we did
    resolve the indirection for each constant buffer access. This looks very
    reasonable since llvm can figure out if it's the same pointer, however it
    turns out that this can cause llvm compilation time to go through the roof
    and beyond (I've seen cases in excess of factor 100, e.g. from 50 ms to more
    than 10 seconds (!)), with all the additional time spent in IR optimization
    passes (and in the end all of it in DominatorTree::dominate()).
    I've been unable to narrow it down a bit more (only some shaders seem affected,
    seemingly without much correlation to overall shader complexity or constant
    usage) but it is easily avoidable by doing the buffer lookups themeselves just
    once (at constant buffer declaration time).
    
    Reviewed-by: default avatarJose Fonseca <jfonseca@vmware.com>
    8a9f5ecd