ROCm / ROCm-CompilerSupport

The compiler support repository provides various Lightning Compiler related services.
47 stars 31 forks source link

disasm_options_test failed when running `make test` #14

Closed iChant closed 4 years ago

iChant commented 4 years ago

Hi,

I'm trying to build this project from source, and finished without errors. But when running make test I got this message:

The following tests FAILED:
          5 - disasm_options_test (Failed)

Here is the log for failed part of test:


5/20 Testing: disasm_options_test
5/20 Test: disasm_options_test
Command: "/home/chant/Repos/ROCm/ROCm-CompilerSupport/lib/comgr/build/test/disasm_options_test"
Directory: /home/chant/Repos/ROCm/ROCm-CompilerSupport/lib/comgr/build/test
"disasm_options_test" start time: Jul 22 11:46 CST
Output:
----------------------------------------------------------
: for the   --file-headers option: may only occur zero or one times!
: for the   --file-headers option: may only occur zero or one times!
: for the   --file-headers option: may only occur zero or one times!
FAILED: unexpected output
expected:

:   file format ELF64-amdgpu

Disassembly of section .text:
foo:
    s_load_dwordx2 s[0:1], s[4:5], 0x0                         // 000000000100: C0060002 00000000 
    v_mov_b32_e32 v2, 42                                       // 000000000108: 7E0402AA 
    s_waitcnt lgkmcnt(0)                                       // 00000000010C: BF8C007F 
    v_mov_b32_e32 v0, s0                                       // 000000000110: 7E000200 
    v_mov_b32_e32 v1, s1                                       // 000000000114: 7E020201 
    flat_store_dword v[0:1], v2                                // 000000000118: DC700000 00000200 
    s_endpgm                                                   // 000000000120: BF810000 
actual:

:   file format ELF64-amdgpu

Disassembly of section .text:
foo:
    s_load_dwordx2 s[0:1], s[4:5], 0x0                         // 000000000100: C0060002 00000000 
    s_mov_b32 s8, s7                                           // 000000000108: BE880007 
    v_mov_b32_e32 v2, 42                                       // 00000000010C: 7E0402AA 
    s_mov_b32 s32, s8                                          // 000000000110: BEA00008 
    s_waitcnt lgkmcnt(0)                                       // 000000000114: BF8C007F 
    v_mov_b32_e32 v0, s0                                       // 000000000118: 7E000200 
    v_mov_b32_e32 v1, s1                                       // 00000000011C: 7E020201 
    flat_store_dword v[0:1], v2                                // 000000000120: DC700000 00000200 
    s_endpgm                                                   // 000000000128: BF810000 
<end of output>
Test time =   0.01 sec
----------------------------------------------------------
Test Failed.
"disasm_options_test" end time: Jul 22 11:46 CST
"disasm_options_test" time elapsed: 00:00:00
----------------------------------------------------------

That log is quite confusing for me, and I also want to know what the failed test means.

Thanks for any help!

scott-linder commented 4 years ago

Hi,

The failing test was originally based on a code-object which was compiled from OpenCL source, but about a month ago a change in LLVM codegen "broke" it. Since the test is only for disassembly, the code-object was changed to one generated from assembly in ea428852b66cf2b96f266778fdaa171742874358; are you using ROCm-CompilerSupport sources from before this patch?

iChant commented 4 years ago

Hi,

The failing test was originally based on a code-object which was compiled from OpenCL source, but about a month ago a change in LLVM codegen "broke" it. Since the test is only for disassembly, the code-object was changed to one generated from assembly in ea42885; are you using ROCm-CompilerSupport sources from before this patch?

Thanks for your replying,

And yes, I checked git log and found the last change was committed in June, 12. The code was fetched with this tool, and the tag is "roc-2.6.0". Should I build the comgr from master branch, or just ignore the failing test?

scott-linder commented 4 years ago

I apologize for the delay in replying! You can safely ignore the failure in this case, as this is a bug in the test case itself, not in Comgr or LLVM.

However, I would expect the roc2.6 sources of LLVM to be completely compatible with the roc2.6 sources of Comgr. Do you know the ref of the Clang/LLVM/LLD sources you are linking against? This may be a bug in either the 2.6 release of Comgr or in the tool you linked to.

iChant commented 4 years ago

I apologize for the delay in replying! You can safely ignore the failure in this case, as this is a bug in the test case itself, not in Comgr or LLVM.

However, I would expect the roc2.6 sources of LLVM to be completely compatible with the roc2.6 sources of Comgr. Do you know the ref of the Clang/LLVM/LLD sources you are linking against? This may be a bug in either the 2.6 release of Comgr or in the tool you linked to.

I'm not sure what is the ref of those sources. The branch of source code I'm using is "amd-common", and I didn't specify the tag when I cloned the repos.

scott-linder commented 4 years ago

Right, that makes sense as the LLVM commit which exposed the broken test behavior comes after the 2.6 branching. When building Comgr from a release tag I would recommend using the corresponding release tag for LLVM. I'm closing as the fix for this test is in master.