LLVM/project a581cebclang CMakeLists.txt

[clang][cmake] Use llvm-libtool-darwin in clang multi-stage build (#177277)

We are seeing the build system uses the XCode's libtool when building
the 2nd stage of the clang on mac. We should use the llvm-libtool-darwin
from the previous stage clang build instead. This patch makes multi-stage
clang build to use llvm-libtool-darwin from the previous stage when targeting
mac.
DeltaFile
+2-0clang/CMakeLists.txt
+2-01 files

LLVM/project 1b37911compiler-rt/lib/orc elfnix_platform.cpp, compiler-rt/test/orc/TestCases/Linux/Generic ctor-dtor.cpp

[ORC] Fix missing support of deinitialize on ELF platform and execution order by priority (#175981)

This PR fixes
1. issue #175509 about missing support of deinitialize on ELF platform. 
2. missing support of execution order by proirity at both initialize and
deinitialize stage.

cc: @tqchen @joker-eph
DeltaFile
+210-27llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
+103-0compiler-rt/lib/orc/elfnix_platform.cpp
+86-0compiler-rt/test/orc/TestCases/Linux/Generic/ctor-dtor.cpp
+15-0llvm/lib/ExecutionEngine/Orc/Shared/ObjectFormats.cpp
+7-0llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
+2-0llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h
+423-276 files

LLVM/project 30fba3cflang/lib/Optimizer/OpenMP MapInfoFinalization.cpp

[Flang][OpenMP][Offload] Modify MapInfoFinalization to handle attach mapping and 6.1's ref_* and attach map keywords

This PR is one of four required to implement the attach mapping semantics in Flang, alongside the
ref_ptr/ref_ptee/ref_ptr_ptee map modifiers and the attach(always/never/auto) modifiers.

This PR is the MapInfoFinalization changes required to support these features, it mainly deals with
applying the correct attach map type and manipulating the descriptor types maps for base address
and descriptor so that when we specify ref_ptr/ref_ptee we emit one of the two maps and when we
emit ref_ptr_ptee we emit our usual default maps. In all cases we add the "glue" of an new
attach map except in cases where a user has provided attach never. In cases where we are
provided an always, we apply the always map type to our attach maps.

It's important to note the runtime has a toggle for the auto map behaviour, which will flip the
attach behaviour to the newer semantics or the older semantics for backwards compatability (outside
the purview of this PR but good to mention).
DeltaFile
+491-246flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
+491-2461 files

LLVM/project dfae932flang/test/Lower/OpenMP teams.f90

remove unrelated test changes
DeltaFile
+1-1flang/test/Lower/OpenMP/teams.f90
+1-11 files

LLVM/project 1ae4275flang/lib/Lower/OpenMP Clauses.cpp ClauseProcessor.cpp, flang/test/Lower/OpenMP thread-limit-dims.f90

Fix flang to mlir lowering for thread_limit
DeltaFile
+61-0flang/test/Lower/OpenMP/thread-limit-dims.f90
+10-3flang/lib/Lower/OpenMP/Clauses.cpp
+4-3flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+3-1llvm/include/llvm/Frontend/OpenMP/ClauseT.h
+78-74 files

LLVM/project 1b2f56ellvm/lib/Target/AMDGPU GCNSubtarget.h AMDGPU.td

[NFCI][AMDGPU] Remove more redundant code from `GCNSubtarget.h`
DeltaFile
+22-58llvm/lib/Target/AMDGPU/GCNSubtarget.h
+30-46llvm/lib/Target/AMDGPU/AMDGPU.td
+11-11llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+3-3llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+3-3llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+2-4llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
+71-1255 files not shown
+78-13311 files

LLVM/project aab3083flang/test/Lower/OpenMP num-threads-dims.f90

Add a test for flanf to mlir lowering for num_threads
DeltaFile
+61-0flang/test/Lower/OpenMP/num-threads-dims.f90
+61-01 files

LLVM/project 962a9a3mlir/lib/Dialect/Vector/IR VectorOps.cpp, mlir/test/Dialect/Vector canonicalize.mlir vector-transfer-to-vector-load-store.mlir

[mlir][vector] Canonicalize vector.extract and vector.broadcast to vector.shape_cast (#174452)

Based on the original PR
https://github.com/llvm/llvm-project/pull/140583, but without
vector.transpose -> vector.shape_cast.

This PR canonicalizes 

%0 = vector.broadcast %arg0 : vector<4xi8> to vector<1x1x4xi8>
%2 = vector.extract %arg2[0] : vector<4xi8> from vector<1x4xi8>

to shape_cast. It was decided (see
https://github.com/llvm/llvm-project/pull/140583) that the
vector.transpose -> vector.shape_cast needs further consideration before
being added.

---------

Signed-off-by: James Newling <james.newling at gmail.com>
DeltaFile
+130-0mlir/test/Dialect/Vector/canonicalize/vector-to-shape-cast.mlir
+72-24mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+11-11mlir/test/Dialect/Vector/canonicalize.mlir
+3-5mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir
+2-2mlir/test/Dialect/Vector/vector-warp-distribute.mlir
+1-1mlir/test/Dialect/Vector/canonicalize/vector-from-elements.mlir
+219-431 files not shown
+220-447 files

LLVM/project c91d5c7llvm/lib/Transforms/Utils InjectTLIMappings.cpp, llvm/test/Transforms/Util add-TLI-mappings.ll

InjectTLIMappings: remove incompatible attributes from vector declarations. (#173206)

Some attributes (e.g., the signext attribute) are not supported on
vector types; adding them would cause the verifier pass to fail.
DeltaFile
+19-4llvm/test/Transforms/Util/add-TLI-mappings.ll
+12-0llvm/lib/Transforms/Utils/InjectTLIMappings.cpp
+31-42 files

LLVM/project f51bdc2llvm/lib/Target/AMDGPU GCNSubtarget.h AMDGPU.td

[NFCI][AMDGPU] Remove more redundant code from `GCNSubtarget.h`
DeltaFile
+21-55llvm/lib/Target/AMDGPU/GCNSubtarget.h
+27-41llvm/lib/Target/AMDGPU/AMDGPU.td
+11-11llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+3-3llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+2-4llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
+3-3llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+67-1175 files not shown
+74-12511 files

LLVM/project f2a3079clang/lib/Serialization ModuleManager.cpp, clang/test/ClangScanDeps build-session-validation-outdated-module.c

[Modules] Fix spurious errors about module input file changing after .pcm file was built. (#176537)

For incremental multi-process/multi-thread compilation utilizing a build
session fix errors like

> fatal error: file '/path/to/Frmwrk.framework/Headers/Header.h' has been modified since the module file '/path/to/ModuleCache.noindex/XXX/Frmwrk-YYY.pcm' was built: mtime changed (was aaa, now bbb)
    
Another symptom of the bug is when you check Frmwrk.pcm the header's
mtime is correct, so it is confusing where "was aaa" is even coming from.
    
The main problem is that in case of a signature mismatch
`ModuleManager::addModule` returns `OutOfDate` but keeps .pcm buffer in
`InMemoryModuleCache`. So if later on it tries to use such a module, it
would have an outdated buffer in `InMemoryModuleCache`. If another
process/thread happens to rebuild such module and write a new validation
timestamp, the original process would skip the input file validation and
would keep using the outdated .pcm buffer hitting errors about
unexpected input modifications.


    [6 lines not shown]
DeltaFile
+122-0clang/test/ClangScanDeps/build-session-validation-outdated-module.c
+7-2clang/lib/Serialization/ModuleManager.cpp
+129-22 files

LLVM/project 73a309ellvm/lib/Target/RISCV RISCVISelLowering.cpp RISCVRegisterInfo.td, llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/rvv select.mir

[RISCV] Add ZZZ_ to some inline assembly vector register classes to sort them after VR/VRNoV0 in regclass enum. (#177087)

This prevents getCommonSubClass from finding them before VR/VRNoV0.

Fixes a crash reported post-commit in #171231. getCommonSubClass
returned one of these classes, but it doesn't have the same VTs as
VR/VRNoV0 leading to an assertion failure.

The subregister-undef-early-clobber.mir still ends up finding these
register classes in the InitUndef pass.
DeltaFile
+71-0llvm/test/CodeGen/RISCV/rvv/pr171231.ll
+13-12llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+12-12llvm/test/CodeGen/RISCV/rvv/subregister-undef-early-clobber.mir
+14-8llvm/lib/Target/RISCV/RISCVRegisterInfo.td
+10-10llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/rvv/select.mir
+3-3llvm/test/CodeGen/RISCV/rvv/vmv.v.v-peephole.mir
+123-457 files not shown
+133-5713 files

LLVM/project 2b22d76orc-rt/include/orc-rt bit.h, orc-rt/unittests bit-test.cpp EndianTest.cpp

[orc-rt] Implement rotl / rotr, fix missing include in unit test. (#177305)

In e838f27e0f3 the EndianTest.cpp unittest was updated to avoid using
`llvm::rotl` function, but the corresponding `orc_rt::rotl` function had
not been implemented yet.

This commit implements orc_rt::rotl, orc_rt::rotr, and
orc_rt::has_single_bit by copying their definitions from the
corresponding LLVM header (llvm-project/llvm/include/llvm/ADT/bit.h).
Unit tests for these functions are also copied from their LLVM
counterparts.

Thanks to @jaredwy for spotting this!
DeltaFile
+69-0orc-rt/unittests/bit-test.cpp
+31-0orc-rt/include/orc-rt/bit.h
+1-0orc-rt/unittests/EndianTest.cpp
+101-03 files

LLVM/project a173e79flang/lib/Lower/OpenMP ClauseProcessor.cpp Clauses.cpp, flang/test/Lower/OpenMP num-teams-dims.f90

Use only num_teams_lower and num_teams_upper_vars for clause
DeltaFile
+22-140mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+51-0flang/test/Lower/OpenMP/num-teams-dims.f90
+15-21mlir/include/mlir/Dialect/OpenMP/OpenMPClauses.td
+21-9flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+21-4flang/lib/Lower/OpenMP/Clauses.cpp
+7-7flang/lib/Lower/OpenMP/OpenMP.cpp
+137-1815 files not shown
+157-19711 files

LLVM/project 9b5b25bflang/lib/Optimizer/OpenMP MapInfoFinalization.cpp

[Flang][OpenMP][Offload] Modify MapInfoFinalization to handle attach mapping and 6.1's ref_* and attach map keywords

This PR is one of four required to implement the attach mapping semantics in Flang, alongside the
ref_ptr/ref_ptee/ref_ptr_ptee map modifiers and the attach(always/never/auto) modifiers.

This PR is the MapInfoFinalization changes required to support these features, it mainly deals with
applying the correct attach map type and manipulating the descriptor types maps for base address
and descriptor so that when we specify ref_ptr/ref_ptee we emit one of the two maps and when we
emit ref_ptr_ptee we emit our usual default maps. In all cases we add the "glue" of an new
attach map except in cases where a user has provided attach never. In cases where we are
provided an always, we apply the always map type to our attach maps.

It's important to note the runtime has a toggle for the auto map behaviour, which will flip the
attach behaviour to the newer semantics or the older semantics for backwards compatability (outside
the purview of this PR but good to mention).
DeltaFile
+609-351flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
+609-3511 files

LLVM/project 7d3a567lld/ELF SyntheticSections.cpp InputFiles.h, lld/test/ELF verneed-weak.s verneed-as-needed-weak.s

[ELF] Set vna_flags to VER_FLG_WEAK if all references are weak

When all undefined references to a version are weak, set vna_flags to
VER_FLG_WEAK in the .gnu.version_r section. This enables glibc ld.so to
report a warning instead of an error when the required version is not
found at runtime, supporting optional dependencies.

Per https://sourceware.org/bugzilla/show_bug.cgi?id=24718#c20 ,
glibc rtld since 2.30 (BZ #24741) tolerates missing versioned symbols
when the runtime shared object defines the required version. With this
vna_flags VER_FLG_WEAK change, rtld can also tolerate a completely
missing version, printing a message like:

```
% LD_PRELOAD=c2.so ./a
./a: /tmp/t/v2/c2.so: weak version `v1' not found (required by /tmp/t/v2/b.so)
a
```


    [5 lines not shown]
DeltaFile
+80-0lld/test/ELF/verneed-weak.s
+21-15lld/ELF/SyntheticSections.cpp
+0-18lld/test/ELF/verneed-as-needed-weak.s
+10-4lld/ELF/InputFiles.h
+1-1lld/ELF/SyntheticSections.h
+112-385 files

LLVM/project 2036bc5llvm/include/llvm/IR IRBuilder.h, llvm/lib/IR IRBuilder.cpp

[IR] Update IRBuilder::createVectorSplice to allow variable offsets (#177178)

Following on from #174693, this updates IRBuilder to allow variable
offsets, and splits the createVectorSplice function into two functions
for left and right splices.

We could preserve the existing createVectorSplice API but given there's
only one LLVM-internal user of it in the loop vectorizer, and the notion
of a negative offset doesn't exist in the intrinsics anymore, I've
removed it. Happy to add it back if reviewers prefer though.

I've also added unit tests since createVectorSpliceLeft has no coverage
otherwise.
DeltaFile
+36-24llvm/lib/IR/IRBuilder.cpp
+58-0llvm/unittests/IR/IRBuilderTest.cpp
+21-9llvm/include/llvm/IR/IRBuilder.h
+1-1llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+116-344 files

LLVM/project 017c009orc-rt/unittests EndianTest.cpp

Revert "[orc-rt] Update another unittest to use orc-rt/bit.h functions. (#177…"

This reverts commit e838f27e0f3f417e3963992c9591d412b621cd4c.
DeltaFile
+1-1orc-rt/unittests/EndianTest.cpp
+1-11 files

LLVM/project e838f27orc-rt/unittests EndianTest.cpp

[orc-rt] Update another unittest to use orc-rt/bit.h functions. (#177303)

Unit test was mistakenly using an `llvm::` function.

Thanks to @jaredwy for spotting this!
DeltaFile
+1-1orc-rt/unittests/EndianTest.cpp
+1-11 files

LLVM/project 1bc3133flang/lib/Optimizer/OpenMP MapInfoFinalization.cpp, flang/lib/Utils OpenMP.cpp

[Flang][MLIR][OpenMP] Add distinct var_ptr_ptr_type to omp.map.info operations

This is a precursor patch to attach and ref_ptr/ptee mapping that I intend to upstream
over the next few weeks. The attach maps require both the type of the descriptor and
the pointed to data to calculate the appropriate offload/base pointers and size. In
the base case of ref_ptr_ptee all of this information can be gathered from the pointer
and pointee maps, but in cases where we have only one (i.e. ref_ptr/ref_ptee) we will
be missing one of the key elements required to create an corresponding attach map.

So, this PR basically adds the ability to ferry around the type of both var_ptr and
var_ptr_ptr as opposed to just var_ptr, then we can emit attach maps as seperate
map.info's that carry all the pre-requisite informaion for lowering to LLVM-IR. But,
otherwise it seems reasonable to have var_ptr_ptr mirror var_ptr in all aspects for
consistency.
DeltaFile
+25-16flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
+18-11mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+18-11flang/lib/Utils/OpenMP.cpp
+14-14flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
+19-5mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+11-11flang/test/Transforms/omp-map-info-finalization.fir
+105-6837 files not shown
+192-14943 files

LLVM/project 42a6ca2flang/lib/Lower/OpenMP ClauseProcessor.cpp, flang/test/Lower/OpenMP attach-and-ref-modifier.f90

[Flang][OpenMP][MLIR] Add attach and ref map type lowering to MLIR

This doesn't implement the functionality, just the relevant map type
lowering to MLIR's omp.map.info. The more complicated changes to
MapInfoFinalizationPass.cpp and OpenMPTOLLVMIRTranslation.cpp to support
attach map and the various ref/attach semantics will come in a subsequent
set of PRs. This just helps compartmentalize the changeset.
DeltaFile
+63-0flang/test/Lower/OpenMP/attach-and-ref-modifier.f90
+29-2flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+0-9flang/test/Lower/OpenMP/Todo/attach-modifier.f90
+92-113 files

LLVM/project d7d4786clang/www cxx_status.html

[NFC][clang] Mark P3034R1 as implemented (#177150)

Mark [P1857R3 Modules Dependency Discovery](https://wg21.link/p1857r3)
as implemented.
This paper was implemented in
https://github.com/llvm/llvm-project/pull/173789.

Signed-off-by: yronglin <yronglin777 at gmail.com>
DeltaFile
+1-1clang/www/cxx_status.html
+1-11 files

LLVM/project e98c327llvm/lib/Transforms/Vectorize VPlan.cpp, llvm/test/Transforms/LoopVectorize exact.ll tripcount.ll

capture weights
DeltaFile
+31-7llvm/lib/Transforms/Vectorize/VPlan.cpp
+30-3llvm/test/Transforms/LoopVectorize/exact.ll
+9-6llvm/test/Transforms/LoopVectorize/tripcount.ll
+70-163 files

LLVM/project 6149895orc-rt/unittests bit-test.cpp

[orc-rt] Actually test orc-rt/bit.h functions. (#177300)

The unit test was copied from a similar test in llvm, and was still
qualifying calls with 'llvm::'. This was unintended, but happened to
work because LLVM's bit.h is transitively included through LLVM's gtest
headers. Qualifying with 'orc_rt::' tests the intended functions.

Thanks to @jaredwy for spotting this!
DeltaFile
+46-46orc-rt/unittests/bit-test.cpp
+46-461 files

LLVM/project 1869b15lld/ELF MarkLive.cpp, lld/test/ELF why-live.test

[ELF] --why-live: Skip symbol at index 0 and section symbols, handle .eh_frame symbols (#177099)

Symbols of empty names can be matched by `--why-live='*'`, which are
generally not useful.

* The first entry in a symbol table (STB_LOCAL and undefined)
* `STT_SECTION` symbols (emitted by LLVM integrated assembler when
  needed by relocations). These input section symbols will be demoted by
  `demoteAndCopyLocalSymbols`, so technically not really live.
  In addition, such symbols of non-allocable sections currently lead to
  crashes: `whyLive` does not record the section, causing the second
  iteration of the `while (true)` loop in printWhyLive to call
  `std::get<Symbol *>(cur)` when `cur` is an `InputSectionBase *`.

In addition, handle GCC crtendS.o `__FRAME_END__`, which is defined
relative to a `.eh_frame` section created with
`__attribute__((used, section(".eh_frame")))`.

Fix #176890
DeltaFile
+44-0lld/test/ELF/why-live.test
+8-1lld/ELF/MarkLive.cpp
+52-12 files

LLVM/project b57dcffflang/lib/Optimizer/Transforms/CUDA CUFFunctionRewrite.cpp

[flang][cuda][NFC] Fix typo in header (#177299)

DeltaFile
+1-1flang/lib/Optimizer/Transforms/CUDA/CUFFunctionRewrite.cpp
+1-11 files

LLVM/project 564571fllvm/lib/CodeGen TargetLoweringObjectFileImpl.cpp, llvm/lib/Target/SystemZ SystemZAsmPrinter.cpp

Fix clang-format.
DeltaFile
+2-2llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+2-2llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
+4-42 files

LLVM/project 8c8661elibcxx/include/__ranges subrange.h

[libc++][NFC] Reformat `subrange.h` (#177118)

As a pre-requisite to https://github.com/llvm/llvm-project/pull/176936
DeltaFile
+6-5libcxx/include/__ranges/subrange.h
+6-51 files

LLVM/project 503db98libcxx/include/__iterator wrap_iter.h

[libc++][NFC] Reformat `wrap_iter.h` (#177127)

As a pre-requisite to https://github.com/llvm/llvm-project/pull/172200
DeltaFile
+4-5libcxx/include/__iterator/wrap_iter.h
+4-51 files

LLVM/project f34d420llvm/include/llvm/CodeGen TargetLoweringObjectFileImpl.h, llvm/lib/CodeGen TargetLoweringObjectFileImpl.cpp

Set ADA section correctly.
DeltaFile
+8-9llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+12-3llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
+2-2llvm/test/CodeGen/SystemZ/zos_sinit.ll
+1-2llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
+23-164 files