Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libclc] clspv* tests are failing #127316

Closed
mgorny opened this issue Feb 15, 2025 · 4 comments · Fixed by #127529
Closed

[libclc] clspv* tests are failing #127316

mgorny opened this issue Feb 15, 2025 · 4 comments · Fixed by #127529
Assignees
Labels
libclc libclc OpenCL library test-suite

Comments

@mgorny
Copy link
Member

mgorny commented Feb 15, 2025

As of c30a7f4:

$ ninja test
[0/1] Running tests...
Test project /home/mgorny/git/llvm-project/libclc/build
      Start  1: external-calls-tahiti-amdgcn--.bc
 1/11 Test  #1: external-calls-tahiti-amdgcn--.bc .............   Passed    2.40 sec
      Start  2: external-calls-amdgcn--amdhsa.bc
 2/11 Test  #2: external-calls-amdgcn--amdhsa.bc ..............   Passed    2.47 sec
      Start  3: external-calls-tahiti-amdgcn-mesa-mesa3d.bc
 3/11 Test  #3: external-calls-tahiti-amdgcn-mesa-mesa3d.bc ...   Passed    2.42 sec
      Start  4: external-calls-clspv--.bc
 4/11 Test  #4: external-calls-clspv--.bc .....................***Failed    0.20 sec
      Start  5: external-calls-clspv64--.bc
 5/11 Test  #5: external-calls-clspv64--.bc ...................***Failed    0.20 sec
      Start  6: external-calls-nvptx--nvidiacl.bc
 6/11 Test  #6: external-calls-nvptx--nvidiacl.bc .............   Passed    1.93 sec
      Start  7: external-calls-nvptx64--nvidiacl.bc
 7/11 Test  #7: external-calls-nvptx64--nvidiacl.bc ...........   Passed    1.94 sec
      Start  8: external-calls-cedar-r600--.bc
 8/11 Test  #8: external-calls-cedar-r600--.bc ................   Passed    0.93 sec
      Start  9: external-calls-cypress-r600--.bc
 9/11 Test  #9: external-calls-cypress-r600--.bc ..............   Passed    0.90 sec
      Start 10: external-calls-barts-r600--.bc
10/11 Test #10: external-calls-barts-r600--.bc ................   Passed    0.92 sec
      Start 11: external-calls-cayman-r600--.bc
11/11 Test #11: external-calls-cayman-r600--.bc ...............   Passed    0.90 sec

82% tests passed, 2 tests failed out of 11

Total Test time (real) =  15.21 sec

The following tests FAILED:
	  4 - external-calls-clspv--.bc (Failed)
	  5 - external-calls-clspv64--.bc (Failed)
Errors while running CTest
Output from these tests are in: /home/mgorny/git/llvm-project/libclc/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
FAILED: CMakeFiles/test.util 
cd /home/mgorny/git/llvm-project/libclc/build && /usr/bin/ctest --force-new-ctest-process
ninja: build stopped: subcommand failed.

LastTest.log: LastTest.log

Basically, they seem to boil down to:

ERROR: 17977 unresolved calls detected in /home/mgorny/git/llvm-project/libclc/build/clspv--.bc
ERROR: 17977 unresolved calls detected in /home/mgorny/git/llvm-project/libclc/build/clspv64--.bc

Full build log
$ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
-- The CXX compiler identification is GNU 14.2.1
-- The C compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /usr/lib64/libffi.so
-- Looking for histedit.h
-- Looking for histedit.h - found
-- Found LibEdit: /usr/include (found version "2.11")
-- Found ZLIB: /usr/lib64/libz.so (found version "1.3.1")
-- Found zstd: /usr/lib64/libzstd.so
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.13.5")
-- Linker detection: GNU ld
-- libclc LLVM version: 21.0.0git2cd8207b
-- Found Python3: /usr/bin/python3.13 (found version "3.13.2") found components: Interpreter
-- libclc target 'amdgcn--' is enabled
--   device: tahiti ( pitcairn;verde;oland;hainan;bonaire;kabini;kaveri;hawaii;mullins;tonga;tongapro;iceland;carrizo;fiji;stoney;polaris10;polaris11;gfx602;gfx705;gfx805;gfx900;gfx902;gfx904;gfx906;gfx908;gfx909;gfx90a;gfx90c;gfx940;gfx941;gfx942;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201 )
-- libclc target 'amdgcn--amdhsa' is enabled
--   device: none (  )
-- libclc target 'amdgcn-mesa-mesa3d' is enabled
--   device: tahiti ( pitcairn;verde;oland;hainan;bonaire;kabini;kaveri;hawaii;mullins;tonga;tongapro;iceland;carrizo;fiji;stoney;polaris10;polaris11;gfx602;gfx705;gfx805;gfx900;gfx902;gfx904;gfx906;gfx908;gfx909;gfx90a;gfx90c;gfx940;gfx941;gfx942;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201 )
-- libclc target 'clspv--' is enabled
--   device: none (  )
-- libclc target 'clspv64--' is enabled
--   device: none (  )
-- libclc target 'nvptx--' is enabled
--   device: none (  )
-- libclc target 'nvptx--nvidiacl' is enabled
--   device: none (  )
-- libclc target 'nvptx64--' is enabled
--   device: none (  )
-- libclc target 'nvptx64--nvidiacl' is enabled
--   device: none (  )
-- libclc target 'r600--' is enabled
--   device: cedar ( palm;sumo;sumo2;redwood;juniper )
--   device: cypress ( hemlock )
--   device: barts ( turks;caicos )
--   device: cayman ( aruba )
-- Configuring done (1.1s)
-- Generating done (0.8s)
-- Build files have been written to: /home/mgorny/git/llvm-project/libclc/build
$ ninja
[1779/3520] Generating builtins.link.pre-deps.tahiti-amdgcn--.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/tahiti-amdgcn--/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/tahiti-amdgcn--/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll.bc' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5' whereas 'llvm-link' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/tahiti-amdgcn--/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9'

