platform/upstream/llvm.git
3 years ago[flang] (NFC) Break up flang/runtime/reduction.cpp
peter klausler [Thu, 22 Apr 2021 21:23:45 +0000 (14:23 -0700)]
[flang] (NFC) Break up flang/runtime/reduction.cpp

The single source file reduction.cpp is a little large in
terms of both source lines and generated text bytes, so
split SUM, PRODUCT, FINDLOC, and MAXLOC/MAXVAL/MINLOC/MINVAL
off into their own C++ source files that share a set of
implementation function templates now in a common header.

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

3 years ago[RISCV] Fix crash with fptosi.sat/fptoui.sat intrinsics on RV64. Add test cases.
Craig Topper [Thu, 22 Apr 2021 22:10:47 +0000 (15:10 -0700)]
[RISCV] Fix crash with fptosi.sat/fptoui.sat intrinsics on RV64. Add test cases.

Add PromoteIntOp_FP_TO_XINT_SAT to type legalize the bit width
operand from i32 to i64 for RV64.

Add test cases for the saturating intrinsics for half/float/double
and i32/i64. CodeGen is definitely not optimal. We can probably
make use of the native behavior of fcvt instructions in many cases.

Fixes PR50083

3 years ago[Hexagon] Improve lowering of returns of i1
Krzysztof Parzyszek [Thu, 22 Apr 2021 21:18:39 +0000 (16:18 -0500)]
[Hexagon] Improve lowering of returns of i1

Emit explicit any-extend to avoid weird tstbit sequences.

3 years ago[AST] Enable AST node introspection on Apple
Stephen Kelly [Thu, 22 Apr 2021 21:19:21 +0000 (22:19 +0100)]
[AST] Enable AST node introspection on Apple

This was previously excluded due to possible buildbot failures.

3 years ago[dfsan] Fix Len argument type in call to __dfsan_mem_transfer_callback
Elia Geretto [Thu, 22 Apr 2021 21:05:13 +0000 (21:05 +0000)]
[dfsan] Fix Len argument type in call to __dfsan_mem_transfer_callback

This patch is supposed to solve: https://bugs.llvm.org/show_bug.cgi?id=50075

The function `__dfsan_mem_transfer_callback` takes a `Len` argument of type `i64`; however, when processing a `MemTransferInst` such as `llvm.memcpy.p0i8.p0i8.i32`, the `len` argument has type `i32`. In order to make the type of `len` compatible with the one of the callback argument, this change zero-extends it when necessary.

Reviewed By: stephan.yichao.zhao, gbalats

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

3 years agoRevert "Re-land "[Driver] Support default libc++ library location on Darwin""
Petr Hosek [Thu, 22 Apr 2021 21:02:46 +0000 (14:02 -0700)]
Revert "Re-land "[Driver] Support default libc++ library location on Darwin""

This reverts commit 6331680ad2ad000fdaf7e72f3c1880c7908ffa25 because
this breaks the compiler-rt build.

3 years ago[GVN] Generate LE and BE check lines (NFC)
Nikita Popov [Thu, 22 Apr 2021 20:44:08 +0000 (22:44 +0200)]
[GVN] Generate LE and BE check lines (NFC)

I accidentally dropped some check lines in my previous commit.
Apparently update_test_checks no longer warns on label conflicts???

3 years ago[GVN] Regenerate test checks (NFC)
Nikita Popov [Thu, 22 Apr 2021 20:38:18 +0000 (22:38 +0200)]
[GVN] Regenerate test checks (NFC)

3 years ago[Hexagon] Use 'vnot' instead of 'not' in patterns with vectors
Krzysztof Parzyszek [Thu, 22 Apr 2021 19:59:30 +0000 (14:59 -0500)]
[Hexagon] Use 'vnot' instead of 'not' in patterns with vectors

'not' expands to checking for an xor with a -1 constant. Since
this looks for a ConstantSDNode it will never match for a vector.

Co-authored-by: Craig Topper <craig.topper@sifive.com>
Differential Revision: https://reviews.llvm.org/D100687

3 years agolldb/Instrumentation: NFC-ish use GetFrameCodeAddressForSymbolication()
Fred Riss [Thu, 22 Apr 2021 18:02:45 +0000 (11:02 -0700)]
lldb/Instrumentation: NFC-ish use GetFrameCodeAddressForSymbolication()

A couple of our Instrumentation runtimes were gathering backtraces,
storing it in a StructuredData array and later creating a HistoryThread
using this data. By deafult HistoryThread will consider the history PCs
as return addresses and thus will substract 1 from them to go to the
call address.

This is usually correct, but it's also wasteful as when we gather the
backtraces ourselves, we have much better information to decide how
to backtrace and symbolicate. This patch uses the new
GetFrameCodeAddressForSymbolication() to gather the PCs that should
be used for symbolication and configures the HistoryThread to just
use those PCs as-is.

(The MTC plugin was actaully applying a -1 itself and then the
HistoryThread would do it again, so this actaully fixes a bug there.)

rdar://77027680

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

3 years ago[trace][intel-pt] Fix a crash on unconsumed Expected's Error
Jan Kratochvil [Thu, 22 Apr 2021 20:24:05 +0000 (22:24 +0200)]
[trace][intel-pt] Fix a crash on unconsumed Expected's Error

Reproducible with build using libipt and -DLLVM_ENABLE_ASSERTIONS=ON:
(lldb) b main
(lldb) r
(lldb) process trace start

3 years ago[GlobalOpt] Don't replace alias with aliasee if aliasee is interposable
Arthur Eubanks [Tue, 20 Apr 2021 18:02:57 +0000 (11:02 -0700)]
[GlobalOpt] Don't replace alias with aliasee if aliasee is interposable

Both the alias and aliasee linkage are important.

PR27866 provides some background.

Reviewed By: rnk

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

3 years ago[AArch64] Improve vector reverse lowering
David Green [Thu, 22 Apr 2021 20:01:25 +0000 (21:01 +0100)]
[AArch64] Improve vector reverse lowering

