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

Improve for 2022.1 #1

Closed
wants to merge 4 commits into from

Conversation

keryell
Copy link

@keryell keryell commented Aug 12, 2022

Mainly update the Vitis IP part to something available by default.

@keryell
Copy link
Author

keryell commented Aug 12, 2022

Still a lot of timeout, but it seems the usual xsim bug

********************
TIMEOUT: SYCL :: vitis/simple_tests/internal_defines.cpp (37 of 37)
******************** TEST 'SYCL :: vitis/simple_tests/internal_defines.cpp' FAILED ********************
Script:
--
: 'RUN: at line 3';   rm -rf /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis/simple_tests/Output/internal_defines.cpp.tmp.dir && mkdir /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis/simple_tests/Output/internal_defines.cpp.tmp.dir && cd /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis/simple_tests/Output/internal_defines.cpp.tmp.dir
: 'RUN: at line 4';   /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/bin/clang --driver-mode=g++  -D_GLIBCXX_ASSERTIONS=1 -std=c++20 -fsycl -fsycl-targets=fpga64_hls_hw_emu-xilinx-linux /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/sycl/test/vitis/simple_tests/internal_defines.cpp -o /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis/simple_tests/Output/internal_defines.cpp.tmp.dir/exec.out
: 'RUN: at line 5';   env --unset=XCL_EMULATION_MODE env SYCL_DEVICE_FILTER=xrt flock --exclusive /tmp/xrt-rkeryell.lock unshare --pid --map-current-user --kill-child timeout 600 env  /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis/simple_tests/Output/internal_defines.cpp.tmp.dir/exec.out
--
Exit Code: -9
Timeout: Reached timeout of 3600 seconds

Command Output (stdout):
--
$ ":" "RUN: at line 3"
note: command had no output on stdout or stderr
$ "rm" "-rf" "/home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis/simple_tests/Output/internal_defines.cpp.tmp.dir"
note: command had no output on stdout or stderr
$ "mkdir" "/home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis/simple_tests/Output/internal_defines.cpp.tmp.dir"
note: command had no output on stdout or stderr
$ "cd" "/home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis/simple_tests/Output/internal_defines.cpp.tmp.dir"
note: command had no output on stdout or stderr
$ ":" "RUN: at line 4"
note: command had no output on stdout or stderr
$ "/home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/bin/clang" "--driver-mode=g++" "-D_GLIBCXX_ASSERTIONS=1" "-std=c++20" "-fsycl" "-fsycl-targets=fpga64_hls_hw_emu-xilinx-linux" "/home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/sycl/test/vitis/simple_tests/internal_defines.cpp" "-o" "/home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis/simple_tests/Output/internal_defines.cpp.tmp.dir/exec.out"
note: command had no output on stdout or stderr
error: command failed with exit status: -9
error: command reached timeout: True

--

********************
********************
Timed Out Tests (17):
  SYCL :: vitis/simple_tests/answer_42.cpp
  SYCL :: vitis/simple_tests/boost_hana_functor_arg.cpp
  SYCL :: vitis/simple_tests/constexpr_correct.cpp
  SYCL :: vitis/simple_tests/ddr_bank_test.cpp
  SYCL :: vitis/simple_tests/device_noexcept.cpp
  SYCL :: vitis/simple_tests/integration_header_check.cpp
  SYCL :: vitis/simple_tests/internal_defines.cpp
  SYCL :: vitis/simple_tests/kernel_argument_forwarding.cpp
  SYCL :: vitis/simple_tests/kernel_uint_name.cpp
  SYCL :: vitis/simple_tests/multi_parallel_for.cpp
  SYCL :: vitis/simple_tests/pipe_complex_types.cpp
  SYCL :: vitis/simple_tests/pipe_multi_kernel.cpp
  SYCL :: vitis/simple_tests/simple_struct.cpp
  SYCL :: vitis/simple_tests/ternary_compare.cpp
  SYCL :: vitis/simple_tests/unamed_lambda_parallel_for.cpp
  SYCL :: vitis/simple_tests/variant.cpp
  SYCL :: vitis/simple_tests/vector_math.cpp