[2053/3520] Generating builtins.link.pre-deps.tahiti-amdgcn-mesa-mesa3d.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/tahiti-amdgcn-mesa-mesa3d/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/tahiti-amdgcn-mesa-mesa3d/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll.bc' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5' whereas 'llvm-link' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/tahiti-amdgcn-mesa-mesa3d/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9'

[3358/3520] Generating builtins.link.pre-deps.cypress-r600--.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/cypress-r600--/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/cypress-r600--/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1'

[3359/3520] Generating builtins.link.pre-deps.cedar-r600--.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/cedar-r600--/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/cedar-r600--/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1'

[3360/3520] Generating builtins.link.pre-deps.cayman-r600--.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/cayman-r600--/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/cayman-r600--/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1'

[3361/3520] Generating builtins.link.pre-deps.barts-r600--.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/barts-r600--/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/barts-r600--/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1'

[3366/3520] Generating builtins.link.pre-deps.nvptx64--.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/nvptx64--/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/nvptx64--/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64'

[3367/3520] Generating builtins.link.pre-deps.nvptx--.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/nvptx--/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/nvptx--/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64'

[3371/3520] Generating builtins.link.pre-deps.amdgcn--amdhsa.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/amdgcn--amdhsa/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/amdgcn--amdhsa/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll.bc' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5' whereas 'llvm-link' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/amdgcn--amdhsa/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9'

[3373/3520] Generating builtins.link.pre-deps.nvptx--nvidiacl.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/nvptx--nvidiacl/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/nvptx--nvidiacl/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p:32:32-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64'

[3376/3520] Generating builtins.link.pre-deps.nvptx64--nvidiacl.bc
warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/nvptx64--nvidiacl/generic/lib/subnormal_use_default.ll.bc' is '' whereas 'llvm-link' is 'e-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64'

warning: Linking two modules of different data layouts: '/home/mgorny/git/llvm-project/libclc/build/obj.libclc.dir/nvptx64--nvidiacl/generic/lib/subnormal_helper_func.ll.bc' is '' whereas 'llvm-link' is 'e-p6:32:32-i64:64-i128:128-v16:16-v32:32-n16:32:64'

[3379/3520] Generating builtins.opt.clspv--.bc
/usr/lib/llvm/21/bin/opt: WARNING: failed to create target machine for 'spir-unknown-unknown': unable to get target for 'spir-unknown-unknown', see --version and --triple.
[3382/3520] Generating builtins.opt.clspv64--.bc
/usr/lib/llvm/21/bin/opt: WARNING: failed to create target machine for 'spir64-unknown-unknown': unable to get target for 'spir64-unknown-unknown', see --version and --triple.
[3520/3520] Generating gfx1201-amdgcn-mesa-mesa3d.bc
@nikic
Copy link
Contributor

nikic commented Feb 15, 2025

Worth mentioning that these test failures are not new. We've been suppressing them since at least LLVM 13.

@frasercrmck
Copy link
Contributor

Good find, thanks. Yeah, because clspv intentionally doesn't compile all OpenCL functions they're necessarily going to have unresolved external calls. Again, this is intentional on their part. This might resolve itself when the CLC work is complete, but otherwise we might just have to work around those targets in the test targets. Note we already do this for NVPTX:

  # nvptx-- targets don't include workitem builtins
  if( NOT ARG_TRIPLE MATCHES ".*ptx.*--$" )
    add_test( NAME external-calls-${obj_suffix}
      COMMAND ./check_external_calls.sh ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} ${LLVM_TOOLS_BINARY_DIR}
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
  endif()

CC @rjodinchr.

frasercrmck added a commit to frasercrmck/llvm-project that referenced this issue Feb 17, 2025
These targets don't include all OpenCL builtins, so there will always be
external calls in the final bytecode module.

Fixes llvm#127316.
frasercrmck added a commit that referenced this issue Feb 18, 2025
These targets don't include all OpenCL builtins, so there will always be
external calls in the final bytecode module.

Fixes #127316.
@nikic nikic added this to the LLVM 20.X Release milestone Feb 18, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Feb 18, 2025
@nikic
Copy link
Contributor

nikic commented Feb 18, 2025

/cherry-pick 9fec0a0

@llvmbot
Copy link
Member

llvmbot commented Feb 18, 2025

/pull-request #127597

swift-ci pushed a commit to swiftlang/llvm-project that referenced this issue Feb 18, 2025
These targets don't include all OpenCL builtins, so there will always be
external calls in the final bytecode module.

Fixes llvm#127316.

(cherry picked from commit 9fec0a0)
wldfngrs pushed a commit to wldfngrs/llvm-project that referenced this issue Feb 19, 2025
These targets don't include all OpenCL builtins, so there will always be
external calls in the final bytecode module.

Fixes llvm#127316.
@tstellar tstellar moved this from Needs Triage to Done in LLVM Release Status Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libclc libclc OpenCL library test-suite
Projects
Development

Successfully merging a pull request may close this issue.

5 participants