Changes

Summary

  1. [LoopUnroll] Support loops with exiting block that is neither header nor (details)
  2. [llvm-xray][test] Fix unsupported-elf32.txt after D80185 (details)
  3. [WebAssembly] Fix a bug in removing unnecessary branches (details)
  4. [WebAssembly] Fix a bug in finding matching EH pad (details)
  5. [ObjectYAML][DWARF] Add DWARF entry in ELFYAML. (details)
  6. [Tests] Migrate more statepoint lowering tests to use operand bundles (details)
  7. [LoopUnroll] Fix not-rotated.ll by adding back a limitation was unintentionally (details)
  8. [JITLink] Fix 80-column rule violation. (details)
  9. [JITLink] Improve llvm-jitlink regression testing support for ELF. (details)
  10. [ORC] Add debugging output for LLJIT construction. (details)
  11. [gn build] Port a6deaeec370 (details)
  12. [AArch64][GlobalISel] Enable extending loads combines post-legalization. (details)
  13. [X86] Remove MMX isel patterns containing (x86mmx (scalar_to_vector (i32))). (details)
  14. [libc] Add implementation of call_once from threads.h. (details)
  15. [CodeGen] Add support for extracting elements of scalable vectors (details)
  16. [SVE] Fix warnings in SelectInst::areInvalidOperands (details)
  17. [SVE] Remove getNumElements() warnings in InstCombiner::visitBitCast (details)
  18. [CMake] Pass CLANG_VENDOR variables into later stages (details)
  19. libclc: update website url (details)
Commit 1bc73b02d6934c8586ca5740da416b7094c3c471 by whitneyt
[LoopUnroll] Support loops with exiting block that is neither header nor
latch.

Summary: Remove the limitation in LoopUnrollPass that exiting block must
be either header or latch.
Reviewer: dmgreen, jdoerfert, Meinersbur, kbarton, bmahjour, etiotto,
fhahn, efriedma
Reviewed By: etiotto, fhahn, efriedma
Subscribers: efriedma, lkail, xbolva00, hiraditya, zzheng, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D80477
The file was addedllvm/test/Transforms/LoopUnroll/nonlatchcondbr.ll
The file was modifiedllvm/lib/Transforms/Utils/LoopUnroll.cpp
Commit 59ba12994c07d03ac3b628c05c45a834774f9b17 by maskray
[llvm-xray][test] Fix unsupported-elf32.txt after D80185
The file was modifiedllvm/test/tools/llvm-xray/X86/unsupported-elf32.txt
Commit 3fe6ea4641b20c3406e2ef10c0f3782788585030 by aheejin
[WebAssembly] Fix a bug in removing unnecessary branches

Summary:
One of the things `removeUnnecessaryInstrs()` in CFGStackify does is to
remove an unnecessary unconditinal branch before an EH pad. When there
is an unconditional branch right before a catch instruction and it
branches to the end of `end_try` marker, we don't need the branch,
because it there is no exception, the control flow transfers to
that point anyway.
```
bb0:
  try
    ...
    br bb2      <- Not necessary
bb1:
  catch
    ...
bb2:
  end
```

This applies when we have a conditional branch followed by an
unconditional one, in which case we should only remove the unconditional
branch. For example:
```
bb0:
  try
    ...
    br_if someplace_else
    br bb2                 <- Not necessary
bb1:
  catch
    ...
bb2:
  end
```

But `TargetInstrInfo::removeBranch` we used removed all existing
branches when there are multiple ones. This patch fixes it by only
deleting the last (= unconditional) branch manually.

Also fixes some `preds` comments in the test file.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80572
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll
Commit 4cd3f4b31b0bd19f3b63f53888a5a2afea68e109 by aheejin
[WebAssembly] Fix a bug in finding matching EH pad

Summary:
`getMatchingEHPad()` in LateEHPrepare is a function to find the nearest
EH pad that dominates the given instruction. This intends to be
lightweight so it does not use full WebAssemblyException scope analysis
or dominator analysis. It simply does backward BFS to its predecessors
and stops at the first EH pad each search path encounters. All search
should end up at the same EH pad, and if not, it returns null.

