Changes

Summary

  1. [analyzer] Add control flow arrows to the analyzer's HTML reports (details)
  2. [analyzer] Highlight arrows for currently selected event (details)
  3. unwind: repair register restoration for OR1K (details)
  4. [flang] Fix IsSimplyContiguous() for the case of a pointer component (details)
  5. [WebAssembly] Compute known bits for SIMD bitmask intrinsics (details)
  6. Add script to bisect over files in an rsp file (details)
  7. [NFC][InstCombine] Add tests for xor reductions on i1 elt type (PR51259) (details)
  8. [InstCombine] `xor` reduction w/ i1 elt type is a parity check (details)
  9. [PatternRewriter] Disable copy/assign operators. (details)
  10. [VPlan] Use defined and ops VPValues to print VPInterleaveRecipe. (details)
  11. [WebAssembly] Add new pass to lower int/ptr conversions of reftypes (details)
  12. [DWARF] Don't process .debug_info relocations for DWO Context (details)
  13. [flang] Symbol representation for dummy SubprogramDetails (details)
  14. [unroll] Add clarifying comment (details)
  15. [AMDGPU][HIP] Switch default DWARF version to 5 (details)
  16. [gn build] (manually) port 5c2b48fdb0a6 (details)
  17. [lldb] Get rid of HAVE_SIGACTION (details)
  18. Revert "[WebAssembly] Add new pass to lower int/ptr conversions of reftypes" (details)
  19. [flang][nfc] Add a regression test for #50993 (details)
Commit 97bcafa28deb95ad32f83fe339d78454d899ca1b by vsavchenko
[analyzer] Add control flow arrows to the analyzer's HTML reports

This commit adds a very first version of this feature.
It is off by default and has to be turned on by checking the
corresponding box.  For this reason, HTML reports still keep
control notes (aka grey bubbles).

Further on, we plan on attaching arrows to events and having all arrows
not related to a currently selected event barely visible.  This will
help with reports where control flow goes back and forth (eg in loops).
Right now, it can get pretty crammed with all the arrows.

Differential Revision: https://reviews.llvm.org/D92639
The file was modifiedclang/include/clang/Analysis/PathDiagnostic.h
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporter.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
The file was addedclang/test/Analysis/html_diagnostics/control-arrows.cpp
The file was modifiedclang/lib/Rewrite/HTMLRewrite.cpp
Commit 9e02f58780ab8734e5d27a0138bd477d18ae64a1 by vsavchenko
[analyzer] Highlight arrows for currently selected event

In some cases, when the execution path of the diagnostic
goes back and forth, arrows can overlap and create a mess.
Dimming arrows that are not relevant at the moment, solves this issue.
They are still visible, but don't draw too much attention.

Differential Revision: https://reviews.llvm.org/D92928
The file was modifiedclang/test/Analysis/html_diagnostics/control-arrows.cpp
The file was modifiedclang/lib/Rewrite/HTMLRewrite.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
Commit d6d0b6559e97a3d0b258814e870d3e19f3a7ffcc by Saleem Abdulrasool
unwind: repair register restoration for OR1K

Currently, OR1K architecture put the program counter at offset 0x128 of
the current `or1k_thread_state_t`. However, the PC is restored after
updating the thread pointer in `r3`, which causes the PC to be fetched
incorrectly.

This patch swaps the order of restoration of `r9` and `r3`, such that
the PC is restored to `r9` using the current thread state.

Patch by Oi Chee Cheung!

Reviewed By: whitequark, compnerd

Differential Revision: https://reviews.llvm.org/D107042
The file was modifiedlibunwind/src/UnwindRegistersRestore.S
Commit bab86463df0789c39888285494bf68c713f0c5f3 by pklausler
[flang] Fix IsSimplyContiguous() for the case of a pointer component

The result expression for the analysis of a Component is not (longer)
valid in the expression traversal framework used by IsSimplyContiguousHelper
now that it has a tri-state result.  Fix so that any result of
analyzing the component symbol is required to be true, not just
present.

Differential Revision: https://reviews.llvm.org/D106693
The file was modifiedflang/lib/Evaluate/check-expression.cpp
Commit 417e500668621e1275851ccf6e573a39482368b5 by tlively
[WebAssembly] Compute known bits for SIMD bitmask intrinsics

This optimizes out the mask when the result of a bitmask is interpreted as an i8
or i16 value. Resolves PR50507.

