SuccessChanges

Summary

  1. GlobalISel: Combine `op undef, x` to 0 (details)
  2. [ARM] Follow AACPS standard for volatile bit-fields access width (details)
  3. [GVN] Add testcase that uses masked loads and stores, NFC (details)
  4. Add more explicit error message when creating a type or attribute for an unregistered dialect (NFC) (details)
  5. [sanitizers] Remove unneeded MaybeCall*DefaultOptions() and nullptr checks (details)
Commit 1242dd330d9054a57c1403f16d5487f9e3a3a92f by vkeles
GlobalISel: Combine `op undef, x` to 0

https://reviews.llvm.org/D86611
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp (diff)
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h (diff)
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/combine-shl.mir
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td (diff)
Commit 514df1b2bb1ecd1a33327001ea38a347fd2d0380 by ties.stuij
[ARM] Follow AACPS standard for volatile bit-fields access width

This patch resumes the work of D16586.
According to the AAPCS, volatile bit-fields should
be accessed using containers of the widht of their
declarative type. In such case:
```
struct S1 {
  short a : 1;
}
```
should be accessed using load and stores of the width
(sizeof(short)), where now the compiler does only load
the minimum required width (char in this case).
However, as discussed in D16586,
that could overwrite non-volatile bit-fields, which
conflicted with C and C++ object models by creating
data race conditions that are not part of the bit-field,
e.g.
```
struct S2 {
  short a;
  int  b : 16;
}
```
Accessing `S2.b` would also access `S2.a`.

The AAPCS Release 2020Q2
(https://documentation-service.arm.com/static/5efb7fbedbdee951c1ccf186?token=)
section 8.1 Data Types, page 36, "Volatile bit-fields -
preserving number and width of container accesses" has been
updated to avoid conflict with the C++ Memory Model.
Now it reads in the note:
```
This ABI does not place any restrictions on the access widths of bit-fields where the container
overlaps with a non-bit-field member or where the container overlaps with any zero length bit-field
placed between two other bit-fields. This is because the C/C++ memory model defines these as being
separate memory locations, which can be accessed by two threads simultaneously. For this reason,
compilers must be permitted to use a narrower memory access width (including splitting the access into
multiple instructions) to avoid writing to a different memory location. For example, in
struct S { int a:24; char b; }; a write to a must not also write to the location occupied by b, this requires at least two
memory accesses in all current Arm architectures. In the same way, in struct S { int a:24; int:0; int b:8; };,
writes to a or b must not overwrite each other.
```

Patch D16586 was updated to follow such behavior by verifying that we
only change volatile bit-field access when:
- it won't overlap with any other non-bit-field member
- we only access memory inside the bounds of the record
- avoid overlapping zero-length bit-fields.

Regarding the number of memory accesses, that should be preserved, that will
be implemented by D67399.

Differential Revision: https://reviews.llvm.org/D72932

The following people contributed to this patch:
- Diogo Sampaio
- Ties Stuij
The file was modifiedclang/include/clang/Basic/CodeGenOptions.def (diff)
The file was modifiedclang/lib/CodeGen/CGRecordLayout.h (diff)
The file was modifiedclang/lib/CodeGen/CGExpr.cpp (diff)
The file was modifiedclang/test/CodeGen/bitfield-2.c (diff)
The file was modifiedclang/lib/CodeGen/CGRecordLayoutBuilder.cpp (diff)
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp (diff)
The file was modifiedclang/include/clang/Driver/Options.td (diff)
The file was modifiedclang/test/CodeGen/aapcs-bitfield.c (diff)
Commit d0ccfcb040c684e91d8b5fe5111ba7f4ec7e019a by kparzysz
[GVN] Add testcase that uses masked loads and stores, NFC
The file was addedllvm/test/Transforms/GVN/masked-load-store.ll
Commit 97e77ac0ed80877cda58b1dddf98890cc7b0d167 by joker.eph
Add more explicit error message when creating a type or attribute for an unregistered dialect (NFC)

Differential Revision: https://reviews.llvm.org/D87177
The file was modifiedmlir/include/mlir/IR/TypeSupport.h (diff)
The file was modifiedmlir/lib/Support/StorageUniquer.cpp (diff)
The file was modifiedmlir/include/mlir/IR/AttributeSupport.h (diff)
The file was modifiedmlir/include/mlir/Support/StorageUniquer.h (diff)
Commit 2d7fd38cf7db18edbbfa0e6dfb7454a255171867 by i
[sanitizers] Remove unneeded MaybeCall*DefaultOptions() and nullptr checks

D28596 added SANITIZER_INTERFACE_WEAK_DEF which can guarantee `*_default_options` are always defined.
The weak attributes on the `__{asan,lsan,msan,ubsan}_default_options` declarations can thus be removed.

`MaybeCall*DefaultOptions` no longer need nullptr checks, so their call sites can just be replaced by `__*_default_options`.

Reviewed By: #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D87175
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_flags.cpp (diff)
The file was modifiedcompiler-rt/lib/asan/asan_interface_internal.h (diff)
The file was modifiedcompiler-rt/lib/msan/msan.cpp (diff)
The file was modifiedcompiler-rt/lib/ubsan/ubsan_flags.h (diff)
The file was modifiedcompiler-rt/lib/lsan/lsan.cpp (diff)
The file was modifiedcompiler-rt/lib/hwasan/hwasan.cpp (diff)
The file was modifiedcompiler-rt/lib/asan/asan_flags.cpp (diff)
The file was modifiedcompiler-rt/lib/cfi/cfi.cpp (diff)
The file was modifiedcompiler-rt/lib/lsan/lsan_common.cpp (diff)
The file was modifiedcompiler-rt/lib/msan/msan_interface_internal.h (diff)
The file was modifiedcompiler-rt/lib/ubsan/ubsan_flags.cpp (diff)