'Load LLVM with HSAIL SPIR spec'

def load_llvm(self, llvmir):

    llvmir = self._preprocess(llvmir)
    (tmp_llvm_ir, fin) = self._create_temp_file('dump-llvm-ir')
    with tmp_llvm_ir:
        tmp_llvm_ir.write(llvmir.encode('ascii'))
    fout = self._track_temp_file('verified-llvm-ir')
    self._cmd.verify(ipath=fin, opath=fout)
    if config.DUMP_OPTIMIZED:
        with open(fout, 'rb') as fin_opt:
            print(fin_opt.read().decode('ascii'))
    self._linkfiles.append(fout)
