platform/upstream/llvm.git
2 years ago[libc] Enable creat, fsync, open, openat, read and write for aarch64.
Siva Chandra [Fri, 28 Jan 2022 19:41:26 +0000 (11:41 -0800)]
[libc] Enable creat, fsync, open, openat, read and write for aarch64.

2 years agoAdd BITINT_MAXWIDTH support
Aaron Ballman [Fri, 28 Jan 2022 20:00:20 +0000 (15:00 -0500)]
Add BITINT_MAXWIDTH support

Part of the _BitInt feature in C2x
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2763.pdf) is a new
macro in limits.h named BITINT_MAXWIDTH that can be used to determine
the maximum width of a bit-precise integer type. This macro must expand
to a value that is at least as large as ULLONG_WIDTH.

This adds an implementation-defined macro named __BITINT_MAXWIDTH__ to
specify that value, which is used by limits.h for the standard macro.

This also limits the maximum bit width to 128 bits because backends do
not currently support all mathematical operations (such as division) on
wider types yet. This maximum is expected to be increased in the future.

2 years ago[flang][NFC] Remove obsolete ComplexExpr helper
Valentin Clement [Fri, 28 Jan 2022 20:01:39 +0000 (21:01 +0100)]
[flang][NFC] Remove obsolete ComplexExpr helper

Functionality present in `flang/include/flang/Lower/ComplexExpr.h` are
available in `flang/include/flang/Optimizer/Builder/Complex.h`. This patch removes
the obsolete files.

Reviewed By: kiranchandramohan, schweitz

Differential Revision: https://reviews.llvm.org/D118462

2 years ago[clang][NFC] Fix Typo
Jacob Lambert [Fri, 28 Jan 2022 19:55:46 +0000 (11:55 -0800)]
[clang][NFC] Fix Typo

2 years ago[IRSim][IROutliner] Allowing Intrinsic Calls to be Used in Similarity Matching and...
Andrew Litteken [Thu, 23 Dec 2021 00:07:43 +0000 (18:07 -0600)]
[IRSim][IROutliner] Allowing Intrinsic Calls to be Used in Similarity Matching and Outlined Regions