********************
Failed Tests (11):
  SYCL :: vitis/simple_tests/answer_42_unnamed.cpp
  SYCL :: vitis/simple_tests/evaluation_tree.cpp
  SYCL :: vitis/simple_tests/generic_executor.cpp
  SYCL :: vitis/simple_tests/id_mangle.cpp
  SYCL :: vitis/simple_tests/math_mangle.cpp
  SYCL :: vitis/simple_tests/matmul.cpp
  SYCL :: vitis/simple_tests/multi_file.cpp
  SYCL :: vitis/simple_tests/parallel_for.cpp
  SYCL :: vitis/simple_tests/partion_ndarray.cpp
  SYCL :: vitis/simple_tests/pipe_control_flow.cpp
  SYCL :: vitis/simple_tests/single_task_vector_add.cpp


Testing Time: 38585.63s
  Unsupported:  3
  Passed     :  6
  Timed Out  : 17
  Failed     : 11
FAILED: tools/sycl/test/CMakeFiles/check-sycl-vitis-xrt /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/CMakeFiles/check-sycl-vitis-xrt 
cd /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test && /usr/bin/python3.10 /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/./bin/llvm-lit -v -sv --param VITIS=only --param SYCL_TRIPLE=fpga64_hls_hw_emu-xilinx-linux --param SYCL_PLUGIN=xrt /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/tools/sycl/test/vitis
ninja: build stopped: subcommand failed.

@keryell
Copy link
Author

keryell commented Aug 12, 2022

Going to main repository instead.

@keryell keryell closed this Aug 12, 2022
Ralender pushed a commit that referenced this pull request Jun 9, 2023
In RegisterInfos_loongarch64.h, r22 is defined twice. Having an extra array
member causes problems reading and writing registers defined after r22. So,
for r22, keep the alias fp, delete the s9 alias.

The PC register is incorrectly accessed when the step command is executed.
The step command behavior is incorrect.

This test reflects this problem:

```
loongson@linux:~$ cat test.c

 #include <stdio.h>

int func(int a) {
  return a + 1;
}

int main(int argc, char const *argv[]) {
  func(10);
  return 0;
}

loongson@linux:~$ clang -g test.c  -o test

```

Without this patch:
```
loongson@linux:~$ llvm-project/llvm/build/bin/lldb test
(lldb) target create "test"
Current executable set to '/home/loongson/test' (loongarch64).
(lldb) b main
Breakpoint 1: where = test`main + 40 at test.c:8:3, address = 0x0000000120000668
(lldb) r
Process 278049 launched: '/home/loongson/test' (loongarch64)
Process 278049 stopped
* thread #1, name = 'test', stop reason = breakpoint 1.1
    frame #0: 0x0000000120000668 test`main(argc=1, argv=0x00007fffffff72a8) at test.c:8:3
   5   	}
   6
   7   	int main(int argc, char const *argv[]) {
-> 8   	  func(10);
   9   	  return 0;
   10  	}
   11
(lldb) s
Process 278049 stopped
* thread #1, name = 'test', stop reason = step in
    frame #0: 0x0000000120000670 test`main(argc=1, argv=0x00007fffffff72a8) at test.c:9:3
   6
   7   	int main(int argc, char const *argv[]) {
   8   	  func(10);
-> 9   	  return 0;
   10  	}

```

With this patch:

```
loongson@linux:~$ llvm-project/llvm/build/bin/lldb test
(lldb) target create "test"
Current executable set to '/home/loongson/test' (loongarch64).
(lldb) b main
Breakpoint 1: where = test`main + 40 at test.c:8:3, address = 0x0000000120000668
(lldb) r
Process 278632 launched: '/home/loongson/test' (loongarch64)
Process 278632 stopped
* thread #1, name = 'test', stop reason = breakpoint 1.1
    frame #0: 0x0000000120000668 test`main(argc=1, argv=0x00007fffffff72a8) at test.c:8:3
   5   	}
   6
   7   	int main(int argc, char const *argv[]) {
-> 8   	  func(10);
   9   	  return 0;
   10  	}
   11
