FailedChanges

Summary

  1. [InlineCost] Fix scalable vectors in visitAlloca (details)
  2. [lldb][NFC] Use the proper type for the 'storage' parameter of CreateFunctionDeclaration (details)
  3. [X86][AVX] Move lowerShuffleWithVPMOV inside explicit shuffle lowering cases (details)
  4. [lldb][NFC] Use expect_expr in more tests (details)
  5. [lldb][NFC] Remove name parameter from CreateFunctionTemplateDecl (details)
  6. [LLD][ELF] - Do not produce an invalid dynamic relocation order with --shuffle-sections. (details)
  7. [NFC] Run update script on test (details)
  8. [DemandedBits] Reorder addition test checks. NFC. (details)
  9. [DemandedBits] Improve accuracy of Add propagator (details)
  10. [llvm-readobj/elf] - Refine the warning about the broken PT_DYNAMIC segment. (details)
  11. [InstCombine] reduce code duplication; NFC (details)
  12. [InstCombine] add tests for sdiv-of-abs; NFC (details)
  13. [InstCombine] fold abs(X)/X to cmp+select (details)
  14. [gn build] Port c1f6ce0c732 (details)
  15. [RISCV] Indirect branch generation in position independent code (details)
  16. [RISCV] Enable the use of the old mucounteren name (details)
  17. [llvm-readobj] - Remove unwrapOrError calls from GNUStyle<ELFT>::printRelocations. (details)
  18. [lldb][NFC] Use StringRef in CreateFunctionDeclaration/GetDeclarationName (details)
  19. [NFC] Tweak a comment about the lock-free builtins (details)
  20. [NFC] run update test script (details)
  21. [SystemZ/ZOS]__(de)register_frame are not available on z/OS. (details)
  22. [lldb] Skip TestSimulatorPlatform with sanitized builds (details)
  23. [llvm] support graceful failure of DataLayout parsing (details)
  24. [mlir] Move data layout from LLVMDialect to module Op attributes (details)
Commit 2ccde3c96b784f74370beff5dab5fbf3e70fae8b by cullen.rhodes
[InlineCost] Fix scalable vectors in visitAlloca

Discovered as part of the VLS type work (see D85128).

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D85848
The file was modifiedllvm/lib/Analysis/InlineCost.cpp
The file was addedllvm/test/Transforms/Inline/inline-scalable.ll
Commit cd2139a527f2d829bdde7877c992215f598e927b by Raphael Isemann
[lldb][NFC] Use the proper type for the 'storage' parameter of CreateFunctionDeclaration

All the callers pass an enum and we cast the int anyway back to the actual type,
so we might as well just use the type for the parameter.
The file was modifiedlldb/unittests/Symbol/TestTypeSystemClang.cpp
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
Commit 1d2ede87eacb0c4a063691905b4464bb04f8eca7 by llvm-dev
[X86][AVX] Move lowerShuffleWithVPMOV inside explicit shuffle lowering cases

Perform lowerShuffleWithVPMOV as part of the v16i8/v8i16 shuffle lowering stages, which are the only types that are currently supported.

We need to expand support for lowering shuffles as truncations to fix the remaining regressions in D66004
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 42b9a683523628bfbb4f7447c0ca9607f3eee83f by Raphael Isemann
[lldb][NFC] Use expect_expr in more tests
The file was modifiedlldb/test/API/commands/expression/ignore-artificial-constructors/main.cpp
The file was modifiedlldb/test/API/lang/objc/objc_direct-methods/main.m
The file was modifiedlldb/test/API/commands/expression/function_template_specialization_temp_args/TestFunctionTemplateSpecializationTempArgs.py
The file was modifiedlldb/test/API/lang/cpp/namespace/TestNamespace.py
The file was modifiedlldb/test/API/commands/expression/cast_int_to_anonymous_enum/TestCastIntToAnonymousEnum.py
The file was modifiedlldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py
The file was modifiedlldb/test/API/commands/expression/argument_passing_restrictions/TestArgumentPassingRestrictions.py
Commit 7e6c437fb413eb7ae102e8db869bb55a748411ff by Raphael Isemann
[lldb][NFC] Remove name parameter from CreateFunctionTemplateDecl

It's unused and not documented.
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
The file was modifiedlldb/unittests/Symbol/TestTypeSystemClang.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
Commit c135a68d426fd69d26454658bfa62102993f12a7 by grimar
[LLD][ELF] - Do not produce an invalid dynamic relocation order with --shuffle-sections.

Normally (when not on android with android relocation packing enabled),
we put IRelative relocations to ".rel[a].dyn", after other relocations,
to ensure that IRelatives are processed last by the dynamic loader.

To achieve that we add the `in.relaIplt` after the `part.relaDyn`:
https://github.com/llvm/llvm-project/blob/master/lld/ELF/Writer.cpp#L540

