FailedChanges

Summary

  1. [InstCombine] add tests for FP cast+bitcast signbit checks; NFC (details)
  2. [InstCombine] reduce FP-casted and bitcasted signbit check (details)
  3. Add BitWidth trait to BitmaskEnum, and use for clang DependenceFlags. NFC (details)
  4. [lld test] Tighten ELF/pre_init_fini_array.s test (details)
  5. [LLDB] CPlusPlusNameParser does not handles templated operator< properly (details)
  6. [OPENMP50]Fix PR45117: Orphaned task reduction should be allowed. (details)
  7. [VirtualFileSystem] Support directory entries in the YAMLVFSWriter (details)
  8. [Darwin] Respect -fno-unroll-loops during LTO. (details)
  9. [llvm][Type] Return fixed size for scalar types. [NFC] (details)
  10. [mlir][spirv] Add return to function to please MSVC (details)
  11. [DAGCombine] Fix splitting indexed loads in ForwardStoreValueToDirectLoad() (details)
  12. [Syntax] Prevent (accidentally) copying TokenBuffer (details)
  13. [AST] Add a Dependence bitmask to use for calculations with multiple node types. (details)
  14. FunctionRef: Strip cv qualifiers in the converting constructor (details)
  15. `shape` dialect: add some ops (details)
  16. Improve recovery from invalid template-ids. (details)
  17. [RISCV] Support llvm.thread.pointer (details)
  18. [FileCollector] Add a method to add a whole directory and it contents. (details)
  19. [FileCollector] Devirtualize FileCollector (NFC) (details)
  20. [lldb/CMake] Only CMAKE_CFG_INTDIR if it's not '.' (details)
  21. [GlobalISel] Fix equality for copies from physregs in matchEqualDefs (details)
  22. [mlir] NFC: fix trivial typo in source files (details)
  23. [MLIR] Introduce full/partial tile separation using if/else (details)
Commit e72730ee3a5740c3a8be9db03eb30f00ef9b53e1 by spatel
[InstCombine] add tests for FP cast+bitcast signbit checks; NFC

PR45305:
https://bugs.llvm.org/show_bug.cgi?id=45305
The file was modifiedllvm/test/Transforms/InstCombine/icmp.ll
Commit 0f56bbc1a5b2ddc881d1c55c9024b9c473dac6f0 by spatel
[InstCombine] reduce FP-casted and bitcasted signbit check

PR45305:
https://bugs.llvm.org/show_bug.cgi?id=45305

Alive2 proofs:
http://volta.cs.utah.edu:8080/z/bVyrko
http://volta.cs.utah.edu:8080/z/Vxpz9q
The file was modifiedllvm/test/Transforms/InstCombine/icmp.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
Commit 6b3bedec999a57015339fa5eed276710e87cbb0f by sam.mccall
Add BitWidth trait to BitmaskEnum, and use for clang DependenceFlags. NFC

Reviewers: hokein

Subscribers: dexonsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76942
The file was modifiedclang/lib/Serialization/ASTReaderStmt.cpp
The file was modifiedllvm/include/llvm/ADT/BitmaskEnum.h
The file was modifiedclang/include/clang/AST/Stmt.h
The file was modifiedclang/include/clang/AST/DependenceFlags.h
The file was modifiedclang/include/clang/AST/Type.h
Commit 6eb345af5a1bb182a1292c8a285a6a509af61a94 by thomasp
[lld test] Tighten ELF/pre_init_fini_array.s test

Summary:
Make use of FileCheck numeric variable to tighten symbol address checks
in ELF/pre_init_fini_array.s test.

Reviewers: khemant, compnerd, echristo, jhenderson, espindola, MaskRay

Reviewed By: MaskRay

Subscribers: emaste, MaskRay, llvm-commits, rupprecht

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76852
The file was modifiedlld/test/ELF/pre_init_fini_array.s
Commit 8016d61e3cf4967dd28c8f6296cec685dadcaee6 by shafik
[LLDB] CPlusPlusNameParser does not handles templated operator< properly

CPlusPlusNameParser is used in several places on of them is during IR execution and setting breakpoints to pull information C++ like the basename, the context and arguments.

