Changes

Summary

  1. [zorg] Remove flang-aarch64-ubuntu-out-of-tree-new-driver (details)
Commit de74f83353c32d08126bddb778b9d89cc2708e46 by diana.picus
[zorg] Remove flang-aarch64-ubuntu-out-of-tree-new-driver

The new driver is on by default now, so this builder does the same thing
as flang-aarch64-ubuntu-out-of-tree.

Differential Revision: https://reviews.llvm.org/D102319
The file was modifiedbuildbot/osuosl/master/config/builders.py (diff)
The file was modifiedbuildbot/osuosl/master/config/workers.py (diff)

Summary

  1. Making Instrumentation aware of LoopNest Pass (details)
  2. [lld:elf] Weaken the requirement for a computed binding to be STB_LOCAL (details)
  3. [Sema] Always search the full function scope context if a potential availability violation is encountered (details)
  4. [cfe] Support target-specific escaped character in inline asm (details)
  5. [JITLink] Enable creation and management of mutable block content. (details)
  6. AMDGPU/GlobalISel: Legalize G_[SU]DIVREM instructions (details)
Commit a2ae14514a26bda6d8dae11e56f3186931b8d8c7 by aeubanks
Making Instrumentation aware of LoopNest Pass

Intrumentation callbacks are not made aware of LoopNest passes. From the loop pass manager, we can pass the outermost loop of the LoopNest to instrumentation in case of LoopNest passes.

The current patch made the change in two places in StandardInstrumentation.cpp. I will submit a proper patch where the OuterMostLoop is passed from the LoopPassManager to the call backs. That way we will avoid making changes at multiple places in StandardInstrumentation.cpp.

A testcase also will be submitted.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D102463
The file was modifiedllvm/include/llvm/Transforms/Scalar/LoopPassManager.h
The file was addedllvm/test/Other/loopnest-callback.ll
Commit 2f6516605615e99221181ec2a1947f9ad55aa9d3 by nathan
[lld:elf] Weaken the requirement for a computed binding to be STB_LOCAL

Given the following scenario:

```
// Cat.cpp
struct Animal { virtual void makeNoise() const = 0; };
struct Cat : Animal { void makeNoise() const override; };

extern "C" int puts(char const *);
void Cat::makeNoise() const { puts("Meow"); }
void doThingWithCat(Animal *a) { static_cast<Cat *>(a)->makeNoise(); }

// CatUser.cpp
struct Animal { virtual void makeNoise() const = 0; };
struct Cat : Animal { void makeNoise() const override; };

void doThingWithCat(Animal *a);

void useDoThingWithCat() {
  Cat *d = new Cat;
  doThingWithCat(d);
}

// cat.ver
{
  global: _Z17useDoThingWithCatv;
  local: *;
};

$ clang++ Cat.cpp CatUser.cpp -fpic -flto=thin -fwhole-program-vtables
-shared -O3 -fuse-ld=lld -Wl,--lto-whole-program-visibility
-Wl,--version-script,cat.ver
```

We cannot devirtualize `Cat::makeNoise`. The issue is complex:

Due to `-fsplit-lto-unit` and usage of type metadata, we place the Cat
vtable declaration into module 0 and the Cat vtable definition with type
metadata into module 1, causing duplicate entries (Undefined followed by
Defined) in the `lto::InputFile::symbols()` output.
In `BitcodeFile::parse`, after processing the `Undefined` then the
`Defined`, the final state is `Defined`.
In `BitcodeCompiler::add`, for the first symbol, `computeBinding`
returns `STB_LOCAL`, then we reset it to `Undefined` because it is
prevailing (`versionId` is `preserved`). For the second symbol, because
the state is now `Undefined`, `computeBinding` returns `STB_GLOBAL`,
causing `ExportDynamic` to be true and suppressing devirtualization.

