Commit Graph

412957 Commits

Author SHA1 Message Date
Fangrui Song f318fd9bf8 [ELF] crtbegin/crtend test: replace std::regex with hand-written matcher. NFC
My x86-64 lld executable is 18KiB smaller.
2022-01-30 01:11:19 -08:00
Fangrui Song a7f9c002cd [ELF][test] Test {crtbegin,crtend}{S,T}.o 2022-01-30 01:08:10 -08:00
Fangrui Song fcd8817da5 [ELF] Simplify maybeCompress with lld::split. NFC 2022-01-30 00:44:19 -08:00
Fangrui Song bc1369fae3 [ELF] Optimize MergeInputSection::splitNonStrings with resize_for_overwrite. NFC 2022-01-30 00:10:52 -08:00
Fangrui Song 988a03c585 [ELF] Add some Mips*Section to InStruct and change make<Mips*Section> to std::make_unique
Similar to D116143. My x86-64 lld executable is 20+KiB smaller.
2022-01-29 23:55:29 -08:00
Fangrui Song c0b986aa0c [ELF] Remove make<std::unique_ptr<MemoryBuffer>>. NFC 2022-01-29 23:35:15 -08:00
Fangrui Song 8d8fce87bb [ELF] De-template getErrorPlace. NFC 2022-01-29 23:05:54 -08:00
Craig Topper 524545317c [RISCV] Remove RISCVISD::BREV8 and use RISCVISD::GREV instead.
We already have an ISD opcode for the more general GREV/GREVI
instructon. We can just use it with the encoding that corresponds
to the behavior of brev8. This is similar to what we do for orc.b
where we use the GORC ISD opcode.
2022-01-29 22:45:43 -08:00
Craig Topper 0405ac0150 [RISCV] Rerrange RISCVInstrInfoZB.td to better group related wthings. NFC
Especially placing W instructions/patterns near their non-W versions.
2022-01-29 21:16:15 -08:00
Fangrui Song 72a005bf19 [ELF] De-template getAndFeatures. NFC 2022-01-29 20:11:59 -08:00
Richard 9948020682 [clang-tidy] Organize the release notes a little better
- Sort new checks by check name
- Sort changes to existing checks by check name
- Add docs for changes to readability-simplify-boolean-expr
- Move check changes from "Improvements to clang-tidy" to
  "Changes in existing checks" section

Differential Revision: https://reviews.llvm.org/D118519
2022-01-29 20:32:25 -07:00
Fangrui Song d754c0b64f [ELF] Make errorOrWarn opaque to decrease code size. NFC
In my x86-64 lld, .text is -3.08Ki smaller.
2022-01-29 19:31:09 -08:00
Craig Topper 815786eb67 [RISCV] Use RVBUnary to simplify ZEXT_H_RV32/ZEXT_H_RV64 definitions. NFC 2022-01-29 18:28:14 -08:00
Ben Shi 653836251a [clang][AVR] Set '-fno-use-cxa-atexit' to default
AVR is baremetal environment, so the avr-libc does not support
'__cxa_atexit()'.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D118445
2022-01-30 02:26:19 +00:00
Ben Shi ac3894cf1e [Clang] Move XCore specific options from Clang.cpp to XCore.cpp
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D118535
2022-01-30 02:24:35 +00:00
Fangrui Song ee647d4c96 [ELF] Optimize obj.getSectionIndex. NFC 2022-01-29 18:01:58 -08:00
Fangrui Song 5d00d37617 [ELF] Simplify eSyms. NFC 2022-01-29 17:00:38 -08:00
Fangrui Song d86435c230 [ELF] createInputSection: remove unneeded argument. NFC 2022-01-29 16:52:32 -08:00
Fangrui Song ee7720acd6 [ELF] Avoid repeated getObj construction in getSectionIndex. NFC 2022-01-29 16:51:00 -08:00
Fangrui Song 94e97e668c [ELF] Reorder InputSectionBase::parent. NFC
Move it before others.
2022-01-29 16:20:40 -08:00
Fangrui Song b204d7c459 [ELF] Reorder InputFile members. NFC
`symbols` is used frequently. Moving it before others can decrease offsets.
2022-01-29 16:10:52 -08:00
John Ericson 368c54b81a [openmp][cmake] `CMAKE_INSTALL_BINDIR` usage should not be quoted
As @mstorsjo wrote in https://reviews.llvm.org/D117945#inline-1132920 :

> This change seems to have broken one aspect: When doing `ninja
install` I now get a warning saying `Error copying file "libomp.dll" to
"libiomp5md.dll".`, and `libiomp5md.dll` isn't installed.
>
> I believe the reason is that the inline cmake snippet is written to
`runtime/src/cmake_install.cmake` and then executed on install, but on
install, `${CMAKE_INSTALL_BINDIR}` isn't set (as `GNUInstallDirs` isn't
included there). Should this maybe expand `${CMAKE_INSTALL_BINDIR}`
right here instead of deferring it to the install cmake, or what's the
right course of action?

I agree that is the right course of action. We also agreed to restore the `CMAKE_INSTALL_PREFIX` that was there before, too.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D118528
2022-01-29 23:52:50 +00:00
Jeff Bailey f86844da49 Remove reference to LLVMLibC as the doc has moved.
https://reviews.llvm.org/D117436 caused a build failure
due to this error.

Tested:
ninja docs-llvm-libc builds

Reviewed By: abrachet

Differential Revision: https://reviews.llvm.org/D118537
2022-01-29 23:39:03 +00:00
Fangrui Song 469c4124ab [ELF] --gdb-index: switch to SmallVector. NFC 2022-01-29 15:24:56 -08:00
Joe Loser 81cc834a48
[libc++][test] Clean up libcxx/test/support/MoveOnly.h
Remove copy and copy assignment rather than have them as private declarations.
They are superfluous given the move and move assignment.

As a drive-by, also specialize `std::hash` without reopening `namespace std`.

Differential Revision: https://reviews.llvm.org/D118502
2022-01-29 18:20:46 -05:00
Fangrui Song da0e5b885b [ELF] Refactor -z combreloc
* `RelocationBaseSection::addReloc` increases `numRelativeRelocs`, which
  duplicates the work done by RelocationSection<ELFT>::writeTo.
* --pack-dyn-relocs=android has inappropropriate DT_RELACOUNT.
  AndroidPackedRelocationSection does not necessarily place relative relocations
  in the front and DT_RELACOUNT might cause semantics error (though our
  implementation doesn't and Android bionic doesn't use DT_RELACOUNT anyway.)

Move `llvm::partition` to a new function `partitionRels` and compute
`numRelativeRelocs` there. Now `RelocationBaseSection::addReloc` is trivial and
can be moved to the header to enable inlining.

The rest of DynamicReloc and `-z combreloc` handling is moved to the
non-template `RelocationBaseSection::computeRels` to decrease code size. My
x86-64 lld executable is 44+KiB smaller.

While here, rename `sort` to `combreloc`.
2022-01-29 14:45:58 -08:00
Mateusz Mikuła 460830a9c6 [LLD][MinGW] Add --heap argument support
Noticed in https://github.com/msys2/MINGW-packages/pull/10567.

Differential Revision: https://reviews.llvm.org/D118405
2022-01-30 00:01:45 +02:00
Rainer Orth 067650fd12 [sanitizer_common] Use atomic builtin in sanitizer_atomic_clang.h
As discussed in D118021 <https://reviews.llvm.org/D118021>, `clang -m32` on
Solaris/sparcv9 currently incorrectly doesn't inline atomics on 8-byte
operands, unlike `gcc`.  With the workaround in that patch in place, we're
left with may undefined references to `__sync_val_compare_and_swap_8`,
which isn't provided by `libatomic`.  This reference is due to the use of
`__sync_val_compare_and_swap` in `sanitizer_atomic_clang.h`'s
`atomic_compare_exchange_strong`.  As is already done in
`scudo/standalone/atomic_helpers.h`, using `__atomic_compare_exchange`
instead avoids this problem.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D118024
2022-01-29 22:52:55 +01:00
Nuno Lopes f1c18acb07 [NewGVN] do phi(undef, x) -> x only if x is not poison
phi([undef, A], [x, B]) -> x is only correct x is guaranteed to be
a non-poison value.
Otherwise we would be changing an undef to poison in the branch A.

Differential Revision: https://reviews.llvm.org/D117907
2022-01-29 21:43:57 +00:00
Nico Weber 7b2dfe1c22 [gn build] (manually) port 36892727e4 2022-01-29 16:06:24 -05:00
Jameson Nash 36892727e4 enable plugins for clang-tidy
Fixes #32739

Differential Revision: https://reviews.llvm.org/D111100
2022-01-29 14:21:19 -05:00
Fangrui Song 333f501930 [SmallVector] Optimize move assignment operator for N==0 case
Due to the SmallVector hierarchy, N==0 cannot be leveraged by functions defined
in base classes. This patch special cases N==0 for SmallVector to save code size
and be slightly more efficient.

In a Release build of x86 only clang, .text is -3.34KiB smaller. In lld .text is
7.17KiB smaller.

Reviewed By: lichray

Differential Revision: https://reviews.llvm.org/D117976
2022-01-29 11:03:42 -08:00
Sanjay Patel 4a69c8ef47 [InstCombine] add tests for demanded bit of mul; NFC 2022-01-29 12:55:23 -05:00
Mircea Trofin bc5644ee74 [MLGO] Regalloc: allow multiple occurences of -regalloc-enable-advisor
This allows scearios where some central config sets it one way and a
user wants to override it.
2022-01-29 09:00:52 -08:00
Stanislav Gatev 56cc697323 [clang][dataflow] Merge distinct pointer values in Environment::join
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: ymandel, xazax.hun

Differential Revision: https://reviews.llvm.org/D118480
2022-01-29 16:33:15 +00:00
Shilei Tian d4d0ae628c [OpenMP] Fix link error on Windows caused by `interop` functions
This patch fixes the link error on Windows caused by `interop`
functions.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D118524
2022-01-29 11:29:29 -05:00
Florian Hahn efd4938723
[VPlan] Handle IV vector splat using VPWidenCanonicalIV.
This patch tries to use an existing VPWidenCanonicalIVRecipe
instead of creating another step-vector for canonical
induction recipes in widenIntOrFpInduction.

This has the following benefits:

 1. First step to avoid setting both vector and scalar values for the
    same induction def.
 2. Reducing complexity of widenIntOrFpInduction through making things
    more explicit in VPlan
 3. Only need to splat the vector IV for block in masks.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D116123
2022-01-29 16:25:27 +00:00
Simon Pilgrim ee9eeed773 [X86] LowerFunnelShift - enable v8i16 lowering 2022-01-29 16:20:36 +00:00
Simon Pilgrim 6777289dd9 [X86] lowerShuffleAsBlend - pull out repeated getVectorNumElements() calls. NFC. 2022-01-29 16:16:29 +00:00
Arthur O'Dwyer d1c4c75531 [libc++] Fix the last instances of `namespace ranges::inline...`. NFC.
Make these look the same as everywhere else.
2022-01-29 11:10:04 -05:00
Simon Pilgrim 3a1fd17027 [WebAssembly] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointers are dereferenced immediately, so assert the cast is correct instead of returning nullptr
2022-01-29 16:08:06 +00:00
Simon Pilgrim b81b3ac668 [lldb] TypeSystemClang - use castAs/cast<> instead of getAs/dyn_cast<> to avoid dereference of nullptr
The pointers are dereferenced immediately, so assert the cast is correct instead of returning nullptr
2022-01-29 15:34:26 +00:00
Arthur O'Dwyer 424400da2d [clang][NFC] Change some ->getType()->isPlaceholderType() to just ->hasPlaceholderType()
Differential Revision: https://reviews.llvm.org/D118518
2022-01-29 10:20:22 -05:00
Simon Pilgrim f1305f2369 [X86] combinePredicateReduction - always use PMOVMSKB(PCMPEQB()) for allof(icmp_eq()) reductions
This greatly simplifies the codegen for recognising PTEST patterns and matches the codegen from the very similar LowerVectorAllZero
2022-01-29 15:16:59 +00:00
Arthur O'Dwyer da23e87319 [libc++] [test] Mark two ranges tests with libcpp-has-no-incomplete-ranges.
Should fix the Apple build CI, e.g.
https://buildkite.com/llvm-project/libcxx-ci/builds/8227
2022-01-29 10:14:02 -05:00
Aaron Ballman a10ff373dd Speculatively fix the sphinx build for Clang's attribute reference 2022-01-29 09:39:26 -05:00
Simon Pilgrim 67a399fd57 [X86] SimplifyDemandedBits - add X86ISD::BLENDV SimplifyMultipleUseDemandedBits handling
Lets us see through multiple use operands
2022-01-29 14:26:41 +00:00
Simon Pilgrim 7e849fd97b [X86] LowerFunnelShift - allow non-constant vXi8 unpack(y,x) << zext(z) lowering pre-AVX512
Without AVX512 (which can efficiently extend/truncate to vXi16/vXi32), unpacking/packing to vXi16 is more efficient that relying on the (uops-heavy) PBLENDV shift expansion
2022-01-29 13:58:30 +00:00
Aaron Ballman a6cabd9802 Revert fad7e491a0 with fixes applied
fad7e491a0 was a revert of
86797fdb6f due to build failures. This
hopefully fixes them.
2022-01-29 08:12:16 -05:00
Jim Lin 33fe0872cd [M68k] Add addressing modes ARIPI and ARIPD support for BTST
BTST missed ARIPI and ARIPD addressing modes support.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D116580
2022-01-29 21:05:10 +08:00