SuccessChanges

Summary

  1. [mlir] Remove LLVMTypeTestDialect (details)
  2. [clang][NFC] Remove spurious +x flag on DeclTemplate.cpp and DeclTemplate.h (details)
  3. [clang][NFC] Add a test showcasing an unnamed template parameter in a diagnostic (details)
  4. [clang][NFC] Remove an old workaround for MSVC 2013 (details)
  5. [clang][NFC] Document NamedDecl::printName (details)
  6. [clang][nearly-NFC] Remove some superfluous uses of NamedDecl::getNameAsString (details)
  7. [clang][NFCI] Get rid of ConstantMatrixTypeBitfields to avoid increasing the size of every type. (details)
  8. [clang][NFC] DeclPrinter: use NamedDecl::getDeclName instead of NamedDecl::printName to print the name of enumerations, namespaces and template parameters. (details)
  9. [gn build] (manually) merge 3ab01550b (details)
  10. Recommit "[InstCombine] Negator: -(X << C)  -->  X * (-1 << C)" (details)
  11. [mlir] Initial version of C APIs (details)
  12. [clang] Add -fno-delayed-template-parsing to the added unit tests in DeclPrinterTest.cpp (details)
  13. [Statepoints] Operand folding in presense of tied registers. (details)
  14. [OpenMP] Fix `present` for exit from `omp target data` (details)
  15. [OpenMP][Docs] Add map clause reordering status as unclaimed (details)
  16. [OpenMP][Docs] Mark `present` map type modifier as done (details)
  17. [OpenMP] Fix `omp target update` for array extension (details)
  18. [llvm-readobj] - Make decode_relrs() don't return Expected<>. NFCI. (details)
  19. [X86][AVX] Fold CONCAT(HOP(X,Y),HOP(Z,W)) -> HOP(CONCAT(X,Z),CONCAT(Y,W)) for integer types (details)
  20. [X86] isHorizontalBinOp - only update LHS/RHS references on success (details)
Commit 4e491570b5ecff17d3ac7cf6dbb328d379cd4fb6 by zinenko
[mlir] Remove LLVMTypeTestDialect

This dialect was introduced during the bring-up of the new LLVM dialect type
system for testing purposes. The main LLVM dialect now uses the new type system
and the test dialect is no longer necessary, so remove it.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D85224
The file was modifiedmlir/tools/mlir-opt/CMakeLists.txt
The file was modifiedmlir/tools/mlir-translate/CMakeLists.txt
The file was modifiedmlir/tools/mlir-translate/mlir-translate.cpp
The file was removedmlir/test/lib/Dialect/LLVMIR/LLVMTypeTestDialect.cpp
The file was modifiedmlir/tools/mlir-opt/mlir-opt.cpp
The file was modifiedmlir/test/Target/llvmir-types.mlir
The file was modifiedmlir/test/Dialect/LLVMIR/types-invalid.mlir
The file was modifiedmlir/test/lib/Dialect/CMakeLists.txt
The file was removedmlir/test/lib/Dialect/LLVMIR/CMakeLists.txt
Commit 00b89f66f988e9ec6f366ed46a51ace39fac07c8 by riccibrun
[clang][NFC] Remove spurious +x flag on DeclTemplate.cpp and DeclTemplate.h
The file was modifiedclang/include/clang/AST/DeclTemplate.h
The file was modifiedclang/lib/AST/DeclTemplate.cpp
Commit 98b4b4570542a255e9a81e4a349183402a2d478d by riccibrun
[clang][NFC] Add a test showcasing an unnamed template parameter in a diagnostic
The file was modifiedclang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp
Commit bc29634b93acf2e55c82dd906f0d9af196c66ff3 by riccibrun
[clang][NFC] Remove an old workaround for MSVC 2013
The file was modifiedclang/include/clang/AST/DeclTemplate.h
Commit 6f2fa9d312fcea2448706a8e410c7bc1b6436ea7 by riccibrun
[clang][NFC] Document NamedDecl::printName
The file was modifiedclang/include/clang/AST/Decl.h
Commit 19701458d4691ee7ec59e5aa7217a479b0fb10e7 by riccibrun
[clang][nearly-NFC] Remove some superfluous uses of NamedDecl::getNameAsString

