split out Builder for ir.h, fix strict aliasing in Optional<T>