[DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through…

Authored by Orlando on Jun 11 2019, 3:37 AM.


[DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion

Bug: https://bugs.llvm.org/show_bug.cgi?id=39024

The bug reports that a vectorized loop is stepped through 4 times and each step through the loop seemed to show a different path. I found two problems here:

A) An incorrect line number on a preheader block (for.body.preheader) instruction causes a step into the loop before it begins.
B) Instructions in the middle block have different line numbers which give the impression of another iteration.

In this patch I give all of the middle block instructions the line number of the scalar loop latch terminator branch. This seems to provide the smoothest debugging experience because the vectorized loops will always end on this line before dropping into the scalar loop. To solve problem A I have altered llvm::SplitBlockPredecessors to accommodate loop header blocks.

I have set up a separate review D61933 for a fix which is required for this patch.

Reviewers: samsonov, vsk, aprantl, probinson, anemet, hfinkel, jmorse

Reviewed By: hfinkel, jmorse

Subscribers: jmorse, javed.absar, eraman, kcc, bjope, jmellorcrummey, hfinkel, gbedwell, hiraditya, zzheng, llvm-commits

Tags: #llvm, debug-info

Differential Revision: https://reviews.llvm.org/D60831

llvm-svn: 363046

Event Timeline

tbosch added a subscriber: tbosch.Apr 20 2020, 4:29 PM

Hello, I believe this broke the clang-opt-bisect.cpp test (see the failure below that I am getting with a checkout from today (@ee12edcb76423c78b55cdddae2edfe45cbb2ccd6):

FAIL: debuginfo-tests :: dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp (21 of 54)
******************** TEST 'debuginfo-tests :: dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp' FAILED ********************
: 'RUN: at line 6';   true
: 'RUN: at line 7';   "/usr/bin/python" "/usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/dexter.py" clang-opt-bisect --debugger 'lldb' --builder 'clang'      --cflags "-O0 -g" -- /usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp      | /usr/local/google/home/tbosch/llvm-project/build/bin/FileCheck /usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp
Exit Code: 2

Command Output (stderr):

**                                    **
** This is a bug in DExTer.           **
**                                    **
**                  Please report it. **
**                                    **


DExTer 1.0.0 [master ee12edcb76423c78b55cdddae2edfe45cbb2ccd6] (git@github.com:tbosch/llvm-project.git)
  using Python 3.7.6 (default, Dec 19 2019, 09:25:23)
[GCC 9.2.1 20191109]

['/usr/bin/python', '/usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/dexter.py', 'clang-opt-bisect', '--debugger', 'lldb', '--builder', 'clang', '--cflags', '-O0 -g', '--', '/usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp']

Traceback (most recent call last):
  File "/usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/dexter.py", line 15, in <module>
    return_code = main()
  File "/usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/dex/tools/Main.py", line 193, in main
    return tool_main(context, module.Tool(context), args)
  File "/usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/dex/tools/Main.py", line 162, in tool_main
    return_code = tool.go()
  File "/usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/dex/tools/TestToolBase.py", line 122, in go
  File "/usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/dex/tools/clang_opt_bisect/Tool.py", line 141, in _run_test
    self.context, debugger_controller)
  File "/usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/dex/debugger/Debuggers.py", line 140, in run_debugger_subprocess
    dir=working_dir_path, delete=False, mode='wb') as fp:
  File "/usr/lib/python3.7/tempfile.py", line 686, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "/usr/lib/python3.7/tempfile.py", line 395, in _mkstemp_inner
    file = _os.path.join(dir, pre + name + suf)
  File "/usr/lib/python3.7/posixpath.py", line 80, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not DefaultController
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /usr/local/google/home/tbosch/llvm-project/build/bin/FileCheck /usr/local/google/home/tbosch/llvm-project/debuginfo-tests/dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp

Hello @tbosch I see that you also posted the same comment on D76926. That patch seems a much more likely candidate for causing the failure, was this one by mistake?