[llvm] [TableGen] Avoid repeated hash lookups (NFC) (PR #122586)

Mikael Holmén via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 12 22:54:07 PST 2025


mikaelholmen wrote:

Hi @kazutakahirata 

I've no idea what's going wrong but I noticed that the testcase
 llvm/test/tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml
starts failing with this commit when I build with -DLLVM_ENABLE_EXPENSIVE_CHECKS=ON.

If I then run
```
build-all-expensive/bin/llvm-lit -av test/tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml
```
It fails like
```
-- Testing: 1 tests, 1 workers --
FAIL: LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml (1 of 1)
******************** TEST 'LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
Input file: /repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.dSYM
Output file (aarch64): /repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.default.gSYM
Loaded 3 functions from DWARF.
Loaded 3 functions from symbol table.
warning: same address range contains different debug info. Removing:
[0x0000000000000248 - 0x0000000000000270): Name=0x00000001
addr=0x0000000000000248, file=  1, line=  5
addr=0x0000000000000254, file=  1, line=  7
addr=0x0000000000000258, file=  1, line=  9
addr=0x000000000000025c, file=  1, line=  8
addr=0x0000000000000260, file=  1, line= 11
addr=0x0000000000000264, file=  1, line= 10
addr=0x0000000000000268, file=  1, line=  6


In favor of this one:
[0x0000000000000248 - 0x0000000000000270): Name=0x00000047
addr=0x0000000000000248, file=  3, line=  5
addr=0x0000000000000254, file=  3, line=  7
addr=0x0000000000000258, file=  3, line=  9
addr=0x000000000000025c, file=  3, line=  8
addr=0x0000000000000260, file=  3, line= 11
addr=0x0000000000000264, file=  3, line= 10
addr=0x0000000000000268, file=  3, line=  6


warning: same address range contains different debug info. Removing:
[0x0000000000000248 - 0x0000000000000270): Name=0x00000047
addr=0x0000000000000248, file=  3, line=  5
addr=0x0000000000000254, file=  3, line=  7
addr=0x0000000000000258, file=  3, line=  9
addr=0x000000000000025c, file=  3, line=  8
addr=0x0000000000000260, file=  3, line= 11
addr=0x0000000000000264, file=  3, line= 10
addr=0x0000000000000268, file=  3, line=  6


In favor of this one:
[0x0000000000000248 - 0x0000000000000270): Name=0x00000030
addr=0x0000000000000248, file=  2, line=  5
addr=0x0000000000000254, file=  2, line=  7
addr=0x0000000000000258, file=  2, line=  9
addr=0x000000000000025c, file=  2, line=  8
addr=0x0000000000000260, file=  2, line= 11
addr=0x0000000000000264, file=  2, line= 10
addr=0x0000000000000268, file=  2, line=  6


Pruned 5 functions, ended with 1 total
Duplicate address ranges with different debug info. occurred 2 time(s)

--
Command Output (stderr):
--
RUN: at line 1: /repo/uabelho/main-github/llvm/build-all-expensive/bin/yaml2obj /repo/uabelho/main-github/llvm/test/tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml -o /repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.dSYM
+ /repo/uabelho/main-github/llvm/build-all-expensive/bin/yaml2obj /repo/uabelho/main-github/llvm/test/tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml -o /repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.dSYM
RUN: at line 4: llvm-gsymutil --num-threads=1 --convert /repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.dSYM --out-file=/repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.default.gSYM
+ llvm-gsymutil --num-threads=1 --convert /repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.dSYM --out-file=/repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.default.gSYM
RUN: at line 5: llvm-gsymutil --verify --verbose /repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.default.gSYM | /repo/uabelho/main-github/llvm/build-all-expensive/bin/FileCheck --check-prefix=CHECK-GSYM-DEFAULT /repo/uabelho/main-github/llvm/test/tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml
+ llvm-gsymutil --verify --verbose /repo/uabelho/main-github/llvm/build-all-expensive/test/tools/llvm-gsymutil/ARM_AArch64/Output/macho-merged-funcs-dwarf.yaml.tmp.default.gSYM
+ /repo/uabelho/main-github/llvm/build-all-expensive/bin/FileCheck --check-prefix=CHECK-GSYM-DEFAULT /repo/uabelho/main-github/llvm/test/tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml
/repo/uabelho/main-github/llvm/test/tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml:16:23: error: CHECK-GSYM-DEFAULT: expected string not found in input
# CHECK-GSYM-DEFAULT: FunctionInfo @ 0x{{[0-9a-fA-F]+}}: [0x{{[0-9a-fA-F]+}} - 0x{{[0-9a-fA-F]+}}) "my_func_03"
                      ^
<stdin>:1:1: note: scanning from here
Header:
^
<stdin>:40:1: note: possible intended match here
FunctionInfo @ 0x000000bc: [0x0000000000000248 - 0x0000000000000270) "my_func_02"
^

Input file: <stdin>
Check file: /repo/uabelho/main-github/llvm/test/tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: Header: 
check:16'0     X~~~~~~~ error: no match found
            2:  Magic = 0x4753594d 
check:16'0     ~~~~~~~~~~~~~~~~~~~~
            3:  Version = 0x0001 
check:16'0     ~~~~~~~~~~~~~~~~~~
            4:  AddrOffSize = 0x02 
check:16'0     ~~~~~~~~~~~~~~~~~~~~
            5:  UUIDSize = 0x10 
check:16'0     ~~~~~~~~~~~~~~~~~
            6:  BaseAddress = 0x0000000000000000 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            .
            .
            .
           35: 0x00000030: "my_func_02" 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           36: 0x0000003b: "file_02.cpp" 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           37: 0x00000047: "my_func_03" 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           38: 0x00000052: "file_03.cpp" 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           39:  
check:16'0     ~
           40: FunctionInfo @ 0x000000bc: [0x0000000000000248 - 0x0000000000000270) "my_func_02" 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:16'1     ?                                                                                  possible intended match
           41: LineTable: 
check:16'0     ~~~~~~~~~~~
           42:  0x0000000000000248 /tmp/test_gsym_yaml/out/file_02.cpp:5 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           43:  0x0000000000000254 /tmp/test_gsym_yaml/out/file_02.cpp:7 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           44:  0x0000000000000258 /tmp/test_gsym_yaml/out/file_02.cpp:9 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           45:  0x000000000000025c /tmp/test_gsym_yaml/out/file_02.cpp:8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
********************
Failed Tests (1):
  LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml


Testing Time: 0.08s

Total Discovered Tests: 1
  Failed: 1 (100.00%)
```

https://github.com/llvm/llvm-project/pull/122586


More information about the llvm-commits mailing list