SuccessChanges

Summary

  1. [CodeGen] Fix warnings in sve-ld1-addressing-mode-reg-imm.ll (details)
  2. [analyzer] Silence gcc -Wparentheses warning [NFC] (details)
  3. [CodeGen] Fix wrong use of getVectorNumElements in PromoteIntRes_EXTRACT_SUBVECTOR (details)
  4. [CodeGen] Fix wrong use of getVectorNumElements() in DAGTypeLegalizer::SplitVecRes_ExtendOp (details)
  5. [llvm-readobj] - Refine error reporting in MipsGOTParser<ELFT> helper. (details)
  6. [DebugInfo/DWARF] - Test invalid CFI opcodes properly and refine related `CFIProgram::parse` code. (details)
  7. [X86][AVX] Remove redundant EXTRACT_VECTOR_ELT(VBROADCAST(SCALAR())) fold (details)
  8. Fix MSVC "not all control paths return a value" warnings. NFC. (details)
  9. [NFCI][llvm-reduce] Cleanup Delta passes to use Oracle abstraction (details)
  10. [DWARF] Add cuttoff guarding quadratic validThroughout behaviour (details)
  11. [MLIR][SPIRVToLLVM] Implementation of spv.BitFieldSExtract and spv.BitFieldUExtract patterns (details)
  12. [lldb] Skip TestIOHandlerResizeNoEditline on Windows (details)
  13. [SVE] Custom ISel for fixed length extract/insert_subvector. (details)
Commit 15aeb805dc46fbd268388af5f8de19e4de29cdb3 by david.sherwood
[CodeGen] Fix warnings in sve-ld1-addressing-mode-reg-imm.ll

For the GetElementPtr case in function
  AddressingModeMatcher::matchOperationAddr
I've changed the code to use the TypeSize class instead of relying
upon the implicit conversion to a uint64_t. As part of this we now
check for scalable types and if we encounter one just bail out for
now as the subsequent optimisations doesn't currently support them.

This changes fixes up all warnings in the following tests:

  llvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-imm.ll
  llvm/test/CodeGen/AArch64/sve-st1-addressing-mode-reg-imm.ll

Differential Revision: https://reviews.llvm.org/D83124
The file was modifiedllvm/test/CodeGen/AArch64/sve-st1-addressing-mode-reg-imm.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-imm.ll
The file was modifiedllvm/lib/CodeGen/CodeGenPrepare.cpp
Commit cfcf8e17ef537686e03c58921a10593a2b0c4a3d by mikael.holmen
[analyzer] Silence gcc -Wparentheses warning [NFC]
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporter.cpp
Commit 5b14f5051f134d29f51b523e5c9b602c08a4a7af by david.sherwood
[CodeGen] Fix wrong use of getVectorNumElements in PromoteIntRes_EXTRACT_SUBVECTOR

Calling getVectorNumElements() is not safe for scalable vectors and we
should normally use getVectorElementCount() instead. However, for the
code changed in this patch I decided to simply move the instantiation of
the variable 'OutNumElems' lower down to the place where only fixed-width
vectors are used, and hence it is safe to call getVectorNumElements().

Fixes up one warning in this test:

  sve-sext-zext.ll

Differential Revision: https://reviews.llvm.org/D83195
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
Commit 9e66e9c30a19dc5923c85d3a3a4b757935299fba by david.sherwood
[CodeGen] Fix wrong use of getVectorNumElements() in DAGTypeLegalizer::SplitVecRes_ExtendOp

In DAGTypeLegalizer::SplitVecRes_ExtendOp I have replaced an invalid
call to getVectorNumElements() with a call to getVectorMinNumElements(),
since the code path works for both fixed and scalable vectors.

This fixes up a warning in the following test:

  sve-sext-zext.ll

Differential Revision: https://reviews.llvm.org/D83197
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
Commit 1f84ace3c7266564801d79185ebb05eb451205f1 by grimar
[llvm-readobj] - Refine error reporting in MipsGOTParser<ELFT> helper.

This is a follow-up for D83225. This does the following:
1) Adds missing tests for existent errors.
2) Stops using `unwrapOrError` to propagate errors to caller.
   (I am trying to get rid of all `unwrapOrErr` calls in the llvm-readelf code).
3) Improves error messages reported slightly.

Differential revision: https://reviews.llvm.org/D83314
The file was modifiedllvm/test/tools/llvm-readobj/ELF/mips-got.test
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedllvm/test/tools/llvm-readobj/ELF/mips-plt.test
Commit bee8cdcabd2b3931be3f240e70b0b04e766ea4fe by grimar
[DebugInfo/DWARF] - Test invalid CFI opcodes properly and refine related `CFIProgram::parse` code.

There are following issues with `CFIProgram::parse` code:

1) Invalid CFI opcodes were never tested. And currently a test would fail
when the `LLVM_ENABLE_ABI_BREAKING_CHECKS` is enabled. It happens because
the `DataExtractor::Cursor C` remains unchecked when the
"Invalid extended CFI opcode" error is reported:

```
.eh_frame section at offset 0x1128 address 0x0:
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior to being destroyed).
```

2) It is impossible to reach the "Invalid primary CFI opcode" error with the current code.
There are 3 possible primary opcode values and all of them are handled. Hence this error
should be replaced with llvm_unreachable.

3) Errors currently reported are upper-case.

This patch refines the code in the `CFIProgram::parse` method to fix all issues mentioned
and adds unit tests for all possible invalid extended CFI opcodes.

Differential revision: https://reviews.llvm.org/D82868
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
The file was modifiedllvm/unittests/DebugInfo/DWARF/DWARFDebugFrameTest.cpp
Commit c00a27752e4944db609a683504bb10e0975fdf76 by llvm-dev
[X86][AVX] Remove redundant EXTRACT_VECTOR_ELT(VBROADCAST(SCALAR())) fold

Noticed while looking for similar cases to rG931ec74f7a29 - SimplifyDemandedVectorElts and shuffle combining both should handle this now.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 997a3c29f4655e930a9ef44be98d28368d757d98 by llvm-dev
Fix MSVC "not all control paths return a value" warnings. NFC.
The file was modifiedllvm/lib/MC/MCParser/MasmParser.cpp
Commit a39c7ab9c355670510341191a802f3799265e9ef by lebedev.ri
[NFCI][llvm-reduce] Cleanup Delta passes to use Oracle abstraction

Summary:
I think, this results in much more understandable/readable flow.
At least the original logic was perhaps the most hard thing for me to grasp when taking an initial look on the delta passes.

Reviewers: nickdesaulniers, dblaikie, diegotf, george.burgess.iv

Reviewed By: nickdesaulniers

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83287
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceMetadata.cpp
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceOperandBundles.cpp
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceGlobalVars.cpp
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceArguments.cpp
The file was modifiedllvm/tools/llvm-reduce/deltas/Delta.h
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceFunctions.cpp
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp
Commit b9d977b0ca60c54f11615ca9d144c9f08b29fd85 by jeremy.morse
[DWARF] Add cuttoff guarding quadratic validThroughout behaviour

Occasionally we see absolutely massive basic blocks, typically in global
constructors that are vulnerable to heavy inlining. When these blocks are
dense with DBG_VALUE instructions, we can hit near quadratic complexity in
DwarfDebug's validThroughout function. The problem is caused by:

  * validThroughout having to step through all instructions in the block to
    examine their lexical scope,
  * and a high proportion of instructions in that block being DBG_VALUEs
    for a unique variable fragment,

Leading to us stepping through every instruction in the block, for (nearly)
each instruction in the block.

By adding this guard, we force variables in large blocks to use a location
list rather than a single-location expression, as shown in the added test.
This shouldn't change the meaning of the output DWARF at all: instead we
use a less efficient DWARF encoding to avoid a poor-performance code path.

Differential Revision: https://reviews.llvm.org/D83236
The file was addedllvm/test/DebugInfo/MIR/X86/singlelocation-cutoffs.mir
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
Commit 7a4e39b326d0cc69e6b4fbe9010aaf5dc704a12f by georgemitenk0v
[MLIR][SPIRVToLLVM] Implementation of spv.BitFieldSExtract and spv.BitFieldUExtract patterns

This patch adds conversion patterns for `spv.BitFieldSExtract` and `spv.BitFieldUExtract`.
As in the patch for `spv.BitFieldInsert`, `offset` and `count` have to be broadcasted in
vector case and casted to match the type of the base.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D82640
The file was modifiedmlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
The file was modifiedmlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
Commit e9f943429c895e4d6d29505fab2fad365fe2766e by Raphael Isemann
[lldb] Skip TestIOHandlerResizeNoEditline on Windows

It seems opening the empty file and trying use that file object as an input
stream doesn't work on Windows. Skipping it for now.
The file was modifiedlldb/test/API/iohandler/resize/TestIOHandlerResizeNoEditline.py
Commit fb75451775f83c04d53e4e94bb4bd298ea9a882f by paul.walker
[SVE] Custom ISel for fixed length extract/insert_subvector.

We use extact_subvector and insert_subvector to "cast" between
fixed length and scalable vectors.  This patch adds custom c++
based ISel for the following cases:

  fixed_vector = ISD::EXTRACT_SUBVECTOR scalable_vector, 0
  scalable_vector = ISD::INSERT_SUBVECTOR undef(scalable_vector), fixed_vector, 0

Which result in either EXTRACT_SUBREG/INSERT_SUBREG for NEON sized
vectors or COPY_TO_REGCLASS otherwise.

Differential Revision: https://reviews.llvm.org/D82871
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was addedllvm/test/CodeGen/AArch64/sve-fixed-length-subvector.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.h