The problem is that `--shuffle-sections` might break the sections order.
This patch fixes it.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47056.

Differential revision: https://reviews.llvm.org/D85651
The file was modifiedlld/test/ELF/gnu-ifunc-plt.s
The file was modifiedlld/ELF/Writer.cpp
Commit 613d8f29538ee43137a77dfd0d6464c65b328b68 by sam.parker
[NFC] Run update script on test

Update IndVarSimplify/no-iv-rewrite.ll
The file was modifiedllvm/test/Transforms/IndVarSimplify/no-iv-rewrite.ll
Commit 79d9e2cd93a3ff7b448f40caf50dbfd3516f7c0d by llvm-dev
[DemandedBits] Reorder addition test checks. NFC.

As suggested on D72423 we should try to keep the same order as the original IR
The file was modifiedllvm/test/Analysis/DemandedBits/add.ll
Commit c1f6ce0c7322d47f1bb90169585fa54232231ede by llvm-dev
[DemandedBits] Improve accuracy of Add propagator

The current demand propagator for addition will mark all input bits at and right of the alive output bit as alive. But carry won't propagate beyond a bit for which both operands are zero (or one/zero in the case of subtraction) so a more accurate answer is possible given known bits.

I derived a propagator by working through truth tables and using a bit-reversed addition to make demand ripple to the right, but I'm not sure how to make a convincing argument for its correctness in the comments yet. Nevertheless, here's a minimal implementation and test to get feedback.

This would help in a situation where, for example, four bytes (<128) packed into an int are added with four others SIMD-style but only one of the four results is actually read.

Known A:     0_______0_______0_______0_______
Known B:     0_______0_______0_______0_______
AOut:        00000000001000000000000000000000
AB, current: 00000000001111111111111111111111
AB, patch:   00000000001111111000000000000000

Committed on behalf of: @rrika (Erika)

Differential Revision: https://reviews.llvm.org/D72423
The file was modifiedllvm/include/llvm/Analysis/DemandedBits.h
The file was modifiedllvm/unittests/Support/KnownBitsTest.cpp
The file was addedllvm/unittests/Support/KnownBitsTest.h
The file was addedllvm/unittests/IR/DemandedBitsTest.cpp
The file was modifiedllvm/unittests/IR/CMakeLists.txt
The file was modifiedllvm/lib/Analysis/DemandedBits.cpp
The file was modifiedllvm/test/Analysis/DemandedBits/add.ll
Commit 6567f822160ea7c4d13a7e3358883eafc61af337 by grimar
[llvm-readobj/elf] - Refine the warning about the broken PT_DYNAMIC segment.

Splitted out from D85519.

Currently we report "PT_DYNAMIC segment offset + size exceeds the size of the file",
this changes it to
"PT_DYNAMIC segment offset (0x1234) + file size (0x5678) exceeds the size of the file (0x68ab)"

Differential revision: https://reviews.llvm.org/D85654
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedllvm/test/tools/llvm-readobj/ELF/malformed-pt-dynamic.test
The file was modifiedllvm/test/Object/invalid.test
Commit 6cd4a6f6b27eea40dbddccb21c206fb4d4354c53 by spatel
[InstCombine] reduce code duplication; NFC
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
Commit 61512ddd2d57fc33464bda477dab04829266faa1 by spatel
[InstCombine] add tests for sdiv-of-abs; NFC
The file was modifiedllvm/test/Transforms/InstCombine/sdiv-canonicalize.ll
Commit e6b6787d01e9ea6338b5b51c6e3ba1b903876b3a by spatel
[InstCombine] fold abs(X)/X to cmp+select

The backend can convert the select-of-constants to
bit-hack shift+logic if desirable.

https://alive2.llvm.org/ce/z/pgJT6E

  define i8 @src(i8 %x) {
  %0:
    %a = abs i8 %x, 1
    %d = sdiv i8 %x, %a
    ret i8 %d
  }
  =>
  define i8 @tgt(i8 %x) {
  %0:
    %cond = icmp sgt i8 %x, 255
    %r = select i1 %cond, i8 1, i8 255
    ret i8 %r
  }
  Transformation seems to be correct!
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
The file was modifiedllvm/test/Transforms/InstCombine/sdiv-canonicalize.ll
Commit e0eb4f204a0ef48cff8fedc0cbc5be2c71fe2afe by llvmgnsyncbot
[gn build] Port c1f6ce0c732
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/IR/BUILD.gn
Commit 5f9ecc5d857fa5d95f6ea36153be19db40576f8a by selliott
[RISCV] Indirect branch generation in position independent code

This fixes the "Unable to insert indirect branch" fatal error sometimes
seen when generating position-independent code.

Patch by msizanoen1

Reviewed By: jrtc27