This improves the lowering of v8i16 and v16i8 vector reverse shuffles.
Instead of going via a generic tbl it uses a rev64; ext pair, as already
happens for v4i32.

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

3 years ago[M68k][Disassembler][NFC] Decorate dump methods with LLVM_DUMP_METHOD
Min-Yih Hsu [Thu, 22 Apr 2021 19:00:30 +0000 (12:00 -0700)]
[M68k][Disassembler][NFC] Decorate dump methods with LLVM_DUMP_METHOD

And guard them with proper macro conditions. NFC.

3 years agoSkip unreliable LLDB tests when running under asan
Adrian Prantl [Thu, 22 Apr 2021 18:55:08 +0000 (11:55 -0700)]
Skip unreliable LLDB tests when running under asan

3 years ago[M68k][AsmParser][NFC] Remove redundant default cases
Min-Yih Hsu [Thu, 22 Apr 2021 18:49:08 +0000 (11:49 -0700)]
[M68k][AsmParser][NFC] Remove redundant default cases

Remove redundant default cases since all enumeration values have
been covered (-Wcovered-switch-default). NFC.

3 years agoRevert "[AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs installed"
Jon Chesterfield [Thu, 22 Apr 2021 18:38:17 +0000 (19:38 +0100)]
Revert "[AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs installed"

This reverts commit 722d4d8e7585457d407d0639a4ae2610157e06a8.

Unclear where hsa.h should be included from, see report in D99949

3 years ago[lldb] Include thread name in crashlog.py output
Jonas Devlieghere [Thu, 22 Apr 2021 18:34:47 +0000 (11:34 -0700)]
[lldb] Include thread name in crashlog.py output

Update the JSON parser to include the thread name in the Thread object.

rdar://76677320

3 years agoAdd support of the next Ubuntu (Ubuntu 21.10 - Impish Idri)
Sylvestre Ledru [Thu, 22 Apr 2021 18:37:04 +0000 (20:37 +0200)]
Add support of the next Ubuntu (Ubuntu 21.10 - Impish Idri)

3 years ago[Diagnostics] Restore -Wdeprecated warning when user-declared copy assignment operato...
Dávid Bolvanský [Thu, 22 Apr 2021 18:35:29 +0000 (20:35 +0200)]
[Diagnostics] Restore -Wdeprecated warning when user-declared copy assignment operator is defined as deleted (PR45634)

Solves https://bugs.llvm.org/show_bug.cgi?id=45634
Be more agressive than GCC with -Wdeprecated-copy. Also provide -W(no-)deprecated-copy-user-provided-copy/dtor options to on/off this behaviour.

Reviewed By: Quuxplusone

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

3 years agoCoverage: Document how to collect a profile without a filesystem
Duncan P. N. Exon Smith [Wed, 21 Apr 2021 22:00:51 +0000 (15:00 -0700)]
Coverage: Document how to collect a profile without a filesystem

The profiling runtime was designed to work without static initializers
or a a filesystem (see 117cf2bd1ff585f9754b5f30f5a4cfd65b230bbf and
others). The no-static-initializers part was already documented but this
part got missed before.

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

3 years agoFix the triple used in llvm-mca.
Kai Nacke [Wed, 21 Apr 2021 15:23:13 +0000 (11:23 -0400)]
Fix the triple used in llvm-mca.

lookupTarget() can update the passed triple argument. This happens
when no triple is given on the command line, and the architecture
argument does not match the architecture in the default triple.

For example, passing -march=aarch64 on the command line, and the
default triple being x86_64-windows-msvc, the triple is changed
to aarch64-windows-msvc.

However, this triple is not saved, and later in the code, the
triple is constructed again from the triple name, which is the
default triple at this point. Thus the default triple is passed
to constructor of MCSubtargetInfo instance.

The triple is only used determine the object file format, and by
chance, the AArch64 target also uses the COFF file format, and
all is fine. Obviously, the AArch64 target does not support all
available binary file formats, e.g. XCOFF and GOFF, and llvm-mca
crashes in this case.

The fix is to update the triple name with the changed triple
name for the target lookup. Then the default object file format
for the architecture is used, in the example ELF.

Reviewed By: andreadb, abhina.sreeskantharajan

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

3 years ago[flang] (NFC) Document Fortran feature history
peter klausler [Thu, 22 Apr 2021 16:46:26 +0000 (09:46 -0700)]
[flang] (NFC) Document Fortran feature history

Add flang/docs/FortranFeatureHistory.md

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

3 years agoscudo: Use a table to look up the LSB for computing the odd/even mask. NFCI.
Peter Collingbourne [Thu, 22 Apr 2021 04:03:45 +0000 (21:03 -0700)]
scudo: Use a table to look up the LSB for computing the odd/even mask. NFCI.

In the most common case we call computeOddEvenMaskForPointerMaybe()
from quarantineOrDeallocateChunk(), in which case we need to look up
the class size from the SizeClassMap in order to compute the LSB. Since
we need to do a lookup anyway, we may as well look up the LSB itself
and avoid computing it every time.

While here, switch to a slightly more efficient way of computing the
odd/even mask.

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

3 years agoRevert "[sanitizer] Use COMPILER_RT_EMULATOR with gtests"
Vitaly Buka [Thu, 22 Apr 2021 18:15:23 +0000 (11:15 -0700)]
Revert "[sanitizer] Use COMPILER_RT_EMULATOR with gtests"

Missed review comments.

This reverts commit e25082961cb5aaafc817cb55593cf0ea8d3c4c22.

3 years ago[SCEV] Compute ranges for lshr recurrences
Philip Reames [Thu, 22 Apr 2021 18:05:19 +0000 (11:05 -0700)]
[SCEV] Compute ranges for lshr recurrences

Straight forward extension to the recently added infrastructure which was pioneered with shl.

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

3 years ago[Driver] Specify -ccc-install-dir for linux-cross test
Petr Hosek [Thu, 22 Apr 2021 07:08:36 +0000 (00:08 -0700)]
[Driver] Specify -ccc-install-dir for linux-cross test

This avoids test failures where extra files exist in the tree, such
as the standard library built using the runtimes build.

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

