plctlab / llvm-project

PLCT实验室的 RISC-V V Spec 实现,基于llvm/llvm-project,rkruppe/rvv-llvm 和 https://repo.hca.bsc.es/gitlab/rferrer/llvm-epi-0.8
156 stars 42 forks source link

[simd] fails on running all tests #47

Closed fepicture closed 2 years ago

fepicture commented 2 years ago

Well, I am building through the latest commit in branch libcxx-simd-dev and working on Ubuntu2204, but after running gitlab-ci.yml these steps, it fails to pass all the tests.

reproduce method

  1. clone with latest commit https://github.com/plctlab/llvm-project/commit/29edde3ef113ba5287585e342bc1ac299603343f under branch libcxx-simd-dev
  2. run following command in your llvm-project directory
    mkdir build && cd build
    cmake ../runtimes -G Ninja -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" -DCMAKE_C_COMPILER="$(which clang)" -DCMAKE_CXX_COMPILER="$(which clang++)"
    ninja cxx-test-depends
    bin/llvm-lit -sv libcxx/test/std/experimental/simd

error log

error log ``` In file included from /root/llvm-project/libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp:16: /root/llvm-project/build/include/c++/v1/experimental/simd:751:3: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical] _LIBCXX_SIMD_REFERENCE_OP_(&) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ && /root/llvm-project/build/include/c++/v1/experimental/simd:743:11: note: expanded from macro '_LIBCXX_SIMD_REFERENCE_OP_' __set(__get() __op std::forward<_Up>(__v)); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/llvm-project/libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp:111:12: note: in instantiation of function template specialization 'std::experimental::__simd_reference>, bool>::operator&=>, bool>>' requested here c[0] &= b[0]; ^ /root/llvm-project/libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp:192:3: note: in instantiation of function template specialization 'test_access>>' requested here test_access>(); ^ /root/llvm-project/build/include/c++/v1/experimental/simd:751:3: note: cast one or both operands to int to silence this warning _LIBCXX_SIMD_REFERENCE_OP_(&) ^ /root/llvm-project/build/include/c++/v1/experimental/simd:743:11: note: expanded from macro '_LIBCXX_SIMD_REFERENCE_OP_' __set(__get() __op std::forward<_Up>(__v)); \ ^ /root/llvm-project/build/include/c++/v1/experimental/simd:752:3: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] _LIBCXX_SIMD_REFERENCE_OP_(|) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || /root/llvm-project/build/include/c++/v1/experimental/simd:743:11: note: expanded from macro '_LIBCXX_SIMD_REFERENCE_OP_' __set(__get() __op std::forward<_Up>(__v)); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/llvm-project/libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp:117:12: note: in instantiation of function template specialization 'std::experimental::__simd_reference>, bool>::operator|=>, bool>>' requested here c[0] |= b[0]; ^ /root/llvm-project/libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp:192:3: note: in instantiation of function template specialization 'test_access>>' requested here test_access>(); ^ /root/llvm-project/build/include/c++/v1/experimental/simd:752:3: note: cast one or both operands to int to silence this warning _LIBCXX_SIMD_REFERENCE_OP_(|) ^ /root/llvm-project/build/include/c++/v1/experimental/simd:743:11: note: expanded from macro '_LIBCXX_SIMD_REFERENCE_OP_' __set(__get() __op std::forward<_Up>(__v)); \ ^ /root/llvm-project/build/include/c++/v1/experimental/simd:751:3: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical] _LIBCXX_SIMD_REFERENCE_OP_(&) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ && /root/llvm-project/build/include/c++/v1/experimental/simd:743:11: note: expanded from macro '_LIBCXX_SIMD_REFERENCE_OP_' __set(__get() __op std::forward<_Up>(__v)); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/llvm-project/libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp:111:12: note: in instantiation of function template specialization 'std::experimental::__simd_reference>, bool>::operator&=>, bool>>' requested here c[0] &= b[0]; ^ /root/llvm-project/libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp:193:3: note: in instantiation of function template specialization 'test_access>>' requested here test_access>(); ^ /root/llvm-project/build/include/c++/v1/experimental/simd:751:3: note: cast one or both operands to int to silence this warning _LIBCXX_SIMD_REFERENCE_OP_(&) ^ /root/llvm-project/build/include/c++/v1/experimental/simd:743:11: note: expanded from macro '_LIBCXX_SIMD_REFERENCE_OP_' __set(__get() __op std::forward<_Up>(__v)); \ ^ /root/llvm-project/build/include/c++/v1/experimental/simd:752:3: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] _LIBCXX_SIMD_REFERENCE_OP_(|) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || /root/llvm-project/build/include/c++/v1/experimental/simd:743:11: note: expanded from macro '_LIBCXX_SIMD_REFERENCE_OP_' __set(__get() __op std::forward<_Up>(__v)); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/llvm-project/libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp:117:12: note: in instantiation of function template specialization 'std::experimental::__simd_reference>, bool>::operator|=>, bool>>' requested here c[0] |= b[0]; ^ /root/llvm-project/libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp:193:3: note: in instantiation of function template specialization 'test_access>>' requested here test_access>(); ^ /root/llvm-project/build/include/c++/v1/experimental/simd:752:3: note: cast one or both operands to int to silence this warning _LIBCXX_SIMD_REFERENCE_OP_(|) ^ /root/llvm-project/build/include/c++/v1/experimental/simd:743:11: note: expanded from macro '_LIBCXX_SIMD_REFERENCE_OP_' __set(__get() __op std::forward<_Up>(__v)); \ ^ 4 errors generated. error: command failed with exit status: 1 -- ******************** ******************** Failed Tests (1): libc++ :: std/experimental/simd/simd.mask.access/default.pass.cpp ```

weird code reference:

https://github.com/plctlab/llvm-project/blob/29edde3ef113ba5287585e342bc1ac299603343f/libcxx/include/experimental/simd#L751-L752

fepicture commented 2 years ago

@joy2myself please take a look if you have time.

joy2myself commented 2 years ago

@fepicture Could you give your clang version information please?

I can't reproduce this problem with

clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
fepicture commented 2 years ago
root@7c800237842f:~/llvm-project/build# clang++ --version
Ubuntu clang version 14.0.0-1ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

root@7c800237842f:~/llvm-project/build# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:        22.04
Codename:       jammy

root@7c800237842f:~/llvm-project/build# ./bin/llvm-lit --version
lit 14.0.0dev
root@7c800237842f:~/llvm-project/build# 

@fepicture Could you give your clang version information please?

I can't reproduce this problem with

clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
joy2myself commented 2 years ago

Fixed by commit https://github.com/plctlab/llvm-project/commit/d79fd0f83ece038af196fbe50a94fa934044b918