[X86][APX] Fix EFLAGS reuse across cycles (#223613)
optimizeCompareInstr's multi-predecessor NF reuse (added in
ab39c491430e) did not scan the below-CmpInstr region of CmpMBB when
CmpMBB was on a CFG cycle: that region is on the back-edge path but is
scanned by neither the caller nor the helper's predecessor walk. A
non-NF-convertible EFLAGS clobber there (e.g. an unrelated CMP feeding a
JCC, as in the reproducer below with VUCOMISS/CTEST/COPY-\$eflags) still
let the helper delete the redundant compare and mark \$eflags live-in on
CmpMBB. That broke the reused EFLAGS on iteration 2+ and tripped
X86FlagsCopyLowering's SuccMBB == TestMBB self-loop check with a fatal
report_fatal_error when a preexisting COPY \$eflags save/restore sat in
the cycle.
Reproducer: https://godbolt.org/z/s58j5zxqd
Detect CmpMBB on a cycle via a forward-reachability BFS on its
successors and, when so, scan from just after CmpInstr to the block's
end: bail on any non-NF-convertible EFLAGS clobber, stage NF-convertible
[10 lines not shown]
[X86] getPSHUFShuffleMask - use PSHUFD/LW/HW decodes directly. NFC. (#224900)
Don't bother going through getTargetShuffleMask and checking for a
repeated lane mask when all we care about is the mask[4] permute mask -
PSHUFLW/HW don't even need the full 128-bit lane mask!
[clang][bytecode] Notify bytecode interpreter after deserializing constant global declarations (#198062)
The problem looks something like this:
```c++
extern const int m;
constexpr int getm() { return m; }
const int m = 12;
static_assert(getm() == 12);
```
The generated bytecode for `getm()` references a global variable stored
in `interp::Program`. This variable is uninitialized when the bytecode
is generated, but since it's extern, that's not diagnosed (because it
might be initialized later).
When we parse the redeclaration of `m` on line 4, we evaluate its
initializer via `Expr::EvaluateAsInitializer`, which makes the bytecode
[15 lines not shown]
[HIPSTDPAR] Add `sincos` support (#224620)
The math fixup pass for `hipstdpar` only supported standard library math
functions. Due to #194616, combining `sin` + `cos` into `sincos` becomes
possible, so whilst `sincos` itself is not (yet) a standard library
interface, it has to be handled as well. This extends the set of covered
intrinsics to include it.
[clang][test] Add regression test for invalid 'int decltype {}' (#224855)
The parser crash on `int decltype {}` was fixed by #211221, but the test
it added only covers the `= 0` forms. Add the brace-init form reported
in the issue.
Fixes #165246