1. Apr 27, 2024
  2. Apr 26, 2024
    • Simon Pilgrim's avatar
    • Fangrui Song's avatar
      [MC] Rename temporary symbols of empty name to ".L0 " (#89693) · bf67610a
      Fangrui Song authored
      Temporary symbols generated for .eh_frame and .debug_line have an empty
      name, which appear in .symtab in the presence of RISC-V style linker
      relaxation and will not be discarded by ld/objcopy --discard-locals
      (-X).
      
      In contrast, GNU assembler's riscv port assigns a fake name ".L0 " (with
      a trailing space) to these symbols so that will be discarded by
      ld/objcopy --discard-locals.
      
      This patch matches the GNU behavior. Since Clang's RISC-V targets pass
      -X to ld, and GNU ld defaults to -X for RISC-V targets, these ".L0 "
      symbols will be discarded after linking by default, as expected by
      users.
      
      The llvm-symbolizer special case for RISC-V `SF_FormatSpecific` symbols
      https://reviews.llvm.org/D98669 needs to be adjusted.
      
      Note: `"":` in assembly currently crashes.
      
      Note: bolt tests used /usr/bin/clang before
      llvmorg-19-init-9532-g59bfc310.
      The revert llvmorg-19-init-9531-g28b55342 actually broke
      bolt/test/RISCV/fake-label-no-entry.c
      bf67610a
    • Diego Caballero's avatar
      [mlir] Add sub-byte type emulation support for `memref.collapse_shape` (#89962) · 571831a6
      Diego Caballero authored
      This PR adds support for `memref.collapse_shape` to sub-byte type emulation. The `memref.collapse_shape` becomes a no-opt given that we are flattening the memref as part of the emulation (i.e., we are collapsing all the dimensions).
      571831a6
    • Jie Fu's avatar
      [mlir] Fix -Wdeprecated-declarations of cast in VCIXToLLVMIRTranslation.cpp (NFC) · 64d514a2
      Jie Fu authored
      In file included from /llvm-project/mlir/lib/Target/LLVMIR/Dialect/VCIX/VCIXToLLVMIRTranslation.cpp:70:
      /llvm-project/build-Release/tools/mlir/include/mlir/Dialect/LLVMIR/VCIXConversions.inc:8:48: error: 'cast' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations]
            VectorType vt = op.getResult().getType().cast<VectorType>();
                                                     ^
      /llvm-project/mlir/include/mlir/IR/Types.h:345:9: note: 'cast' has been explicitly marked deprecated here
      U Type::cast() const {
              ^
      In file included from /llvm-project/mlir/lib/Target/LLVMIR/Dialect/VCIX/VCIXToLLVMIRTranslation.cpp:70:
      /llvm-project/build-Release/tools/mlir/include/mlir/Dialect/LLVMIR/VCIXConversions.inc:8:48: error: 'cast<mlir::VectorType>' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations]
            VectorType vt = op.getResult().getType().cast<VectorType>();
                                                     ^
      /llvm-project/mlir/include/mlir/IR/Types.h:112:5: note: 'cast<mlir::VectorType>' has been explicitly marked deprecated here
        [[deprecated("Use mlir::cast<U>() instead")]]
          ^
      In file included from /llvm-project/mlir/lib/Target/LLVMIR/Dialect/VCIX/VCIXToLLVMIRTranslation.cpp:70:
      /llvm-project/build-Release/tools/mlir/include/mlir/Dialect/LLVMIR/VCIXConversions.inc:32:48: error: 'cast' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations]
            VectorType vt = op.getResult().getType().cast<VectorType>();
                                                     ^
      /llvm-project/mlir/include/mlir/IR/Types.h:345:9: note: 'cast' has been explicitly marked deprecated here
      U Type::cast() const {
              ^
      In file included from /llvm-project/mlir/lib/Target/LLVMIR/Dialect/VCIX/VCIXToLLVMIRTranslation.cpp:70:
      /llvm-project/build-Release/tools/mlir/include/mlir/Dialect/LLVMIR/VCIXConversions.inc:32:48: error: 'cast<mlir::VectorType>' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations]
            VectorType vt = op.getResult().getType().cast<VectorType>();
                                                     ^
      /llvm-project/mlir/include/mlir/IR/Types.h:112:5: note: 'cast<mlir::VectorType>' has been explicitly marked deprecated here
        [[deprecated("Use mlir::cast<U>() instead")]]
          ^
      4 errors generated.
      64d514a2
    • NagyDonat's avatar
      [clang-tidy][NFC] Fix broken link in documentation of cert-env33-c (#90216) · 2d09ac40
      NagyDonat authored
      It seems that the description of the SEI CERT rules was moved from
      `www.securecoding.cert.org` to `wiki.sei.cmu.edu` and the page IDs were
      not preserved during the transition.
      
      However, the old domain name redirects to the new one and permalinks
      derived from the name of the rule still work, so I kept using the old
      domain name to be consistent with other documentation files using it.
      2d09ac40
    • Xiaoyang Liu's avatar
      [libc++][ranges] LWG3984: ranges::to's recursion branch may be ill-formed (#87964) · e74be35c
      Xiaoyang Liu authored
      
      
      This pull request implements LWG3984: ranges::to's recursion branch
      may be ill-formed.
      
      In the current implementation, ranges::to's recursion branch pipes the
      range into a `views::transform(/* lambda */)`, which is a __range_adaptor_closure
      object. In libc++, the pipe operator of __range_adaptor_closure requires a
      viewable_range, so the following code won't compile, as the type of lvalue
      `r` doesn't model viewable_range:
      
        #include <ranges>
        #include <vector>
        #include <list>
      
        int main() {
          std::vector<std::vector<int>> v;
          auto r = std::views::all(std::move(v));
          auto l = std::ranges::to<std::list<std::list<int>>>(r);
        }
      
      Co-authored-by: default avatarA. Jiang <de34@live.cn>
      e74be35c
    • Vlad Serebrennikov's avatar
      [clang] Add test for CWG2149 "Brace elision and array length deduction" (#90079) · 1728a56d
      Vlad Serebrennikov authored
      This patch adds test for
      [CWG2149](https://cplusplus.github.io/CWG/issues/2149.html), following
      [P3106R1](https://wg21.link/p3106R1) "Clarifying rules for brace elision
      in aggregate initialization" and a clarification note on top of it added
      on April 2024.
      
      I haven't found a better way to check for equality of values inside
      array in 98 mode than to dump AST. I'm open to suggestions there.
      1728a56d
    • Christian Sigg's avatar
    • Diego Caballero's avatar
      [mlir][MemRef] Add ExtractStridedMetadataOpCollapseShapeFolder (#89954) · 450ac01b
      Diego Caballero authored
      This PR adds a new pattern to the set of patterns used to resolve the offset, sizes and
      stride of a memref. Similar to `ExtractStridedMetadataOpSubviewFolder`, the new
      pattern resolves strided_metadata(collapse_shape) directly, without introduce a
      reshape_cast op.
      450ac01b
    • Alexey Bataev's avatar
      [SLP]Attempt to vectorize long stores, if short one failed. · d74e42ac
      Alexey Bataev authored
      We can try to vectorize long store sequences, if short ones were
      unsuccessful because of the non-profitable vectorization. It should not
      increase compile time significantly (stores are sorted already,
      complexity is n x log n), but vectorize extra code.
      
      Metric: size..text
      
      Program                                                                         size..text
                                                                                      results     results0    diff
               test-suite :: External/SPEC/CINT2006/400.perlbench/400.perlbench.test  1088012.00  1088236.00  0.0%
                        test-suite :: SingleSource/UnitTests/matrix-types-spec.test   480396.00   480476.00  0.0%
                test-suite :: External/SPEC/CINT2017rate/525.x264_r/525.x264_r.test   664613.00   664661.00  0.0%
               test-suite :: External/SPEC/CINT2017speed/625.x264_s/625.x264_s.test   664613.00   664661.00  0.0%
              test-suite :: External/SPEC/CFP2017rate/510.parest_r/510.parest_r.test  2041105.00  2040961.00 -0.0%
                       test-suite :: MultiSource/Applications/JM/lencod/lencod.test   836563.00   836387.00 -0.0%
                       test-suite :: MultiSource/Benchmarks/7zip/7zip-benchmark.test  1035100.00  1032140.00 -0.3%
      
      In all benchmarks extra code gets vectorized
      
      Reviewers: RKSimon
      
      Reviewed By: RKSimon
      
      Pull Request: https://github.com/llvm/llvm-project/pull/88563
      d74e42ac
    • Jay Foad's avatar
      Revert "[TableGen] Ignore inaccessible memory when checking pattern flags (#90061)" · ace3bd05
      Jay Foad authored
      This reverts commit 6578356a.
      
      The patch had no effect due to a silly mistake and fixing the mistake
      causes other problems.
      ace3bd05
    • Joseph Huber's avatar
      [Offload] Remove remaining `__tgt_register_requires` references (#90198) · 904b1a85
      Joseph Huber authored
      Summary:
      This call was removed a few months ago to allow the runtime to actually
      init / deinit in a correct order. However that patch forgot to remove a
      few leftover uses.
      904b1a85
    • Matt Arsenault's avatar
      DAG: Simplify demanded bits for truncating atomic_store (#90113) · 405c018c
      Matt Arsenault authored
      It's really unfortunate that STORE and ATOMIC_STORE are separate
      opcodes. This duplicates a basic simplify demanded for the truncating
      case. This avoids some AMDGPU lit regressions in a future patch.
      
      I'm not sure how to craft a test that exposes this without first
      introducing the regressions by promoting half to i16.
      405c018c
    • erichkeane's avatar
      [NFC][OpenACC] Remove stale FIXME comment in a test · bb1a8bbb
      erichkeane authored
      A recent patch changed the array sections to work differently for
      OpenACC, including for the diagnostic, so the FIXME is now irrelevant.
      bb1a8bbb
    • Simon Pilgrim's avatar
      [DAG] visitORCommutative - fold build_pair(not(x),not(y)) ->... · 55d85c84
      Simon Pilgrim authored
      [DAG] visitORCommutative - fold build_pair(not(x),not(y)) -> not(build_pair(x,y)) style patterns (#90050)
      
      (Sorry, not an actual build_pair node just a similar pattern).
      
      For cases where we're concatenating 2 integers into a double width integer, see if both integer sources are NOT patterns.
      
      We could take this further and handle all logic ops with a constant operands, but I just wanted to handle the case reported on #89533 initially.
      
      Fixes #89533
      55d85c84
    • Alex Bradbury's avatar
      [RISCV][NFC] Future-proof reference to ISA manual in RISCVInstrInfoC.td · c379a5b6
      Alex Bradbury authored
      The reference to a particular page number is long since out of date.
      Instead, let's name the section title which at least has remained stable
      so far.
      c379a5b6
    • Carlos Alberto Enciso's avatar
      [Transforms] Debug values are not remapped when cloning. (#87747) · 7696d36b
      Carlos Alberto Enciso authored
      When cloning instructions from one basic block to another,
      the debug values are not remapped, in the same was as the
      normal instructions.
      7696d36b
    • Peter Lafreniere's avatar
      [M68k] Add support for MOVEQ instruction (#88542) · c4c9d4f3
      Peter Lafreniere authored
      Add support for the moveq instruction, which is both faster and smaller
      (1/2 to 1/3 the size) than a move with immediate to register.
      
      This change introduces the instruction, along with a set of
      pseudoinstructions to handle immediate moves to a register that is
      lowered post-RA.
      
      Pseudos are used as moveq can only write to the full register, which
      makes
      matching i8 and i16 immediate loads difficult in tablegen. Furthermore,
      selecting moveq before RA constrains that immediate to be moved into a
      data
      register, which may not be optimal.
      
      The bulk of this change are fixes to existing tests, which cover the new
      functionality sufficiently.
      c4c9d4f3
    • Bjorn Pettersson's avatar
      Add test cases for SELECT->AND miscompiles in DAGCombiner · 39f1b2de
      Bjorn Pettersson authored
      Adding reproducers for github issues #84653 and #85190.
      39f1b2de
    • Dan Klishch's avatar
      [clang][X86] Fix -Wundef warning in cpuid.h (#89842) · 134e6456
      Dan Klishch authored
      Caught by compiling a project (SerenityOS) that uses compiler-rt and not
      silencing warnings from system headers.
      134e6456
    • Jonathan Thackray's avatar
      [AArch64] Add support for Neoverse-N3, Neoverse-V3 and Neoverse-V3AE (#90143) · a670cdad
      Jonathan Thackray authored
      Neoverse-N3, Neoverse-V3 and Neoverse-V3AE are Armv9.2 AArch64 CPUs.
      
      Technical Reference Manual for Neoverse-N3:
         https://developer.arm.com/documentation/107997/latest/
      
      Technical Reference Manual for Neoverse-V3:
         https://developer.arm.com/documentation/107734/latest/
      
      Technical Reference Manual for Neoverse-V3AE:
         https://developer.arm.com/documentation/101595/latest/
      a670cdad
    • Bjorn Pettersson's avatar
      [DAGCombiner] Do not always fold FREEZE over BUILD_VECTOR (#85932) · 8e2f6495
      Bjorn Pettersson authored
      Avoid turning a BUILD_VECTOR that can be recognized as "all zeros",
      "all ones" or "constant" into something that depends on
      freeze(undef), as that would destroy those properties.
      
      Instead we replace undef by 0/-1 in such vectors, making it possible
      to fold away the freeze. We typically use -1 if the BUILD_VECTOR
      would identify as "all ones", and otherwise we use the value 0.
      8e2f6495