`OS << ND->getDeclName();` is equivalent to `OS << ND->getNameAsString();`
without the extra temporary string.

This is not quite a NFC since two uses of `getNameAsString` in a
diagnostic are replaced, which results in the named entity being
quoted with additional "'"s (ie: 'var' instead of var).
The file was modifiedclang/lib/AST/Interp/Disasm.cpp
The file was modifiedclang/lib/Frontend/FrontendAction.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/ExprEngine.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp
The file was modifiedclang/test/Index/error-on-deserialized.c
The file was modifiedclang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp
The file was modifiedclang/test/SemaCXX/warn-msvc-enum-bitfield.cpp
The file was modifiedclang/lib/Index/FileIndexRecord.cpp
The file was modifiedclang/lib/AST/TextNodeDumper.cpp
The file was modifiedclang-tools-extra/clang-move/HelperDeclRefGraph.cpp
The file was modifiedclang-tools-extra/clang-move/Move.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
The file was modifiedclang/lib/Tooling/Refactoring/ASTSelection.cpp
The file was modifiedclang/lib/AST/ASTDiagnostic.cpp
The file was modifiedclang/lib/Sema/AnalysisBasedWarnings.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
The file was modifiedclang/lib/Sema/SemaChecking.cpp
The file was modifiedclang-tools-extra/clang-include-fixer/find-all-symbols/FindAllSymbols.cpp
Commit 94b43118e2203fed8ca0377ae762c08189aa6f3d by riccibrun
[clang][NFCI] Get rid of ConstantMatrixTypeBitfields to avoid increasing the size of every type.

sizeof(ConstantMatrixTypeBitfields) > 8 which increases the size of every type.
This was not detected because no corresponding static_assert for its size was
added.

To prevent this from occuring again replace the various static_asserts for
the size of each of the bit-field classes by a single static_assert for the
size of Type.

I have left ConstantMatrixType::MaxElementsPerDimension unchanged since
the limit is exercised by multiple tests.
The file was modifiedclang/lib/AST/Type.cpp
The file was modifiedclang/include/clang/AST/Type.h
Commit f7a039de7af7b83105f3e0345d65dceda1a0e0d4 by riccibrun
[clang][NFC] DeclPrinter: use NamedDecl::getDeclName instead of NamedDecl::printName to print the name of enumerations, namespaces and template parameters.