Currently it does not handle templated operator< properly, because of idiosyncrasy is how clang generates debug info for these cases.

It uses clang::Lexer which will tokenize operator<<A::B> into:

tok::kw_operator
tok::lessless
tok::raw_identifier

Later on the parser in ConsumeOperator() does not handle this case properly and we end up failing to parse.

Differential Revision: https://reviews.llvm.org/D76168
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
The file was modifiedlldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
Commit 0fca766458da04bbc6d33b3f9ecd57e615c556c1 by a.bataev
[OPENMP50]Fix PR45117: Orphaned task reduction should be allowed.

Add support for orpahned task reductions.
The file was modifiedopenmp/runtime/test/tasking/omp_task_red_taskloop.c
The file was modifiedclang/lib/CodeGen/CGStmtOpenMP.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/test/OpenMP/task_in_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp
The file was modifiedclang/test/OpenMP/task_ast_print.cpp
The file was modifiedclang/test/OpenMP/master_taskloop_simd_in_reduction_messages.cpp
The file was modifiedclang/test/OpenMP/task_in_reduction_message.cpp
The file was modifiedclang/test/OpenMP/master_taskloop_in_reduction_messages.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/test/OpenMP/taskloop_in_reduction_messages.cpp
Commit 3ef33e69de085cb6bc028b4fc4dd39087631ac12 by Jonas Devlieghere
[VirtualFileSystem] Support directory entries in the YAMLVFSWriter

The current implementation of the JSONWriter does not support writing
out directory entries. Earlier today I added a unit test to illustrate
the problem. When an entry is added to the YAMLVFSWriter and the path is
a directory, it will incorrectly emit the directory as a file, and any
files inside that directory will not be found by the VFS.

It's possible to partially work around the issue by only adding "leaf
nodes" (files) to the YAMLVFSWriter. However, this doesn't work for
representing empty directories. This is a problem for clients of the VFS
that want to iterate over a directory. The directory not being there is
not the same as the directory being empty.

This is not just a hypothetical problem. The FileCollector for example
does not differentiate between file and directory paths. I temporarily
worked around the issue for LLDB by ignoring directories, but I suspect
this will prove problematic sooner rather than later.

This patch fixes the issue by extending the JSONWriter to support
writing out directory entries. We store whether an entry should be
emitted as a file or directory.

Differential revision: https://reviews.llvm.org/D76670
The file was modifiedllvm/unittests/Support/VirtualFileSystemTest.cpp
The file was modifiedllvm/lib/Support/VirtualFileSystem.cpp
The file was modifiedllvm/include/llvm/Support/VirtualFileSystem.h
Commit 9ce198d6ed371399e9bd9ba8b48fbab0f4e60240 by flo
[Darwin] Respect -fno-unroll-loops during LTO.

Currently -fno-unroll-loops is ignored when doing LTO on Darwin. This
patch adds a new -lto-no-unroll-loops option to the LTO code generator
and forwards it to the linker if -fno-unroll-loops is passed.

Reviewers: thegameg, steven_wu

Reviewed By: thegameg

Differential Revision: https://reviews.llvm.org/D76916
The file was modifiedclang/lib/Driver/ToolChains/Darwin.cpp
The file was addedllvm/test/tools/llvm-lto/fno-unroll-loops-option.ll
The file was addedclang/test/Driver/darwin-ld-lto-fno-unroll-loops.c
The file was modifiedllvm/lib/LTO/LTOCodeGenerator.cpp
Commit 4b3d94051ca2cfc43f276c05f0619d22fc7deb87 by francesco.petrogalli
[llvm][Type] Return fixed size for scalar types. [NFC]

Summary:
It is safe to assume that the TypeSize associated to scalar types has
a fixed size.

This avoids an implicit cast of TypeSize to integer inside
`Type::getScalarSizeInBits()`, as such implicit cast is deprecated.

Reviewers: efriedma, sdesmalen

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76892
The file was modifiedllvm/lib/IR/Type.cpp
Commit d0af43816193aac382276c878deb4e33ed76be1d by antiagainst
[mlir][spirv] Add return to function to please MSVC