But it didn't take into account that when there are inner scopes within
the current scope, some path in BFS can hit an inner EH pad first. For
example, in the given diagram, `Inst` belongs to the outer scope and
`getMathingEHPad()` should return 'EHPad 1', but some search path can go
into the inner scope and end up with 'EHPad 2'. The search will return
null because different paths end up with different EH pads.
```
--- EHPad 1 ---
| - EHPad 2 - |
| |         | |
| ----------- |
|   Inst      |
---------------
```

So far this was OK because we haven't tested a case in which a given
instruction is far from its EH pad. Also, this bug does not happen when
the inner EH scope is a cleanup scope, because a cleanup scope ends with
a `cleanupret` whose successor is an EH pad, so the search encounters
that EH pad first before going into the child scope. But this can happen
when the child scope is a catch scope that ends with `catchret`. So this
patch, when doing backward BFS, does not search predecessors that ends
with `catchret`. Because `catchret`s are replaced with `br`s during this
pass, this records BBs that have `catchret`s in the beginning, before
doing any other transformations.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80571
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/exception.ll
Commit 373e98a3a5f882661acf67c1f99e89b838aa2ad2 by Xing
[ObjectYAML][DWARF] Add DWARF entry in ELFYAML.

This patch adds a new DWARF entry in ELF YAML file.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D80203
The file was modifiedllvm/lib/ObjectYAML/ELFYAML.cpp
The file was modifiedllvm/lib/ObjectYAML/ELFEmitter.cpp
The file was modifiedllvm/include/llvm/ObjectYAML/DWARFYAML.h
The file was addedllvm/test/tools/yaml2obj/ELF/DWARF/debug-str.yaml
The file was modifiedllvm/lib/ObjectYAML/DWARFYAML.cpp
The file was modifiedllvm/include/llvm/ObjectYAML/ELFYAML.h
Commit 66e6b9afa833426032b1450cb707e6ad892aba00 by listmail
[Tests] Migrate more statepoint lowering tests to use operand bundles

Only 2 tests left after this.  They just happen to be the most annoying.
The file was modifiedllvm/test/CodeGen/X86/statepoint-stack-usage.ll
The file was modifiedllvm/test/CodeGen/X86/statepoint-vector.ll
The file was modifiedllvm/test/CodeGen/X86/statepoint-live-in-remat.ll
The file was modifiedllvm/test/CodeGen/X86/statepoint-live-in.ll
The file was modifiedllvm/test/CodeGen/X86/statepoint-gctransition-call-lowering.ll
The file was modifiedllvm/test/CodeGen/X86/statepoint-regs.ll
Commit 4e74541a928090b3604094e239884b0ea0a631bb by whitneyt
[LoopUnroll] Fix not-rotated.ll by adding back a limitation was unintentionally
removed in https://reviews.llvm.org/D80477
The file was modifiedllvm/lib/Transforms/Utils/LoopUnroll.cpp
Commit 9eafcbfca1b0ab4016bc7320e4d6646b29bf051a by Lang Hames
[JITLink] Fix 80-column rule violation.
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp
Commit a6deaeec370ec5e34f9e5aa3fad3bc73770d4895 by Lang Hames
[JITLink] Improve llvm-jitlink regression testing support for ELF.

This patch adds a jitlink pass, 'registerELFGraphInfo', that records section
and symbol information about each LinkGraph in the llvm-jitlink session object.
This allows symbols and sections to be referred to by name in llvm-jitlink
regression tests. This will enable a testcase to be written for
https://reviews.llvm.org/D80613.
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink.h
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink.cpp
The file was modifiedllvm/tools/llvm-jitlink/CMakeLists.txt
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
The file was addedllvm/tools/llvm-jitlink/llvm-jitlink-elf.cpp
Commit ff92d3c672e2bf0b885b67b0efebea691df9c5b9 by Lang Hames
[ORC] Add debugging output for LLJIT construction.

This can be handy for checking whether the LLJIT instance you're constructing
matches your expectations.
The file was modifiedllvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/LLJIT.cpp
Commit 3ea38b5b4e6b0684b352a79191b55472aac09f13 by llvmgnsyncbot
[gn build] Port a6deaeec370
The file was modifiedllvm/utils/gn/secondary/llvm/tools/llvm-jitlink/BUILD.gn
Commit a0c90b5b2ad6a81e8aded5ad59cc25ff58464bcf by Amara Emerson
[AArch64][GlobalISel] Enable extending loads combines post-legalization.

