Known bits

The walk also keeps, for each 32-bit integer value, the bits known 0 and the bits known 1 (LLVM's known bits), two words per id: a constant's are all known; an instruction's come from its operands':

What it folds:

A boolean is known only as a constant, which the folds above take already. The comparisons then fold the selects and logical instructions on them as constants.

On the Maxwell translator's modules it removes the component of an indexed constant buffer read: the translator splits an address made of a register shifted by 4 plus an offset into a vec4's index and (address >> 2) & 3, and the low bits of such an address are known. Also the sign tests of masked values (an absolute value or a clamp of what cannot be negative) and the fields past a value's width.


Made from docs/layers/gpu/spirv-opt.md at 69237645142c. GPL-3.0-or-later.