Commit Graph

414002 Commits

Author SHA1 Message Date
Simon Pilgrim 1b27940a11 Revert rG7275de7fb2f087871611d037d1b529b226dd0521 "[AArch64] translateLocChar - silence dead code warning"
Seems to cause some buildbot misbehaviour (+ there's a dumb copy+paste typo in the commit message....)
2022-02-06 17:19:23 +00:00
Simon Pilgrim 1ab7d43bf9 [clang][CodeGen] Add _BitInt test coverage to builtins-elementwise-math.c
As suggested on D117898, we should be testing irregular _BitInt types with the __builtin_elementwise_* intrinsics
2022-02-06 17:17:28 +00:00
Simon Pilgrim 784c78f20f Fix Wdocumentation unknown parameter warning 2022-02-06 16:52:32 +00:00
Florian Hahn 541ca12dcd
[LV] Use VPReplicateRecipe::isUniform instead isUniformAfterVec (NFCI).
In scalarizeInstruction(), isUniformAfterVectorization is used to detect
cases where it is sufficient to always access the first lane. This
should map directly checking whether the operand is a uniform replicate
recipe.

Differential Revision: https://reviews.llvm.org/D116654
2022-02-06 16:37:20 +00:00
Simon Pilgrim 7275de7fb2 [AArch64] translateLocChar - silence dead code warning
Remove default case from switch and return None after the switch()
2022-02-06 16:32:16 +00:00
Simon Pilgrim d3f966c6f0 [AArch64] LowerVectorSRA_SRL_SHL - silence dead code warning
Remove default case from switch and move llvm_unreachable to after the switch()
2022-02-06 16:29:38 +00:00
Simon Pilgrim 20e212197a [Support] Use llvm_unreachable instead of LLVM_BUILTIN_UNREACHABLE internal define 2022-02-06 16:26:00 +00:00
David Green b7d3a2b62f [ARM] Mark i64 and f64 shuffles as Custom for MVE
This way they get lowered through the ARMISD::BUILD_VECTOR, which can
produce more efficient D register moves.

Also helps D115653 not get stuck in a loop.
2022-02-06 16:17:06 +00:00
David Green 3dff4f5cfb [ARM] Add extra vabd, vhadd and vmulh tests. NFC
This is some extra testing for vabd, vhadd and vmulh. Some of the tests
have also be reordered.
2022-02-06 14:12:28 +00:00
Simon Pilgrim 74b98ab1db [X86] Fold ZERO_EXTEND_VECTOR_INREG(BUILD_VECTOR(X,Y,?,?)) -> BUILD_VECTOR(X,0,Y,0)
Helps avoid some unnecessary shift by splat amount extensions before shuffle combining gets limited by with one use checks
2022-02-06 12:53:11 +00:00
Fangrui Song bad1b7fbb0 [ELF] Fix crash when an input is incompatible with a lazy object file
The diagnostic is concise. It is ok because the case is rare.
2022-02-05 23:34:14 -08:00
Stella Laurenzo b4626f22de [mlir] Do not use an empty source file when building aggregate libraries.
See discussion: https://discourse.llvm.org/t/check-mlir-times-examples-standalone-testing-time/6073/7

It turns out that it has been legal since CMake 3.11 to omit sources at library creation time if they are added later via target_sources, as is done here. This side-steps the issue of having a file that changes and invalidates the build of leaves.

Differential Revision: https://reviews.llvm.org/D119069
2022-02-05 23:06:28 -08:00
Rong Xu 52d981a4c1 [SampleFDO] Enable FSAFDO loading passes if --enable-fs-discriminator is enabled
FSAFDO profile loader is currently disabled even --enable-fs-discriminator is enabled.
They need to be turned on by options which makes it cumbersome for experiments.

This patch changes the FSAFDO profile loader enabled by default.  Since they are
guarded by EnableFSDiscriminator, they will only be turned on if
--enable-fs-discriminator is enabled. Note that --enable-fs-discriminator is
still disabled by default.

Differential Revision: https://reviews.llvm.org/D119033
2022-02-05 22:37:09 -08:00
Kazu Hirata 2d650ee03e [Transforms] Use default member initialization in SCEVFindUnsafe (NFC) 2022-02-05 21:39:27 -08:00
Kazu Hirata cb13ebbf46 [Transforms] Use default member initialization in AAIsDeadCallSiteReturned (NFC) 2022-02-05 21:39:25 -08:00
Kazu Hirata 31d72f0e45 [Transforms] Use default member initialization in TruncInstCombine (NFC) 2022-02-05 21:39:23 -08:00
Kazu Hirata 9ed6800ef9 [Transforms] Use default member initialization in MaskOps (NFC) 2022-02-05 21:39:21 -08:00
Kazu Hirata a867f32c5f [Transforms] Use default member initialization in EscapeEnumerator (NFC) 2022-02-05 21:39:19 -08:00
Kazu Hirata bd5b279af0 [IR] Use default member initialization in PMDataManager (NFC) 2022-02-05 21:39:17 -08:00
Craig Topper f3a725af43 [RISCV] Add signext test for llvm.abs.i32 for rv64 Zbb.
This shows that we don't preserve sign bits across the
abs expansion, but I think we could if we used negw+max.
2022-02-05 21:26:47 -08:00
Fangrui Song 5ad2aae244 [ELF] SharedFile::parse: move verdefIndex assignment outside of ctor. NFC
SharedSymbol::SharedSymbol initializes verdefIndex and Symbol::replace
copies verdefIndex.

By move verdefIndex assignment outside of ctor, Symbol::replace can be changed
to not copy verdefIndex. This can be used to decrease work for for
ObjKind/BitcodeKind.
2022-02-05 20:43:51 -08:00
Ruiling Song 0719c43735 AMDGPU: Don't clobber source register for V_SET_INACTIVE_*
The WWM register has unmodeled register liveness, For v_set_inactive_*,
clobberring source register is dangerous because it will overwrite the
inactive lanes. When the source vgpr is dead at v_set_inactive_lane,
the inactive lanes may be not really dead. This may make common
optimizations doing wrong.

For example in a simple if-then cfg in Machine IR:
bb.if:
  %src =

bb.then:
  %src1 = COPY %src
  %dst = V_SET_INACTIVE %src1(tied-def 0), %inactive

bb.end
  ... = PHI [0, %bb.then] [%src, %bb.if]

The register coalescer will think it is safe to optimize "%src1 = COPY %src"
in bb.then. And at the same time, there is no interference for the PHI in
bb.end. The source and destination values of the PHI will be assigned
the same register. The single PHI register will be overwritten by the
v_set_inactive, then we would get wrong value in bb.end.

With this change, we will copy the content of the source register before
setting inactive lanes after register allocation. Yes, this will sacrifice
the WWM code generation a little, but I don't have any better idea to do things
correctly.

Differential Revision: https://reviews.llvm.org/D117482
2022-02-06 12:38:26 +08:00
Ruiling Song 2f4d44bcd4 AMDGPU: add test to show wwm register overwrite issue
Pre-commit the test to make the diff easy to read later.

Differential Revision: https://reviews.llvm.org/D117527
2022-02-06 12:38:26 +08:00
Krystian Kuzniarek 6cd0015e78 [clang-format][docs] Fix incorrect 'clang-format 14' option markers
Introduced by 23a5090c6, some style option markers indicated 'clang-format 14',
though their respective options were available in earlier releases.

Note: Even though the value type of 'SpacesInAngles' option changed,
this option has been already present since version 3.4.

Differential Revision: https://reviews.llvm.org/D118991
2022-02-05 20:04:39 -08:00
Fangrui Song 977a1a523c [ELF] Symbol::replace: use the old nameData/nameSize. NFC
Currently `this->getName() == newSym.getName()`.
By keeping the old nameData/nameSize, newSym's nameData/nameSize will be
ignored. The call sites can avoid calling getName().

printTraceSymbol needs to take the symbol name since `other`'s name is empty.
2022-02-05 16:34:02 -08:00
Adrian Prantl c5699c6eb7 fix module build failure 2022-02-05 16:30:39 -08:00
Adrian Prantl 511fa14ce3 fix module build failure 2022-02-05 16:30:38 -08:00
Adrian Prantl 607c589048 fix module build failure 2022-02-05 16:30:38 -08:00
Kazu Hirata 7ae64e598a [Support] Use default member initialization in ScopedPrinter (NFC) 2022-02-05 16:29:28 -08:00
Kazu Hirata 1569252774 [IR] Use default member initialization in GlobalObject (NFC) 2022-02-05 16:29:26 -08:00
Kazu Hirata f072603685 [ADT] Use default member initialization in OptionalStorage (NFC) 2022-02-05 16:29:24 -08:00
Kazu Hirata e24384b506 [Transforms] Use default member initialization in SimplifyIndvar (NFC) 2022-02-05 16:29:22 -08:00
Kazu Hirata d0f52ff12a [ADT] Use default member initialization in DebugEpochBase (NFC) 2022-02-05 16:29:20 -08:00
Kazu Hirata 70fc36d8ed [MC] Use default member initialization in WasmCustomSection (NFC) 2022-02-05 16:29:19 -08:00
Benjamin Kramer ce9417348e [SLP] Skip a DenseSet<unsigned> -> bit vector conversion. NFCI. 2022-02-06 00:57:47 +01:00
Fangrui Song 50460b8004 [ELF] Don't access other eSym members it st_shndx == SHN_UNDEF. NFC 2022-02-05 15:25:23 -08:00
Fangrui Song 9af90e205a [ELF] De-template reportUndefinedSymbols. NFC
My x86-64 lld executable is 16KiB smaller.
2022-02-05 15:03:56 -08:00
Adrian Prantl 11d64edbf9 Revert "Disable TestLldbGdbServer on Dwarf2 and clang versions below 14"
This reverts commit 867fdec194.
2022-02-05 14:54:41 -08:00
Adrian Prantl a701dc8eda Revert "Fixed typos in TestLldbGdbServer.py"
This reverts commit cf93a08575.
2022-02-05 14:54:37 -08:00
Fangrui Song f9e3ca542e [ELF] Move Symbol::needsTlsLd to config->needsTlsLd. NFC
to decrease sizeof(SymbolUnion) from 72 to 64 on ELF64 platforms.
2022-02-05 14:40:15 -08:00
Benjamin Kramer a40dc4eaf8 Simplify mask creation with llvm::seq. NFCI. 2022-02-05 23:35:41 +01:00
Yaxun (Sam) Liu 171da443d5 [HIPSPV] Fix literals are mapped to Generic address space
This issue is an oversight in D108621.

Literals in HIP are emitted as global constant variables with default
address space which maps to Generic address space for HIPSPV. In
SPIR-V such variables translate to OpVariable instructions with
Generic storage class which are not legal. Fix by mapping literals
to CrossWorkGroup address space.

The literals are not mapped to UniformConstant because the “flat”
pointers in HIP may reference them and “flat” pointers are modeled
as Generic pointers in SPIR-V. In SPIR-V/OpenCL UniformConstant
pointers may not be casted to Generic.

Patch by: Henry Linjamäki

Reviewed by: Yaxun Liu

Differential Revision: https://reviews.llvm.org/D118876
2022-02-05 17:26:52 -05:00
Fangrui Song 73f55fba76 [ELF] Reorder Symbol members to improve access locality. NFC
* partition and isPreemptible are frequently used. Move it to the front
* move used beside isUsedInRegularObj. They are similar and accessed together in .symtab finalizing
* move auxIdx/dynsymIndex/verdefIndex to the end.

This decreases code size.
2022-02-05 14:11:37 -08:00
Koakuma 2b9554b885 [libunwind] [sparc] Add SPARCv9 support
Adds libunwind support for SPARCv9 (aka sparc64). This is a rebase of @kettenis' patch D32450, which I created (with his permission) because the original review has become inactive.
The changes are of a cosmetic nature to make it fit better with the new code style, and to reuse the existing SPARCv8 code, whenever possible.

Please let me know if I posted this on the wrong place. Also, the summary of the original review is reproduced below:

> This adds unwinder support for 64-bit SPARC (aka SPARCv9). The implementation was done on OpenBSD/sparc64, so it takes StackGhost into account:
>
> https://www.usenix.org/legacy/publications/library/proceedings/sec01/full_papers/frantzen/frantzen_html/index.html
>
> Since StackGhost xor's return addresses with a random cookie before storing them on the stack, the unwinder has to do some extra work to recover those. This is done by introducing a new kRegisterInCFADecrypt "location" type that is used to implement the DW_CFA_GNU_window_save opcode. That implementation is SPARC-specific, but should work for 32-bit SPARC as well. DW_CFA_GNU_window_save is only ever generated on SPARC as far as I know.

Co-authored-by: Mark Kettenis
Reviewed By: #libunwind, thesamesam, MaskRay, Arfrever

Differential Revision: https://reviews.llvm.org/D116857
2022-02-05 13:08:26 -08:00
Simon Pilgrim 527654dceb [libunwind] Attempt to fix broken sphinx doc link
bbce75e352 replaced `LLVM Bugzilla` with `LLVM bug tracker`
2022-02-05 21:05:01 +00:00
Craig Topper c1cef111a3 Revert "[RISCV] Fold (sext_inreg (fmv_x_anyexth X), i16) -> (fmv_x_signexth X)."
This reverts commit 673d68cd92.

This hadn't been reviewed yet.
2022-02-05 12:51:01 -08:00
Craig Topper d1899da3a2 [RISCV] Add more tests for rotate idioms. Add more RUN lines. NFC
We were only testing rotate idioms on rv32i. DAGCombiner won't
form ISD::ROTL/ROTR unless those operations are Legal or Custom.
They aren't for rv32 so we were only testing shift lowering.

This commit adds i64 idioms and the idioms that mask the shift
amount to avoid UB for a rotate of 0. I've added riscv64 and Zbb
RUN lines to show that we do match rotate for XLen types when
available. We currently miss i32 on rv64izbb.
2022-02-05 12:48:22 -08:00
Craig Topper 673d68cd92 [RISCV] Fold (sext_inreg (fmv_x_anyexth X), i16) -> (fmv_x_signexth X).
Add a new ISD opcode to represent the sign extending behavior of
vmv.x.h. Keep the previous anyext opcode to allow the existing
(fmv_x_anyexth (fmv_h_x X)) combine to keep working without needing
to generate a sign extend.

For fmv.x.w we are able to match the sext_inreg in an isel pattern,
but a 16-bit sext_inreg is lowered to a shift pair before isel. This
seemed like a larger match than we should do in isel.

Differential Revision: https://reviews.llvm.org/D118974
2022-02-05 12:42:12 -08:00
Fangrui Song 7c675923c7 [ELF] Merge canInline into scriptDefined
They perform similar tasks and are essentially the same after
d28c26bbdd.
2022-02-05 12:00:34 -08:00
Simon Pilgrim eb9ac2cc14 [llvm-remark-size-diff] Don't use enum name as auto variable name
This was confusing the clang-cmake-x86_64-avx2-linux buildbot (gcc version 5.4.0).
2022-02-05 19:30:10 +00:00