File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -e
3
+
4
+ # Update operands like "1966090 /* regdef:VGPR_32 */" in MIR tests when register
5
+ # class numbers change.
6
+
7
+ if [ $# -eq 0 ] ; then
8
+ echo " usage: ${0##*/ } /path/to/<Target>GenRegisterInfo.inc test/CodeGen/<Target>/testfile.mir..." >&2
9
+ exit 1
10
+ fi
11
+
12
+ reginfo=" $1 "
13
+ shift
14
+
15
+ files=$( grep -El ' [0-9]+ /\* [a-z-]+:\w+ \*/' " $@ " )
16
+ [ " $files " ] || exit 0
17
+
18
+ grep -Eho ' [0-9]+ /\* [a-z-]+:\w+ \*/' $files | sed -E ' s/.*:(\w+).*/\1/' | sort -u | while read -r class ; do
19
+ id=$( grep -E " ^ ${class} RegClassID = " " $reginfo " | sed -E ' s/.* = ([0-9]+).*/\1/' )
20
+ if [ " $id " ] ; then
21
+ echo " $class ..."
22
+ sed -Ei -e ' s| [0-9]+ (/\* reguse:' " $class " ' \*/)| ' " $(( (id + 1 ) << 16 | 9 )) " ' \1|g' \
23
+ -e ' s| [0-9]+ (/\* regdef:' " $class " ' \*/)| ' " $(( (id + 1 ) << 16 | 10 )) " ' \1|g' \
24
+ -e ' s| [0-9]+ (/\* regdef-ec:' " $class " ' \*/)| ' " $(( (id + 1 ) << 16 | 11 )) " ' \1|g' \
25
+ $files
26
+ fi
27
+ done
You can’t perform that action at this time.
0 commit comments