pan/midgard: Add make_compiler_temp_reg helper