This suppresses the "not all control paths return a value" warning.
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
Commit 482141134729237072cb94248381dab96ce34374 by nemanja.i.ibm
[DAGCombine] Fix splitting indexed loads in ForwardStoreValueToDirectLoad()

In DAGCombiner::visitLOAD() we perform some checks before breaking up an indexed
load. However, we don't do the same checking in ForwardStoreValueToDirectLoad()
which can lead to failures later during combining
(see: https://bugs.llvm.org/show_bug.cgi?id=45301).

This patch just adds the same checks to this function as well.

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

Differential revision: https://reviews.llvm.org/D76778
The file was addedllvm/test/CodeGen/PowerPC/pr45301.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Commit 94938d7d41cd11c4539ff93b801fe53cb4fddba2 by sam.mccall
[Syntax] Prevent (accidentally) copying TokenBuffer
The file was modifiedclang/include/clang/Tooling/Syntax/Tokens.h
Commit d68c09ac87959694fbb4895ff49443afc2b582f9 by sam.mccall
[AST] Add a Dependence bitmask to use for calculations with multiple node types.

Summary:
This makes it easier/safer to add bits (error) to other node types without
worrying about bit layout all the time.

For now, just use to implement the ad-hoc conversion functions.
Next: remove these functions and use this directly.

Reviewers: hokein

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76939
The file was modifiedclang/lib/AST/ComputeDependence.cpp
The file was modifiedclang/include/clang/AST/DependenceFlags.h
Commit cbce88dd3a9ea7161da3c57749cf03873dc7ea79 by dblaikie
FunctionRef: Strip cv qualifiers in the converting constructor

Without this some instances of copy construction would use the
converting constructor & lead to the destination function_ref referring
to the source function_ref instead of the underlying functor.

Discovered in feedback from 857bf5da35af8e1f9425e1865dab5f5fce5e38f2

Thanks to Johannes Doerfert, Arthur O'Dwyer, and Richard Smith for the
discussion and debugging.
The file was modifiedllvm/unittests/ADT/FunctionRefTest.cpp
The file was modifiedllvm/include/llvm/ADT/STLExtras.h
Commit 569e4f9bc99a755cc30f0102b29b1eefd4fa33b4 by silvasean
`shape` dialect: add some ops

- add `to_extent_tensor`
- rename `create_shape` to `from_extent_tensor` for symmetry
- add `split_at` and `concat` ops for basic shape manipulations

This set of ops is inspired by the requirements of lowering a dynamic-shape-aware batch matmul op. For such an op, the "matrix" dimensions aren't subject to broadcasting but the others are, and so we need to slice, broadcast, and reconstruct the final output shape. Furthermore, the actual broadcasting op used downstream uses a tensor of extents as its preferred shape interface for the actual op that does the broadcasting.

However, this functionality is quite general. It's obvious that `to_extent_tensor` is needed long-term to support many common patterns that involve computations on shapes. We can evolve the shape manipulation ops introduced here. The specific choices made here took into consideration the potentially unranked nature of the !shape.shape type, which means that a simple listing of dimensions to extract isn't possible in general.

Differential Revision: https://reviews.llvm.org/D76817
The file was modifiedmlir/lib/Dialect/Shape/IR/Shape.cpp
The file was modifiedmlir/lib/Dialect/Shape/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/Shape/IR/Shape.h
The file was modifiedmlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
Commit b3f6e3d6d64d77a9c840b8407b7e3c49b62b46dd by richard
Improve recovery from invalid template-ids.

Instead of bailing out of parsing when we encounter an invalid
template-name or template arguments in a template-id, produce an
annotation token describing the invalid construct.

This avoids duplicate errors and generally allows us to recover better.
In principle we should be able to extend this to store some kinds of
invalid template-id in the AST for tooling use, but that isn't handled
as part of this change.
The file was modifiedclang/lib/Parse/Parser.cpp
The file was modifiedclang/test/SemaCXX/injected-class-name-crash.cpp
The file was modifiedclang/lib/Parse/ParseExprCXX.cpp
The file was modifiedclang/test/CXX/drs/dr3xx.cpp
The file was modifiedclang/lib/Sema/DeclSpec.cpp
The file was modifiedclang/test/SemaCXX/PR9459.cpp
The file was modifiedclang/test/SemaCXX/builtins.cpp
The file was modifiedclang/test/Parser/cxx-member-initializers.cpp
The file was modifiedclang/lib/Parse/ParseTentative.cpp
The file was modifiedclang/test/Parser/cxx-template-decl.cpp
The file was modifiedclang/test/SemaTemplate/ms-delayed-default-template-args.cpp
The file was modifiedclang/lib/Parse/ParseDecl.cpp
The file was modifiedclang/test/SemaTemplate/temp_arg.cpp
The file was modifiedclang/lib/Parse/ParseTemplate.cpp
The file was modifiedclang/test/Parser/cxx-ambig-init-templ.cpp
The file was modifiedclang/test/CXX/temp/p3.cpp
The file was modifiedclang/test/SemaCXX/invalid-member-expr.cpp
The file was modifiedclang/test/SemaCXX/implicit-exception-spec.cpp
The file was modifiedclang/include/clang/Sema/Ownership.h
The file was modifiedclang/include/clang/Sema/ParsedTemplate.h
The file was modifiedclang/test/Parser/cxx-class.cpp
The file was modifiedclang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
The file was modifiedclang/lib/Parse/ParseCXXInlineMethods.cpp
The file was modifiedclang/lib/Parse/ParseDeclCXX.cpp
The file was modifiedclang/test/SemaCXX/PR20705.cpp
The file was modifiedclang/test/Parser/eof2.cpp
The file was modifiedclang/test/Parser/recovery.cpp
Commit aabc24acf0d5f8677bd22fe9c108581e07c3e180 by maskray
[RISCV] Support llvm.thread.pointer

Fixes https://bugs.llvm.org/show_bug.cgi?id=45303 (clang crashed on __builtin_thread_pointer)

Reviewed By: lenary, MaskRay, luismarques

Differential Revision: https://reviews.llvm.org/D76828
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.h
The file was addedllvm/test/CodeGen/RISCV/thread-pointer.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
Commit 8913769e353a171ba01fa8ce9d598e979b620be9 by Jonas Devlieghere
[FileCollector] Add a method to add a whole directory and it contents.

Extend the FileCollector's API with addDirectory which adds a directory
and its contents to the VFS mapping.

Differential revision: https://reviews.llvm.org/D76671
The file was modifiedllvm/lib/Support/FileCollector.cpp
The file was modifiedllvm/include/llvm/Support/FileCollector.h
The file was modifiedllvm/unittests/Support/FileCollectorTest.cpp
Commit a67f057f6975d2b7e51765e976b8772ffb8fb7e8 by Jonas Devlieghere
[FileCollector] Devirtualize FileCollector (NFC)

This is not (yet) necessary.
The file was modifiedllvm/include/llvm/Support/FileCollector.h
Commit 823dbb4c748feaae6f20637efd0de159dd156c69 by Jonas Devlieghere
[lldb/CMake] Only CMAKE_CFG_INTDIR if it's not '.'

Thanks to Brooks Davis for spotting this and finding a solution.
The file was modifiedlldb/CMakeLists.txt
Commit 98d05f88d55b8b2e5a1392110030d5f45ad4cbcf by Jessica Paquette
[GlobalISel] Fix equality for copies from physregs in matchEqualDefs

When we see this:

```
%a = COPY $physreg
...
SOMETHING implicit-def $physreg
...
%b = COPY $physreg
```

The two copies are not equivalent, and so we shouldn't perform any folding
on them.

When we have two instructions which use a physical register check that they
define the same virtual register(s) as well.

e.g., if we run into this case

```
%a = COPY $physreg
...
%b = COPY %a
```

we can say that the two copies are the same, and can be folded.

Differential Revision: https://reviews.llvm.org/D76890
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-select.mir
Commit e5a8512655cea42f70d4205f59e9c36d3628b8da by ishizaki
 [mlir] NFC: fix trivial typo in source files

Summary: fix trivial typos in the source files

Reviewers: mravishankar, antiagainst, nicolasvasilache, herhut, rriddle, aartbik

Reviewed By: antiagainst, rriddle

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, bader, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76876
The file was modifiedmlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp
The file was modifiedmlir/test/lib/Transforms/TestGpuParallelLoopMapping.cpp
The file was modifiedmlir/tools/mlir-tblgen/OpFormatGen.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/lib/Dialect/Traits.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVAttributes.h
The file was modifiedmlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
The file was modifiedmlir/lib/Dialect/Vector/VectorTransforms.cpp
The file was modifiedmlir/include/mlir/Transforms/Passes.h
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp
The file was modifiedmlir/tools/mlir-vulkan-runner/VulkanRuntime.h
The file was modifiedmlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp
The file was modifiedmlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp
The file was modifiedmlir/lib/Conversion/LoopToStandard/LoopToStandard.cpp
The file was modifiedmlir/lib/IR/MLIRContext.cpp
The file was modifiedmlir/lib/ExecutionEngine/RunnerUtils.cpp
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
The file was modifiedmlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
The file was modifiedmlir/lib/Dialect/Affine/IR/AffineOps.cpp
Commit 43a95a543fbb1ed4b3903e88ce291444d4970f5a by uday
[MLIR] Introduce full/partial tile separation using if/else

This patch introduces a utility to separate full tiles from partial
tiles when tiling affine loop nests where trip counts are unknown or
where tile sizes don't divide trip counts. A conditional guard is
generated to separate out the full tile (with constant trip count loops)
into the then block of an 'affine.if' and the partial tile to the else
block. The separation allows the 'then' block (which has constant trip
count loops) to be optimized better subsequently: for eg. for
unroll-and-jam, register tiling, vectorization without leading to
cleanup code, or to offload to accelerators. Among techniques from the
literature, the if/else based separation leads to the most compact
cleanup code for multi-dimensional cases (because a single version is
used to model all partial tiles).

INPUT

  affine.for %i0 = 0 to %M {
    affine.for %i1 = 0 to %N {
      "foo"() : () -> ()
    }
  }

OUTPUT AFTER TILING W/O SEPARATION

  map0 = affine_map<(d0) -> (d0)>
  map1 = affine_map<(d0)[s0] -> (d0 + 32, s0)>

  affine.for %arg2 = 0 to %M step 32 {
    affine.for %arg3 = 0 to %N step 32 {
      affine.for %arg4 = #map0(%arg2) to min #map1(%arg2)[%M] {
        affine.for %arg5 = #map0(%arg3) to min #map1(%arg3)[%N] {
          "foo"() : () -> ()
        }
      }
    }
  }

  OUTPUT AFTER TILING WITH SEPARATION

  map0 = affine_map<(d0) -> (d0)>
  map1 = affine_map<(d0) -> (d0 + 32)>
  map2 = affine_map<(d0)[s0] -> (d0 + 32, s0)>

  #set0 = affine_set<(d0, d1)[s0, s1] : (-d0 + s0 - 32 >= 0, -d1 + s1 - 32 >= 0)>

  affine.for %arg2 = 0 to %M step 32 {
    affine.for %arg3 = 0 to %N step 32 {
      affine.if #set0(%arg2, %arg3)[%M, %N] {
        // Full tile.
        affine.for %arg4 = #map0(%arg2) to #map1(%arg2) {
          affine.for %arg5 = #map0(%arg3) to #map1(%arg3) {
            "foo"() : () -> ()
          }
        }
      } else {
        // Partial tile.
        affine.for %arg4 = #map0(%arg2) to min #map2(%arg2)[%M] {
          affine.for %arg5 = #map0(%arg3) to min #map2(%arg3)[%N] {
            "foo"() : () -> ()
          }
        }
      }
    }
  }

The separation is tested via a cmd line flag on the loop tiling pass.
The utility itself allows one to pass in any band of contiguously nested
loops, and can be used by other transforms/utilities. The current
implementation works for hyperrectangular loop nests.

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>

Differential Revision: https://reviews.llvm.org/D76700
The file was modifiedmlir/include/mlir/Dialect/Affine/IR/AffineOps.td
The file was modifiedmlir/include/mlir/Transforms/LoopUtils.h
The file was modifiedmlir/test/Dialect/Affine/loop-tiling.mlir
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
The file was modifiedmlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
The file was modifiedmlir/include/mlir/Analysis/AffineStructures.h
The file was modifiedmlir/lib/Analysis/Utils.cpp