brintos

brintos / llvm-project-archived public Read only

0
0
Text · 853 B · fe08a06 Raw
30 lines · bash
1#!/bin/bash2# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3# See https://llvm.org/LICENSE.txt for license information.4# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5 6# Script for refreshing all defined SPIR-V ops using SPIR-V spec from the7# Internet.8#9# Run as:10# ./refresh_inst.sh11 12current_file="$(readlink -f "$0")"13current_dir="$(dirname "$current_file")"14 15spirv_ir_include_dir="${current_dir}/../../include/mlir/Dialect/SPIRV/IR/"16 17for file in "${spirv_ir_include_dir}"/*; do18  file_name="$(basename $file)"19  if [[ $file_name == "SPIRVOps.td" ||20        $file_name == "SPIRVCLOps.td" ||21        $file_name == "SPIRVGLOps.td" ]]; then22    continue23  fi24  if [[ $file_name =~ SPIRV.*Ops.td ]]; then25    echo "--- refreshing $file_name ---"26    "${current_dir}/define_inst.sh" ${file_name} Op27  fi28done29 30