SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [clang-format] [PR45942] [[nodiscard]] causes && to be miss interpreted as BinaryOperators (details)
  2. [clang-format] [PR44476] Add space between template and attribute (details)
  3. [clang-format] [PR45614] Incorrectly indents [[nodiscard]] attribute funtions after a macro without semicolon (details)
  4. [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format (details)
  5. [ELF] Make --trace-symbol track preempted shared definitions (details)
  6. [InstCombine] Remove hasNoInfs check for pow(C,y) -> exp2(log2(C)*y) (details)
  7. [LV] Remove duplicated return stmt (NFC). (details)
  8. [X86] Split masked integer vector stores into vXi32/vXi64 variants (PR45975). NFC (details)
Commit 6189dd06ad4889dfbccf185f9d81e72fe9173a8a by mydeveloperday
[clang-format] [PR45942] [[nodiscard]] causes && to be miss interpreted as BinaryOperators

Summary:
https://bugs.llvm.org/show_bug.cgi?id=45942

With Chromium style (although that is not important) its just it defines PointerAligmment: Left

The following arguments `S&&` are formatted differently depending on if the class has an attribute between it and the class identifier

```
class S {
  S(S&&) = default;
};

class [[nodiscard]] S {
  S(S &&) = default;
};
```

The prescense of [[nodiscard]] between the `class/struct` and the `{` causes the `{` to be incorrectly seen as a `TT_FunctionLBrace` which in turn transforms all the && to be `TT_BinaryOperators` rather than `TT_PointerOrReference`, as binary operators other spacing rules come into play causing a miss format

This revision resolves this by allowing the parseRecord to consider the [[nodisscard]]

Reviewed By: Abpostelnicu

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D80008
The file was modifiedclang/lib/Format/UnwrappedLineParser.cpp
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit 07740dd08b572af26d9fdeed2615f3a6996bee22 by mydeveloperday
[clang-format] [PR44476] Add space between template and attribute

Summary:
https://bugs.llvm.org/show_bug.cgi?id=44476

```template <typename T> [[nodiscard]] int a() { return 1; }```

gets incorrectly formatted to be

```template <typename T>[[nodiscard]] int a() { return 1; }```

This revision ensure there is a space between the template and the attribute

Reviewed By: JakeMerdichAMD

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D79905
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
Commit 575c59cf6a32889c5f1131af39e07bbdde27e8da by mydeveloperday
[clang-format] [PR45614] Incorrectly indents [[nodiscard]] attribute funtions after a macro without semicolon

Summary:
https://bugs.llvm.org/show_bug.cgi?id=45614

`[[nodiscard]]` after a macro doesn't behave the same as an __attribute__ resulting in incorrect indentation

This revision corrects that behavior

See original Mozilla bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1629756

Before:

```
class FooWidget : public nsBaseWidget {
public:
  FooWidget();

  NS_DECL_ISUPPORTS_INHERITED

      [[nodiscard]] nsresult
      FunctionOne();
  [[nodiscard]] nsresult FunctionTwo();
};
```

After:
```
class FooWidget : public nsBaseWidget {
public:
  FooWidget();

  NS_DECL_ISUPPORTS_INHERITED

  [[nodiscard]] nsresult FunctionOne();
  [[nodiscard]] nsresult FunctionTwo();
};
```

Reviewed By: Abpostelnicu

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D79990
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/lib/Format/UnwrappedLineParser.cpp
Commit 5d82cb3c3a6af8d12b87bcbdc6abd3b7f4b01652 by mydeveloperday
[clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

Summary:
https://twitter.com/lefticus/status/1262392152950288384?s=20

Jason Turner's (@lefticus) most recent C++ weekly explains the usage of [[likely]] and [[unlikely]] in an 'if/else' context in C++ 20

clang-format leaves the code a little messy afterwards..

```
if (argc > 5)
  [[unlikely]] {
    // ...
  }
else if (argc < 0)
  [[likely]] {
    // ...
  }
else
  [[likely]] {
    // ...
  }
```

try to improve the situation

```
if (argc > 5) [[unlikely]] {
  // ...
} else if (argc < 0) [[likely]] {
  // ...
} else [[likely]] {
  // ...
}
```

Reviewed By: JakeMerdichAMD

Subscribers: cfe-commits, lefticus

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D80144
The file was modifiedclang/lib/Format/UnwrappedLineParser.cpp
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit 64676499741cb985146ab982a67da859ff8f4f4d by maskray
[ELF] Make --trace-symbol track preempted shared definitions

Note, we still name a preempted SharedSymbol "shared definition",
instead of "reference" as printed by GNU ld. This difference should not matter.

```
// GNU ld
ld.bfd: t: definition of f@v1
ld.bfd: t.so: reference to f@v1
```

Reviewed By: psmith

Differential Revision: https://reviews.llvm.org/D80143
The file was modifiedlld/ELF/Symbols.cpp
The file was modifiedlld/test/ELF/trace-symbols.s
Commit 9bc989a48d639d04283d6144505e33e8e354c783 by jay.foad
[InstCombine] Remove hasNoInfs check for pow(C,y) -> exp2(log2(C)*y)

We already check hasNoNaNs and that x is finite and strictly positive.
That only leaves the following special cases (taken from the Linux man
page for pow):

If x is +1, the result is 1.0 (even if y is a NaN).
If the absolute value of x is less than 1, and y is negative infinity, the result is positive infinity.
If the absolute value of x is greater than 1, and y is negative infinity, the result is +0.
If the absolute value of x is less than 1, and y is positive infinity, the result is +0.
If the absolute value of x is greater than 1, and y is positive infinity, the result is positive infinity.

The first case is handled elsewhere, and this transformation preserves
all the others, so there is no need to limit it to hasNoInfs.

Differential Revision: https://reviews.llvm.org/D79409
The file was modifiedllvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
The file was modifiedllvm/test/Transforms/InstCombine/pow-exp.ll
Commit 7cefd1b4cd77cd37128965264051e617c7005593 by flo
[LV] Remove duplicated return stmt (NFC).
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit 0980c9c6f155d8a06ad839d530636bf109aae34b by andrea.dibiagio
[X86] Split masked integer vector stores into vXi32/vXi64 variants (PR45975). NFC

This effectively splits the scheduling WriteVecMaskedStore(Y) classes
into four different classes (one per each variant).

The new VecMaskedStore scheduling classes are now correctly marked as
'unsupported' by the bdver2 and btver2 models.

No functional change intended.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D80201
The file was modifiedllvm/lib/Target/X86/X86ScheduleSLM.td
The file was modifiedllvm/lib/Target/X86/X86SchedHaswell.td
The file was modifiedllvm/lib/Target/X86/X86SchedSkylakeServer.td
The file was modifiedllvm/lib/Target/X86/X86InstrSSE.td
The file was modifiedllvm/lib/Target/X86/X86ScheduleAtom.td
The file was modifiedllvm/lib/Target/X86/X86ScheduleBtVer2.td
The file was modifiedllvm/lib/Target/X86/X86SchedSandyBridge.td
The file was modifiedllvm/lib/Target/X86/X86SchedBroadwell.td
The file was modifiedllvm/lib/Target/X86/X86ScheduleBdVer2.td
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver2.td
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver1.td
The file was modifiedllvm/lib/Target/X86/X86SchedSkylakeClient.td
The file was modifiedllvm/lib/Target/X86/X86Schedule.td