NamedDecl::printName will print the pretty-printed name of the entity, which
is not what we want here (we should print "enum { e };" instead of "enum
(unnamed enum at input.cc:1:5) { e };").

For now only DecompositionDecl and MDGuidDecl have an overloaded printName so
this does not result in any functional change, but this change is needed since
I will be adding overloads to better handle unnamed entities in diagnostics.
The file was modifiedclang/lib/AST/DeclPrinter.cpp
The file was modifiedclang/unittests/AST/DeclPrinterTest.cpp
Commit cc2612185833a0e4b7a19bfbde801ced9297b0f7 by thakis
[gn build] (manually) merge 3ab01550b

This reverts commit 0bbaacc8cae0373d4500c4e3f6f128d21f9033b7 and
2ad56119f5dc6c6af2b8ddfd9fc8c6460a7507c8 which merged 10b1b4a23
(and follow-ups), since that change was reverted in 3ab01550b.
The file was modifiedllvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/test/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/lld/test/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/compiler-rt/test/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/clang/test/BUILD.gn
Commit f5df5cd5586ae9cfb2d9e53704dfc76f47aff149 by lebedev.ri
Recommit "[InstCombine] Negator: -(X << C)  -->  X * (-1 << C)"

This reverts commit ac70b37a00dc02bd8923e0a4602d26be4581c570
which reverted commit 8aeb2fe13a4100b4c2e78d6ef75119304100cb1f
because codegen tests got broken and i needed time to investigate.

This shows some regressions in tests, but they are all around GEP's,
so i'm not really sure how important those are.

https://rise4fun.com/Alive/1Gn
The file was modifiedllvm/test/Transforms/InstCombine/icmp.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/reqd-work-group-size.ll
The file was modifiedllvm/test/Transforms/InstCombine/sub.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
The file was modifiedllvm/test/Transforms/InstCombine/sub-gep.ll
The file was modifiedllvm/test/Transforms/InstCombine/sub-of-negatible.ll
Commit 75f239e9756b157f209412268c5a50a69b1a4e74 by zinenko
[mlir] Initial version of C APIs

    Introduce an initial version of C API for MLIR core IR components: Value, Type,
    Attribute, Operation, Region, Block, Location. These APIs allow for both
    inspection and creation of the IR in the generic form and intended for wrapping
    in high-level library- and language-specific constructs. At this point, there
    is no stability guarantee provided for the API.

Reviewed By: stellaraccident, lattner

Differential Revision: https://reviews.llvm.org/D83310
The file was modifiedmlir/CMakeLists.txt
The file was addedmlir/include/mlir-c/Registration.h
The file was addedmlir/lib/CAPI/Registration/Registration.cpp
The file was addedmlir/lib/CAPI/IR/IR.cpp
The file was modifiedmlir/test/CMakeLists.txt
The file was addedmlir/lib/CAPI/CMakeLists.txt
The file was addedmlir/docs/CAPI.md
The file was modifiedmlir/test/lit.cfg.py
The file was addedmlir/test/CAPI/lit.local.cfg
The file was addedmlir/lib/CAPI/IR/CMakeLists.txt
The file was addedmlir/lib/CAPI/Registration/CMakeLists.txt
The file was addedmlir/test/CAPI/ir.c
The file was addedmlir/include/mlir-c/IR.h
The file was addedmlir/test/CAPI/CMakeLists.txt
Commit 4dcbb9cef71afa549afe8f6b4d335b1c996f8079 by riccibrun
[clang] Add -fno-delayed-template-parsing to the added unit tests in DeclPrinterTest.cpp
The file was modifiedclang/unittests/AST/DeclPrinterTest.cpp
Commit d21ce408218150e23b5cc4af45c088c0926d7e18 by dantrushin
[Statepoints] Operand folding in presense of tied registers.

Implement proper folding of statepoint meta operands (deopt and GC)
when statepoint uses tied registers.
For deopt operands it is just about properly preserving tiedness
in new instruction.
For tied GC operands folding is a little bit more tricky.
We can fold tied GC operands only from InlineSpiller, because it knows
how to properly reload tied def after it was turned into memory operand.
Other users (e.g. peephole) cannot properly fold such operands as they
do not know how (or when) to reload them from memory.
We do this by un-tieing operand we want to fold in InlineSpiller
and allowing to fold only untied operands in foldPatchpoint.
The file was modifiedllvm/lib/CodeGen/TargetInstrInfo.cpp
The file was modifiedllvm/lib/CodeGen/InlineSpiller.cpp
The file was addedllvm/test/CodeGen/X86/statepoint-vreg-folding.mir
Commit 002d61db2b7790dc884953bf9271878bf0af3a8e by jdenny.ornl
[OpenMP] Fix `present` for exit from `omp target data`

Without this patch, the following example fails but shouldn't
according to OpenMP TR8:

```
#pragma omp target enter data map(alloc:i)
#pragma omp target data map(present, alloc: i)
{
   #pragma omp target exit data map(delete:i)
} // fails presence check here
```

OpenMP TR8 sec. 2.22.7.1 "map Clause", p. 321, L23-26 states:

> If the map clause appears on a target, target data, target enter
> data or target exit data construct with a present map-type-modifier
> then on entry to the region if the corresponding list item does not
> appear in the device data environment an error occurs and the
> program terminates.

There is no corresponding statement about the exit from a region.
Thus, the `present` modifier should:

1. Check for presence upon entry into any region, including a `target
   exit data` region.  This behavior is already implemented correctly.

2. Should not check for presence upon exit from any region, including
   a `target` or `target data` region.  Without this patch, this
   behavior is not implemented correctly, breaking the above example.

In the case of `target data`, this patch fixes the latter behavior by
removing the `present` modifier from the map types Clang generates for
the runtime call at the end of the region.

In the case of `target`, we have not found a valid OpenMP program for
which such a fix would matter.  It appears that, if a program can
guarantee that data is present at the beginning of a `target` region
so that there's no error there, that data is also guaranteed to be
present at the end.  This patch adds a comment to the runtime to
document this case.

Reviewed By: grokos, RaviNarayanaswamy, ABataev

Differential Revision: https://reviews.llvm.org/D84422
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.h
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.cpp
The file was modifiedclang/lib/CodeGen/CGStmtOpenMP.cpp
The file was modifiedclang/test/OpenMP/target_data_codegen.cpp
The file was modifiedopenmp/libomptarget/src/omptarget.cpp
The file was addedopenmp/libomptarget/test/mapping/present/target_data_at_exit.c
Commit 26cf9c17044515cdde3e7baeea843001ba33be59 by jdenny.ornl
[OpenMP][Docs] Add map clause reordering status as unclaimed
The file was modifiedclang/docs/OpenMPSupport.rst
Commit 03bb545b68c2edb9dc5bd092104bdb83a8e5e347 by jdenny.ornl
[OpenMP][Docs] Mark `present` map type modifier as done
The file was modifiedclang/docs/OpenMPSupport.rst
Commit 5ab43989c353a2378910d20c7b88e44ea92b3aee by jdenny.ornl
[OpenMP] Fix `omp target update` for array extension

OpenMP TR8 sec. 2.15.6 "target update Construct", p. 183, L3-4 states:

> If the corresponding list item is not present in the device data
> environment and there is no present modifier in the clause, then no
> assignment occurs to or from the original list item.

L10-11 states:

> If a present modifier appears in the clause and the corresponding
> list item is not present in the device data environment then an
> error occurs and the program termintates.

(OpenMP 5.0 also has the first passage but without mention of the
present modifier of course.)

In both passages, I assume "is not present" includes the case of
partially but not entirely present.  However, without this patch, the
target update directive misbehaves in this case both with and without
the present modifier.  For example:

```
#pragma omp target enter data map(to:arr[0:3])
#pragma omp target update to(arr[0:5]) // might fail on data transfer
#pragma omp target update to(present:arr[0:5]) // might fail on data transfer
```

The problem is that `DeviceTy::getTgtPtrBegin` does not return a null
pointer in that case, so `target_data_update` sees the data as fully
present, and the data transfer then might fail depending on the target
device.  However, without the present modifier, there should never be
a failure.  Moreover, with the present modifier, there should always
be a failure, and the diagnostic should mention the present modifier.

This patch fixes `DeviceTy::getTgtPtrBegin` to return null when
`target_data_update` is the caller.  I'm wondering if it should do the
same for more callers.

Reviewed By: grokos, jdoerfert

Differential Revision: https://reviews.llvm.org/D85246
The file was addedopenmp/libomptarget/test/mapping/present/target_update_array_extension.c
The file was modifiedopenmp/libomptarget/src/device.cpp
The file was addedopenmp/libomptarget/test/mapping/target_update_array_extension.c
The file was modifiedopenmp/libomptarget/src/omptarget.cpp
The file was modifiedopenmp/libomptarget/src/device.h
Commit 6ae5b9e40587f5586e2970ca717797b68c34758d by grimar
[llvm-readobj] - Make decode_relrs() don't return Expected<>. NFCI.

The `decode_relrs` helper is declared as:

`Expected<std::vector<Elf_Rel>> decode_relrs(Elf_Relr_Range relrs) const;`

it never returns an error though and hence can be simplified to return
a vector.

Differential revision: https://reviews.llvm.org/D85302
The file was modifiedllvm/lib/Object/ELF.cpp
The file was modifiedllvm/include/llvm/Object/ELF.h
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
Commit a57bfb44bc7918c907500ba9ac4cdd80e445660a by llvm-dev
[X86][AVX] Fold CONCAT(HOP(X,Y),HOP(Z,W)) -> HOP(CONCAT(X,Z),CONCAT(Y,W)) for integer types
The file was modifiedllvm/test/CodeGen/X86/haddsub-2.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 6a06c7a0a7688ce142865e92d879b8bece79de7a by llvm-dev
[X86] isHorizontalBinOp - only update LHS/RHS references on success

We've had issues in the past where isHorizontalBinOp calls would affect later combines as the LHS/RHS references had been commuted but still failed to match.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp