Changes

Summary

  1. [clang-format][NFC] Reformat the clang/unittests/Format directory (details)
  2. [GlobalISel] Fix known bits for G_ASSERT_ALIGN. (details)
  3. AMDGPU: Stop validating earlyclobber operands in assembler (details)
  4. [GlobalISel] Fix std::max after D134380 (details)
  5. [Driver] Add --gcc-install-dir= (details)
  6. [libunwind] Handle G in personality string (details)
  7. [Hexagon] Fix -Wunused-variable in non-assertion builds after f6e7ad56040ee8531be3375e04312d30700a58b2 (details)
  8. [test][msan] Precommit part of D134119 (details)
  9. [TTI] Recognize fp constants in getOperandInfo (details)
  10. [Analysis] Make members of InlineCost const (NFC) (details)
  11. [MLIR] Add a create function for mlir::SerializeToCubinPass (details)
  12. [MLIR] Set default NVIDIA GPU version (details)
  13. [msan] Handle x86_avx_cmp_pd_256 and x86_avx_cmp_ps_256 (details)
Commit e347c0fc9bf8a9c415ca09887bf707e718b8fb1c by owenca
[clang-format][NFC] Reformat the clang/unittests/Format directory

Also add a .clang-format file to clang/include/clang/Format and
clang/unittests/Format to keep the directories formatted.
The file was modifiedclang/unittests/Format/MacroCallReconstructorTest.cpp (diff)
The file was addedclang/include/clang/Format/.clang-format
The file was addedclang/unittests/Format/.clang-format
Commit 85cd376f706fe00833100bbc975db087aed9ad14 by Amara Emerson
[GlobalISel] Fix known bits for G_ASSERT_ALIGN.

I don't know what was going on originally with these tests. It seems reasonable
to have the immediate be the same byte alignment unit as the IR, in which case
we need to take the log2 in order to set the right number of low bits.

This fixes a miscompile in chromium.

Differential Revision: https://reviews.llvm.org/D134380
The file was modifiedllvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp (diff)
The file was modifiedllvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp (diff)
Commit 5c7ee894f8039902b9cd6da3db39b43819ca3996 by jay.foad
AMDGPU: Stop validating earlyclobber operands in assembler

This validation was introduced in D34003 for v_qsad/v_mqsad instructions
but it applies to all instructions with earlyclobber operands, which now
includes v_mad_i64/v_mad_u64.

In all these cases I do not think there is documentation saying that the
destination must not overlap the sources. Rather there are *some* cases
where the instruction may not function correctly if there is an overlap,
and we are using earlyclobber as a conservative way of preventing
codegen from generating those cases.

I think it is unhelpful for the assembler to enforce the earlyclobber
restriction because it prevents assembling cases where the programmer
knows that in fact the overlap is safe.

See also: https://github.com/llvm/llvm-project/issues/57610

Differential Revision: https://reviews.llvm.org/D134272
The file was modifiedllvm/test/MC/AMDGPU/vop3-errs.s (diff)
The file was modifiedllvm/test/MC/AMDGPU/gfx10_err_pos.s (diff)
The file was modifiedllvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp (diff)
Commit 2d975f1efe6cdb4f6303cfe33a3a06cbe02e755a by i
[GlobalISel] Fix std::max after D134380
The file was modifiedllvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp (diff)
Commit 23e4299261d90ae5040766eceeeb11e1e2d46d5b by i
[Driver] Add --gcc-install-dir=

This option specifies a GCC installation directory such as
/usr/lib/gcc/x86_64-linux-gnu/12, /usr/lib/gcc/x86_64-gentoo-linux-musl/11.2.0 .

It is intended to replace --gcc-toolchain=, which specifies a directory where
`lib/gcc{,-cross}` can be found. When --gcc-toolchain= is specified, the
selected `lib/gcc/$triple/$version` installation uses complex logic and the
largest GCC version is picked. There is no way to specify another version in the
presence of multiple GCC versions.

D25661 added gcc-config detection for Gentoo: `ScanGentooConfigs`.
The implementation may be simplified by using --gcc-install-dir=.

Reviewed By: mgorny

Differential Revision: https://reviews.llvm.org/D133329
The file was modifiedclang/include/clang/Driver/Options.td (diff)
The file was addedclang/test/Driver/gcc-install-dir.cpp
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp (diff)
The file was modifiedclang/include/clang/Basic/DiagnosticDriverKinds.td (diff)
Commit a3153381af48b2e704750255a704748a13c4c4de by fmayer
[libunwind] Handle G in personality string

Tested with the following program:

```
static volatile int* x = nullptr;

void throws()  __attribute__((noinline)) {
  if (getpid() == 0)
    return;
  throw "error";
}

void maybe_throws()  __attribute__((noinline)) {
  volatile int y = 1;
  x = &y;
  throws();
  y = 2;
}

int main(int argc, char** argv) {
  int y;
  try {
    maybe_throws();
  } catch (const char* e) {
    //printf("Caught\n");
  }
  y = *x;
  printf("%d\n", y); // should be MTE failure.
  return 0;
}
```

Built using `clang++ -c -O2 -target aarch64-linux -fexceptions -march=armv8-a+memtag -fsanitize=memtag-heap,memtag-stack`

Currently only Android implements runtime support for MTE stack tagging.

Without this change, we crash on `__cxa_get_globals` when trying to catch
the exception (because the stack frame __cxa_get_globals frame will fail due
to tags left behind on the stack). With this change, we crash on the `y = *x;`
as expected, because the stack frame has been untagged, but the pointer hasn't.

Reviewed By: #libunwind, compnerd, MaskRay

Differential Revision: https://reviews.llvm.org/D128998
The file was modifiedlibunwind/src/DwarfParser.hpp (diff)
The file was modifiedlibunwind/src/UnwindLevel1.c (diff)
The file was modifiedlibunwind/src/DwarfInstructions.hpp (diff)
The file was modifiedlibunwind/src/UnwindCursor.hpp (diff)
The file was modifiedlibunwind/src/libunwind.cpp (diff)
Commit 8805e5d1b7be72b007448477aa55cc6b104b4842 by i
[Hexagon] Fix -Wunused-variable in non-assertion builds after f6e7ad56040ee8531be3375e04312d30700a58b2
The file was modifiedllvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp (diff)
Commit e078dd5342b0fd0cf6959eec9803ce234c6762fa by Vitaly Buka
[test][msan] Precommit part of D134119
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/avx-intrinsics-x86.ll (diff)
Commit 8c46881a5386ebbe273d15d6a9d369885c2460a9 by listmail
[TTI] Recognize fp constants in getOperandInfo

We were recognizing vectors of floats, but not scalars.  That's a tad odd.
The file was modifiedllvm/test/Transforms/LoopVectorize/X86/pointer-runtime-checks-unprofitable.ll (diff)
The file was modifiedllvm/lib/Analysis/TargetTransformInfo.cpp (diff)
Commit 9ac934d1bf5769276335b247e954f2dbcb467c79 by kazu
[Analysis] Make members of InlineCost const (NFC)

Once we create an instance of InlineCost, we don't change its
contents.

Differential Revision: https://reviews.llvm.org/D134388
The file was modifiedllvm/include/llvm/Analysis/InlineCost.h (diff)
Commit 2f7a774ed77ad549f4fc46ccf3637686184df240 by gh
[MLIR] Add a create function for mlir::SerializeToCubinPass

Differential Revision: https://reviews.llvm.org/D134153
The file was modifiedmlir/include/mlir/Dialect/GPU/Transforms/Passes.h (diff)
The file was modifiedmlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp (diff)
Commit f9211330f6beee97fc6ac27c67fab8925abb5a63 by gh
[MLIR] Set default NVIDIA GPU version
The file was modifiedmlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp (diff)
Commit 6fd959d6258702bd9e020b012f8c9fecd91c5404 by Vitaly Buka
[msan] Handle x86_avx_cmp_pd_256 and x86_avx_cmp_ps_256

Removed FIXME which looks irrelevant. The error message happens only without -mattr=+avx.
E.g.
GOOD: opt llvm/test/Instrumentation/MemorySanitizer/avx-intrinsics-x86.ll -passes=msan -o - | llc -O3 -o /dev/null -mattr=+avx
BAD: opt llvm/test/Instrumentation/MemorySanitizer/avx-intrinsics-x86.ll -passes=msan -o - | llc -O3 -o /dev/null

So nothing to fix here.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D134119
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/avx-intrinsics-x86.ll (diff)
The file was modifiedllvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp (diff)