Differential Revision: https://reviews.llvm.org/D84833
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.cpp
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.td
The file was modifiedllvm/test/CodeGen/RISCV/branch-relaxation.ll
Commit 3f7068ad986d7f44f47faec78597a5e62b07b20b by selliott
[RISCV] Enable the use of the old mucounteren name

The RISC-V Privileged Specification 1.11 defines `mcountinhibit`, which
has the same numeric CSR value as `mucounteren` from 1.09.1. This patch
enables the use of the old `mucounteren` name.

Patch by Yuichi Sugiyama.

Reviewed By: lenary, jrtc27, pzheng

Differential Revision: https://reviews.llvm.org/D85067
The file was modifiedllvm/test/MC/RISCV/machine-csr-names.s
The file was modifiedllvm/lib/Target/RISCV/RISCVSystemOperands.td
Commit bc902191d3c002c13436f2c9a299826704861a80 by grimar
[llvm-readobj] - Remove unwrapOrError calls from GNUStyle<ELFT>::printRelocations.

This fixes existent FIXMEs: we should not error out when unable to
find the number of relocations.

Differential revision: https://reviews.llvm.org/D85891
The file was modifiedllvm/test/tools/llvm-readobj/ELF/packed-relocs.test
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedllvm/test/tools/llvm-readobj/ELF/relr-relocs.test
Commit cfb773c676236652f63f9ba031d6755d55f5d884 by Raphael Isemann
[lldb][NFC] Use StringRef in CreateFunctionDeclaration/GetDeclarationName

CreateFunctionDeclaration should just take a StringRef. GetDeclarationName is
(only) used by CreateFunctionDeclaration so that's why now also takes a
StringRef.
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
Commit 687e7d34253b283945bdf9892aa58fd167f9913d by luismarques
[NFC] Tweak a comment about the lock-free builtins
The file was modifiedclang/lib/AST/ExprConstant.cpp
Commit dad04e62f13bf64868c9b842f51dfc5fffbe95c0 by sam.parker
[NFC] run update test script

On Transforms/LoopUnroll/runtime-small-upperbound.ll
The file was modifiedllvm/test/Transforms/LoopUnroll/runtime-small-upperbound.ll
Commit c2ae7934c809d739f7677f4422755c58e4ab8ea3 by kai
[SystemZ/ZOS]__(de)register_frame are not available on z/OS.

The functions `__register_frame`/`__deregister_frame` are not
available on z/OS, so add a guard to not use them.

Reviewed By: lhames, abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D84787
The file was modifiedllvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
The file was modifiedllvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
Commit f5f22f04481bec765ccaf6e400da24987a421c2e by Raphael Isemann
[lldb] Skip TestSimulatorPlatform with sanitized builds

The test executable crashes when ran on a simulator. Skipping until this is
fixed.

rdar://67238668
The file was modifiedlldb/test/API/macosx/simulator/TestSimulatorPlatform.py
Commit 874aef875d0cd04b33f25bb71b534cbb0d6220ae by zinenko
[llvm] support graceful failure of DataLayout parsing

Existing implementation always aborts on syntax errors in a DataLayout
description. While this is meaningful for consuming textual IR modules, it is
inconvenient for users that may need fine-grained control over the layout from,
e.g., command-line options. Propagate errors through the parsing functions and
only abort in the top-level parsing function instead.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D85650
The file was modifiedllvm/lib/IR/DataLayout.cpp
The file was modifiedllvm/include/llvm/IR/DataLayout.h
Commit 168213f91c571352c56f432573513cba3f9ba61b by zinenko
[mlir] Move data layout from LLVMDialect to module Op attributes

Legacy implementation of the LLVM dialect in MLIR contained an instance of
llvm::Module as it was required to parse LLVM IR types. The access to the data
layout of this module was exposed to the users for convenience, but in practice
this layout has always been the default one obtained by parsing an empty layout
description string. Current implementation of the dialect no longer relies on
wrapping LLVM IR types, but it kept an instance of DataLayout for
compatibility. This effectively forces a single data layout to be used across
all modules in a given MLIR context, which is not desirable. Remove DataLayout
from the LLVM dialect and attach it as a module attribute instead. Since MLIR
does not yet have support for data layouts, use the LLVM DataLayout in string
form with verification inside MLIR. Introduce the layout when converting a
module to the LLVM dialect and keep the default "" description for
compatibility.

This approach should be replaced with a proper MLIR-based data layout when it
becomes available, but provides an immediate solution to compiling modules with
different layouts, e.g. for GPUs.

This removes the need for LLVMDialectImpl, which is also removed.

Depends On D85650

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D85652
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
The file was modifiedmlir/include/mlir/Conversion/Passes.td
The file was addedmlir/test/Conversion/StandardToLLVM/convert-data-layout.mlir
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/test/Dialect/LLVMIR/invalid.mlir
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
The file was modifiedmlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
The file was modifiedmlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
The file was modifiedmlir/test/Target/llvmir.mlir