(lldb) s
Process 278632 stopped
* thread #1, name = 'test', stop reason = step in
    frame #0: 0x0000000120000624 test`func(a=10) at test.c:4:10
   1   	 #include <stdio.h>
   2
   3   	int func(int a) {
-> 4   	  return a + 1;
   5   	}

```

Reviewed By: SixWeining, DavidSpickett

Differential Revision: https://reviews.llvm.org/D140615
Ralender pushed a commit that referenced this pull request Jun 9, 2023
When building/testing ASan inside the GCC tree on Solaris while using GNU
`ld` instead of Solaris `ld`, a large number of tests SEGVs on both sparc
and x86 like this:

  Thread 2 received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 1 (LWP 1)]
  0xfe014cfc in __sanitizer::atomic_load<__sanitizer::atomic_uintptr_t>
(a=0xfc602a58, mo=__sanitizer::memory_order_acquire) at
sanitizer_common/sanitizer_atomic_clang_x86.h:46
  46	      v = a->val_dont_use;
  1: x/i $pc
  => 0xfe014cfc
<_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE+62>:
mov (%eax),%eax
  (gdb) bt
  #0 0xfe014cfc in __sanitizer::atomic_load<__sanitizer::atomic_uintptr_t>
(a=0xfc602a58, mo=__sanitizer::memory_order_acquire) at
sanitizer_common/sanitizer_atomic_clang_x86.h:46
  #1 0xfe0bd1d7 in __sanitizer::DTLS_NextBlock (cur=0xfc602a58) at
sanitizer_common/sanitizer_tls_get_addr.cpp:53
  triSYCL#2 0xfe0bd319 in __sanitizer::DTLS_Find (id=1) at
sanitizer_common/sanitizer_tls_get_addr.cpp:77
  triSYCL#3 0xfe0bd466 in __sanitizer::DTLS_on_tls_get_addr (arg_void=0xfeffd068,
res=0xfe602a18, static_tls_begin=0, static_tls_end=0) at
sanitizer_common/sanitizer_tls_get_addr.cpp:116
  triSYCL#4 0xfe063f81 in __interceptor___tls_get_addr (arg=0xfeffd068) at
sanitizer_common/sanitizer_common_interceptors.inc:5501
  triSYCL#5 0xfe0a3054 in __sanitizer::CollectStaticTlsBlocks (info=0xfeffd108,
size=40, data=0xfeffd16c) at
sanitizer_common/sanitizer_linux_libcdep.cpp:366
  triSYCL#6  0xfe6ba9fa in dl_iterate_phdr () from /usr/lib/ld.so.1
  triSYCL#7 0xfe0a3132 in __sanitizer::GetStaticTlsBoundary (addr=0xfe608020,
size=0xfeffd244, align=0xfeffd1b0) at
sanitizer_common/sanitizer_linux_libcdep.cpp:382
  triSYCL#8 0xfe0a33f7 in __sanitizer::GetTls (addr=0xfe608020, size=0xfeffd244)
at sanitizer_common/sanitizer_linux_libcdep.cpp:482
  triSYCL#9 0xfe0a34b1 in __sanitizer::GetThreadStackAndTls (main=true,
stk_addr=0xfe608010, stk_size=0xfeffd240, tls_addr=0xfe608020,
tls_size=0xfeffd244) at sanitizer_common/sanitizer_linux_libcdep.cpp:565

The address being accessed is unmapped.  However, even when the tests
`PASS` with Solaris `ld`, `ASAN_OPTIONS=verbosity=2` shows

  ==6582==__tls_get_addr: Can't guess glibc version

Given that that the code is stricly `glibc`-specific according to
`sanitizer_tls_get_addr.h`, there seems little point in using the
interceptor on non-`glibc` targets.

That's what this patch does.  Tested on `i386-pc-solaris2.11` and
`sparc-sun-solaris2.11` inside the GCC tree.

Differential Revision: https://reviews.llvm.org/D141385
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant