platform/upstream/llvm.git
3 years ago[LiveDebugValues] Handle spill locations with a fixed and scalable component.
Sander de Smalen [Wed, 6 Jan 2021 10:54:41 +0000 (10:54 +0000)]
[LiveDebugValues] Handle spill locations with a fixed and scalable component.

This patch fixes the two LiveDebugValues implementations
(InstrRef/VarLoc)Based to handle cases where the StackOffset contains
both a fixed and scalable component.

This depends on the `TargetRegisterInfo::prependOffsetExpression` being
added in D90020. Feel free to leave comments on that patch if you have them.

Reviewed By: djtodoro, jmorse

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

3 years ago[ARM] Handle any extend whilst lowering addw/addl/subw/subl
David Green [Wed, 6 Jan 2021 11:26:39 +0000 (11:26 +0000)]
[ARM] Handle any extend whilst lowering addw/addl/subw/subl

Same as a9b6440edd, use zanyext to treat any_extends as zero extends
during lowering to create addw/addl/subw/subl nodes.

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

3 years ago[VPlan] Add getLiveInIRValue accessor to VPValue.
Florian Hahn [Wed, 6 Jan 2021 10:57:46 +0000 (10:57 +0000)]
[VPlan] Add getLiveInIRValue accessor to VPValue.

This patch adds a new getLiveInIRValue accessor to VPValue, which
returns the underlying value, if the VPValue is defined outside of
VPlan. This is required to handle scalars in VPTransformState, which
requires dealing with scalars defined outside of VPlan.

We can simply check VPValue::Def to determine if the value is defined
inside a VPlan.

Reviewed By: Ayal

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

3 years ago[mlir] Use thread_local stack in LLVM dialect type parsing and printing
Alex Zinenko [Tue, 5 Jan 2021 16:01:41 +0000 (17:01 +0100)]
[mlir] Use thread_local stack in LLVM dialect type parsing and printing

LLVM dialect type parsing and printing have been using a local stack object
forwarded between recursive functions responsible for parsing or printing
specific types. This stack is necessary to intercept (mutually) recursive
structure types and avoid inifinite recursion. This approach works only thanks
to the closedness of the LLVM dialect type system: types that don't belong to
the dialect are not allowed. Switch the approach to using a `thread_local`
stack inside the functions parsing the structure types. This makes the code
slightly cleaner by avoiding the need to pass the stack object around and, more
importantly, makes it possible to reconsider the closedness of the LLVM dialect
type system. As a nice side effect of this change, container LLVM dialect types
now support type aliases in their body (although it is currently impossible to
also use the alises when printing).

Depends On D93713

Reviewed By: mehdi_amini

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

3 years ago[RISCV][NFC] Add new test cases for mul
Ben Shi [Wed, 6 Jan 2021 10:55:56 +0000 (18:55 +0800)]
[RISCV][NFC] Add new test cases for mul

3 years ago[ARM] Handle any extend whilst lowering mull
David Green [Wed, 6 Jan 2021 10:51:12 +0000 (10:51 +0000)]
[ARM] Handle any extend whilst lowering mull

Similar to 78d8a821e23e but for ARM, this handles any_extend whilst
creating MULL nodes, treating them as zextends.

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

3 years ago[VPlan] Use public VPValue constructor in VPPRedInstPHIRecipe (NFC).
Florian Hahn [Wed, 6 Jan 2021 10:23:40 +0000 (10:23 +0000)]
[VPlan] Use public VPValue constructor in VPPRedInstPHIRecipe (NFC).

VPPredInstPHIRecipe does not need access to VPValue via friendship. It
can just use the public constructor,

Discussed as part of D92281.

3 years agoFix test failure in a7e3339f3b0eb71e43d44e6f59cc8db6a7b110bf
Sander de Smalen [Wed, 6 Jan 2021 10:42:05 +0000 (10:42 +0000)]
Fix test failure in a7e3339f3b0eb71e43d44e6f59cc8db6a7b110bf

Set the target-triple to aarch64 in debug-info-sve-dbg-value.mir
to avoid "'+sve' is not a recognized feature for this target"
diagnostic.

3 years ago[flang][driver] Update error messages (nfc)
Andrzej Warzynski [Wed, 6 Jan 2021 10:35:00 +0000 (10:35 +0000)]
[flang][driver] Update error messages (nfc)

As per Flang's coding guidelines
(flang/docs/C++style.md#error-messages):
```
Messages should start with a capital letter.
```

This patch updates error messages in the driver (new and old) so that
they conform with the guideline above.

This change was suggested in one of the recent reviews:
https://reviews.llvm.org/D93712. It felt like this deserved a dedicated
patch, so sending it separately.

3 years ago[AArch64] Handle any extend whilst lowering addw/addl/subw/subl
David Green [Wed, 6 Jan 2021 10:35:23 +0000 (10:35 +0000)]
[AArch64] Handle any extend whilst lowering addw/addl/subw/subl

This adds an extra tablegen PatFrag, zanyext, which matches either any
extend or zext and uses that in the aarch64 backend to handle any
extends in addw/addl/subw/subl patterns.

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

3 years agoRevert "[sanitizer] Define SANITIZER_GLIBC to refine SANITIZER_LINUX feature detectio...
Oliver Stannard [Wed, 6 Jan 2021 10:31:59 +0000 (10:31 +0000)]
Revert "[sanitizer] Define SANITIZER_GLIBC to refine SANITIZER_LINUX feature detection and support musl"

This reverts commit b7718b617557aa9827f994a16267537236634095, because it
is causing build failures on all 32-bit ARM bots which build
compiler-rt.

3 years ago[flang][driver] Add checks for errors from `Prescan` and `Parse`
Andrzej Warzynski [Wed, 6 Jan 2021 09:54:30 +0000 (09:54 +0000)]
[flang][driver] Add checks for errors from `Prescan` and `Parse`

If either `Prescan` or `Parse` generate any fatal errors, the new driver
will:
  * report it (i.e. issue an error diagnostic)
  * exit early
  * return non-zero exit code
This behaviour is consistent with f18 (i.e. the old driver).

Reviewed By: sameeranjoshi

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

3 years ago[AArch64] Handle any extend whilst lowering mull
David Green [Wed, 6 Jan 2021 10:08:43 +0000 (10:08 +0000)]
[AArch64] Handle any extend whilst lowering mull

Demanded bits may turn a sext or zext into an anyext if the top bits are
not needed. This currently prevents the lowering to instructions like
mull, addl and addw. This patch fixes the mull generation by keeping it
simple and treating them like zextends.

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

3 years ago[AArch64][SVE] Emit DWARF location expression for SVE stack objects.
Sander de Smalen [Wed, 6 Jan 2021 09:37:57 +0000 (09:37 +0000)]
[AArch64][SVE] Emit DWARF location expression for SVE stack objects.

Extend PEI to emit a DWARF expression for StackOffsets that have
a fixed and scalable component. This means the expression that needs
to be added is either:
  <base> + offset
or:
  <base> + offset + scalable_offset * scalereg

where for SVE, the scale reg is the Vector Granule Dwarf register, which
encodes the number of 64bit 'granules' in an SVE vector and which
the debugger can evaluate at runtime.

Reviewed By: jmorse

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

3 years ago[AArch64] Use faddp to implement fadd reductions.
Sander de Smalen [Tue, 5 Jan 2021 09:39:59 +0000 (09:39 +0000)]
[AArch64] Use faddp to implement fadd reductions.

Custom-expand legal VECREDUCE_FADD SDNodes
to benefit from pair-wise faddp instructions.

Reviewed By: dmgreen

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

3 years ago[MC][WebAssembly] Avoid recalculating indexes in -gsplit-dwarf mode
Sam Clegg [Mon, 21 Dec 2020 18:24:32 +0000 (10:24 -0800)]
[MC][WebAssembly] Avoid recalculating indexes in -gsplit-dwarf mode

Be consistent about asserting before setting WasmIndices.  Adding
these assertions revealed that we were duplicating a lot of work
and setting these indexed twice when running in DWO mode.

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

3 years ago[RISCV] Add vector integer mul/mulh/div/rem ISel patterns
Fraser Cormack [Mon, 4 Jan 2021 10:41:49 +0000 (10:41 +0000)]
[RISCV] Add vector integer mul/mulh/div/rem ISel patterns

There is no test coverage for the mulhs or mulhu patterns as I can't get
the DAGCombiner to generate them for scalable vectors. There are a few
places in that still need updating for that to work. I left the patterns
in regardless as they are correct.

Reviewed By: craig.topper

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

3 years ago[clangd][fuzzyFind] Do not show stale symbols in the result.
Aleksandr Platonov [Wed, 6 Jan 2021 07:07:12 +0000 (10:07 +0300)]
[clangd][fuzzyFind] Do not show stale symbols in the result.

This is follow up to D93393.
Without this patch `MergedIndex::fuzzyFind()` returns stale symbols from the static index even if these symbols were removed.

Reviewed By: sammccall

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

3 years ago[OpenMP][AMDGPU] Use AMDGPU_KERNEL calling convention for entry function
Pushpinder Singh [Mon, 4 Jan 2021 11:46:31 +0000 (06:46 -0500)]
[OpenMP][AMDGPU] Use AMDGPU_KERNEL calling convention for entry function

AMDGPU backend requires entry functions/kernels to have AMDGPU_KERNEL
calling convention for proper linking.

Reviewed By: JonChesterfield

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

3 years ago[libc] Add implementations of nextafter[f|l] functions.
Siva Chandra Reddy [Mon, 4 Jan 2021 06:33:48 +0000 (22:33 -0800)]
[libc] Add implementations of nextafter[f|l] functions.

A differential fuzzer for these functions has also been added.
Along the way, a small correction has been done to the normal/subnormal
limits of x86 long double values.

Reviewed By: lntue

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

3 years ago[libc] Add implementations of nearbyint[f|l].
Siva Chandra Reddy [Sat, 2 Jan 2021 05:19:31 +0000 (21:19 -0800)]
[libc] Add implementations of nearbyint[f|l].

The implementation is exactly the same as rint* as even rint does not
raise any floating point exceptions currently. [Note that the standards
do not specify that floating point exceptions must be raised - they
leave it up to the implementation to choose to raise FE_INEXACT when
rounding non-integral values.]

Reviewed By: lntue

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

3 years ago[llvm] Use llvm::lower_bound and llvm::upper_bound (NFC)
Kazu Hirata [Wed, 6 Jan 2021 05:15:59 +0000 (21:15 -0800)]
[llvm] Use llvm::lower_bound and llvm::upper_bound (NFC)

3 years ago[MachineSink] Construct SmallVector with iterator ranges (NFC)
Kazu Hirata [Wed, 6 Jan 2021 05:15:57 +0000 (21:15 -0800)]
[MachineSink] Construct SmallVector with iterator ranges (NFC)

3 years ago[tools] Use llvm::append_range (NFC)
Kazu Hirata [Wed, 6 Jan 2021 05:15:56 +0000 (21:15 -0800)]
[tools] Use llvm::append_range (NFC)

3 years ago[GlobalISel] Base implementation for sret demotion.
Christudasan Devadasan [Wed, 23 Dec 2020 06:52:36 +0000 (12:22 +0530)]
[GlobalISel] Base implementation for sret demotion.

If the return values can't be lowered to registers
SelectionDAG performs the sret demotion. This patch
contains the basic implementation for the same in
the GlobalISel pipeline.

Furthermore, targets should bring relevant changes
during lowerFormalArguments, lowerReturn and
lowerCall to make use of this feature.

Reviewed By: arsenm

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

3 years ago[NFC] Removed unused prefixes in CodeGen/AMDGPU
Mircea Trofin [Wed, 6 Jan 2021 03:24:37 +0000 (19:24 -0800)]
[NFC] Removed unused prefixes in CodeGen/AMDGPU

This covers the tests starting with h-k.

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

3 years ago[-Wcalled-once-parameter][NFC] Fix operator precedence warning
Yang Fan [Wed, 6 Jan 2021 03:49:34 +0000 (11:49 +0800)]
[-Wcalled-once-parameter][NFC] Fix operator precedence warning

3 years agoscudo: Update a comment to match the Linux kernel behavior. NFCI.
Peter Collingbourne [Wed, 6 Jan 2021 03:48:10 +0000 (19:48 -0800)]
scudo: Update a comment to match the Linux kernel behavior. NFCI.

3 years agoELF: Teach the linker about the 'B' augmentation string character.
Peter Collingbourne [Thu, 31 Dec 2020 06:11:45 +0000 (22:11 -0800)]
ELF: Teach the linker about the 'B' augmentation string character.

This character indicates that when return pointer authentication is
being used, the function signs the return address using the B key.

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

3 years ago[NFC] Removed unused prefixes in test/CodeGen/AMDGPU
Mircea Trofin [Tue, 5 Jan 2021 22:37:29 +0000 (14:37 -0800)]
[NFC] Removed unused prefixes in test/CodeGen/AMDGPU

More patches to follow. This covers the pertinent tests starting with e,
f, and g.

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

3 years ago[mlir] Print the correct tool name in mlirTranslateMain
Andrew Young [Tue, 5 Jan 2021 21:38:29 +0000 (13:38 -0800)]
[mlir] Print the correct tool name in mlirTranslateMain

    The passed in tool name is not used, causing the wrong tool name to be printed by the help text.

Reviewed By: mehdi_amini

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

3 years ago[Constant] Add containsPoisonElement
Juneyoung Lee [Tue, 5 Jan 2021 01:09:49 +0000 (10:09 +0900)]
[Constant] Add containsPoisonElement

This patch

- Adds containsPoisonElement that checks existence of poison in constant vector elements,
- Renames containsUndefElement to containsUndefOrPoisonElement to clarify its behavior & updates its uses properly

With this patch, isGuaranteedNotToBeUndefOrPoison's tests w.r.t constant vectors are added because its analysis is improved.

Thanks!

Reviewed By: nikic

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

3 years ago[X86] Update X86InstCombineIntrinsic to use CreateShuffleVector with one vector
Juneyoung Lee [Tue, 5 Jan 2021 04:37:53 +0000 (13:37 +0900)]
[X86] Update X86InstCombineIntrinsic to use CreateShuffleVector with one vector

This patch updates X86InstCombineIntrinsic.cpp to use the newly updated CreateShuffleVector.

The tests are updated because the updated CreateShuffleVector uses poison value for the second vector.
If I didn't miss something, the masks in the tests are choosing elements from the first vector only; therefore the tests are having equivalent behavior.

Reviewed By: RKSimon

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

3 years ago[SLP,LV] Use poison constant vector for shufflevector/initial insertelement
Juneyoung Lee [Tue, 5 Jan 2021 05:11:50 +0000 (14:11 +0900)]
[SLP,LV] Use poison constant vector for shufflevector/initial insertelement

This patch makes SLP and LV emit operations with initial vectors set to poison constant instead of undef.
This is a part of efforts for using poison vector instead of undef to represent "doesn't care" vector.
The goal is to make nice shufflevector optimizations valid that is currently incorrect due to the tricky interaction between undef and poison (see https://bugs.llvm.org/show_bug.cgi?id=44185 ).

Reviewed By: fhahn

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

3 years ago[mlir] Fix MathJax rendering in Affine doc
lewuathe [Wed, 6 Jan 2021 01:59:45 +0000 (01:59 +0000)]
[mlir] Fix MathJax rendering in Affine doc

MathJax is not properly imported in Affine doc. It causes the invalid rendering
of math formulas in the Affine doc page.

https://mlir.llvm.org/docs/Dialects/Affine/#affine-expressions

Importing MathJax code from CDN resolved the rendering issue as follows.

{F14942131}

Reviewed By: ftynse

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

3 years ago[Sema] Fix deleted function problem in implicitly movable test
Yang Fan [Mon, 4 Jan 2021 09:36:58 +0000 (17:36 +0800)]
[Sema] Fix deleted function problem in implicitly movable test

In implicitly movable test, a two-stage overload resolution is performed.
If the first overload resolution selects a deleted function, Clang directly
performs the second overload resolution, without checking whether the
deleted function matches the additional criteria.

This patch fixes the above problem.

Reviewed By: Quuxplusone

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

3 years agoSuppress GCC Wdangling-else warning on gtest macros
Reid Kleckner [Wed, 6 Jan 2021 01:32:56 +0000 (17:32 -0800)]
Suppress GCC Wdangling-else warning on gtest macros

See https://github.com/google/googletest/issues/1119

3 years ago[sanitizer][Darwin] Suppress -Wno-non-virtual-dtor warning
Julian Lettner [Wed, 6 Jan 2021 00:09:46 +0000 (16:09 -0800)]
[sanitizer][Darwin] Suppress -Wno-non-virtual-dtor warning

Suppress the warning:
```
'fake_shared_weak_count' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
```

The warning has been recently enabled [1], but the associated cleanup
missed this instance in Darwin code [2].

[1] 9c31e12609e1935eb84a2497ac08a49e3139859a
[2] d48f2d7c02743571075bb7812bb4c9e634e51ed1

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

3 years agoMake DWARFUnit use the dwo_id from the DWARF5 CU header.
Jorge Gorbe Moya [Thu, 17 Dec 2020 05:35:16 +0000 (21:35 -0800)]
Make DWARFUnit use the dwo_id from the DWARF5 CU header.

In split DWARF v5 files, the DWO id is no longer in the DW_AT_GNU_dwo_id
attribute. It's in the CU header instead. This change makes lldb look in
both places.

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

3 years agoDebugInfo: Add support for always using ranges (rather than low/high pc) in DWARFv5
David Blaikie [Fri, 18 Dec 2020 04:51:20 +0000 (20:51 -0800)]
DebugInfo: Add support for always using ranges (rather than low/high pc) in DWARFv5

Given the ability provided by DWARFv5 rnglists to reuse addresses in the
address pool, it can be advantageous to object file size to use range
encodings even when the range could be described by a direct low/high
pc.

Add a flag to allow enabling this in DWARFv5 for the purpose of
experimentation/data gathering.

It might be that it makes sense to enable this functionality by default
for DWARFv5 + Split DWARF at least, where the tradeoff/desire to
optimize for .o file size is more explicit and .o bytes are higher
priority than .dwo bytes.

3 years agoReland D93848 "[sanitizer] Define SANITIZER_GLIBC to refine SANITIZER_LINUX feature...
Fangrui Song [Wed, 6 Jan 2021 00:18:43 +0000 (16:18 -0800)]
Reland D93848 "[sanitizer] Define SANITIZER_GLIBC to refine SANITIZER_LINUX feature detection and support musl""

Several `#if SANITIZER_LINUX && !SANITIZER_ANDROID` guards are replaced
with the more appropriate `#if SANITIZER_GLIBC` (the headers are glibc
extensions, not specific to Linux (i.e. if we ever support GNU/kFreeBSD
or Hurd, the guards may automatically work)).

Several `#if SANITIZER_LINUX && !SANITIZER_ANDROID` guards are refined
with `#if SANITIZER_GLIBC` (the definitions are available on Linux glibc,
but may not be available on other libc (e.g. musl) implementations).

This patch makes `ninja asan cfi msan stats tsan ubsan xray` build on a musl based Linux distribution (apk install musl-libintl)
Notes about disabled interceptors for musl:

* `SANITIZER_INTERCEPT_GLOB`: musl does not implement `GLOB_ALTDIRFUNC` (GNU extension)
* Some ioctl structs and functions operating on them.
* `SANITIZER_INTERCEPT___PRINTF_CHK`: `_FORTIFY_SOURCE` functions are GNU extension
* `SANITIZER_INTERCEPT___STRNDUP`: `dlsym(RTLD_NEXT, "__strndup")` errors so a diagnostic is formed. The diagnostic uses `write` which hasn't been intercepted => SIGSEGV
* `SANITIZER_INTERCEPT_*64`: the `_LARGEFILE64_SOURCE` functions are glibc specific. musl does something like `#define pread64 pread`
* Disabled `msg_iovlen msg_controllen cmsg_len` checks: musl is conforming while many implementations (Linux/FreeBSD/NetBSD/Solaris) are non-conforming. Since we pick the glibc definition, exclude the checks for musl (incompatible sizes but compatible offsets)

Pass through LIBCXX_HAS_MUSL_LIBC to make check-msan/check-tsan able to build libc++ (https://bugs.llvm.org/show_bug.cgi?id=48618).

Many sanitizer features are available now.

```
% ninja check-asan
(known issues:
* ASAN_OPTIONS=fast_unwind_on_malloc=0 odr-violations hangs
)
...
Testing Time: 53.69s
  Unsupported      : 185
  Passed           : 512
  Expectedly Failed:   1
  Failed           :  12

% ninja check-ubsan check-ubsan-minimal check-memprof # all passed

% ninja check-cfi
( all cross-dso/)
...
Testing Time: 8.68s
  Unsupported      : 264
  Passed           :  80
  Expectedly Failed:   8
  Failed           :  32

% ninja check-lsan
(With GetTls (D93972), 10 failures)
Testing Time: 4.09s
  Unsupported:  7
  Passed     : 65
  Failed     : 22

% ninja check-msan
(Many are due to functions not marked unsupported.)
Testing Time: 23.09s
  Unsupported      :   6
  Passed           : 764
  Expectedly Failed:   2
  Failed           :  58

% ninja check-tsan
Testing Time: 23.21s
  Unsupported      :  86
  Passed           : 295
  Expectedly Failed:   1
  Failed           :  25
```

Used `ASAN_OPTIONS=verbosity=2` to verify there is no unneeded interceptor.

Partly based on Jari Ronkainen's https://reviews.llvm.org/D63785#1921014

Reviewed By: vitalybuka

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

3 years ago[libomptarget] Allow calls to omp_target_memcpy with 0 size.
George Rokos [Wed, 6 Jan 2021 00:03:53 +0000 (16:03 -0800)]
[libomptarget] Allow calls to omp_target_memcpy with 0 size.

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

3 years ago[mlir] Fully specify removeAttr return type
Tres Popp [Tue, 5 Jan 2021 23:39:04 +0000 (00:39 +0100)]
[mlir] Fully specify removeAttr return type

This was added without full specification like other generated methods.
This then leads to other downstream dialects failing to compile the
generated code when they are not in the mlir namespace.

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

3 years agoAllow dependent alias template specializations in the preferred_name
Richard Smith [Tue, 5 Jan 2021 23:32:44 +0000 (15:32 -0800)]
Allow dependent alias template specializations in the preferred_name
attribute.

This was intended to work, but didn't match the checks because these
types are modeled as TemplateSpecializationTypes not TypedefTypes.

3 years ago[mlir][sparse] adjust output shape inference to new tensor abstraction
Aart Bik [Tue, 5 Jan 2021 21:29:28 +0000 (13:29 -0800)]
[mlir][sparse] adjust output shape inference to new tensor abstraction

Nicolas changed the tensor abstraction so that every output has
its own shape definition. This simplifies the "inference" that
was used in the sparse compiler.

Reviewed By: penpornk

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

3 years ago[SimplifyCFG] SimplifyEqualityComparisonWithOnlyPredecessor(): really don't delete...
Roman Lebedev [Tue, 5 Jan 2021 19:02:53 +0000 (22:02 +0300)]
[SimplifyCFG] SimplifyEqualityComparisonWithOnlyPredecessor(): really don't delete DomTree edges multiple times

3 years ago[NFC][SimplifyCFG] Add a test where SimplifyEqualityComparisonWithOnlyPredecessor...
Roman Lebedev [Tue, 5 Jan 2021 19:01:22 +0000 (22:01 +0300)]
[NFC][SimplifyCFG] Add a test where SimplifyEqualityComparisonWithOnlyPredecessor() deletes existing edge

3 years ago[SimplifyCFG] SwitchToLookupTable(): switch to non-permissive DomTree updates
Roman Lebedev [Tue, 5 Jan 2021 16:59:16 +0000 (19:59 +0300)]
[SimplifyCFG] SwitchToLookupTable(): switch to non-permissive DomTree updates

... which requires not deleting a DomTree edge that we just deleted.

3 years ago[NFC][SimplifyCFG] SwitchToLookupTable(): pull out SI->getParent() into a variable
Roman Lebedev [Tue, 5 Jan 2021 15:19:41 +0000 (18:19 +0300)]
[NFC][SimplifyCFG] SwitchToLookupTable(): pull out SI->getParent() into a variable

3 years ago[SimplifyCFG] FoldValueComparisonIntoPredecessors(): deal with each predecessor only...
Roman Lebedev [Tue, 5 Jan 2021 14:04:44 +0000 (17:04 +0300)]
[SimplifyCFG] FoldValueComparisonIntoPredecessors(): deal with each predecessor only once

If the predecessor is a switch, and BB is not the default destination,
multiple cases could have the same destination. and it doesn't
make sense to re-process the predecessor, because we won't make any changes,
once is enough.

I'm not sure this can be really tested, other than via the assertion
being added here, which fires without the fix.

3 years ago[SimplifyCFG] FoldValueComparisonIntoPredecessors(): switch to non-permissive DomTree...
Roman Lebedev [Tue, 5 Jan 2021 13:23:59 +0000 (16:23 +0300)]
[SimplifyCFG] FoldValueComparisonIntoPredecessors(): switch to non-permissive DomTree updates

... which requires not adding a DomTree edge that we just added.

3 years ago[SimplifyCFG] simplifyUnreachable(): fix handling of degenerate same-destination...
Roman Lebedev [Tue, 5 Jan 2021 11:49:54 +0000 (14:49 +0300)]
[SimplifyCFG] simplifyUnreachable(): fix handling of degenerate same-destination conditional branch

One would hope that it would have been already canonicalized into an
unconditional branch, but that isn't really guaranteed to happen
with SimplifyCFG's visitation order.

3 years ago[NFC][SimplifyCFG] Add a test with same-destination condidional branch
Roman Lebedev [Tue, 5 Jan 2021 11:57:07 +0000 (14:57 +0300)]
[NFC][SimplifyCFG] Add a test with same-destination condidional branch

Reported by Mikael Holmén as post-commit feedback on
https://reviews.llvm.org/rG2d07414ee5f74a09fb89723b4a9bb0818bdc2e18#968162

3 years ago[SimplifyCFG] simplifyUnreachable(): switch to non-permissive DomTree updates
Roman Lebedev [Tue, 5 Jan 2021 09:30:10 +0000 (12:30 +0300)]
[SimplifyCFG] simplifyUnreachable(): switch to non-permissive DomTree updates

... which requires not removing a DomTree edge if the switch's default
still points at that destination, because it can't be removed;
... and not processing the same predecessor more than once.

3 years agoAMDGPU: Annotate amdgpu.noclobber for global loads only
Changpeng Fang [Tue, 5 Jan 2021 22:47:19 +0000 (14:47 -0800)]
AMDGPU: Annotate amdgpu.noclobber for global loads only

Summary:
  This is to avoid unnecessary analysis since amdgpu.noclobber is only used for globals.

Reviewers:
  arsenm

Fixes:
   SWDEV-239161

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

3 years ago[SLP] reduce code for finding reduction costs; NFC
Sanjay Patel [Tue, 5 Jan 2021 22:23:24 +0000 (17:23 -0500)]
[SLP] reduce code for finding reduction costs; NFC

We can get both (vector/scalar) costs in a single switch
instead of sequentially.

3 years ago[NFC] Removed unused prefixes in test/CodeGen/AMDGPU
Mircea Trofin [Tue, 5 Jan 2021 22:15:20 +0000 (14:15 -0800)]
[NFC] Removed unused prefixes in test/CodeGen/AMDGPU

More patches to follow.

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

3 years ago[NFC] Removed unused prefixes in CodeGen/AMDGPU
Mircea Trofin [Tue, 5 Jan 2021 21:06:10 +0000 (13:06 -0800)]
[NFC] Removed unused prefixes in CodeGen/AMDGPU

This is part of the pertinent tests, more to follow in subsequent
patches.

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

3 years ago[ASTMatchers] Fix child traversal over range-for loops
Stephen Kelly [Sat, 26 Dec 2020 21:07:14 +0000 (21:07 +0000)]
[ASTMatchers] Fix child traversal over range-for loops

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

3 years ago[FuncAttrs] Infer noreturn
Arthur Eubanks [Wed, 30 Dec 2020 06:58:14 +0000 (22:58 -0800)]
[FuncAttrs] Infer noreturn

A function is noreturn if all blocks terminating with a ReturnInst
contain a call to a noreturn function. Skip looking at naked functions
since there may be asm that returns.

This can be further refined in the future by checking unreachable blocks
and taking into account recursion. It looks like the attributor pass
does this, but that is not yet enabled by default.

This seems to help with code size under the new PM since PruneEH does
not run under the new PM, missing opportunities to mark some functions
noreturn, which in turn doesn't allow simplifycfg to clean up dead code.
https://bugs.llvm.org/show_bug.cgi?id=46858.

Reviewed By: rnk

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

3 years agoscudo: Fix compilation for non-Linux aarch64
Roland McGrath [Tue, 5 Jan 2021 19:55:11 +0000 (11:55 -0800)]
scudo: Fix compilation for non-Linux aarch64

Linux-specific aarch64 code was deconditionalized in commit
dfa40840e0e2fa094c5d3f441affe0785cdc8d09.  This broke builds for
non-Linux aarch64 platforms.

Reviewed By: cryptoad

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

3 years ago[NFC] Removed unused prefixes in CodeGen/AMDGPU/GlobalISel
Mircea Trofin [Tue, 5 Jan 2021 17:46:19 +0000 (09:46 -0800)]
[NFC] Removed unused prefixes in CodeGen/AMDGPU/GlobalISel

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

3 years ago[android] Fix some tests for AOSP-master devices.
Mitch Phillips [Tue, 5 Jan 2021 20:12:45 +0000 (12:12 -0800)]
[android] Fix some tests for AOSP-master devices.

Some tests are broken at API level 30 on AOSP-master devices. When we
change the buildbuit to API level 30, the following tests get enabled.
They're currently broken due to various issues, and so fix up those
issues.

Reviewed By: oontvoo, eugenis

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

3 years ago[Coverage] Fix Profile test failures from commit rG9f2967bcfe2f
Alan Phipps [Tue, 5 Jan 2021 20:50:18 +0000 (14:50 -0600)]
[Coverage] Fix Profile test failures from commit rG9f2967bcfe2f

Fix test failures with Branch Coverage tests from commit rG9f2967bcfe2f
that failed build on builder clang-x64-windows-msvc while building llvm:
    http://lab.llvm.org:8011/#/builders/123/builds/2162

3 years ago[Inliner] Compute the full cost for the cost benefit analsysis
Kazu Hirata [Tue, 5 Jan 2021 20:48:49 +0000 (12:48 -0800)]
[Inliner] Compute the full cost for the cost benefit analsysis

This patch teaches the inliner to compute the full cost for a call
site where the newly introduced cost benefit analysis is enabled.

Note that the cost benefit analysis requires the full cost to be
computed.  However, without this patch or the -inline-cost-full
option, the early termination logic would kick in when the cost
exceeds the threshold, so we don't get to perform the cost benefit
analysis.  For this reason, we would need to specify four clang
options:

  -mllvm -inline-cost-full
  -mllvm -inline-enable-cost-benefit-analysis

This patch eliminates the need to specify -inline-cost-full.

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

3 years ago[DAGCombiner] Don't speculatively create an all ones constant in visitREM that might...
Craig Topper [Tue, 5 Jan 2021 20:40:38 +0000 (12:40 -0800)]
[DAGCombiner] Don't speculatively create an all ones constant in visitREM that might not be used.

This looks to have been done to save some duplicated code under
two different if statements, but it ends up being harmful to D94073.
This speculative constant can be called on a scalable vector type
with i64 element size when i64 scalars aren't legal. The code tries
and fails to find a vector type with i32 elements that it can use.

So only create the node when we know it will be used.

3 years ago[SLP] use reduction kind's opcode for cost model queries; NFC
Sanjay Patel [Tue, 5 Jan 2021 20:08:51 +0000 (15:08 -0500)]
[SLP] use reduction kind's opcode for cost model queries; NFC

This should be no-functional-change because the reduction kind
opcodes are 1-for-1 mappings to the instructions we are matching
as reductions. But we want to remove the need for the
`OperationData` opcode field because that does not work when
we start matching intrinsics (eg, maxnum) as reduction candidates.

3 years ago[SLP] reduce code duplication; NFC
Sanjay Patel [Tue, 5 Jan 2021 19:59:27 +0000 (14:59 -0500)]
[SLP] reduce code duplication; NFC

3 years ago[Hexagon] Silence unused function warning with gcc10, NFC
Krzysztof Parzyszek [Tue, 5 Jan 2021 20:10:56 +0000 (14:10 -0600)]
[Hexagon] Silence unused function warning with gcc10, NFC

3 years ago[LoopNest] Remove unused include.
Whitney Tsang [Tue, 5 Jan 2021 20:04:54 +0000 (20:04 +0000)]
[LoopNest] Remove unused include.

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

3 years ago[LoopDeletion] Allows deletion of possibly infinite side-effect free loops
Atmn Patel [Wed, 23 Dec 2020 02:54:21 +0000 (21:54 -0500)]
[LoopDeletion] Allows deletion of possibly infinite side-effect free loops

From C11 and C++11 onwards, a forward-progress requirement has been
introduced for both languages. In the case of C, loops with non-constant
conditionals that do not have any observable side-effects (as defined by
6.8.5p6) can be assumed by the implementation to terminate, and in the
case of C++, this assumption extends to all functions. The clang
frontend will emit the `mustprogress` function attribute for C++
functions (D86233, D85393, D86841) and emit the loop metadata
`llvm.loop.mustprogress` for every loop in C11 or later that has a
non-constant conditional.

This patch modifies LoopDeletion so that only loops with
the `llvm.loop.mustprogress` metadata or loops contained in functions
that are required to make progress (`mustprogress` or `willreturn`) are
checked for observable side-effects. If these loops do not have an
observable side-effect, then we delete them.

Loops without observable side-effects that do not satisfy the above
conditions will not be deleted.

Reviewed By: jdoerfert

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

3 years ago[RISCV] Move shift ComplexPatterns and custom isel to PatFrags with predicates
Craig Topper [Tue, 5 Jan 2021 19:16:50 +0000 (11:16 -0800)]
[RISCV] Move shift ComplexPatterns and custom isel to PatFrags with predicates

ComplexPatterns are kind of weird, they don't call any of the predicates on their operands. And their "complexity" used for tablegen ordering purposes in the matcher table is hand specified.

This started as an attempt to just use sext_inreg + SLOIPat to implement SLOIW just to have one less Select function. The matching for the or+shl is the same as long as you know the immediate is less than 32 for SLOIW. But that didn't work out because using uimm5 with SLOIPat didn't do anything if it was a ComplexPattern.

I realized I could just use a PatFrag with the opcodes I wanted to match and an immediate predicate would then evaluate correctly. This also computes the complexity just like any other pattern does. Then I just needed to check the constraints on the immediates in the predicate. Conveniently the predicate is evaluated after the fragment has been matched. So the structure has already been checked, we just need to find the constants.

I'll note that this is unusual, I didn't find any other targets looking through operands in PatFrag predicate. There is a PredicateCodeUsesOperands feature that can be used to collect the operands into an array that is used by AMDGPU/VOP3Instructions.td. I believe that feature exists to handle commuted matching, but since the nodes here use constants, they aren't ever commuted

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

3 years ago[Coverage] Fix test failures from commit rG9f2967bcfe2f
Alan Phipps [Tue, 5 Jan 2021 19:25:57 +0000 (13:25 -0600)]
[Coverage] Fix test failures from commit rG9f2967bcfe2f

Fix test failures with Branch Coverage tests from commit rG9f2967bcfe2f
that failed build on builder clang-x64-windows-msvc while building llvm:
    http://lab.llvm.org:8011/#builders/123/builds/2155

3 years ago[WebAssembly] Prototype prefetch instructions
Thomas Lively [Tue, 5 Jan 2021 19:32:03 +0000 (11:32 -0800)]
[WebAssembly] Prototype prefetch instructions

As proposed in https://github.com/WebAssembly/simd/pull/352 and using the
opcodes used in the V8 prototype:
https://chromium-review.googlesource.com/c/v8/v8/+/2543167. These instructions
are only usable via intrinsics and clang builtins to make them opt-in while they
are being benchmarked.

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

3 years ago[clang][cli] Specify correct integer width for -fbuild-session-timestamp
Jan Svoboda [Tue, 5 Jan 2021 18:45:31 +0000 (19:45 +0100)]
[clang][cli] Specify correct integer width for -fbuild-session-timestamp

This fixes an issue where large integer values were rejected as invalid.

Reviewed By: arphaman

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

3 years ago[NFC] Rename registerAliasAnalyses -> registerDefaultAliasAnalyses
Arthur Eubanks [Sun, 3 Jan 2021 02:54:51 +0000 (18:54 -0800)]
[NFC] Rename registerAliasAnalyses -> registerDefaultAliasAnalyses

To clarify that this only affects the "default" AA.

Reviewed By: ychen

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

3 years ago[RISCV] Don't parse 'vmsltu.vi v0, v1, 0' as 'vmsleu.vi v0, v1, -1'
Craig Topper [Tue, 5 Jan 2021 18:43:44 +0000 (10:43 -0800)]
[RISCV] Don't parse 'vmsltu.vi v0, v1, 0' as 'vmsleu.vi v0, v1, -1'

vmsltu.vi v0, v1, 0 is always false there is no unsigned number
less than 0. vmsleu.vi v0, v1, -1 on the other hand is always true
since -1 will be considered unsigned max and all numbers are <=
unsigned max.

A similar problem exists for vmsgeu.vi v0, v1, 0 which is always true,
but becomes vmsgtu.vi v0, v1, -1 which is always false.

To match the GNU assembler we'll emit vmsne.vv and vmseq.vv with
the same register for these cases instead.

I'm using AsmParserOnly pseudo instructions here because we can't
match an explicit immediate in an InstAlias. And we can't use a
AsmOperand for the zero because the output we want doesn't use an
immediate so there's nowhere to name the AsmOperand we want to use.

To keep the implementations similar I'm also handling signed with
pseudo instructions even though they don't have this issue. This
way we can avoid the special renderMethod that decremented by 1 so
the immediate we see for the pseudo instruction in processInstruction
is 0 and not -1. Another option might have been to have a different
simm5_plus1 operand for the unsigned case or just live with the
immediate being pre-decremented. I felt this way was clearer, but I'm
open to other opinions.

Reviewed By: frasercrmck

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

3 years ago[mlir] Gen removeAttr methods with tablegen
Felipe de Azevedo Piovezan [Tue, 5 Jan 2021 18:44:26 +0000 (18:44 +0000)]
[mlir] Gen removeAttr methods with tablegen

If an operation defines an optional attribute (OptionalAttr or
UnitAttr), transformations may wish to remove these attributes while
maintaining invariants established by the operation. Currently, the only
way to do this is by calling `Operation::removeAttr("attrName")`, which
requires developers to know the exact name of the attribute used by
table-gen. Furthermore, if the attribute name changes, this won't be
detected at compile time. Instead, `removeAttr` would return an empty
attribute and no errors would be raised, unless the caller checks for
the returned value.

This patch adds table gen support for generating `remove<AttrName>Attr`
methods for OptionalAttributes defined by operations.

Implementation choice: to preserve camelCase for the method's name, the
first character of an attribute called `myAttr` is changed to upper case
in order to preserve the coding style, so the final method would be
called `removeMyAttr`.

Reviewed By: mehdi_amini

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

3 years ago[LoopNest] Allow empty basic blocks without loops
Whitney Tsang [Tue, 5 Jan 2021 18:40:24 +0000 (18:40 +0000)]
[LoopNest] Allow empty basic blocks without loops

Addressed Florian's post commit review comments:
1. included STLExtras.h
2. changed std::all_of to llvm::all_of

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

3 years ago[NFC] Fix -Wrange-loop-analysis warnings.
Dan Zheng [Tue, 5 Jan 2021 18:15:26 +0000 (18:15 +0000)]
[NFC] Fix -Wrange-loop-analysis warnings.

Remove unnecessary `&` from loop variables.

Fix warnings: "loop variable is always a copy because the range does not
return a reference".

```
[240/2862] Building CXX object tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/TypeDefGen.cpp.o
llvm-project/mlir/tools/mlir-tblgen/TypeDefGen.cpp:50:25: warning: loop variable 'typeDef' is always a copy because the range of type 'llvm::iterator_range<llvm::mapped_iterator<std::__1::__wrap_iter<llvm::Record **>, (lambda at llvm-project/mlir/tools/mlir-tblgen/TypeDefGen.cpp:40:16), mlir::tblgen::TypeDef> >' does not return a reference [-Wrange-loop-analysis]
    for (const TypeDef &typeDef : defs)
                        ^
llvm-project/mlir/tools/mlir-tblgen/TypeDefGen.cpp:50:10: note: use non-reference type 'mlir::tblgen::TypeDef'
    for (const TypeDef &typeDef : defs)
         ^~~~~~~~~~~~~~~~~~~~~~~~
llvm-project/mlir/tools/mlir-tblgen/TypeDefGen.cpp:64:23: warning: loop variable 'typeDef' is always a copy because the range of type 'llvm::iterator_range<llvm::mapped_iterator<std::__1::__wrap_iter<llvm::Record **>, (lambda at llvm-project/mlir/tools/mlir-tblgen/TypeDefGen.cpp:40:16), mlir::tblgen::TypeDef> >' does not return a reference [-Wrange-loop-analysis]
  for (const TypeDef &typeDef : defs)
                      ^
llvm-project/mlir/tools/mlir-tblgen/TypeDefGen.cpp:64:8: note: use non-reference type 'mlir::tblgen::TypeDef'
  for (const TypeDef &typeDef : defs)
       ^~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.

[1934/2862] Building CXX object tools...Files/toyc-ch4.dir/mlir/MLIRGen.cpp.o
llvm-project/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp:139:22: warning: loop variable 'name_value' is always a copy because the range of type 'detail::zippy<detail::zip_shortest, ArrayRef<unique_ptr<VariableExprAST, default_delete<VariableExprAST> > > &, MutableArrayRef<BlockArgument> >' does not return a reference [-Wrange-loop-analysis]
    for (const auto &name_value :
                     ^
llvm-project/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp:139:10: note: use non-reference type 'std::__1::tuple<const std::__1::unique_ptr<toy::VariableExprAST, std::__1::default_delete<toy::VariableExprAST> > &, mlir::BlockArgument &>'
    for (const auto &name_value :
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

[1940/2862] Building CXX object tools...Files/toyc-ch5.dir/mlir/MLIRGen.cpp.o
llvm-project/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp:139:22: warning: loop variable 'name_value' is always a copy because the range of type 'detail::zippy<detail::zip_shortest, ArrayRef<unique_ptr<VariableExprAST, default_delete<VariableExprAST> > > &, MutableArrayRef<BlockArgument> >' does not return a reference [-Wrange-loop-analysis]
    for (const auto &name_value :
                     ^
llvm-project/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp:139:10: note: use non-reference type 'std::__1::tuple<const std::__1::unique_ptr<toy::VariableExprAST, std::__1::default_delete<toy::VariableExprAST> > &, mlir::BlockArgument &>'
    for (const auto &name_value :
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
```

Reviewed By: jpienaar

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

3 years ago[RISCV] Don't print zext.b alias.
Craig Topper [Tue, 5 Jan 2021 18:23:04 +0000 (10:23 -0800)]
[RISCV] Don't print zext.b alias.

This alias for andi x, 255 was recently added to the spec. If we
print it, code we output can't be compiled with -fno-integrated-as
unless the GNU assembler is also a version that supports alias.

Reviewed By: lenary

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

3 years ago[SLP] delete unused pairwise reduction option
Sanjay Patel [Tue, 5 Jan 2021 18:21:49 +0000 (13:21 -0500)]
[SLP] delete unused pairwise reduction option

SLP tries to model 2 forms of vector reductions: pairwise and splitting.
From the cost model code comments, those are defined using an example as:

  /// Pairwise:
  ///  (v0, v1, v2, v3)
  ///  ((v0+v1), (v2+v3), undef, undef)
  /// Split:
  ///  (v0, v1, v2, v3)
  ///  ((v0+v2), (v1+v3), undef, undef)

I don't know the full history of this functionality, but it was partly
added back in D29402. There are apparently no users at this point (no
regression tests change). X86 might have managed to work-around the need
for this through cost model and codegen improvements.

Removing this code makes it easier to continue the work that was started
in D87416 / D88193. The alternative -- if there is some target that is
silently using this option -- is to move this logic into LoopUtils. We
have related/duplicate functionality there via llvm::createTargetReduction().

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

3 years ago[RISCV] Match vmslt(u).vx intrinsics with a small immediate to vmsle(u).vx.
Craig Topper [Tue, 5 Jan 2021 18:00:14 +0000 (10:00 -0800)]
[RISCV] Match vmslt(u).vx intrinsics with a small immediate to vmsle(u).vx.

There are vmsle(u).vx and vmsle(u).vi instructions, but there is
only vmslt(u).vx and no vmslt(u).vi. vmslt(u).vi can be emulated
for some immediates by decrementing the immediate and using vmsle(u).vi.

To avoid the user needing to know about this, this patch does this
conversion.

The assembler does the same thing for vmslt(u).vi and vmsge(u).vi
pseudoinstructions. There is no vmsge(u).vx intrinsic or
instruction so this patch is limited to vmslt(u).

Reviewed By: frasercrmck

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

3 years ago[llvm-link] fix linker behavior when linking archives with --only-needed option
Sergey Dmitriev [Tue, 5 Jan 2021 17:46:55 +0000 (09:46 -0800)]
[llvm-link] fix linker behavior when linking archives with --only-needed option

This patch fixes linker behavior when archive is linked with other inputs
as a library (i.e. when --only-needed option is specified). In this case library
is expected to be normally linked first into a separate module and only after
that linker should import required symbols from the linked library module.

Reviewed By: tra

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

3 years agoGlobalISel: Add isKnownToBeAPowerOfTwo helper function
Matt Arsenault [Tue, 3 Nov 2020 00:08:00 +0000 (19:08 -0500)]
GlobalISel: Add isKnownToBeAPowerOfTwo helper function

3 years ago[libTooling] Add support for smart pointers to relevant Transformer `Stencil`s.
Yitzhak Mandelbaum [Mon, 21 Dec 2020 14:49:17 +0000 (14:49 +0000)]
[libTooling] Add support for smart pointers to relevant Transformer `Stencil`s.

Stencils `maybeDeref` and `maybeAddressOf` are designed to handle nodes that may
be pointers. Currently, they only handle native pointers. This patch extends the
support to recognize smart pointers and handle them as well.

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

3 years ago[lldb] Add timers to Reproducer::Keep and Reproducer::Discard
Jonas Devlieghere [Thu, 24 Dec 2020 00:18:54 +0000 (16:18 -0800)]
[lldb] Add timers to Reproducer::Keep and Reproducer::Discard

3 years ago[mlir][Linalg] Add a test case that consumer has "reduction" loops.
Hanhan Wang [Tue, 5 Jan 2021 17:43:53 +0000 (09:43 -0800)]
[mlir][Linalg] Add a test case that consumer has "reduction" loops.

In the past, this was a missing test case and the fusion was not supported. It's
supported after the revisit of init_tensor in Linalg.

Reviewed By: nicolasvasilache

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

3 years ago[ASTMatchers] Omit methods from explicit template instantations
Stephen Kelly [Mon, 28 Dec 2020 01:10:20 +0000 (01:10 +0000)]
[ASTMatchers] Omit methods from explicit template instantations

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

3 years ago[ARM][AArch64] Some extra test to show anyextend lowering. NFC
David Green [Tue, 5 Jan 2021 17:34:23 +0000 (17:34 +0000)]
[ARM][AArch64] Some extra test to show anyextend lowering. NFC

3 years agoCGExpr - EmitMatrixSubscriptExpr - fix getAs<> null-dereference static analyzer warni...
Simon Pilgrim [Tue, 5 Jan 2021 16:59:23 +0000 (16:59 +0000)]
CGExpr - EmitMatrixSubscriptExpr - fix getAs<> null-dereference static analyzer warning. NFCI.

getAs<> can return null if the cast is invalid, which can lead to null pointer deferences. Use castAs<> instead which will assert that the cast is valid.

3 years ago[AMDGPU] Remove deprecated V_MUL_LO_I32 from GFX10
Joe Nash [Mon, 4 Jan 2021 18:37:37 +0000 (13:37 -0500)]
[AMDGPU] Remove deprecated V_MUL_LO_I32 from GFX10

It was removed in GFX10 GPUs, but LLVM could
generate it.

Reviewed By: rampitec, arsenm

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

Change-Id: Id1c716d71313edcfb768b2b175a6789ef9b01f3c

3 years ago[clang-tidy] Update uses of deprecated Transformer APIs in StringFindStrContainsCheck.
Yitzhak Mandelbaum [Tue, 22 Dec 2020 14:01:28 +0000 (14:01 +0000)]
[clang-tidy] Update uses of deprecated Transformer APIs in StringFindStrContainsCheck.

Migrates `change` to `changeTo`; changes to new constructor API (2-arg construct
+ `setRule`); refactors use of `addInclude` to newer version.

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

3 years ago[mlir] Remove LLVMType, LLVM dialect types now derive Type directly
Alex Zinenko [Tue, 5 Jan 2021 15:22:53 +0000 (16:22 +0100)]
[mlir] Remove LLVMType, LLVM dialect types now derive Type directly

BEGIN_PUBLIC
[mlir] Remove LLVMType, LLVM dialect types now derive Type directly

This class has become a simple `isa` hook with no proper functionality.
Removing will allow us to eventually make the LLVM dialect type infrastructure
open, i.e., support non-LLVM types inside container types, which itself will
make the type conversion more progressive.

Introduce a call `LLVM::isCompatibleType` to be used instead of
`isa<LLVMType>`. For now, this is strictly equivalent.
END_PUBLIC

Depends On D93681

Reviewed By: mehdi_amini

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

3 years ago[RegisterClassInfo] Return non-zero for RC without allocatable reg
Jinsong Ji [Tue, 5 Jan 2021 15:37:16 +0000 (15:37 +0000)]
[RegisterClassInfo] Return non-zero for RC without allocatable reg

In some case, the RC may have 0 allocatable reg.
eg: VRSAVERC in PowerPC, which has only 1 reg, but it is also reserved.

The curreent implementation will keep calling the computePSetLimit because
getRegPressureSetLimit assume computePSetLimit will return a non-zero value.

The fix simply early return the value from TableGen for such special case.

Reviewed By: RKSimon

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

3 years ago[Clang] Add AArch64 VCMLA LANE variants.
Florian Hahn [Tue, 5 Jan 2021 15:53:40 +0000 (15:53 +0000)]
[Clang] Add AArch64 VCMLA LANE variants.

This patch adds the LANE variants for VCMLA on AArch64 as defined in
"Arm Neon Intrinsics Reference for ACLE Q3 2020" [1]

This patch also updates `dup_typed` to accept constant type strings directly.

Based on a patch by Tim Northover.

[1] https://developer.arm.com/documentation/ihi0073/latest

Reviewed By: SjoerdMeijer

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

3 years ago[Coverage] Add support for Branch Coverage in LLVM Source-Based Code Coverage
Alan Phipps [Mon, 28 Dec 2020 17:20:48 +0000 (11:20 -0600)]
[Coverage] Add support for Branch Coverage in LLVM Source-Based Code Coverage

This is an enhancement to LLVM Source-Based Code Coverage in clang to track how
many times individual branch-generating conditions are taken (evaluate to TRUE)
and not taken (evaluate to FALSE).  Individual conditions may comprise larger
boolean expressions using boolean logical operators.  This functionality is
very similar to what is supported by GCOV except that it is very closely
anchored to the ASTs.

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

3 years ago[clang-tidy] Add extra tests
Stephen Kelly [Tue, 29 Dec 2020 23:14:32 +0000 (23:14 +0000)]
[clang-tidy] Add extra tests

By default, check_clang_tidy runs tests in c++11-or-later mode.

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

3 years ago[gn build] Port fec1a442e3b
LLVM GN Syncbot [Tue, 5 Jan 2021 15:34:25 +0000 (15:34 +0000)]
[gn build] Port fec1a442e3b

3 years ago[AArch64][SVE] Add optimization to remove redundant ptest instructions
Bradley Smith [Mon, 14 Dec 2020 15:31:50 +0000 (15:31 +0000)]
[AArch64][SVE] Add optimization to remove redundant ptest instructions

Co-Authored-by: Graham Hunter <graham.hunter@arm.com>
Co-Authored-by: Paul Walker <paul.walker@arm.com>
Differential Revision: https://reviews.llvm.org/D93292