Differential Revision: https://reviews.llvm.org/D107103
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
The file was addedllvm/test/CodeGen/WebAssembly/simd-bitmask-mask.ll
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
Commit 8490a7d908a981761607b7a138c0b10506ef9756 by aeubanks
Add script to bisect over files in an rsp file

This is mostly intended to be used to find which file contains a miscompile.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D107184
The file was addedllvm/utils/rsp_bisect_test/test_script.py
The file was addedllvm/utils/rsp_bisect_test/test.py
The file was addedllvm/utils/rsp_bisect.py
The file was addedllvm/utils/rsp_bisect_test/test_script_inv.py
Commit f6c44cdd3773a74fe52127b78c494d07f909e74d by lebedev.ri
[NFC][InstCombine] Add tests for xor reductions on i1 elt type (PR51259)
The file was addedllvm/test/Transforms/InstCombine/reduction-xor-sext-zext-i1.ll
Commit 1e801439be26569c9ede6fd309a645b00adb656c by lebedev.ri
[InstCombine] `xor` reduction w/ i1 elt type is a parity check

For i1 element type, `xor` and `add` are interchangeable
(https://alive2.llvm.org/ce/z/e77hhQ), so we should treat it just like
an `add` reduction and consistently transform them both:
https://alive2.llvm.org/ce/z/MjCm5W (self)
https://alive2.llvm.org/ce/z/kgqF4M (skipped zext)
https://alive2.llvm.org/ce/z/pgy3HP (skipped sext)

Though, let's emit the IR that is similar to the one we produce for
`vector_reduce_add(<n x i1>)`.

See https://bugs.llvm.org/show_bug.cgi?id=51259
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
The file was modifiedllvm/test/Transforms/InstCombine/reduction-xor-sext-zext-i1.ll
Commit 07548b83247e5c266e209ac4cdc2ab7a3231155d by clattner
[PatternRewriter] Disable copy/assign operators.

We had a [bad bug](https://github.com/llvm/circt/commit/69655864ee38167016506e9dae2eb1eb43dc3ba5) over in CIRCT
caused by accidentally passing around PatternRewriter
by value.  There is no reason to support copy/assignment
of the pattern rewriter, so disable it.

Differential Revision: https://reviews.llvm.org/D107232
The file was modifiedmlir/include/mlir/IR/PatternMatch.h
Commit bb725c98037eb8ad2ca2033427103b3503d57b2f by flo
[VPlan] Use defined and ops VPValues to print VPInterleaveRecipe.

This patch updates VPInterleaveRecipe::print to print the actual defined
VPValues for load groups and the store VPValue operands for store
groups.

The IR references may become outdated while transforming the VPlan and
the defined and stored VPValues always are up-to-date.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D107223
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.h
The file was modifiedllvm/test/Transforms/LoopVectorize/vplan-printing.ll
Commit ce1c59dea6d01e8ec3d4cb911438254283e4646c by pmatos
[WebAssembly] Add new pass to lower int/ptr conversions of reftypes

Add new pass LowerRefTypesIntPtrConv to generate trap
instruction for an inttoptr and ptrtoint of a reference type instead
of erroring, since calling these instructions on non-integral pointers
has been since allowed (see ac81cb7e6).

Differential Revision: https://reviews.llvm.org/D107102
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
The file was modifiedllvm/lib/Target/WebAssembly/WebAssembly.h
The file was modifiedllvm/lib/Target/WebAssembly/CMakeLists.txt
The file was modifiedllvm/test/CodeGen/WebAssembly/externref-ptrtoint.ll
The file was addedllvm/lib/Target/WebAssembly/WebAssemblyLowerRefTypesIntPtrConv.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/externref-inttoptr.ll
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/BUILD.gn
Commit 5a865b0b1ee650bc4d9b96fea98a1daa8e5933b6 by ayermolo
[DWARF] Don't process .debug_info relocations for DWO Context

When we build with split dwarf in single mode the .o files that contain both "normal" debug sections and dwo sections, along with relocaiton sections for "normal" debug sections.
When we create DWARF context in DWARFObjInMemory we process relocations and store them in the map for .debug_info, etc section.
For DWO Context we also do it for non dwo dwarf sections. Which I believe is not necessary. This leads to a lot of memory being wasted. We observed 70GB extra memory being used.

I went with context sensitive approach, flag is passed in. I am not sure if it's always safe not to process relocations for regular debug sections if Obj contains .dwo sections.
If it is alternatvie might be just to scan, in constructor, sections and if there are .dwo sections not to process regular debug ones.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D106624
The file was modifiedllvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
The file was modifiedllvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
The file was modifiedllvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFContext.cpp
The file was addedllvm/test/DebugInfo/X86/dwarfdump-rela-dwo.s
The file was modifiedllvm/tools/llvm-readobj/DwarfCFIEHPrinter.h
The file was modifiedllvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
The file was modifiedllvm/lib/DebugInfo/Symbolize/Symbolize.cpp
Commit c4a65434d894ca6f8ba1dcf338824b369c67f01b by pklausler
[flang] Symbol representation for dummy SubprogramDetails

Dummy procedures can be defined as subprograms with explicit
interfaces, e.g.

  subroutine subr(dummy)
    interface
      subroutine dummy(x)
        real :: x
      end subroutine
    end interface
    ! ...
  end subroutine

but the symbol table had no means of marking such symbols as dummy
arguments, so predicates like IsDummy(dummy) would fail.  Add an
isDummy_ flag to SubprogramNameDetails, analogous to the corresponding
flag in EntityDetails, and set/test it as needed.

Differential Revision: https://reviews.llvm.org/D106697
The file was modifiedflang/test/Semantics/call02.f90
The file was modifiedflang/lib/Evaluate/check-expression.cpp
The file was modifiedflang/lib/Semantics/check-declarations.cpp
The file was modifiedflang/lib/Semantics/symbol.cpp
The file was modifiedflang/lib/Semantics/resolve-names.cpp
The file was modifiedflang/include/flang/Semantics/symbol.h
The file was modifiedflang/lib/Evaluate/tools.cpp
Commit ebc4c4e3b060ebd92a45a590818515c4cecb279f by listmail
[unroll] Add clarifying comment

The option to not preserve LCSSA is in fact not tested at all in upstream.  I was tempted to just remove the code entirely, but realized I didn't need to for my actual goal.
The file was modifiedllvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
Commit 635c5ba45baee5c6a8841fbac06f6868ddae5a6d by scott.linder
[AMDGPU][HIP] Switch default DWARF version to 5

Another attempt at changing this default, now that tooling has greater
support for DWARF 5.

Differential Revision: https://reviews.llvm.org/D107190
The file was modifiedclang/lib/Driver/ToolChains/HIP.h
The file was modifiedclang/lib/Driver/ToolChains/AMDGPU.h
The file was modifiedclang/test/Driver/amdgpu-toolchain.c
The file was modifiedclang/test/Driver/hip-toolchain-dwarf.hip
Commit 3555880f106d8075a38c71d34ce498b541740561 by thakis
[gn build] (manually) port 5c2b48fdb0a6
The file was modifiedllvm/utils/gn/secondary/compiler-rt/lib/tsan/BUILD.gn
Commit 82dc463bb356200fd46b90d6d5a439c3c9b31c92 by thakis
[lldb] Get rid of HAVE_SIGACTION

The .cpp file uses SIGNAL_POLLING_UNSUPPORTED to guard the call
to sigaction, so use it in the .h file too. (LLVM also calls
sigaction without a guard on non-Windows.)

No behavior change.

Differential Revision: https://reviews.llvm.org/D107255
The file was modifiedlldb/cmake/modules/LLDBGenerateConfig.cmake
The file was modifiedlldb/include/lldb/Host/MainLoop.h
The file was modifiedlldb/include/lldb/Host/Config.h.cmake
Commit 245f2ee6471099b351812d2327886f7c3b6e2ed6 by pmatos
Revert "[WebAssembly] Add new pass to lower int/ptr conversions of reftypes"

This reverts commit ce1c59dea6d01e8ec3d4cb911438254283e4646c.
The file was modifiedllvm/test/CodeGen/WebAssembly/externref-ptrtoint.ll
The file was modifiedllvm/test/CodeGen/WebAssembly/externref-inttoptr.ll
The file was modifiedllvm/lib/Target/WebAssembly/CMakeLists.txt
The file was modifiedllvm/lib/Target/WebAssembly/WebAssembly.h
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/BUILD.gn
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
The file was removedllvm/lib/Target/WebAssembly/WebAssemblyLowerRefTypesIntPtrConv.cpp
Commit ad2e830fe2f791ef37faa2238caed0a73e0cc51d by andrzej.warzynski
[flang][nfc] Add a regression test for #50993

https://bugs.llvm.org/show_bug.cgi?id=50993 was effectively fixed in
https://reviews.llvm.org/D106727. This patch adds a regression
test specifically for the use case reported in 50993.

Differential Revision: https://reviews.llvm.org/D107260
The file was addedflang/test/Preprocessing/parse-preprocessed.F