3 years agoRevert "[instcombine] Exploit UB implied by nofree attributes"
Philip Reames [Thu, 22 Apr 2021 17:47:41 +0000 (10:47 -0700)]
Revert "[instcombine] Exploit UB implied by nofree attributes"

This change effectively reverts 86664638, but since there have been some changes on top and I wanted to leave the tests in, it's not a mechanical revert.

Why revert this now?  Two main reasons:
1) There are continuing discussion around what the semantics of nofree.  I am getting increasing uncomfortable with the seeming possibility we might redefine nofree in a way incompatible with these changes.
2) There was a reported miscompile triggered by this change (https://github.com/emscripten-core/emscripten/issues/9443).  At first, I was making good progress on tracking down the issues exposed and those issues appeared to be unrelated latent bugs.  Now that we've found at least one bug in the original change, and the investigation has stalled, I'm no longer comfortable leaving this in tree.  In retrospect, I probably should have reverted this earlier and investigated the issues once the triggering change was out of tree.

3 years ago[RISCV] Add IR intrinsics for vmsge(u).vv/vx/vi.
Craig Topper [Thu, 22 Apr 2021 17:29:36 +0000 (10:29 -0700)]
[RISCV] Add IR intrinsics for vmsge(u).vv/vx/vi.

These instructions don't really exist, but we have ways we can
emulate them.

.vv will swap operands and use vmsle().vv. .vi will adjust the
immediate and use .vmsgt(u).vi when possible. For .vx we need to
use some of the multiple instruction sequences from the V extension
spec.

For unmasked vmsge(u).vx we use:
  vmslt{u}.vx vd, va, x; vmnand.mm vd, vd, vd

For cases where mask and maskedoff are the same value then we have
vmsge{u}.vx v0, va, x, v0.t which is the vd==v0 case that
requires a temporary so we use:
  vmslt{u}.vx vt, va, x; vmandnot.mm vd, vd, vt

For other masked cases we use this sequence:
  vmslt{u}.vx vd, va, x, v0.t; vmxor.mm vd, vd, v0
We trust that register allocation will prevent vd in vmslt{u}.vx
from being v0 since v0 is still needed by the vmxor.

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

3 years ago[RISCV] Add missing tests for vector type for second operand of vmsgt and vmsgtu...
Craig Topper [Thu, 22 Apr 2021 17:18:33 +0000 (10:18 -0700)]
[RISCV] Add missing tests for vector type for second operand of vmsgt and vmsgtu IR intrinsics.

Refactor to use new multiclass instead of individual patterns.

We already supported this due to SEW=64 on RV32, but we didn't have
test cases for all the types we supported.

Part of D100925

3 years ago[RISCV] Support vector type for second operand of vmfge and vmfgt IR intrinsics.
Craig Topper [Thu, 22 Apr 2021 17:07:23 +0000 (10:07 -0700)]
[RISCV] Support vector type for second operand of vmfge and vmfgt IR intrinsics.

We don't have instructions for these, but can swap the operands
to use vmle/vmflt. This makes the IR interface more consistent and
simplifies the frontend implementation.

Part of D100925

3 years ago[NFC] Remove reference to file deleted by D100981.
Vitaly Buka [Thu, 22 Apr 2021 17:39:04 +0000 (10:39 -0700)]
[NFC] Remove reference to file deleted by D100981.

3 years ago[scudo] Check if MADV_DONTNEED zeroes memory
Vitaly Buka [Thu, 22 Apr 2021 08:45:36 +0000 (01:45 -0700)]
[scudo] Check if MADV_DONTNEED zeroes memory

QEMU just ignores MADV_DONTNEED
https://github.com/qemu/qemu/blob/b1cffefa1b163bce9aebc3416f562c1d3886eeaa/linux-user/syscall.c#L11941

Depends on D100998.

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

3 years ago[sanitizer] Use COMPILER_RT_EMULATOR with gtests
Vitaly Buka [Tue, 20 Apr 2021 20:14:03 +0000 (13:14 -0700)]
[sanitizer] Use COMPILER_RT_EMULATOR with gtests

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

3 years ago[flang] Update recently added OpenMP tests to use the new driver
Andrzej Warzynski [Thu, 22 Apr 2021 16:17:26 +0000 (16:17 +0000)]
[flang] Update recently added OpenMP tests to use the new driver

Switching from `%f18` to `%flang_fc1` in LIT tests added in
https://reviews.llvm.org/D91159. This way these tests are run with the
new driver, `flang-new`, when enabled (i.e. when
`FLANG_BUILD_NEW_DRIVER` is set).

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

3 years agoTemporarily revert the code part of D100981 "Delete le32/le64 targets"
Fangrui Song [Thu, 22 Apr 2021 17:18:44 +0000 (10:18 -0700)]
Temporarily revert the code part of D100981 "Delete le32/le64 targets"

This partially reverts commit 77ac823fd285973cfb3517932c09d82e6a32f46d.

Halide uses le32/le64 (https://github.com/halide/Halide/pull/5934).
Temporarily brings back the code part to give them some time for migration.

3 years ago[lsan] Temporarily disable new check broken on arm7
Vitaly Buka [Thu, 22 Apr 2021 16:57:58 +0000 (09:57 -0700)]
[lsan] Temporarily disable new check broken on arm7

3 years ago[RISCV] Turn splat shuffles of vector loads into strided load with stride of x0.
Craig Topper [Thu, 22 Apr 2021 16:50:52 +0000 (09:50 -0700)]
[RISCV] Turn splat shuffles of vector loads into strided load with stride of x0.

Implementations are allowed to optimize an x0 stride to perform
less memory accesses. This is the case in SiFive cores.

No idea if this is the case in other implementations. We might
need a tuning flag for this.

Reviewed By: frasercrmck, arcbbb

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

3 years ago[lldb] Fix that the expression commands --top-level flag overwrites --allow-jit false
Raphael Isemann [Thu, 22 Apr 2021 16:44:58 +0000 (18:44 +0200)]
[lldb] Fix that the expression commands --top-level flag overwrites --allow-jit false

The `--allow-jit` flag allows the user to force the IR interpreter to run the
provided expression.

The `--top-level` flag parses and injects the code as if its in the top level
scope of a source file.

Both flags just change the ExecutionPolicy of the expression:
* `--allow-jit true` -> doesn't change anything (its the default)
* `--allow-jit false` -> ExecutionPolicyNever
* `--top-level` -> ExecutionPolicyTopLevel

Passing `--allow-jit false` and `--top-level` currently causes the `--top-level`
to silently overwrite the ExecutionPolicy value that was set by `--allow-jit
false`. There isn't any ExecutionPolicy value that says "top-level but only
interpret", so I would say we reject this combination of flags until someone
finds time to refactor top-level feature out of the ExecutionPolicy enum.

The SBExpressionOptions suffer from a similar symptom as `SetTopLevel` and
`SetAllowJIT` just silently disable each other. But those functions don't have
any error handling, so not a lot we can do about this in the meantime.

Reviewed By: labath, kastiglione

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

3 years ago[RISCV] Use stack temporary to splat two GPRs into SEW=64 vector on RV32.
Craig Topper [Thu, 22 Apr 2021 16:33:24 +0000 (09:33 -0700)]
[RISCV] Use stack temporary to splat two GPRs into SEW=64 vector on RV32.

Rather than doing splatting each separately and doing bit manipulation
to merge them in the vector domain, copy the data to the stack
and splat it using a strided load with x0 stride. At least on
some implementations this vector load is optimized to not do
a load for each element.

This is equivalent to how we move i64 to f64 on RV32.

I've only implemented this for the intrinsic fallbacks in this
patch. I think we do similar splatting/shifting/oring in other
places. If this is approved, I'll refactor the others to share
the code.

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

3 years ago[Hexagon] Add HVX intrinsics for conditional vector loads/stores
Krzysztof Parzyszek [Thu, 22 Apr 2021 14:05:05 +0000 (09:05 -0500)]
[Hexagon] Add HVX intrinsics for conditional vector loads/stores

Intrinsics for the following instructions are added. The intrinsic
name is "int_hexagon_<inst>[_128B]", e.g.
  int_hexagon_V6_vL32b_pred_ai        for 64-byte version
  int_hexagon_V6_vL32b_pred_ai_128B   for 128-byte version

V6_vL32b_pred_ai        if (Pv4) Vd32 = vmem(Rt32+#s4)
V6_vL32b_pred_pi        if (Pv4) Vd32 = vmem(Rx32++#s3)
V6_vL32b_pred_ppu       if (Pv4) Vd32 = vmem(Rx32++Mu2)
V6_vL32b_npred_ai       if (!Pv4) Vd32 = vmem(Rt32+#s4)
V6_vL32b_npred_pi       if (!Pv4) Vd32 = vmem(Rx32++#s3)
V6_vL32b_npred_ppu      if (!Pv4) Vd32 = vmem(Rx32++Mu2)

V6_vL32b_nt_pred_ai     if (Pv4) Vd32 = vmem(Rt32+#s4):nt
V6_vL32b_nt_pred_pi     if (Pv4) Vd32 = vmem(Rx32++#s3):nt
V6_vL32b_nt_pred_ppu    if (Pv4) Vd32 = vmem(Rx32++Mu2):nt
V6_vL32b_nt_npred_ai    if (!Pv4) Vd32 = vmem(Rt32+#s4):nt
V6_vL32b_nt_npred_pi    if (!Pv4) Vd32 = vmem(Rx32++#s3):nt
V6_vL32b_nt_npred_ppu   if (!Pv4) Vd32 = vmem(Rx32++Mu2):nt

V6_vS32b_pred_ai        if (Pv4) vmem(Rt32+#s4) = Vs32
V6_vS32b_pred_pi        if (Pv4) vmem(Rx32++#s3) = Vs32
V6_vS32b_pred_ppu       if (Pv4) vmem(Rx32++Mu2) = Vs32
V6_vS32b_npred_ai       if (!Pv4) vmem(Rt32+#s4) = Vs32
V6_vS32b_npred_pi       if (!Pv4) vmem(Rx32++#s3) = Vs32
V6_vS32b_npred_ppu      if (!Pv4) vmem(Rx32++Mu2) = Vs32

V6_vS32Ub_pred_ai       if (Pv4) vmemu(Rt32+#s4) = Vs32
V6_vS32Ub_pred_pi       if (Pv4) vmemu(Rx32++#s3) = Vs32
V6_vS32Ub_pred_ppu      if (Pv4) vmemu(Rx32++Mu2) = Vs32
V6_vS32Ub_npred_ai      if (!Pv4) vmemu(Rt32+#s4) = Vs32
V6_vS32Ub_npred_pi      if (!Pv4) vmemu(Rx32++#s3) = Vs32
V6_vS32Ub_npred_ppu     if (!Pv4) vmemu(Rx32++Mu2) = Vs32

V6_vS32b_nt_pred_ai     if (Pv4) vmem(Rt32+#s4):nt = Vs32
V6_vS32b_nt_pred_pi     if (Pv4) vmem(Rx32++#s3):nt = Vs32
V6_vS32b_nt_pred_ppu    if (Pv4) vmem(Rx32++Mu2):nt = Vs32
V6_vS32b_nt_npred_ai    if (!Pv4) vmem(Rt32+#s4):nt = Vs32
V6_vS32b_nt_npred_pi    if (!Pv4) vmem(Rx32++#s3):nt = Vs32
V6_vS32b_nt_npred_ppu   if (!Pv4) vmem(Rx32++Mu2):nt = Vs32

3 years ago[OpenMP] Add function for setting LIBOMPTARGET_INFO at runtime
Joseph Huber [Wed, 21 Apr 2021 21:31:09 +0000 (17:31 -0400)]
[OpenMP] Add function for setting LIBOMPTARGET_INFO at runtime

Summary:
This patch adds a new runtime function __tgt_set_info_flag that allows the
user to set the information level at runtime without using the environment
variable. Using this will require an extern function, but will eventually be
added into an auxilliary library for OpenMP support functions.

This patch required moving the current InfoLevel to a global variable which must
be instantiated by each plugin.

Reviewed By: jdoerfert

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

3 years agoFix memory leak in MicrosoftDemangleNodes's Node::toString
Raphael Isemann [Thu, 22 Apr 2021 16:33:46 +0000 (18:33 +0200)]
Fix memory leak in MicrosoftDemangleNodes's Node::toString

The buffer we turn into a std::string here is malloc'd and should be
free'd before we return from this function.

Follow up to LLDB leak fixes such as D100806.

Reviewed By: mstorsjo, rupprecht, MaskRay

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

3 years ago[flang] Fix spurious errors from runtime derived type table construction
peter klausler [Wed, 21 Apr 2021 22:12:07 +0000 (15:12 -0700)]
[flang] Fix spurious errors from runtime derived type table construction

Andrezj W. @ Arm discovered that the runtime derived type table
building code in semantics was detecting fatal errors in the tests
that the f18 driver wasn't printing.  This patch fixes f18 so that
these messages are printed; however, the messages were not valid user
errors, and the rest of this patch fixes them up.

There were two sources of the bogus errors.  One was that the runtime
derived type information table builder was calculating the shapes of
allocatable and pointer array components in derived types, and then
complaining that they weren't constant or LEN parameter values, which
of course they couldn't be since they have to have deferred shapes
and those bounds were expressions like LBOUND(component,dim=1).

The second was that f18 was forwarding the actual LEN type parameter
expressions of a type instantiation too far into the uses of those
parameters in various expressions in the declarations of components;
when an actual LEN type parameter is not a constant value, it needs
to remain a "bare" type parameter inquiry so that it will be lowered
to a descriptor inquiry and acquire a captured expression value.

Fixing this up properly involved: moving some code into new utility
function templates in Evaluate/tools.h, tweaking the rewriting of
conversions in expression folding to elide needless integer kind
conversions of type parameter inquiries, making type parameter
inquiry folding *not* replace bare LEN type parameters with
non-constant actual parameter values, and cleaning up some
altered test results.

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

3 years ago[dfsan] Track origin at loads
Jianzhou Zhao [Wed, 21 Apr 2021 04:54:29 +0000 (04:54 +0000)]
[dfsan] Track origin at loads

    The first version of origin tracking tracks only memory stores. Although
    this is sufficient for understanding correct flows, it is hard to figure
    out where an undefined value is read from. To find reading undefined values,
    we still have to do a reverse binary search from the last store in the chain
    with printing and logging at possible code paths. This is
    quite inefficient.

    Tracking memory load instructions can help this case. The main issues of
    tracking loads are performance and code size overheads.

    With tracking only stores, the code size overhead is 38%,
    memory overhead is 1x, and cpu overhead is 3x. In practice #load is much
    larger than #store, so both code size and cpu overhead increases. The
    first blocker is code size overhead: link fails if we inline tracking
    loads. The workaround is using external function calls to propagate
    metadata. This is also the workaround ASan uses. The cpu overhead
    is ~10x. This is a trade off between debuggability and performance,
    and will be used only when debugging cases that tracking only stores
    is not enough.

Reviewed By: gbalats

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

3 years ago[libc++] [test] Fix nodiscard_extensions.pass.cpp in _LIBCPP_DEBUG mode.
Arthur O'Dwyer [Thu, 22 Apr 2021 16:15:09 +0000 (12:15 -0400)]
[libc++] [test] Fix nodiscard_extensions.pass.cpp in _LIBCPP_DEBUG mode.

`std::clamp(2, 1, 3, std::greater<int>())` has UB because (1 > 3) is false.
Swap the operands to fix the _LIBCPP_ASSERT failure in this test.

3 years ago[flang][openmp] Add General Semantic Checks for Allocate Directive
Irina Dobrescu [Thu, 22 Apr 2021 15:45:19 +0000 (15:45 +0000)]
[flang][openmp] Add General Semantic Checks for Allocate Directive

This patch adds semantic checks for the General Restrictions of the
Allocate Directive.

Since the requires directive is not yet implemented in Flang, the
restriction:
```
allocate directives that appear in a target region must
specify an allocator clause unless a requires directive with the
dynamic_allocators clause is present in the same compilation unit
```
will need to be updated at a later time.

A different patch will be made with the Fortran specific restrictions of
this directive.

I have used the code from https://reviews.llvm.org/D89395 for the
CheckObjectListStructure function.

Co-authored-by: Isaac Perry <isaac.perry@arm.com>
Reviewed By: clementval, kiranchandramohan

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

3 years ago[x86] remove stale comment from test file; NFC
Sanjay Patel [Thu, 22 Apr 2021 16:11:47 +0000 (12:11 -0400)]
[x86] remove stale comment from test file; NFC

3 years ago[libc++] Eliminate macro _LIBCPP_UNUSED_VAR. NFCI.
Arthur O'Dwyer [Mon, 19 Apr 2021 02:17:44 +0000 (22:17 -0400)]
[libc++] Eliminate macro _LIBCPP_UNUSED_VAR. NFCI.

Reviewed as part of https://reviews.llvm.org/D100737

3 years ago[libc++] Fix some typos and remove unused macros. NFCI.
Arthur O'Dwyer [Mon, 19 Apr 2021 02:15:38 +0000 (22:15 -0400)]
[libc++] Fix some typos and remove unused macros. NFCI.

Reviewed as part of https://reviews.llvm.org/D100737

3 years ago[SLP]Skip undefs trying to find perfect/shuffled tree entries matching.
Alexey Bataev [Thu, 22 Apr 2021 13:15:27 +0000 (06:15 -0700)]
[SLP]Skip undefs trying to find perfect/shuffled tree entries matching.

We can skip check for undefs trying to find perfect/shuffled tree
entries matching, they can be ignored completely improving the final
cost/vectorization results.

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

3 years ago[llvm-profgen] A couple tweaks to the testing harness.
Hongtao Yu [Thu, 22 Apr 2021 01:02:11 +0000 (18:02 -0700)]
[llvm-profgen] A couple tweaks to the testing harness.

1. Remove unnecessary filtering code.
2. Add llvm-profgen to tool substitutions.

Reviewed By: wenlei

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

3 years ago[flang] Fix checking of argument passing for parameterized derived types
Peter Steinfeld [Wed, 21 Apr 2021 19:12:26 +0000 (12:12 -0700)]
[flang] Fix checking of argument passing for parameterized derived types

We were erroneously not taking into account the constant values of LEN type
parameters of parameterized derived types when checking for argument
compatibility.  The required checks are identical to those for assignment
compatibility.  Since argument compatibility is checked in .../lib/Evaluate and
assignment compatibility is checked in .../lib/Semantics, I moved the common
code into .../lib/Evaluate/tools.cpp and changed the assignment compatibility
checking code to call it.

After implementing these new checks, tests in resolve53.f90 were failing
because the tests were erroneous.  I fixed these tests and added new tests
to call03.f90 to test argument passing of parameterized derived types more
completely.

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

3 years ago[flang][driver][Revert] Reverts f18 to allow options passed to -W
Arnamoy Bhattacharyya [Thu, 22 Apr 2021 15:45:30 +0000 (11:45 -0400)]
[flang][driver][Revert] Reverts f18 to allow options passed to -W

Reviewed By: awarzynski

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

3 years ago[PowerPC] Add missing casts for vec_xlds and vec_load_splats
Nemanja Ivanovic [Thu, 22 Apr 2021 15:28:50 +0000 (10:28 -0500)]
[PowerPC] Add missing casts for vec_xlds and vec_load_splats

The previous commits just missed some pointer casts and ended up
producing warnings.

3 years ago[PowerPC] Add vec_vclz as an alias for vec_cntlz in altivec.h
Nemanja Ivanovic [Thu, 22 Apr 2021 13:47:31 +0000 (08:47 -0500)]
[PowerPC] Add vec_vclz as an alias for vec_cntlz in altivec.h

Another addition for compatibility with XLC. The functions have the
same overloads so just add it as a preprocessor define.

3 years ago[PowerPC] Add vec_load_splats to altivec.h
Nemanja Ivanovic [Thu, 22 Apr 2021 12:27:51 +0000 (07:27 -0500)]
[PowerPC] Add vec_load_splats to altivec.h

Add these overloads for compatibility with XLC. This is a word
load-and-splat.

3 years ago[PowerPC] Add vec_xlds to altivec.h
Nemanja Ivanovic [Thu, 22 Apr 2021 11:43:42 +0000 (06:43 -0500)]
[PowerPC] Add vec_xlds to altivec.h

Add these overloads for compatibility with XLC. This is a doubleword
load-and-splat.

3 years ago[PowerPC] Add vec_roundz as alias for vec_trunc in altivec.h
Nemanja Ivanovic [Thu, 22 Apr 2021 10:53:37 +0000 (05:53 -0500)]
[PowerPC] Add vec_roundz as alias for vec_trunc in altivec.h

Add the overloads for compatibility with XLC.

3 years ago[PowerPC] Add vec_roundp as alias for vec_ceil
Nemanja Ivanovic [Thu, 22 Apr 2021 10:47:00 +0000 (05:47 -0500)]
[PowerPC] Add vec_roundp as alias for vec_ceil

Add the overloads for compatibility with XLC.

3 years ago[PowerPC] Add missing VSX guard for vec_roundm with vector double
Nemanja Ivanovic [Thu, 22 Apr 2021 10:41:37 +0000 (05:41 -0500)]
[PowerPC] Add missing VSX guard for vec_roundm with vector double

The guard was missed in the previous commit.

3 years ago[PowerPC] Add vec_roundm as alias for vec_floor in altivec.h
Nemanja Ivanovic [Thu, 22 Apr 2021 10:38:11 +0000 (05:38 -0500)]
[PowerPC] Add vec_roundm as alias for vec_floor in altivec.h

Add the overloads for compatibility with XLC.

3 years ago[libc++] Re-apply `std::indirectly_readable` and `std::indirectly_writable`
Louis Dionne [Thu, 22 Apr 2021 15:05:30 +0000 (11:05 -0400)]
[libc++] Re-apply `std::indirectly_readable` and `std::indirectly_writable`

That was originally committed in 04733181b513 and then reverted in
a9f11cc0d965 because it broke several people.

The problem was a missing include of __iterator/concepts.h, which has now
been fixed.

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

3 years ago[Hexagon] Unmasked and masked load pair to dame bae -? one load and selects
Coplin, Jared [Thu, 22 Apr 2021 15:15:46 +0000 (10:15 -0500)]
[Hexagon] Unmasked and masked load pair to dame bae -? one load and selects

3 years ago[lld/mac] tweak comment in a test
Nico Weber [Thu, 22 Apr 2021 15:14:58 +0000 (11:14 -0400)]
[lld/mac] tweak comment in a test

3 years ago[AArch64] Block tryCombineToBSL combines for vectors wider than NEON
Joe Ellis [Thu, 22 Apr 2021 15:07:26 +0000 (15:07 +0000)]
[AArch64] Block tryCombineToBSL combines for vectors wider than NEON

There are no patterns for the AArch64ISD::BSP ISD node for anything
other than NEON vectors at the moment. As a result, if we hit these
combines for vectors wider than a NEON vector (such as what we might get
with fixed length SVE) we will fail to lower.

This patch simply prevents us from attempting the combines if the input
vector type is too wide.

Reviewed By: peterwaller-arm

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

3 years ago[OPENMP]Mark test as unsupported to avoid possible unexpected passes,
Alexey Bataev [Thu, 22 Apr 2021 14:58:56 +0000 (07:58 -0700)]
[OPENMP]Mark test as unsupported to avoid possible unexpected passes,
NFC.

3 years ago[LoopVectorize] Fix bug where predicated loads/stores were dropped
Joe Ellis [Wed, 31 Mar 2021 10:41:15 +0000 (10:41 +0000)]
[LoopVectorize] Fix bug where predicated loads/stores were dropped

This commit fixes a bug where the loop vectoriser fails to predicate
loads/stores when interleaving for targets that support masked
loads and stores.

Code such as:

     1  void foo(int *restrict data1, int *restrict data2)
     2  {
     3    int counter = 1024;
     4    while (counter--)
     5      if (data1[counter] > data2[counter])
     6        data1[counter] = data2[counter];
     7  }

... could previously be transformed in such a way that the predicated
store implied by:

    if (data1[counter] > data2[counter])
       data1[counter] = data2[counter];

... was lost, resulting in miscompiles.

This bug was causing some tests in llvm-test-suite to fail when built
for SVE.

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

3 years ago[SLP]Replace more `TTI` with `TTIRef`, NFC.
Alexey Bataev [Thu, 22 Apr 2021 14:53:20 +0000 (07:53 -0700)]
[SLP]Replace more `TTI` with `TTIRef`, NFC.

To pacify MSVC buildbots.

3 years ago[SLP]Added explicit ref to TargetTransformInfo to try to pacify MSVC
Alexey Bataev [Thu, 22 Apr 2021 14:49:08 +0000 (07:49 -0700)]
[SLP]Added explicit ref to TargetTransformInfo to try to pacify MSVC
buildbots, NFC.

3 years ago[lld/mac] make a few "named parameter comments" more consistent
Nico Weber [Thu, 22 Apr 2021 14:44:56 +0000 (10:44 -0400)]
[lld/mac] make a few "named parameter comments" more consistent

Most of LLVM and almost all of lld/MachO uses `/*foo=*/bar` style.
No behavior change.

3 years ago[SLP]Improve cost model for the vectorized extractelements.
Alexey Bataev [Tue, 6 Apr 2021 17:26:25 +0000 (10:26 -0700)]
[SLP]Improve cost model for the vectorized extractelements.

1. No need to call `areAllUsersVectorized` as later the cost is
   calculated only if the instruction has one use and gets vectorized.
2. Need to calculate the cost of the dead extractelement more precisely,
   taking the vector type of the vector operand, not the resulting
   vector type.

Part of D57059.

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

3 years ago[LoopIdiom] Added testcase for double memset (fixed in LLVM 12); NFC
Dávid Bolvanský [Thu, 22 Apr 2021 14:39:07 +0000 (16:39 +0200)]
[LoopIdiom] Added testcase for double memset (fixed in LLVM 12); NFC

3 years ago[C++4OpenCL] Add extra diagnostics for kernel argument types
Anastasia Stulova [Thu, 22 Apr 2021 12:46:46 +0000 (13:46 +0100)]
[C++4OpenCL] Add extra diagnostics for kernel argument types

Add restrictions on type layout (PR48099):
- Types passed by pointer or reference must be standard layout types.
- Types passed by value must be POD types.

Patch by olestrohm (Ole Strohm)!

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

3 years ago[mlir] Move PyConcreteAttribute to header. NFC.
Alex Zinenko [Thu, 22 Apr 2021 13:52:01 +0000 (15:52 +0200)]
[mlir] Move PyConcreteAttribute to header. NFC.

This allows out-of-tree users to derive PyConcreteAttribute to bind custom
attributes.

Reviewed By: nicolasvasilache

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

3 years ago[OpenCL] Add missing C++ legacy atomics with generic
Sven van Haastregt [Thu, 22 Apr 2021 14:08:36 +0000 (15:08 +0100)]
[OpenCL] Add missing C++ legacy atomics with generic

https://reviews.llvm.org/D62335 added some C++ for OpenCL specific
builtins to opencl-c.h, but these were not mirrored to the TableGen
builtin functions yet.

The TableGen builtins machinery does not have dedicated version
handling for C++ for OpenCL at the moment: all builtin versioning is
tied to `LangOpts.OpenCLVersion` (i.e., the OpenCL C version).  As a
workaround, to add builtins that are only available in C++ for OpenCL,
we define a function extension guarded by the __cplusplus macro.

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

Fixes PR50041.

3 years agoRevert "[Hexagon] Masked and unmasked load to same base -> load and two selects"
Krzysztof Parzyszek [Thu, 22 Apr 2021 14:06:18 +0000 (09:06 -0500)]
Revert "[Hexagon] Masked and unmasked load to same base -> load and two selects"

This reverts commit 96dc8d7e7dee68592e56d69184b92fcb021cdb9c.

It breaks a few builds.

3 years agoAArch64: support mixed-size fp <-> int conversions in GlobalISel.
Tim Northover [Tue, 20 Apr 2021 14:05:11 +0000 (15:05 +0100)]
AArch64: support mixed-size fp <-> int conversions in GlobalISel.

3 years agoAArch64: expand G_DIVREM operations in GlobalISel
Tim Northover [Tue, 20 Apr 2021 09:19:02 +0000 (10:19 +0100)]
AArch64: expand G_DIVREM operations in GlobalISel

We don't have a specific instruction for these, so they should be expanded to
whatever separate division & multiplication is needed.

3 years agoRevert "[libcxx][iterator] adds `std::indirectly_readable` and `std::indirectly_writa...
David Zarzycki [Thu, 22 Apr 2021 13:36:49 +0000 (09:36 -0400)]
Revert "[libcxx][iterator] adds `std::indirectly_readable` and `std::indirectly_writable`"

This reverts commit 04733181b5136e2b3df2b37c6bdd9e25f8afecd0 which was
failing for multiple people.

3 years agoUpdate shebang for clang-format-diff script to python3.
Paula Toth [Thu, 22 Apr 2021 13:43:06 +0000 (06:43 -0700)]
Update shebang for clang-format-diff script to python3.

Different distributions have different strategies migrating the `python` symlink. Debian and its derivatives provide `python-is-python2` and `python-is-python3`. If neither is installed, the user gets no `/usr/bin/python`. The clang-format-diff script and consequently `arc diff` can thus fail with a python not found error.  Since we require python greater than 3.6 as part of llvm prerequisites (https://llvm.org/docs/GettingStarted.html#software), let's go ahead and update this shebang.

Reviewed By: MaskRay

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

3 years ago[Hexagon] Masked and unmasked load to same base -> load and two selects
Coplin, Jared [Thu, 22 Apr 2021 13:44:01 +0000 (08:44 -0500)]
[Hexagon] Masked and unmasked load to same base -> load and two selects

3 years ago[lld/mac] add a comment pointing to a test that took me a while to find
Nico Weber [Thu, 22 Apr 2021 13:09:39 +0000 (09:09 -0400)]
[lld/mac] add a comment pointing to a test that took me a while to find

3 years ago[X86] Regenerate atomic-eflags-reuse.ll
Simon Pilgrim [Thu, 22 Apr 2021 13:06:57 +0000 (14:06 +0100)]
[X86] Regenerate atomic-eflags-reuse.ll

3 years ago[LTO] Caching.h - remove unused <string> include. NFCI.
Simon Pilgrim [Thu, 22 Apr 2021 10:40:54 +0000 (11:40 +0100)]
[LTO] Caching.h - remove unused <string> include. NFCI.

3 years ago[InstCombine][NFC] Use --check-globals flag in tests.
Dawid Jurczak [Thu, 22 Apr 2021 13:06:20 +0000 (15:06 +0200)]
[InstCombine][NFC] Use --check-globals flag in tests.

This patch adds strings content checking to printf-2.ll via --check-globals flag.

Split off from D100724.

Reviewed By: xbolva00

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

3 years ago[SimplifyLibCalls][NFC] Use StringRef::back instead explicit indexing.
Dawid Jurczak [Thu, 22 Apr 2021 13:01:44 +0000 (15:01 +0200)]
[SimplifyLibCalls][NFC] Use StringRef::back instead explicit indexing.

Split off from D100724.

Reviewed By: xbolva00

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

3 years ago[DAGCombiner] Allow operand of step_vector to be negative.
Jun Ma [Mon, 19 Apr 2021 09:16:08 +0000 (17:16 +0800)]
[DAGCombiner] Allow operand of step_vector to be negative.

It is proper to relax non-negative limitation of step_vector.
Also this patch adds more combines for step_vector:
(sub X, step_vector(C)) -> (add X,  step_vector(-C))

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

3 years ago[mlir] Add `tensor.reshape`.
Alexander Belyaev [Thu, 22 Apr 2021 12:50:13 +0000 (14:50 +0200)]
[mlir] Add `tensor.reshape`.

This operation a counterpart of `memref.reshape`.

RFC [Reshape Ops Restructuring](https://llvm.discourse.group/t/rfc-reshape-ops-restructuring/3310)

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

3 years ago[X86][AMX][NFC] Remove assert for comparison between different BBs.
Wang, Pengfei [Thu, 22 Apr 2021 09:26:36 +0000 (17:26 +0800)]
[X86][AMX][NFC] Remove assert for comparison between different BBs.

SmallSet may use operator `<` when we insert MIRef elements, so we
cannot limit the comparison between different BBs.

We allow MIRef() to be less that any initialized MIRef object, otherwise,
we always reture false when compare between different BBs.

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

3 years ago[gn build] (manually) port aee6c86c4d better
Nico Weber [Thu, 22 Apr 2021 12:40:48 +0000 (08:40 -0400)]
[gn build] (manually) port aee6c86c4d better

"EmptyNodeIntrospection.inc.in" needs to be a source of the action,
so that ninja knows to rerun this action if that input changes.

3 years ago[AST] Make comment a bit more specific
Stephen Kelly [Thu, 22 Apr 2021 12:40:01 +0000 (13:40 +0100)]
[AST] Make comment a bit more specific

3 years ago[gn build] (manually) port aee6c86c4d
Nico Weber [Thu, 22 Apr 2021 12:36:19 +0000 (08:36 -0400)]
[gn build] (manually) port aee6c86c4d

3 years ago[lldb/elf] Avoid side effects in function calls ParseUnwindSymbols
Pavel Labath [Thu, 22 Apr 2021 12:13:27 +0000 (14:13 +0200)]
[lldb/elf] Avoid side effects in function calls ParseUnwindSymbols

This addresses post-commit feedback to cd64273.

3 years agoclang: libstdc++ LWM is 4.8.3
Nathan Sidwell [Wed, 14 Apr 2021 11:18:23 +0000 (04:18 -0700)]
clang: libstdc++ LWM is 4.8.3

Document oldest libstdc++ as 4.8.3, remove a hack for a 4.6 issue.

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

3 years ago[AArch64][SVE] Regression test all ACLE tests with C++
Sander de Smalen [Wed, 7 Apr 2021 16:06:22 +0000 (17:06 +0100)]
[AArch64][SVE] Regression test all ACLE tests with C++

We found issues with a number of intrinsics when building them with
C++, so it makes sense to guard these tests with some extra RUN lines
to build the tests in C++ mode.

3 years ago[-Wcalled-once] Do not run analysis on Obj-C++
Valeriy Savchenko [Wed, 21 Apr 2021 13:49:06 +0000 (16:49 +0300)]
[-Wcalled-once] Do not run analysis on Obj-C++

Objective-C++ is not yet suppoerted.

rdar://76729552

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

3 years ago[MLIR][Shape] Add canonicalizations for `shape.broadcast`
Frederik Gossen [Thu, 22 Apr 2021 12:09:14 +0000 (14:09 +0200)]
[MLIR][Shape] Add canonicalizations for `shape.broadcast`

Eliminate empty shapes from the operands, partially fold all constant shape
operands, and fix normal folding.

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

3 years ago[lldb] Don't leak LineSequence in PDB parsers
Raphael Isemann [Thu, 22 Apr 2021 10:29:08 +0000 (12:29 +0200)]
[lldb] Don't leak LineSequence in PDB parsers

`InsertSequence` doesn't take ownership of the pointer so releasing this pointer
is just leaking memory.

Follow up to D100806 that was fixing other leak sanitizer test failures

Reviewed By: JDevlieghere

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

3 years ago[clang][deps] Check extra args in tests
Jan Svoboda [Thu, 22 Apr 2021 11:55:23 +0000 (13:55 +0200)]
[clang][deps] Check extra args in tests

These flags are being generated by `clang-scan-deps` and it makes sense to ensure it keeps doing so.