During legalization we can end up with extends of loads, which in the case of
zexts causes us to not hit tablegen imported patterns.

The caveat here is that we don't want anyext load forming, since some variants
are illegal. This change also prevents the combine from creating any illegal
loads.

Differential Revision: https://reviews.llvm.org/D80458
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
The file was modifiedllvm/lib/Target/AArch64/AArch64Combine.td
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/postlegalizercombiner-extending-loads.mir
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64PostLegalizerCombiner.cpp
Commit 17ed6dcb0c96ac6a6fd5021b326213dbd5fef250 by craig.topper
[X86] Remove MMX isel patterns containing (x86mmx (scalar_to_vector (i32))).

I don't think we can make such a node. I don't think
x86_mmx is considered a vector for the check in getNode.
The file was modifiedllvm/lib/Target/X86/X86InstrMMX.td
Commit 0baf0e8cfc1845ef92d397c1ae43793bf9e6aaad by sivachandra
[libc] Add implementation of call_once from threads.h.

Reviewers: abrachet, maskray

Differential Revision: https://reviews.llvm.org/D79828
The file was modifiedlibc/spec/stdc.td
The file was modifiedlibc/src/threads/linux/CMakeLists.txt
The file was modifiedlibc/lib/CMakeLists.txt
The file was addedlibc/test/src/threads/call_once_test.cpp
The file was modifiedlibc/test/src/threads/CMakeLists.txt
The file was modifiedlibc/config/linux/api.td
The file was modifiedlibc/src/threads/CMakeLists.txt
The file was addedlibc/src/threads/linux/call_once.cpp
The file was addedlibc/src/threads/call_once.h
Commit b147b88c8432cdc14a3238925dbfb8d55be32932 by david.sherwood
[CodeGen] Add support for extracting elements of scalable vectors

I have tried to ensure that SelectionDAG and DAGCombiner do
sensible things for scalable vectors, and added support for a
limited number of simple folds. Codegen support for the vector
extract patterns have also been added to the AArch64 backend.

New vector extract tests have been added here:

  CodeGen/AArch64/sve-extract-element.ll

and I have also added new folds using inserts and extracts here:

  CodeGen/AArch64/sve-insert-element.ll

Differential Revision: https://reviews.llvm.org/D80208
The file was addedllvm/test/CodeGen/AArch64/sve-extract-element.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
The file was modifiedllvm/test/CodeGen/AArch64/sve-insert-element.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit 9c0ef044beb4850ad9626cb81a1ede4f3bbda4a7 by david.sherwood
[SVE] Fix warnings in SelectInst::areInvalidOperands

We should be comparing the element counts rather than the
numbers of elements.

Differential Revision: https://reviews.llvm.org/D80634
The file was addedllvm/test/CodeGen/AArch64/sve-bad-select.ll
The file was modifiedllvm/lib/IR/Instructions.cpp
Commit f254f1d94e8d0070b2d006a3d1e7ee6eeae0aaa7 by david.sherwood
[SVE] Remove getNumElements() warnings in InstCombiner::visitBitCast

Whilst trying to compile this test to assembly:

  CodeGen/aarch64-sve-intrinsics/acle_sve_reinterpret.c

I discovered some warnings were firing in InstCombiner::visitBitCast
due to calls to getNumElements() for scalable vector types. These
calls only really made sense for fixed width vectors so I have fixed
up the code appropriately.

Differential Revision: https://reviews.llvm.org/D80559
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
The file was addedllvm/test/Transforms/InstCombine/AArch64/sve-bitcast.ll
Commit ca467542eecfc621eea7fefb3c7e3849c6b43ac7 by sylvestre
[CMake] Pass CLANG_VENDOR variables into later stages

We are already passing CLANG_VERSION_* & PACKAGE_VENDOR
The file was modifiedclang/CMakeLists.txt
Commit a3418631e8aa0941b8b57ec2fc3b8d0c7db493be by sylvestre
libclc: update website url

old link is dead
The file was modifiedlibclc/README.TXT