[NFC][RemoveDIs] Prefer iterator-insertion over instructions
[llvm-project.git] / mlir / utils / spirv / refresh_inst.sh
blobfe08a06d557a8f3c09c5da420632a979697277d7
1 #!/bin/bash
2 # 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-exception
6 # Script for refreshing all defined SPIR-V ops using SPIR-V spec from the
7 # Internet.
9 # Run as:
10 # ./refresh_inst.sh
12 current_file="$(readlink -f "$0")"
13 current_dir="$(dirname "$current_file")"
15 spirv_ir_include_dir="${current_dir}/../../include/mlir/Dialect/SPIRV/IR/"
17 for file in "${spirv_ir_include_dir}"/*; do
18 file_name="$(basename $file)"
19 if [[ $file_name == "SPIRVOps.td" ||
20 $file_name == "SPIRVCLOps.td" ||
21 $file_name == "SPIRVGLOps.td" ]]; then
22 continue
24 if [[ $file_name =~ SPIRV.*Ops.td ]]; then
25 echo "--- refreshing $file_name ---"
26 "${current_dir}/define_inst.sh" ${file_name} Op
28 done