Due to some complications with lifetime, and assume-like intrinsics, intrinsics were not included as outlinable instructions. This patch opens up most intrinsics, excluding lifetime and assume-like intrinsics, to be outlined. For similarity, it is required that the intrinsic IDs, and the intrinsics names match exactly, as well as the function type. This puts intrinsics in a different class than normal call instructions (https://reviews.llvm.org/D109448), where the name will no longer have to match.

This also adds an additional command line flag debug option to disable outlining intrinsics.

Recommit of: 8de76bd569732acae6a10fdcb0152a49f7d4cd39
Adds extra checking of intrinsic function calls names to avoid taking the address of intrinsic calls when extracting function calls.

Reviewers: paquette, jroelofs

Differential Revision: https://reviews.llvm.org/D109450

2 years ago[lld] Add module name to LTO inline asm diagnostic
Fangrui Song [Fri, 28 Jan 2022 19:32:42 +0000 (11:32 -0800)]
[lld] Add module name to LTO inline asm diagnostic

Close #52781: for LTO, the inline asm diagnostic uses `<inline asm>` as the file
name (lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp) and it is unclear which
module has the issue.

With this patch, we will see the module name (say `asm.o`) before `<inline asm>` with ThinLTO.

```
% clang -flto=thin -c asm.c && myld.lld asm.o -e f
ld.lld: error: asm.o <inline asm>:1:2: invalid instruction mnemonic 'invalid'
        invalid
        ^~~~~~~
```

For regular LTO, unfortunately the original module name is lost and we only get
ld-temp.o.

Reviewed By: #lld-macho, ychen, Jez Ng

Differential Revision: https://reviews.llvm.org/D118434

2 years ago[libc] Add implementations of the POSIX creat and openat functions.
Siva Chandra Reddy [Thu, 27 Jan 2022 23:47:50 +0000 (23:47 +0000)]
[libc] Add implementations of the POSIX creat and openat functions.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D118435

2 years ago[gn build] Port f489e86a24d3
LLVM GN Syncbot [Fri, 28 Jan 2022 19:20:50 +0000 (19:20 +0000)]
[gn build] Port f489e86a24d3

2 years agoRemove Waymarking.h as it is unused
Aaron Ballman [Fri, 28 Jan 2022 19:19:18 +0000 (14:19 -0500)]
Remove Waymarking.h as it is unused

This file was added in https://reviews.llvm.org/D74415. There was no
justification as to why it was added, and after about a year of being
in-tree, it's still unused, so this removes it.

2 years ago[ScalarEvolution] Mark a loop as finite if in a willreturn function
William S. Moses [Fri, 28 Jan 2022 04:52:40 +0000 (23:52 -0500)]
[ScalarEvolution] Mark a loop as finite if in a willreturn function

A limited version of (https://reviews.llvm.org/D118090) that only marks a loop as finite if in a willreturn function.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D118429

2 years ago[GVN] Add additional tests for PRE with pointer selects.
Florian Hahn [Fri, 28 Jan 2022 19:11:35 +0000 (19:11 +0000)]
[GVN] Add additional tests for PRE with pointer selects.

Additional tests for D118143.

2 years ago[SLP] Add a clarifying assert in block scheduling [NFC]
Philip Reames [Fri, 28 Jan 2022 18:34:16 +0000 (10:34 -0800)]
[SLP] Add a clarifying assert in block scheduling [NFC]

The fact we could have a block with a valid scheduling window, but nothing to schedule was surprising to me.  After digging through the code, this can only happen if we don't find anything to directly vectorize.  However, the reduction handling code relies on this mode, so we can't simply consider such trees unvectorizeable.  The assert conveys both that this situation can happen, but also that it can *only* happen for an immediate gather.

Context: We built the bundle before deciding that vectorization of a bundle is possible.  A side effect of bundle construction is manipulating the scheduling window, so a bundle which isn't vectorizable can cause the creation or expansion of a scheduling window.

2 years agoGCC ABI Compatibility: Preserve alignment of non-pod members in packed structs
David Blaikie [Tue, 18 Jan 2022 22:28:14 +0000 (14:28 -0800)]
GCC ABI Compatibility: Preserve alignment of non-pod members in packed structs

This matches GCC: https://godbolt.org/z/sM5q95PGY

I realize this is an API break for clang+clang - so I'm totally open to
discussing how we should deal with that. If Apple wants to keep the
Clang layout indefinitely, if we want to put a flag on this so non-Apple
folks can opt out of this fix/new behavior.

Differential Revision: https://reviews.llvm.org/D117616

2 years ago[lld][Macho] Include dead-stripped symbols in mapfile
Roger Kim [Fri, 28 Jan 2022 18:51:27 +0000 (10:51 -0800)]
[lld][Macho] Include dead-stripped symbols in mapfile

ld64 outputs dead stripped symbols when using the -dead-strip flag. This change mimics that behavior for lld.

ld64's -dead_strip flag outputs:
```
$ ld -map map basics.o -o out -dead_strip -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem
$ cat map
# Path: out
# Arch: x86_64
# Object files:
[  0] linker synthesized
[  1] basics.o
# Sections:
# Address       Size            Segment Section
0x100003F97     0x00000021      __TEXT  __text
0x100003FB8     0x00000048      __TEXT  __unwind_info
0x100004000     0x00000008      __DATA_CONST    __got
0x100008000     0x00000010      __DATA  __ref_section
0x100008010     0x00000001      __DATA  __common
# Symbols:
# Address       Size            File  Name
0x100003F97     0x00000006      [  1] _ref_local
0x100003F9D     0x00000001      [  1] _ref_private_extern
0x100003F9E     0x0000000C      [  1] _main
0x100003FAA     0x00000006      [  1] _no_dead_strip_globl
0x100003FB0     0x00000001      [  1] _ref_from_no_dead_strip_globl
0x100003FB1     0x00000006      [  1] _no_dead_strip_local
0x100003FB7     0x00000001      [  1] _ref_from_no_dead_strip_local
0x100003FB8     0x00000048      [  0] compact unwind info
0x100004000     0x00000008      [  0] non-lazy-pointer-to-local: _ref_com
0x100008000     0x00000008      [  1] _ref_data
0x100008008     0x00000008      [  1] l_ref_data
0x100008010     0x00000001      [  1] _ref_com

# Dead Stripped Symbols:
#               Size            File  Name
<<dead>>        0x00000006      [  1] _unref_extern
<<dead>>        0x00000001      [  1] _unref_local
<<dead>>        0x00000007      [  1] _unref_private_extern
<<dead>>        0x00000001      [  1] _ref_private_extern_u
<<dead>>        0x00000008      [  1] _unref_data
<<dead>>        0x00000008      [  1] l_unref_data
<<dead>>        0x00000001      [  1] _unref_com
```

Reviewed By: int3, #lld-macho, thevinster

Differential Revision: https://reviews.llvm.org/D114737

2 years ago[libc] Refactor sqrt implementations and add tests for generic sqrt implementations.
Tue Ly [Tue, 25 Jan 2022 20:11:15 +0000 (15:11 -0500)]
[libc] Refactor sqrt implementations and add tests for generic sqrt implementations.

Re-apply https://reviews.llvm.org/D118173 with fix for aarch64.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D118433

2 years ago[mlir][taco] Accept an integer list for the ordering when defining a tensor format.
Bixia Zheng [Fri, 28 Jan 2022 00:17:26 +0000 (16:17 -0800)]
[mlir][taco] Accept an integer list for the ordering when defining a tensor format.

The unit tests for PyTACO hasn't been upstreamed yet. A unit test for this
change will be added when we upstream all the unit tests for PyTACO.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D118417

2 years ago[AIX][clang] include_next through clang provided float.h
David Tenty [Mon, 17 Jan 2022 20:32:33 +0000 (15:32 -0500)]
[AIX][clang] include_next through clang provided float.h

AIX provides additional definitions in the system libc float.h that we
would like to be available to users, so we need to include_next through,
similar to what is done on some other platforms.

We also adjust the guards for some definitions which are restricted
based on language level to also be provide with the _ALL_SOURCE feature
test macro on AIX, similar to what is done by the platform float.h
header, so we don't run into cases where we don't provide the compiler
macro but still have a different definition from the system.

Differential Revision: https://reviews.llvm.org/D117935

2 years agoReapply "[llvm-libtool-darwin] Print a warning if object file names are repeated"
Shoaib Meenai [Fri, 28 Jan 2022 07:40:30 +0000 (23:40 -0800)]
Reapply "[llvm-libtool-darwin] Print a warning if object file names are repeated"

Loosen the test to make it pass on Windows.

This reapplies commit 4993eff3e253a1c04e1a1a2fa5d68f6b33423419.
This reverts commit 96c66040125e87808b23410632b1a6a34547b4e3.

2 years ago[lldb] Update the lldb build instructions on Windows
Stella Stamenova [Fri, 28 Jan 2022 18:18:19 +0000 (10:18 -0800)]
[lldb] Update the lldb build instructions on Windows

The existing instructions for lldb on Windows can be more explicit. This adds a few details on how to install various components and the easiest way to get to a working build.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D118425

2 years agoEmit swift5 reflection section data in dsym bundle generated by dsymutil in the Dwarf...
Shubham Sandeep Rastogi [Wed, 17 Nov 2021 23:05:58 +0000 (15:05 -0800)]
Emit swift5 reflection section data in dsym bundle generated by dsymutil in the Dwarf section.

Add support for Swift reflection metadata to dsymutil.

This patch adds support for copying Swift reflection metadata (__swift5_.* sections) from .o files to into the symbol-rich binary in the output .dSYM. The functionality is automatically enabled only if a .o file has reflection metadata sections and the binary doesn't. When copying dsymutil moves the section from the __TEXT segment to the __DWARF segment.

rdar://76973336

Differential Revision: https://reviews.llvm.org/D115007

2 years ago[mlir] Only build mlir-cpu-runner when the native arch is targeted
Stella Stamenova [Fri, 28 Jan 2022 18:09:09 +0000 (10:09 -0800)]
[mlir] Only build mlir-cpu-runner when the native arch is targeted

mlir-cpu-runner has a dependency on ExecutionEngine which is only built for the native arch. So currently mlir-cpu-runner does not link correctly when the native arch is not targeted.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D118422

2 years ago[ADT] support fixed-width output with `utohexstr`
Yuanfang Chen [Fri, 28 Jan 2022 18:07:37 +0000 (10:07 -0800)]
[ADT] support fixed-width output with `utohexstr`

Will use it to output a hash value that needs fixed-width.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D118427

2 years ago[AMDGPU] SILoadStoreOptimizer: break lists on instructions with side effects
Jay Foad [Thu, 27 Jan 2022 16:58:00 +0000 (16:58 +0000)]
[AMDGPU] SILoadStoreOptimizer: break lists on instructions with side effects

This just helps to keep the lists shorter and faster to sort. NFCI.

Differential Revision: https://reviews.llvm.org/D118384

2 years ago[RISCV] Update comments about getInstSizeInBytes hard-coding the number of bytes.
Craig Topper [Fri, 28 Jan 2022 17:43:00 +0000 (09:43 -0800)]
[RISCV] Update comments about getInstSizeInBytes hard-coding the number of bytes.

After D118175, we get the information from the tablegen definition.

Differential Revision: https://reviews.llvm.org/D118488

2 years ago[NFC][AIX]Disable new pcm tests on AIX
Steven Wan [Fri, 28 Jan 2022 17:38:50 +0000 (12:38 -0500)]
[NFC][AIX]Disable new pcm tests on AIX

Same as D114481, the PCH reader looks for a `__clangast` section in the precompiled module file, which isn't present on AIX, and we don't support writing this custom section in XCOFF yet.

Reviewed By: Jake-Egan, daltenty, sfertile

Differential Revision: https://reviews.llvm.org/D118477

2 years ago[RISCV] Preserve VL when truncating i64 gather/scatter indices on RV32.
Craig Topper [Fri, 28 Jan 2022 17:21:52 +0000 (09:21 -0800)]
[RISCV] Preserve VL when truncating i64 gather/scatter indices on RV32.

We were creating a truncate with the default for the type, but for
VP intrinsics we have a VL that we should use.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D118406

2 years ago[InstrProf][NFC] Move function out of InstrProf.h
Ellis Hoag [Fri, 28 Jan 2022 01:40:19 +0000 (17:40 -0800)]
[InstrProf][NFC] Move function out of InstrProf.h

`createIRLevelProfileFlagVar()` seems to be only used in
`PGOInstrumentation.cpp` so we move it to that file. Then it can also
take advantage of directly using options rather than passing them as
arguments.

Reviewed By: kyulee, phosek

Differential Revision: https://reviews.llvm.org/D118097

2 years ago[RISCV] Use tablegen size for getInstSizeInBytes.
Craig Topper [Fri, 28 Jan 2022 17:12:10 +0000 (09:12 -0800)]
[RISCV] Use tablegen size for getInstSizeInBytes.

Fix the pseudos to have the correct size in the MCInstrDesc description.

Inspired by D118009 and D117970.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D118175

2 years ago[SLP]Do not reorder top nodes if they do not require reordering.
Alexey Bataev [Thu, 6 Jan 2022 17:46:16 +0000 (09:46 -0800)]
[SLP]Do not reorder top nodes if they do not require reordering.

No need to reorder the top nodes, if they are not stores or
insertelement instructions and each node should be analized only
once, when the bottom-to-top analysis is performed.
We still endup with extractelements for the top node scalars and
the final shuffle just adds an extra cost and currently
crashes the compiler for PHI nodes.

Differential Revision: https://reviews.llvm.org/D116760

2 years ago[msan][tsan] Refine __fxstat{,at}{,64} condition
Fangrui Song [Fri, 28 Jan 2022 17:15:39 +0000 (09:15 -0800)]
[msan][tsan] Refine __fxstat{,at}{,64} condition

In glibc before 2.33, include/sys/stat.h defines fstat/fstat64 to
`__fxstat/__fxstat64` and provides `__fxstat/__fxstat64` in libc_nonshared.a.
The symbols are glibc specific and not needed on other systems.

Reviewed By: vitalybuka, #sanitizers

Differential Revision: https://reviews.llvm.org/D118423

2 years ago[DAGCombiner] Fix invalid size request in combineRepeatedFPDivisors
Cullen Rhodes [Fri, 28 Jan 2022 16:28:40 +0000 (16:28 +0000)]
[DAGCombiner] Fix invalid size request in combineRepeatedFPDivisors

If we have a vector FP division with a splatted divisor, use
getVectorMinNumElements when scaling the num of uses by splat factor.

For AArch64 the combine kicks in for the <vscale x 4 x float> case since it's
above the fdiv threshold (3) when scaling num uses by splat factor, but the
codegen is worse (splat + vector fdiv + vector fmul) than the <vscale x 2 x
double> case (splat + vector fdiv).

If the combine could be converted into a scalar FP division by
scalarizeBinOpOfSplats it may be cheaper, but it looks like this is predicated
on the isExtractVecEltCheap TLI function which is implemented for x86 but not
AArch64. Perhaps for now combineRepeatedFPDivisors should only scale num uses
by splat if the division can be converted into scalar op.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D118343

2 years ago[lldb] [gdb-remote] Support getting siginfo via API
Michał Górny [Mon, 24 Jan 2022 17:52:49 +0000 (18:52 +0100)]
[lldb] [gdb-remote] Support getting siginfo via API

Add Thread::GetSiginfo() and SBThread::GetSiginfo() methods to retrieve
the siginfo value from server.

Differential Revision: https://reviews.llvm.org/D118055

2 years ago[libc][NFC] Create file with all permissions for the user in read_write_test.
Siva Chandra Reddy [Fri, 28 Jan 2022 16:32:45 +0000 (16:32 +0000)]
[libc][NFC] Create file with all permissions for the user in read_write_test.

2 years ago[clang][deps] Adapt test to be compatible when the assembler is called by default
Jake Egan [Fri, 28 Jan 2022 16:39:33 +0000 (11:39 -0500)]
[clang][deps] Adapt test to be compatible when the assembler is called by default

When `-fno-integrated-as` is in effect (the default on AIX) the cc1 job produces a `.s` file instead. This patch adapts the test to accept `.s` or `.o` files.

Reviewed By: jansvoboda11

Differential Revision: https://reviews.llvm.org/D118152

2 years ago[MLIR] Introduce LexSimplex to support lexicographic optimization
Arjun P [Fri, 28 Jan 2022 16:25:19 +0000 (21:55 +0530)]
[MLIR] Introduce LexSimplex to support lexicographic optimization

This patch introduces a class LexSimplex that can currently be used to find the
lexicographically minimal rational point in an IntegerPolyhedron. This is a
series of patches leading to computing the lexicographically minimal integer
lattice point as well parametric lexicographic minimization.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D117437

2 years ago[NFC][AIX][clang] un-XFAIL gcc profile flag compat test
David Tenty [Fri, 28 Jan 2022 15:47:23 +0000 (10:47 -0500)]
[NFC][AIX][clang] un-XFAIL gcc profile flag compat test

We can pass this test now thanks to recent changes that allow us to use PGO without LTO, so un-XFAIL the test and update the comments.

Differential Revision: https://reviews.llvm.org/D118474

2 years ago[lldb] Make ReadCStringFromMemory default to read from the file-cache.
Augusto Noronha [Wed, 26 Jan 2022 17:26:42 +0000 (14:26 -0300)]
[lldb] Make ReadCStringFromMemory default to read from the file-cache.

Differential Revision: https://reviews.llvm.org/D118265

2 years ago[RISCV] Use __extendhfsf2/__truncsfhf2 for fp16 <-> fp32
Kito Cheng [Tue, 6 Apr 2021 01:09:55 +0000 (09:09 +0800)]
[RISCV] Use __extendhfsf2/__truncsfhf2 for fp16 <-> fp32

`__gnu_h2f_ieee` and `__gnu_f2h_ieee` are introduce by ARM and set that as
default name for fp16 and fp32 conversion in LLVM.

However RISC-V GCC using default naming scheme for that, which is
`__extendhfsf2` and `__truncsfhf2` for that, that cause runtime ABI
incompatible issue.

Although we didn't have formal runtime ABI spec to specify those naming
convention yet, but I think it would be great to fix the incompatible
issue first.

And I've plan to create a runtime ABI spec undere psABI spec this year.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D118207

2 years ago[CodeExtractor] Fix warning in assert (NFC)
Nikita Popov [Fri, 28 Jan 2022 15:33:34 +0000 (16:33 +0100)]
[CodeExtractor] Fix warning in assert (NFC)

2 years ago[BasicBlockUtils] Fix typo in API name (NFC)
Nikita Popov [Fri, 28 Jan 2022 15:32:13 +0000 (16:32 +0100)]
[BasicBlockUtils] Fix typo in API name (NFC)

detatch -> detach. As this requires touching all uses, also
lower-case it in accordance with the style guide.

2 years ago[Loads] Require Align in isDereferenceableAndAlignedPointer() (NFC)
Nikita Popov [Fri, 28 Jan 2022 15:15:21 +0000 (16:15 +0100)]
[Loads] Require Align in isDereferenceableAndAlignedPointer() (NFC)

Now that loads always have an alignment, we should not perform an
ABI alignment fallback here.

2 years ago[x86] try harder to scalarize a vector load with extracted integer op uses
Sanjay Patel [Fri, 28 Jan 2022 14:55:13 +0000 (09:55 -0500)]
[x86] try harder to scalarize a vector load with extracted integer op uses

extract_vec_elt (load X), C --> scalar load (X+C)

As noted in the comment, DAGCombiner has this fold -- and the code in this
patch is adapted from DAGCombiner::scalarizeExtractedVectorLoad() -- but
x86 should benefit even if the loaded vector has other uses as long as we
apply some other x86-specific conditions. The motivating example from #50310
is shown in vec_int_to_fp.ll.

Fixes #50310

Differential Revision: https://reviews.llvm.org/D118376

2 years ago[RISCV][NFC] Make Zb* instruction naming match the convention used elsewhere in the...
Alex Bradbury [Fri, 28 Jan 2022 15:13:42 +0000 (15:13 +0000)]
[RISCV][NFC] Make Zb* instruction naming match the convention used elsewhere in the RISC-V backend

Where the instruction mnemonic contains a dot, we name the corresponding
instruction in the .td file using a _ in the place of the dot. e.g. LR_W
rather than LRW. This commit updates RISCVInstrInfoZb.td to follow that
convention.

2 years ago[NFC][RISCV] Bundle up ISAInfo updates and checks
eopXD [Thu, 27 Jan 2022 09:19:52 +0000 (01:19 -0800)]
[NFC][RISCV] Bundle up ISAInfo updates and checks

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D118334

2 years ago[ArgPromotion] Don't assume all entry block instrs are executed
Nikita Popov [Fri, 28 Jan 2022 15:07:40 +0000 (16:07 +0100)]
[ArgPromotion] Don't assume all entry block instrs are executed

We should abort this walk if we hit any instruction that is not
guaranteed to transfer.

2 years ago[ArgPromotion] Add test for non-willreturn load hoisting (NFC)
Nikita Popov [Fri, 28 Jan 2022 15:02:41 +0000 (16:02 +0100)]
[ArgPromotion] Add test for non-willreturn load hoisting (NFC)

In this case, we have no guarantee that the load is unconditionally
executed, so the argument promotion is not legal.

2 years ago[MVerifier] Don't check liveness of any debug instruction operands
Jeremy Morse [Fri, 28 Jan 2022 14:52:55 +0000 (14:52 +0000)]
[MVerifier] Don't check liveness of any debug instruction operands

Shiny new DBG_PHI instruction usually have physical registers as operands
-- however, the machine verifier checks to see whether they're live, and
occasionally this fails. There's a filter for DBG_VALUE instructions to not
get verified in this way: expand it to exempt all debug instructions from
liveness checking, which means DBG_PHIs get treated like DBG_VALUEs.

This also future proofs against us adding new debug instructions.

Differential Revision: https://reviews.llvm.org/D117891

2 years ago[update_test_checks] Fix option name in warning message
Jay Foad [Fri, 28 Jan 2022 14:44:25 +0000 (14:44 +0000)]
[update_test_checks] Fix option name in warning message

2 years ago[X86] SimplifyDemandedBitsForTargetNode - fold MOVMSK(YMM) -> MOVMSK(XMM)
Simon Pilgrim [Fri, 28 Jan 2022 14:42:18 +0000 (14:42 +0000)]
[X86] SimplifyDemandedBitsForTargetNode - fold MOVMSK(YMM) -> MOVMSK(XMM)

If we don't demand the upper elements of the 256-bit vector, then just perform as a 128-bit vector

2 years ago[Sema] Add signed/unsigned integer mismatch tests for min/max elementwise builtins
Simon Pilgrim [Fri, 28 Jan 2022 14:23:17 +0000 (14:23 +0000)]
[Sema] Add signed/unsigned integer mismatch tests for min/max elementwise builtins

As suggested on D117898

Differential Revision: https://reviews.llvm.org/D118464

2 years ago[ArgPromotion] Make areFunctionArgsABICompatible() static (NFC)
Nikita Popov [Fri, 28 Jan 2022 14:26:00 +0000 (15:26 +0100)]
[ArgPromotion] Make areFunctionArgsABICompatible() static (NFC)

This function used to be shared with the Attributor, but can now
be made private.

2 years ago[PowerPC] Update handling of splat loads for v4i32/v4f32/v2i64 to require non-extendi...
Amy Kwan [Fri, 28 Jan 2022 03:36:04 +0000 (21:36 -0600)]
[PowerPC] Update handling of splat loads for v4i32/v4f32/v2i64 to require non-extending loads.

This patch updates how splat loads handled and is an extension of D106555.

Particularly, for v2i64/v4f32/v4i32 types, they are updated to handle only
non-extending loads. For v8i16/v16i8 types, they are updated to handle extending
loads only if the memory VT is the same vector element VT type.

A test case has been added to illustrate a scenario where a PPCISD::LD_SPLAT
node should not be produced. In this test, it depicts the following f64
extending load used in a v2f64 build vector, but the extending load is actually
used in more places other than the build vector (such as in t12 and t16).
```
Type-legalized selection DAG: %bb.0 'test:entry'
SelectionDAG has 20 nodes:
  t0: ch = EntryToken
  t4: i64,ch = CopyFromReg t0, Register:i64 %1
  t6: i64,ch = CopyFromReg t0, Register:i64 %2
  t11: f64,ch = load<(load (s64) from %ir.b, !tbaa !7)> t0, t4, undef:i64
        t16: f64 = fadd t31, t37
      t34: ch = store<(store (s64) into %ir.c, !tbaa !7)> t31:1, t16, t6, undef:i64
    t36: ch = TokenFactor t34, t37:1
    t27: v2f64 = BUILD_VECTOR t37, t37
  t22: ch,glue = CopyToReg t36, Register:v2f64 $v2, t27
      t12: f64 = fadd t11, t37
    t28: ch = store<(store (s64) into %ir.b, !tbaa !7)> t11:1, t12, t4, undef:i64
  t31: f64,ch = load<(load (s64) from %ir.c, !tbaa !7)> t28, t6, undef:i64
    t2: i64,ch = CopyFromReg t0, Register:i64 %0
  t37: f64,ch = load<(load (s32) from %ir.a, !tbaa !3), anyext from f32> t0, t2, undef:i64
  t23: ch = PPCISD::RET_FLAG t22, Register:v2f64 $v2, t22:1
```

Differential Revision: https://reviews.llvm.org/D117803

2 years ago[AArch64][SVE][VLS] Move extends into arguments of comparisons
David Truby [Tue, 16 Nov 2021 11:33:12 +0000 (11:33 +0000)]
[AArch64][SVE][VLS] Move extends into arguments of comparisons

When a comparison is extended and it would be free to extend the
arguments to that comparison, we can propagate the extend into those arguments.
This prevents extra instructions being generated to extend the result of the
comparison, which is not free to extend.

This is a resubmission of D116812 with fixes that need another review.

Differential Revision: https://reviews.llvm.org/D118139

2 years ago[HWASan] Leave pointer tagged when calling memmove.
Matt Morehouse [Fri, 28 Jan 2022 14:14:46 +0000 (06:14 -0800)]
[HWASan] Leave pointer tagged when calling memmove.

Fixes a false positive that occurs when a user-implemented memmove is
instrumented by HWASan.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D118180

2 years ago[x86] add test for possible load scalarization fold; NFC
Sanjay Patel [Fri, 28 Jan 2022 13:33:00 +0000 (08:33 -0500)]
[x86] add test for possible load scalarization fold; NFC

This is a minimal test to show a transform proposed in D118376.

2 years ago[flang] Add missing FIRBuilder library
Valentin Clement [Fri, 28 Jan 2022 13:46:10 +0000 (14:46 +0100)]
[flang] Add missing FIRBuilder library

Fix buildbot failure https://lab.llvm.org/buildbot/#/builders/160

2 years agoDo not crash when trying to encode a _BitInt type
Aaron Ballman [Fri, 28 Jan 2022 13:37:09 +0000 (08:37 -0500)]
Do not crash when trying to encode a _BitInt type

Using a _BitInt (or _ExtInt) type as a block parameter or block return
type hits an "unreachable" when trying to determine the encoding for
the block. Instead of crashing, this patch handles it like some of the
other types for which we don't yet have an encoding. The test case
verifies we no longer crash, but does not verify that we provide any
particular encoding (it can be updated once someone more familiar with
ObjC steps in to define the encoding).

Fixes PR50503.

2 years ago[X86] combineSetCCMOVMSK - don't fold MOVMSK(BITCAST(PCMPEQ(X,0))) -> PTESTZ(X,X...
Simon Pilgrim [Fri, 28 Jan 2022 13:22:25 +0000 (13:22 +0000)]
[X86] combineSetCCMOVMSK - don't fold MOVMSK(BITCAST(PCMPEQ(X,0))) -> PTESTZ(X,X) if we're not testing every element comparison

2 years ago[X86] Add test showing incorrect movmsk->ptest fold
Simon Pilgrim [Fri, 28 Jan 2022 13:01:25 +0000 (13:01 +0000)]
[X86] Add test showing incorrect movmsk->ptest fold

We can't fold MOVMSK(BITCAST(PCMPEQ(X,0))) -> PTESTZ(X,X) if we're not testing every element comparison

2 years ago[SVE] Extend isel pattern coverage for BIC.
Paul Walker [Thu, 27 Jan 2022 13:31:18 +0000 (13:31 +0000)]
[SVE] Extend isel pattern coverage for BIC.

Adds patterns of the form "(and a, (not b)) -> bic".

NOTE: With this support I'm inclined to remove AArch64ISD::BIC,
but will leave that investigation for another time.

Differential Revision: https://reviews.llvm.org/D118365

2 years ago[AArch64][SVE] NFC: Add test for scaled stepvector.
Sander de Smalen [Fri, 28 Jan 2022 11:51:44 +0000 (11:51 +0000)]
[AArch64][SVE] NFC: Add test for scaled stepvector.

This commutative test could be optimised into:
  index z0.d, x0, x1

But currently isn't yet.

2 years ago[test][NewGVN] Use '-passes=newgvn' instead of '-basic-aa -newgvn'
Bjorn Pettersson [Wed, 26 Jan 2022 21:35:08 +0000 (22:35 +0100)]
[test][NewGVN] Use '-passes=newgvn' instead of '-basic-aa -newgvn'

This updates NewGVN test cases that were running
  "opt -basic-aa -newgvn ..."
to run
  "opt -passes=newgvn ..."
instead.

The pipeline will be more similar to what we used to have with
legacy PM by doing it this way. The compatility mode that we've
been using for awhile during transition from legacy PM to new PM,
i.e. using the legacy syntax together with new PM, has resulted in
a pipeline such as
  -passes='function(require<basic-aa>),function(newgvn)'
but running the analysis in a separate function pass manager seem
overly complicated for these tests.

Another difference is that we will get the default aa-pipeline instead
of only running basic-aa. That might be a bit questioned (given that
the tests originally specified basic-aa). The output is however
identival for all the test cases modified here regardless of using
basic-aa or the default aa-pipeline.

This is also another small step towards removal of the support for
using the legacy PM syntax in opt.

Differential Revision: https://reviews.llvm.org/D118340

2 years ago[test][NewGVN] Use -passes=newgvn instead of -newgvn
Bjorn Pettersson [Wed, 26 Jan 2022 21:51:13 +0000 (22:51 +0100)]
[test][NewGVN] Use -passes=newgvn instead of -newgvn

Use the new PM syntax when specifying the pipeline in regression
tests previously running
  "opt -newgvn ..."

Instead we now do
  "opt -passes=newgvn ..."

Notice that this also changes the aa-pipeline to become the default
aa-pipeline instead of just basic-aa. Since these tests haven't been
explicitly requesting basic-aa in the past (compared to the test cases
updated in a separate patch involving "-basic-aa -newgvn") it is
assumed that the exact aa-pipeline isn't important for the validity
of the test cases. An alternative could have been to add
-aa-pipeline=basic-aa as well to the run lines, but that might just
add clutter in case the test cases do not care about the aa-pipeline.

This is another step to move away from the legacy PM syntax when
specifying passes in opt.

Differential Revision: https://reviews.llvm.org/D118341

2 years ago[RISCV] Add tests for possible splat optimizations
Fraser Cormack [Fri, 28 Jan 2022 12:14:12 +0000 (12:14 +0000)]
[RISCV] Add tests for possible splat optimizations

These splats -- whether BUILD_VECTOR or SPLAT_VECTOR -- are formed by
first extracting a value from a vector and splatting it to all elements
of the destination vector. These could be performed more optimally,
avoiding the drop to scalar, using RVV's vrgather, for example.

2 years ago[RISCV] Fix FileCheck prefixes in RVV test
Fraser Cormack [Fri, 28 Jan 2022 11:34:15 +0000 (11:34 +0000)]
[RISCV] Fix FileCheck prefixes in RVV test

The LMULMAX check names didn't match the options we were passing to llc
(they were swapped around) and we were silently missing coverage for one
test which differs between RV32 and RV64.

2 years ago[llvm-mca] Plot as result of comparing multiple files
Milica Matic [Fri, 28 Jan 2022 12:02:03 +0000 (13:02 +0100)]
[llvm-mca] Plot as result of comparing multiple files

This patch introduces a new options for script llvm-mca-compare.py
(-plot-resource-pressure, -plot) to draw plots for llvm-mca tool
statistics and option (--plot-path) to specify relative path where
you want to save the plots.

Differential Revision: https://reviews.llvm.org/D115718

2 years ago[X86] combineSetCCMOVMSK - match all_of patterns with X86ISD::CMP as well as X86ISD...
Simon Pilgrim [Fri, 28 Jan 2022 11:32:18 +0000 (11:32 +0000)]
[X86] combineSetCCMOVMSK - match all_of patterns with X86ISD::CMP as well as X86ISD::SUB

Previous folds by combineSetCCMOVMSK might have converted these to CMP when changing the bitwidth, and the CMP->SUB fold might not have happened (or will happen)

2 years agoclang-format: [JS] fix uninitialized memory.
Martin Probst [Fri, 28 Jan 2022 11:15:17 +0000 (12:15 +0100)]
clang-format: [JS] fix uninitialized memory.

SortJavaScriptImports attempts to set its currently parsed token to an
invalid token when it reaches the end of the line. However in doing so,
it used a `FormatToken`, which contains a `Token Tok`. `Token` does not
have a constructor, so its fields start out as uninitialized memory.

`Token::startToken()` initializes all fields. Calling it in
`JavaScriptImportSorter`'s constructor thus fixes the problem.

Differential Revision: https://reviews.llvm.org/D118448

2 years ago[ConstraintElimination] Add sub nuw test with signed predicates.
Florian Hahn [Fri, 28 Jan 2022 11:20:57 +0000 (11:20 +0000)]
[ConstraintElimination] Add sub nuw test with signed predicates.

Add missing test coverage for `sub nuw` combined with both unsigned and
signed predicates.

2 years ago[BasicAA] Add support for memmove intrinsic
Evgeniy Brevnov [Mon, 24 Jan 2022 09:49:08 +0000 (16:49 +0700)]
[BasicAA] Add support for memmove intrinsic

Currently, basic AA has special support for llvm.memcpy.* intrinsics. This change extends this support for any memory trancsfer opration and in particular llvm.memmove.* intrinsic.

Reviewed By: reames, nikic

Differential Revision: https://reviews.llvm.org/D117095

2 years agoRevert "[InstCombine] Fold and-reduce idiom"
Hans Wennborg [Fri, 28 Jan 2022 11:10:26 +0000 (12:10 +0100)]
Revert "[InstCombine] Fold and-reduce idiom"

It causes builds to fail with

llvm/include/llvm/Support/Casting.h:269:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*)
[with X = llvm::IntegerType; Y = const llvm::Type; typename llvm::cast_retty<X, Y*>::ret_type = const llvm::IntegerType*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

See the code review for link to a reproducer.

> This patch introduces folding of and-reduce idiom and generates code
> that is easier to read and which is lest costly in terms of icmp operations.
> The folding is
> ```
>   icmp eq (bitcast(icmp ne (lhs, rhs)), 0)
> ```
> into
> ```
>   icmp eq(bitcast(lhs), bitcast(rhs))
> ```
>
> See PR53419.
>
> Differential Revision: https://reviews.llvm.org/D118317
> Reviewed By: lebedev.ri, spatel

This reverts commit 8599bb0f26738ed88aae62aba57d82f7cf326cf9.

This also revertes the dependent change:

"[Test] Add 'ne' tests for and-reduce pattern folding"

This reverts commit a4aaa5995308ac2ba1bf180c9ce9c321cdb9f28a.

2 years ago[CodeGen] Emit COFF symbol type for function aliases
Martin Storsjö [Wed, 26 Jan 2022 22:31:31 +0000 (00:31 +0200)]
[CodeGen] Emit COFF symbol type for function aliases

On the level of the generated object files, both symbols (both
original and alias) are generally indistinguishable - both are
regular defined symbols. But previously, only the original
function had the COFF ComplexType set to IMAGE_SYM_DTYPE_FUNCTION,
while the symbol created via an alias had the type set to
IMAGE_SYM_DTYPE_NULL.

This matches what GCC does, which emits directives for setting the
COFF symbol type for this kind of alias symbol too.

This makes a difference when GNU ld.bfd exports symbols without
dllexport directives or a def file - it seems to decide between
function or data exports based on the COFF symbol type. This means
that functions created via aliases, like some C++ constructors,
are exported as data symbols (missing the thunk for calling without
dllimport).

The hasnt been an issue when doing the same with LLD, as LLD decides
between function or data export based on the flags of the section
that the symbol points at.

This should fix the root cause of
https://github.com/msys2/MINGW-packages/issues/10547.

Differential Revision: https://reviews.llvm.org/D118328

2 years ago[X86] Fix MOVMSK(CONCAT(X,Y)) -> MOVMSK(AND/OR(X,Y)) fold for float types and demande...
Simon Pilgrim [Fri, 28 Jan 2022 11:01:32 +0000 (11:01 +0000)]
[X86] Fix MOVMSK(CONCAT(X,Y)) -> MOVMSK(AND/OR(X,Y)) fold for float types and demanded elements

rG9103b73fe052 was assuming that we could OR/AND with the source vector, but that will fail on float/double vectors without bitcasting - it also missed the case that any_of checks might be testing less than all the source elements

2 years ago[clang-format] Move irrelevant code from getRangeLength to getRemainingLength. NFC.
Marek Kurdej [Fri, 28 Jan 2022 10:57:13 +0000 (11:57 +0100)]
[clang-format] Move irrelevant code from getRangeLength to getRemainingLength. NFC.

2 years ago[mlir] Move SCF utils implementations to SCF/Utils.
Adrian Kuegel [Thu, 27 Jan 2022 08:10:59 +0000 (09:10 +0100)]
[mlir] Move SCF utils implementations to SCF/Utils.

BEGIN_PUBLIC
[mlir] Move SCF utils implementations to SCF/Utils.
END_PUBLIC

2 years agoclang-format: [JS] sort import aliases. Users can define aliases for long symbols...
Martin Probst [Fri, 28 Jan 2022 08:12:03 +0000 (09:12 +0100)]
clang-format: [JS] sort import aliases. Users can define aliases for long symbols using import aliases:

    import X = A.B.C;

Previously, these were unhandled and would terminate import sorting.
With this change, aliases sort as their own group, coming last after all
other imports.

Aliases are not sorted within their group, as they may reference each
other, so order is significant.

This reverts commit f750c3d95a0c8bf1d21380ae753fce12010a7561. It fixes
the msan issue by not parsing past the end of the line when handling
import aliases.

Differential Revision: https://reviews.llvm.org/D118446

2 years agoCleanup includes for LLVMTableGenGlobalISel
serge-sans-paille [Fri, 28 Jan 2022 09:06:32 +0000 (10:06 +0100)]
Cleanup includes for LLVMTableGenGlobalISel

Based on the output of include-what-you-use. No big deal here, it's a utils
library and it doesn't seem to be used a lot across the codebase.

$ clang++ -E  -Iinclude -I../llvm/include ../llvm/utils/TableGen/GlobalISel/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l
before: 573143
after:  568908

Related Discourse thread: https://llvm.discourse.group/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D118375

2 years agoCleanup include dependencies for LLVMTableGen
serge-sans-paille [Fri, 28 Jan 2022 06:19:32 +0000 (07:19 +0100)]
Cleanup include dependencies for LLVMTableGen

Based on the output of include-what-you-use. No other library seems affected by
the new forward declaration.

$ clang++ -E  -Iinclude -I../llvm/include ../llvm/lib/TableGen/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l
before: 795231
after: 750654

Related Discourse thread: https://llvm.discourse.group/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D118374

2 years agoCleanup includes for LLVMBitstream
serge-sans-paille [Fri, 28 Jan 2022 09:03:41 +0000 (10:03 +0100)]
Cleanup includes for LLVMBitstream

This is a very small library, so only a few changes and very little gain.

$ clang++ -E  -Iinclude -I../llvm/include ../llvm/lib/Bitstream/Reader/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l
before: 65777
after:  64997

Related Discourse thread: https://llvm.discourse.group/t/include-what-you-use-include-cleanup

Differential Revision: https://reviews.llvm.org/D118373

2 years agoMove llvm::array_lenghtof to llvm/ADT/STLArrayExtras.h
serge-sans-paille [Fri, 28 Jan 2022 09:01:42 +0000 (10:01 +0100)]
Move llvm::array_lenghtof to llvm/ADT/STLArrayExtras.h

This moves the dependency of several files on include/llvm/ADT/STLExtras.h to
the much shorter llvm/ADT/STLArrayExtras.h

Differential Revision: https://reviews.llvm.org/D118342

2 years ago[Matrix] Use ArrayType for allocas instead of VectorType.
Florian Hahn [Fri, 28 Jan 2022 10:47:51 +0000 (10:47 +0000)]
[Matrix] Use ArrayType for allocas instead of VectorType.

When creating an alloca to copy a matrix due to memory conflicts, those
allocas used to use VectorTypes, which forced them to have huge
alignments for large vectors.

This patch updates LowerMatrixIntrinsics to use a corresponding array
type, like Clang already does, to get more manageable alignments.

Reviewed By: anemet, thegameg

Differential Revision: https://reviews.llvm.org/D118239

2 years ago[sanitizers] Silence warnings about unused variables in i386 build. NFC.
Martin Storsjö [Fri, 28 Jan 2022 10:30:17 +0000 (12:30 +0200)]
[sanitizers] Silence warnings about unused variables in i386 build. NFC.

2 years ago[flang][NFC] Remove obsolete DoLoopHelper
Valentin Clement [Fri, 28 Jan 2022 10:29:38 +0000 (11:29 +0100)]
[flang][NFC] Remove obsolete DoLoopHelper

During the upstreaming process from fir-dev some
new builder have been introduced in the `flang/Optimizer/Builder`
directory. This patch removes the obsolete DoLoopHelper still present
in the lowering directories and makes use of the new one where needed.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D118442

2 years ago[flang][NFC] Remove obsolete FIRBuilder and BoxValue
Valentin Clement [Fri, 28 Jan 2022 10:12:28 +0000 (11:12 +0100)]
[flang][NFC] Remove obsolete FIRBuilder and BoxValue

This patch removes some files made obsolete by newer version
of them available in the Optimizer directory.
`flang/include/flang/Lower/FIRBuilder.h` and `flang/lib/Lower/FIRBuilder.cpp` are
removed and replace by the newer version present in
`flang/include/flang/Optimizer/Builder/FIRBuilder.h` and
`flang/lib/Optimizer/Builder/FIRBuilder.cpp`.
`flang/include/flang/Lower/Support/BoxValue.h` and `flang/lib/Lower/ConvertExpr.cpp` are removed and replace by the newer
version present in `flang/include/flang/Optimizer/Builder/BoxValue.h`

This patch is a preparation to be able to upstream the lowering from
fir-dev.

Reviewed By: jeanPerier, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D118404

2 years ago[OpenCL] opencl-c.h: refactor named addrspace builtins
Sven van Haastregt [Fri, 28 Jan 2022 10:24:47 +0000 (10:24 +0000)]
[OpenCL] opencl-c.h: refactor named addrspace builtins

The named address space overloads of builtins that take a pointer
argument are conditionalized on the `__opencl_c_generic_address_space`
feature macro (in a `#else` body).  Introduce an internal feature
macro instead, such that their availability can be controlled in a
single place and independently of the generic address space feature
macro.

This commit does not change the available builtins.

Differential Revision: https://reviews.llvm.org/D118158

2 years ago[clang-format] Remove useless npos parameter from substr. NFC.
Marek Kurdej [Fri, 28 Jan 2022 10:21:21 +0000 (11:21 +0100)]
[clang-format] Remove useless npos parameter from substr. NFC.

2 years ago[ADT] Remove unused variables in Triple.h, fix build warnings with GCC. NFC.
Martin Storsjö [Fri, 28 Jan 2022 10:18:45 +0000 (12:18 +0200)]
[ADT] Remove unused variables in Triple.h, fix build warnings with GCC. NFC.

2 years ago[tblgen] Disable lsan weak hook when building with msvc
Pierre Gousseau [Fri, 28 Jan 2022 09:50:41 +0000 (09:50 +0000)]
[tblgen] Disable lsan weak hook when building with msvc

This change is to fix a link time error when building llvm with msvc.

MSVC's implementation does not support weak hook or lsan so this change
disables lsan's weak hook definition.
Only GCC supports LSan.

Tested with visual studio 2019 v16.9.6

Reviewed By: aaron.ballman, rnk

Differential Revision: https://reviews.llvm.org/D118162

2 years ago[clang][ARM] Emit warnings when PACBTI-M is used with unsupported architectures
Amilendra Kodithuwakku [Fri, 28 Jan 2022 09:58:08 +0000 (09:58 +0000)]
[clang][ARM] Emit warnings when PACBTI-M is used with unsupported architectures

Branch protection in M-class is supported by
 - Armv8.1-M.Main
 - Armv8-M.Main
 - Armv7-M

Attempting to enable this for other architectures, either by
command-line (e.g -mbranch-protection=bti) or by target attribute
in source code (e.g.  __attribute__((target("branch-protection=..."))) )
will generate a warning.

In both cases function attributes related to branch protection will not
be emitted. Regardless of the warning, module level attributes related to
branch protection will be emitted when it is enabled via the command-line.

The following people also contributed to this patch:
- Victor Campos

Reviewed By: chill

Differential Revision: https://reviews.llvm.org/D115501

2 years ago[Sparc] Implement BFD_RELOC_NONE
Rainer Orth [Fri, 28 Jan 2022 09:44:22 +0000 (10:44 +0100)]
[Sparc] Implement BFD_RELOC_NONE

`instrprof-icall-promo.test` `FAIL`s on Solaris/sparcv9:

  Profile-sparc :: instrprof-icall-promo.test
  Profile-sparcv9 :: instrprof-icall-promo.test

when compiling `compiler-rt/test/profile/Inputs/instrprof-icall-promo_2.cpp` with

  fatal error: error in backend: Relocation for CG Profile could not be created: unknown relocation name

This happens because the Sparc backend doesn't implement `BFD_RELOC_NONE`.
This patch fixes that, following what X86 does.

Tested on `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D118136

2 years ago[lldb] Convert DWARF log to the new API
Pavel Labath [Thu, 27 Jan 2022 14:10:29 +0000 (15:10 +0100)]
[lldb] Convert DWARF log to the new API

This also deletes some dead log statements (log initialization commented
out).

2 years ago[InlineFunction] Use phis() iterator (NFC)
Nikita Popov [Fri, 28 Jan 2022 09:36:12 +0000 (10:36 +0100)]
[InlineFunction] Use phis() iterator (NFC)

2 years ago[VPlan] Record whether scalar IVs are need in induction recipe. (NFC)
Florian Hahn [Fri, 28 Jan 2022 09:34:02 +0000 (09:34 +0000)]
[VPlan] Record whether scalar IVs are need in induction recipe. (NFC)

This explicitly records whether a scalar IV is needed in the
VPWidenIntOrFpInductionRecipe, to remove a dependence on the cost-model
during its ::execute.

It will also be used in D116123 to determine if a vector phi will be
generated.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D118167

2 years ago[libcxx] [test] Fix testcases that fail on systems with 16 bit wchar_t
Martin Storsjö [Sun, 9 Jan 2022 22:58:44 +0000 (22:58 +0000)]
[libcxx] [test] Fix testcases that fail on systems with 16 bit wchar_t

Don't decode a UTF-8 character that is out of range for a 16 bit
`wchar_t`.

Differential Revision: https://reviews.llvm.org/D118191

2 years ago[libcxx] Allow using thread safety annotations in MinGW mode
Martin Storsjö [Tue, 11 Jan 2022 09:23:39 +0000 (09:23 +0000)]
[libcxx] Allow using thread safety annotations in MinGW mode

These were omitted in all Windows configurations, but it turns out
that they work just fine in MinGW mode.

This allows converting a couple cases of "XFAIL: LIBCXX-WINDOWS-FIXME"
into "XFAIL: msvc" as the bug is specific to MSVC mode (clang-cl).

Differential Revision: https://reviews.llvm.org/D118192

2 years ago[MC] Remove a stray space after tab for COFF .def directives
Martin Storsjö [Thu, 27 Jan 2022 19:56:33 +0000 (21:56 +0200)]
[MC] Remove a stray space after tab for COFF .def directives

This extra stray space after tab can be traced back to when printing
of this directive was added originally in
4f01b783a3ca5b2544fe1b1677b5bcf6d91c6d2c. The same commit added
inconsistent printing of space after the ELF .type directive too,
which was fixed later in
77fe07a93aeb8feaf39b7d48ad8fc1e6c9e4c78e.

(This is kind of NFC, but it does alter the output, so it's not
strictly non-functional in that sense.)

Differential Revision: https://reviews.llvm.org/D118401

2 years agoRevert "[lldb] [gdb-remote] Support getting siginfo via API"
Michał Górny [Fri, 28 Jan 2022 08:18:14 +0000 (09:18 +0100)]
Revert "[lldb] [gdb-remote] Support getting siginfo via API"

This reverts commit 1a8f60f5f5b8638a3e8e7fb31ba7ae9e17a7ff2d.
The API requires further work.

2 years ago[lldb][ARM/AArch64] Update dissembler to v9.3-a
David Spickett [Thu, 27 Jan 2022 13:27:58 +0000 (13:27 +0000)]
[lldb][ARM/AArch64] Update dissembler to v9.3-a

This means sve2 is enabled by default and the v8.8 mops (memcpy
and memset acceleration instructions) and HBC (hinted conditional
branch) extensions can be disassembled.

v9.3-a is equivalent to v8.8-a except that in v9.0-a sve2 was
enabled by default so v9.3-a includes that too.

MTE remains an optional extension, only enabled for specific CPUs.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D118358

2 years ago[MLIR] Remove some pointer element type accesses
Nikita Popov [Fri, 28 Jan 2022 08:41:17 +0000 (09:41 +0100)]
[MLIR] Remove some pointer element type accesses

Use the MLIR pointer element type, rather than the LLVM pointer
element type.

2 years ago[lld][ELF] Cleanup %t directory in tests, NFC
Alexander Shaposhnikov [Fri, 28 Jan 2022 08:36:38 +0000 (08:36 +0000)]
[lld][ELF] Cleanup %t directory in tests, NFC