In D77280, the `computeBinding` change used a stricter `isDefined()`
condition to make weak``Lazy` symbol work.
This patch relaxes the condition to weaker `!isLazy()` to keep it
working while making the devirtualization work as well.

Differential Revision: https://reviews.llvm.org/D98686
The file was modifiedlld/ELF/Symbols.cpp
The file was addedlld/test/ELF/lto/devirt_split_unit_localize.ll
Commit a5a3efa82a77ab7a1c9787ef97b547a4a81f2440 by logan.r.smith0
[Sema] Always search the full function scope context if a potential availability violation is encountered

This fixes both https://bugs.llvm.org/show_bug.cgi?id=50309 and https://bugs.llvm.org/show_bug.cgi?id=50310.

Previously, lambdas inside functions would mark their own bodies for later analysis when encountering a potentially unavailable decl, without taking into consideration that the entire lambda itself might be correctly guarded inside an @available check. The same applied to inner class member functions. Blocks happened to work as expected already, since Sema::getEnclosingFunction() skips through block scopes.

This patch instead simply and conservatively marks the entire outermost function scope for search, and removes some special-case logic that prevented DiagnoseUnguardedAvailabilityViolations from traversing down into lambdas and nested functions. This correctly accounts for arbitrarily nested lambdas, inner classes, and blocks that may be inside appropriate @available checks at any ancestor level. It also treats all potential availability violations inside functions consistently, without being overly sensitive to the current DeclContext, which previously caused issues where e.g. nested struct members were warned about twice.

DiagnoseUnguardedAvailabilityViolations now has more work to do in some cases, particularly in functions with many (possibly deeply) nested lambdas and classes, but the big-O is the same, and the simplicity of the approach and the fact that it fixes at least two bugs feels like a strong win.

Differential Revision: https://reviews.llvm.org/D102338
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/test/SemaObjC/unguarded-availability.m
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/lib/Sema/SemaAvailability.cpp
Commit 6685a3f3e4c497a3a0fd06aa4e77cb442325d1ba by minyihh
[cfe] Support target-specific escaped character in inline asm

GCC allows each target to define a set of non-letter and non-digit
escaped characters for inline assembly that will be replaced by another
string (They call this "punctuation" characters. The existing "%%" and
"%{" -- replaced by '%' and '{' at the end -- can be seen as special
cases shared by all targets).
This patch implements this feature by adding a new hook in `TargetInfo`.

Differential Revision: https://reviews.llvm.org/D103036
The file was addedclang/test/CodeGen/m68k-asm.c
The file was modifiedclang/lib/Basic/Targets/M68k.cpp
The file was modifiedclang/lib/AST/Stmt.cpp
The file was modifiedclang/lib/Basic/Targets/M68k.h
The file was modifiedclang/include/clang/Basic/TargetInfo.h
Commit 82ad2b6e94b6e9285de38aab9e2e5d87b06a377b by Lang Hames
[JITLink] Enable creation and management of mutable block content.

This patch introduces new operations on jitlink::Blocks: setMutableContent,
getMutableContent and getAlreadyMutableContent. The setMutableContent method
will set the block content data and size members and flag the content as
mutable. The getMutableContent method will return a mutable copy of the existing
content value, auto-allocating and populating a new mutable copy if the existing
content is marked immutable. The getAlreadyMutableMethod asserts that the
existing content is already mutable and returns it.

setMutableContent should be used when updating the block with totally new
content backed by mutable memory. It can be used to change the size of the
block. The argument value should *not* be shared with any other block.

getMutableContent should be used when clients want to modify the existing
content and are unsure whether it is mutable yet.

getAlreadyMutableContent should be used when clients want to modify the existing
content and know from context that it must already be immutable.

These operations reduce copy-modify-update boilerplate and unnecessary copies
introduced when clients couldn't me sure whether the existing content was
mutable or not.
The file was modifiedllvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp
The file was modifiedllvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h
The file was modifiedllvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
The file was modifiedllvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
The file was modifiedllvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/JITLink/x86_64.h
Commit 90d784053f070f734de5b23da892e470a3b4e738 by Christudasan.Devadasan
AMDGPU/GlobalISel: Legalize G_[SU]DIVREM instructions

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D100726
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/sdivrem.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.h
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/udivrem.ll