lldb.git
22 months ago[libc] Add documentation for clang-tidy checks.
Paula Toth [Tue, 7 Jul 2020 01:15:27 +0000 (18:15 -0700)]
[libc] Add documentation for clang-tidy checks.

Reviewers: sivachandra

Reviewed By: sivachandra

Subscribers: tschuett, ecnelises, libc-commits

Tags: #libc-project

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

22 months ago[ModuloSchedule] Devirtualize PeelingModuloScheduleExpander::expand as it's not needed
David Blaikie [Tue, 7 Jul 2020 01:01:57 +0000 (18:01 -0700)]
[ModuloSchedule] Devirtualize PeelingModuloScheduleExpander::expand as it's not needed

The use case is out of tree code deriving from this class - but without
a need to use the base class polymorphically, so skip the virtualization
and virtual dtor.

Post-commit review from 50ac7ce94f34c5f43b02185ae0c33e150e78b044

22 months agoRevert "[LV] Enable the LoopVectorizer to create pointer inductions"
Jordan Rupprecht [Tue, 7 Jul 2020 00:44:33 +0000 (17:44 -0700)]
Revert "[LV] Enable the LoopVectorizer to create pointer inductions"

This reverts commit a8fe12065ec8137e55a6a8b35dd5355477c2ac16.

It causes a crash when building gzip. Will post the detailed reduced test case to D81267.

22 months ago[gn build] Port 05f2b5ccfc5
LLVM GN Syncbot [Tue, 7 Jul 2020 00:37:49 +0000 (00:37 +0000)]
[gn build] Port 05f2b5ccfc5

22 months ago[gn build] Port
LLVM GN Syncbot [Tue, 7 Jul 2020 00:37:49 +0000 (00:37 +0000)]
[gn build] Port

22 months agofix typos to cycle bots
Nico Weber [Tue, 7 Jul 2020 00:37:02 +0000 (20:37 -0400)]
fix typos to cycle bots

22 months agoCorrect 3 spelling errors in headers and doc strings.
Wolfgang Pieb [Wed, 1 Jul 2020 21:28:52 +0000 (14:28 -0700)]
Correct 3 spelling errors in headers and doc strings.

22 months agoFix sdk version test to use 99.99.99 as a max dummy version instead of 10.99.99.
Amara Emerson [Mon, 6 Jul 2020 22:12:12 +0000 (15:12 -0700)]
Fix sdk version test to use 99.99.99 as a max dummy version instead of 10.99.99.

Was failing on macOS 11 hosts which is > 10.99.99

22 months ago[DAGCombiner] reassociate reciprocal sqrt expression to eliminate FP division
Sanjay Patel [Mon, 6 Jul 2020 22:03:55 +0000 (18:03 -0400)]
[DAGCombiner] reassociate reciprocal sqrt expression to eliminate FP division

X / (fabs(A) * sqrt(Z)) --> X / sqrt(A*A*Z) --> X * rsqrt(A*A*Z)

In the motivating case from PR46406:
https://bugs.llvm.org/show_bug.cgi?id=46406
...this is restoring the sequence that was originally in the source code.
We extracted a term from within the sqrt because we do not know in
instcombine whether a target will expand a sqrt call.
Note: we could say that the transform in IR should be restricted, but
that would not solve the problem if the source was originally in the
pattern shown here.

This is a gray area for fast-math-flag requirements. I think we should at
least check fast-math-flags on the fdiv and fmul because I view this
transform as 2 pieces: reassociate the fmul operands and form reciprocal
from the fdiv (as with the existing transform). We could argue that the
sqrt also needs FMF, but that was not required before, so we should change
that in a follow-up patch if that seems better.

We don't currently have a way to check that the target will produce a sqrt
or recip estimate without actually creating nodes (the APIs are SDValue
getSqrtEstimate() and SDValue getRecipEstimate()), so we clean up
speculatively created nodes if we are not able to create an estimate.
The x86 test with doubles verifies that we are not changing a test with
no estimate sequence.

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

22 months agoTemporarily Revert "[llvm-install-name-tool] Merge install-name options" as it breaks...
Eric Christopher [Mon, 6 Jul 2020 22:39:42 +0000 (15:39 -0700)]
Temporarily Revert "[llvm-install-name-tool] Merge install-name options" as it breaks the objcopy build.

This reverts commit c143900a0851b2c7b7d52e4825c7f073b3474cf6.

22 months ago[NFC] change getLimitedCodeGenPipelineReason to static function
Yuanfang Chen [Mon, 6 Jul 2020 22:10:54 +0000 (15:10 -0700)]
[NFC] change getLimitedCodeGenPipelineReason to static function

22 months ago[NFCI][llvm-reduce] ReduceOperandBundles: actually put Module forward-declaration...
Roman Lebedev [Mon, 6 Jul 2020 22:31:36 +0000 (01:31 +0300)]
[NFCI][llvm-reduce] ReduceOperandBundles: actually put Module forward-declaration back into llvm namespace

22 months agoModifications to the algorithm sort benchmark
MinJae Hwang [Mon, 6 Jul 2020 22:29:38 +0000 (18:29 -0400)]
Modifications to the algorithm sort benchmark

Summary:
Modifies the algorithm sort bench:
- shows sorting time per element, instead of sorting time per array.
This would make comparison between different sizes of arrays easier.
- adds std::pair benchmark cases.
- uses a large number of arrays to benchmark, instead of repeatedly sorting the same array.
* sorting the same array again and again would not show actual sorting performance over randomized data sets.

Reviewers: EricWF, #libc, mvels

Reviewed By: EricWF, #libc, mvels

Subscribers: mgrang, libcxx-commits

Tags: #libc

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

22 months ago[OpenMP] Add GOMP 5.0 loop entry points
Peyton, Jonathan L [Mon, 3 Feb 2020 20:29:08 +0000 (14:29 -0600)]
[OpenMP] Add GOMP 5.0 loop entry points

This patch adds missing GOMP_5.0 loop entry points which incorporate
new non-monotonic default into entry point name.  Since monotonic
schedules are a subset of nonmonotonic, it is acceptable to use
monotonic as the implementation.  This patch simply has the nonmonotonic
(and possibly non-monontonic) versions of the loop entry points as
wrappers around the monotonic ones.

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

22 months ago[llvm-reduce] Reducing call operand bundles
Roman Lebedev [Mon, 6 Jul 2020 22:16:37 +0000 (01:16 +0300)]
[llvm-reduce] Reducing call operand bundles

Summary:
This would have been marginally useful to me during/for rG7ea46aee3670981827c04df89b2c3a1cbdc7561b.

With ongoing migration to representing assumes via operand bundles on the assume, this will be gradually more useful.

Reviewers: nickdesaulniers, diegotf, dblaikie, george.burgess.iv, jdoerfert, Tyker

Reviewed By: nickdesaulniers

Subscribers: hiraditya, mgorny, llvm-commits

Tags: #llvm

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

22 months ago[NFCI][IR] Introduce CallBase::Create() wrapper
Roman Lebedev [Mon, 6 Jul 2020 22:16:36 +0000 (01:16 +0300)]
[NFCI][IR] Introduce CallBase::Create() wrapper

Summary:
It is reasonably common to want to clone some call with different bundles.
Let's actually provide an interface to do that.

Reviewers: chandlerc, jdoerfert, dblaikie, nickdesaulniers

Reviewed By: nickdesaulniers

Subscribers: llvm-commits, hiraditya

Tags: #llvm

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

22 months ago[llvm-install-name-tool] Merge install-name options
Sameer Arora [Mon, 6 Jul 2020 21:53:24 +0000 (14:53 -0700)]
[llvm-install-name-tool] Merge install-name options

This diff merges all options for llvm-install-name-tool under a single
function processLoadCommands. Also adds another test case for -add_rpath
option.

Test plan: make check-all

Reviewed by: jhenderson, alexshap, smeenai, Ktwu

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

22 months ago[Scalarizer] Centralize instruction DCE
Roman Lebedev [Mon, 6 Jul 2020 21:25:19 +0000 (00:25 +0300)]
[Scalarizer] Centralize instruction DCE

As reported in https://reviews.llvm.org/D83101#2133062
the new visitInsertElementInst()/visitExtractElementInst() functionality
is causing miscompiles (previously-crashing test added)

It is due to the fact how the infra of Scalarizer is dealing with DCE,
it was not updated or was it ready for such scalar value forwarding.
It always assumed that the moment we "scalarized" something,
it can go away, and did so with prejudice.

But that is no longer safe/okay to do.

Instead, let's prevent it from ever shooting itself into foot,
and let's just accumulate the instructions-to-be-deleted
in a vector, and collectively cleanup (those that are *actually* dead)
them all at the end.

All existing tests are not reporting any new garbage leftovers,
but maybe it's test coverage issue.

22 months ago[X86] Centalize the 'sse4' hack to a single place in X86TargetInfo::setFeatureEnabled...
Craig Topper [Mon, 6 Jul 2020 21:58:31 +0000 (14:58 -0700)]
[X86] Centalize the 'sse4' hack to a single place in X86TargetInfo::setFeatureEnabledImpl. NFCI

Instead of detecting the string in 2 places. Just swap the string
to 'sse4.1' or 'sse4.2' at the top of the function.

Prep work for a patch to switch the rest of this function to a
table based system. And I don't want to include 'sse4a' in the
table.

22 months ago[OpenMP][Tests] Fix/Mark compatibilty for GCC
Joachim Protze [Sun, 21 Jun 2020 15:25:20 +0000 (17:25 +0200)]
[OpenMP][Tests] Fix/Mark compatibilty for GCC

Reviewed by: Hahnfeld, saiislam

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

22 months ago[clang] Enable errors for undefined TARGET_OS_ macros in Darwin driver
Zixu Wang [Mon, 6 Jul 2020 21:52:12 +0000 (14:52 -0700)]
[clang] Enable errors for undefined TARGET_OS_ macros in Darwin driver

Add clang option `-Wundef-prefix=TARGET_OS_` and `-Werror=undef-prefix`
to Darwin driver.

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

22 months agoFix [-Werror,-Wsign-compare] in dominator unit test.
Eric Christopher [Mon, 6 Jul 2020 21:49:21 +0000 (14:49 -0700)]
Fix [-Werror,-Wsign-compare] in dominator unit test.

22 months ago[Support][NFC] Fix Wdocumentation warning in ADT/Bitfields.h
Bruno Ricci [Mon, 6 Jul 2020 21:37:30 +0000 (22:37 +0100)]
[Support][NFC] Fix Wdocumentation warning in ADT/Bitfields.h

\tparam is used for template parameters instead of \param.

22 months ago[AMDGPU] Tweak getTypeLegalizationCost()
Stanislav Mekhanoshin [Thu, 2 Jul 2020 19:02:39 +0000 (12:02 -0700)]
[AMDGPU] Tweak getTypeLegalizationCost()

Even though wide vectors are legal they still cost more as we
will have to eventually split them. Not all operations can
be uniformly done on vector types.

Conservatively add the cost of splitting at least to 8 dwords,
which is our widest possible load.

We are more or less lying to cost mode with this change but
this can prevent vectorizer from creation of wide vectors which
results in RA problems for us.

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

22 months ago[clang] Rework how and when APValues are dumped
Bruno Ricci [Mon, 6 Jul 2020 20:50:23 +0000 (21:50 +0100)]
[clang] Rework how and when APValues are dumped

Currently APValues are dumped as a single string. This becomes quickly
completely unreadable since APValue is a tree-like structure. Even a simple
example is not pretty:

  struct S { int arr[4]; float f; };
  constexpr S s = { .arr = {1,2}, .f = 3.1415f };
  // Struct  fields: Array: Int: 1, Int: 2, 2 x Int: 0, Float: 3.141500e+00

With this patch this becomes:

  -Struct
   |-field: Array size=4
   | |-elements: Int 1, Int 2
   | `-filler: 2 x Int 0
   `-field: Float 3.141500e+00

Additionally APValues are currently only dumped as part of visiting a
ConstantExpr. This patch also dump the value of the initializer of constexpr
variable declarations:

  constexpr int foo(int a, int b) { return a + b - 42; }
  constexpr int a = 1, b = 2;
  constexpr int c = foo(a, b) > 0 ? foo(a, b) : foo(b, a);
  // VarDecl 0x62100008aec8 <col:3, col:57> col:17 c 'const int' constexpr cinit
  // |-value: Int -39
  // `-ConditionalOperator 0x62100008b4d0 <col:21, col:57> 'int'
  // <snip>

Do the above by moving the dump functions to TextNodeDumper which already has
the machinery to display trees. The cases APValue::LValue, APValue::MemberPointer
and APValue::AddrLabelDiff are left as they were before (unimplemented).

We try to display multiple elements on the same line if they are considered to
be "simple". This is to avoid wasting large amounts of vertical space in an
example like:

  constexpr int arr[8] = {0,1,2,3,4,5,6,7};
  // VarDecl 0x62100008bb78 <col:3, col:42> col:17 arr 'int const[8]' constexpr cinit
  // |-value: Array size=8
  // | |-elements: Int 0, Int 1, Int 2, Int 3
  // | `-elements: Int 4, Int 5, Int 6, Int 7

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

Reviewed By: aaron.ballman

22 months agoAMDGPU/GlobalISel: Add types to special inputs
Matt Arsenault [Sun, 5 Jul 2020 17:17:02 +0000 (13:17 -0400)]
AMDGPU/GlobalISel: Add types to special inputs

When passing special ABI inputs, we have no existing context for the
type to use.

22 months agoAdd option LLVM_NM to allow specifying the location of the llvm-nm tool
Arlo Siemsen [Mon, 6 Jul 2020 20:17:22 +0000 (13:17 -0700)]
Add option LLVM_NM to allow specifying the location of the llvm-nm tool

The new option works like the existing LLVM_TABLEGEN, and
LLVM_CONFIG_PATH options.  Instead of building llvm-nm, the build uses
the executable defined by LLVM_NM.

This is useful for cross-compilation scenarios where the host cannot run
the cross-compiled tool, and recursing into another cmake build is not
an option (due to required DEFINE's, for example).

Reviewed By: smeenai

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

22 months agoUse CMAKE_OSX_SYSROOT instead of the environment variable SYSROOT
Adrian Prantl [Mon, 6 Jul 2020 20:15:28 +0000 (13:15 -0700)]
Use CMAKE_OSX_SYSROOT instead of the environment variable SYSROOT

to detect energy support in debugserver.  The way that Swift
build-script is invoked the former may be overridden manually.

<rdar://problem/63840635>

22 months ago[flang] Add missing include for std::min
Tim Keith [Mon, 6 Jul 2020 20:03:00 +0000 (13:03 -0700)]
[flang] Add missing include for std::min

This was causing the build to fail on macos.

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

22 months agoDomTree: add private create{Child,Node} helpers
Nicolai Hähnle [Wed, 24 Jun 2020 08:32:55 +0000 (10:32 +0200)]
DomTree: add private create{Child,Node} helpers

Summary:
Aside from unifying the code a bit, this change smooths the
transition to use of future "opaque generic block references"
in the type-erased dominator tree base class.

Change-Id: If924b092cc8561c4b6a7450fe79bc96df0e12472

Reviewers: arsenm, RKSimon, mehdi_amini, courbet

Subscribers: wdng, llvm-commits

Tags: #llvm

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

22 months agoDomTree: Remove getRoots() accessor
Nicolai Hähnle [Mon, 18 May 2020 14:28:28 +0000 (16:28 +0200)]
DomTree: Remove getRoots() accessor

Summary:
Avoid exposing details about how roots are stored. This enables subsequent
type-erasure changes.

v5:
- cleanup a unit test by using EXPECT_EQ instead of EXPECT_TRUE

Change-Id: I532b774cc71f2224e543bc7d79131d97f63f093d

Reviewers: arsenm, RKSimon, mehdi_amini, courbet

Subscribers: jvesely, wdng, hiraditya, kuhar, kerbowa, llvm-commits

Tags: #llvm

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

22 months agoDomTree: Remove the releaseMemory() method
Nicolai Hähnle [Mon, 18 May 2020 14:28:26 +0000 (16:28 +0200)]
DomTree: Remove the releaseMemory() method

Summary:
It is fully redundant with reset().

Change-Id: I25850b9f08eace757cf03cbb8780e970aca7f51a

Reviewers: arsenm, RKSimon, mehdi_amini, courbet

Subscribers: wdng, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

22 months agoDomTree: Remove getChildren() accessor
Nicolai Hähnle [Mon, 18 May 2020 14:28:24 +0000 (16:28 +0200)]
DomTree: Remove getChildren() accessor

Summary:
Avoid exposing details about how children are stored. This will enable
subsequent type-erasure changes.

New methods are introduced to cover common access patterns.

Change-Id: Idb5f4b1b9c84e4cc71ddb39bb52a388682f5674f

Reviewers: arsenm, RKSimon, mehdi_amini, courbet

Subscribers: qcolombet, sdardis, wdng, hiraditya, jrtc27, zzheng, atanasyan, asbirlea, llvm-commits

Tags: #llvm

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

22 months ago[WebAssembly] Added 64-bit memory.grow/size/copy/fill
Wouter van Oortmerssen [Fri, 26 Jun 2020 23:59:02 +0000 (16:59 -0700)]
[WebAssembly] Added 64-bit memory.grow/size/copy/fill

This covers both the existing memory functions as well as the new bulk memory proposal.
Added new test files since changes where also required in the inputs.

Also removes unused init/drop intrinsics rather than trying to make them work for 64-bit.

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

22 months ago[libc] Add documentation for integration tests.
Paula Toth [Mon, 6 Jul 2020 19:43:29 +0000 (12:43 -0700)]
[libc] Add documentation for integration tests.

Reviewers: sivachandra

Reviewed By: sivachandra

Subscribers: MaskRay, tschuett, ecnelises, libc-commits

Tags: #libc-project

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

22 months ago[WebAssembly] 64-bit memory limits
Wouter van Oortmerssen [Tue, 30 Jun 2020 00:53:09 +0000 (17:53 -0700)]
[WebAssembly] 64-bit memory limits

22 months ago[VE] Support symbol with offset in assembly
Kazushi (Jam) Marukawa [Mon, 6 Jul 2020 18:49:59 +0000 (03:49 +0900)]
[VE] Support symbol with offset in assembly

Summary:
Change MCExpr to support Aurora VE's modifiers.  Change asmparser to use
existing MCExpr parser (parseExpression) to parse an expression contining
symbols with modifiers and offsets.  Also add several regression tests
of MC layer.

Reviewers: simoll, k-ishizaka

Reviewed By: simoll

Subscribers: hiraditya, llvm-commits

Tags: #llvm, #ve

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

22 months ago[Sanitizer] Fix demangling for Swift symbol names
Julian Lettner [Fri, 12 Jun 2020 00:34:39 +0000 (17:34 -0700)]
[Sanitizer] Fix demangling for Swift symbol names

The Swift symbol name prefix has changed from `_T0` to `_$s` as
documented here [1].  This prevents Swift names from properly being
symbolicated when using the in-process LLVM symbolizer.  The best way to
fix this seems to be to avoid the duplication of "Is this a Swift symbol
name?" here.  We can simply remove this check as `swift_demangle`
already returns null for non-Swift names [2,3].

The check was included in the initial support for Swift name demangling
to avoid superfluous calls to `dlsym()` [4].  A subsequent commit
changed this logic to retrieve the `swift_demangle` function pointer
eagerly during sanitizer initialization, but did not remove the check
[5].

[1] https://github.com/apple/swift/blob/master/docs/ABI/Mangling.rst
[2] https://github.com/apple/swift/blob/b5a8b518eae54cea997f3b0954760fc7858829f6/include/swift/Demangling/Demangle.h#L643
[3] https://github.com/apple/swift/blob/b5a8b518eae54cea997f3b0954760fc7858829f6/stdlib/public/runtime/Demangle.cpp#L656
[4] https://reviews.llvm.org/D19135
[5] https://reviews.llvm.org/D20015

rdar://62753845

Reviewers: kubamracek, delcypher, dcoughlin, samsonov, thakis

Reviewed By: kubamracek

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

22 months ago[ELF] Drop an unneeded reference to `symtab` from SymbolTable::addSymbol
William S. Moses [Mon, 6 Jul 2020 19:00:29 +0000 (12:00 -0700)]
[ELF] Drop an unneeded reference to `symtab` from SymbolTable::addSymbol

The Symbol Table in LLD references the global object to add a symbol rather than adding it to itself.

Reviewed By: MaskRay

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

22 months agoRevert "[FPEnv][Clang][Driver] Disable constrained floating point on targets lacking...
Kevin P. Neal [Mon, 6 Jul 2020 18:54:56 +0000 (14:54 -0400)]
Revert "[FPEnv][Clang][Driver] Disable constrained floating point on targets lacking support."

My mistake, I had a blocking reviewer.

This reverts commit 39d2ae0afb2312a15e4d15a0855b35b4e1c49fc4.
This reverts commit bfdafa32a0fa4b2745627fe57dd253db10ac3fcf.
This reverts commit 2b35511350454dd22997f129ee529e3fdb129ac2.

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

22 months ago[VE] Change to use isa
Kazushi (Jam) Marukawa [Mon, 6 Jul 2020 18:35:31 +0000 (03:35 +0900)]
[VE] Change to use isa

Summary: Change to use isa instead of dyn_cast to avoid a warning.

Reviewers: simoll, k-ishizaka

Reviewed By: simoll

Subscribers: hiraditya, llvm-commits

Tags: #llvm, #ve

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

22 months ago[FPEnv][Clang][Driver] Failing tests are now expected failures only on PowerPC
Kevin P. Neal [Mon, 6 Jul 2020 18:41:15 +0000 (14:41 -0400)]
[FPEnv][Clang][Driver] Failing tests are now expected failures only on PowerPC

Mark these tests as only failing on PowerPC. Avoids unexpected passes on
other bots.

Fingers crossed.

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

22 months agoAMDGPU: Don't ignore carry out user when expanding add_co_pseudo
Matt Arsenault [Fri, 19 Jun 2020 19:45:16 +0000 (15:45 -0400)]
AMDGPU: Don't ignore carry out user when expanding add_co_pseudo

This was resulting in a missing vreg def in the use select
instruction.

The output of the pseudo doesn't make sense, since it really shouldn't
have the vreg output in the first place, and instead an implicit scc
def to match the real scalar behavior.

We could have easier to understand tests if we selected scalar
versions of the [us]{add|sub}.with.overflow intrinsics.

This does still end up producing vector code in the end, since it gets
moved later.

22 months ago[flang] Bug fix for ambiguous references to data and functions
Pete Steinfeld [Tue, 30 Jun 2020 19:03:28 +0000 (12:03 -0700)]
[flang] Bug fix for ambiguous references to data and functions

Summary:
A program may erroneously reference the same name as both a data object
and as a function.  Some of these references were causing an internal
error in expression analysis.

It was already the case that a symbol referenced in a parse tree for a
call was changed from an `Entity` to a `ProcEntity`.  I added code to
detect when a symbol was referenced in a parse tree as an array element
gets changed from an `Entity` to an `ObjectEntity`.  Then, if an
`ObjectEntity` gets called as a function or a `ProcEntity` gets
referenced as a data object, errors get emitted.

This analysis was previously confined to the name resolution of the
specification part of a `ProgramTree`.  I added a pass to the execution
part of a `ProgramTree` to catch names declared in blocks.

Reviewers: tskeith, klausler, DavidTruby

Subscribers: llvm-commits

Tags: #llvm, #flang

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

22 months ago[FPEnv][Clang][Driver] Failing tests are now expected failures.
Kevin P. Neal [Mon, 6 Jul 2020 18:20:49 +0000 (14:20 -0400)]
[FPEnv][Clang][Driver] Failing tests are now expected failures.

These are now expected failures on PowerPC. They can be reenabled when
PowerPC is ready.

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

22 months ago[SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function...
Zequan Wu [Wed, 24 Jun 2020 01:05:49 +0000 (18:05 -0700)]
[SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body.

Summary:
Some libraries use empty function to ignore unused variable warnings, which gets a new warning from `-Wuninitialized-const-reference`, discussed here https://reviews.llvm.org/D79895#2107604.
This patch should fix that.

Reviewers: hans, nick, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: aaron.ballman, riccibruno, cfe-commits

Tags: #clang

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

22 months ago[flang] Basic tests of external I/O runtime (part 9/9)
peter klausler [Sat, 4 Jul 2020 21:24:32 +0000 (14:24 -0700)]
[flang] Basic tests of external I/O runtime (part 9/9)

Add new unit tests for external Fortran I/O that drive the
Fortran I/O runtime API from C++ and exercise basic writing
and read-back in the various combinations of access modes,
record length variability, and formatting.  Sequential modes
are tested with positioning.  More thorough tests written in
Fortran will follow when they can be compiled and run.

The Fortran runtime's error termination callback registration
was extended with source file and line number positions for
better failure messages in unit testing.

Reviewed By: sscalpone

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

22 months ago[FPEnv][Clang][Driver] Disable constrained floating point on targets lacking support.
Kevin P. Neal [Mon, 6 Jul 2020 15:52:42 +0000 (11:52 -0400)]
[FPEnv][Clang][Driver] Disable constrained floating point on targets lacking support.

We currently have strict floating point/constrained floating point enabled
for all targets. Constrained SDAG nodes get converted to the regular ones
before reaching the target layer. In theory this should be fine.

However, the changes are exposed to users through multiple clang options
already in use in the field, and the changes are _completely_ _untested_
on almost all of our targets. Bugs have already been found, like
"https://bugs.llvm.org/show_bug.cgi?id=45274".

This patch disables constrained floating point options in clang everywhere
except X86 and SystemZ. A warning will be printed when this happens.

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

22 months ago[mlir] Change ODS to have include and exclude regex
Jacques Pienaar [Mon, 6 Jul 2020 16:55:10 +0000 (09:55 -0700)]
[mlir] Change ODS to have include and exclude regex

This makes it easier to have a "remainder" include rule. And also makes it easier to read the command line flag.

22 months ago[AIX] Add system-aix to lit config file
Shuhong Liu [Fri, 3 Jul 2020 21:14:11 +0000 (17:14 -0400)]
[AIX] Add system-aix to lit config file

Summary: This is a complementary patch to D82100 since the aix builbot is still running the unsupported test shtest-format-argv0. Add system-aix to the sub llvm-lit config.

Reviewers: daltenty, hubert.reinterpretcast

Reviewed By: hubert.reinterpretcast

Subscribers: delcypher, llvm-commits

Tags: #llvm

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

22 months ago[ELF][ARM] Represent R_ARM_LDO32 as R_DTPREL instead of R_ABS
Fangrui Song [Mon, 6 Jul 2020 16:47:53 +0000 (09:47 -0700)]
[ELF][ARM] Represent R_ARM_LDO32 as R_DTPREL instead of R_ABS

Follow-up to D82899. Note, we need to disable R_DTPREL relaxation
because ARM psABI does not define TLS relaxation.

Reviewed By: grimar, psmith

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

22 months ago[RISCV] Fold ADDIs into load/stores with nonzero offsets
Luís Marques [Wed, 24 Jun 2020 12:53:27 +0000 (13:53 +0100)]
[RISCV] Fold ADDIs into load/stores with nonzero offsets

We can often fold an ADDI into the offset of load/store instructions:

   (load (addi base, off1), off2) -> (load base, off1+off2)
   (store val, (addi base, off1), off2) -> (store val, base, off1+off2)

This is possible when the off1+off2 continues to fit the 12-bit immediate.
We remove the previous restriction where we would never fold the ADDIs if
the load/stores had nonzero offsets. We now do the fold the the resulting
constant still fits a 12-bit immediate, or if off1 is a variable's address
and we know based on that variable's alignment that off1+offs2 won't overflow.

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

22 months ago[MLIR] Add a NoRegionArguments trait
Rahul Joshi [Thu, 2 Jul 2020 00:54:12 +0000 (17:54 -0700)]
[MLIR] Add a NoRegionArguments trait

- This trait will verify that all regions attached to an Op have no arguments
- Fixes https://bugs.llvm.org/show_bug.cgi?id=46521 : Add trait NoRegionArguments

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

22 months ago[clang][utils] make-ast-dump-check.sh: strip line and column numbers when generating...
Bruno Ricci [Mon, 6 Jul 2020 15:48:50 +0000 (16:48 +0100)]
[clang][utils] make-ast-dump-check.sh: strip line and column numbers when generating serialization tests

22 months ago[clang] Fix modules build after D82585
Raphael Isemann [Mon, 6 Jul 2020 15:36:49 +0000 (17:36 +0200)]
[clang] Fix modules build after D82585

Just getting the bots running again.

See the D82585 for more info.

22 months ago[XCOFF][AIX] Give symbol an internal name when desired symbol name contains invalid...
jasonliu [Mon, 6 Jul 2020 14:18:06 +0000 (14:18 +0000)]
[XCOFF][AIX] Give symbol an internal name when desired symbol name contains invalid character(s)

Summary:

When a desired symbol name contains invalid character that the
system assembler could not process, we need to emit .rename
directive in assembly path in order for that desired symbol name
to appear in the symbol table.

Reviewed By: hubert.reinterpretcast, DiggerLin, daltenty, Xiangling_L

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

22 months ago[Support] Fix formatted_raw_ostream for UTF-8
Oliver Stannard [Tue, 17 Mar 2020 14:13:32 +0000 (14:13 +0000)]
[Support] Fix formatted_raw_ostream for UTF-8

* The getLine and getColumn functions need to update the position, or
  they will return stale data for buffered streams. This fixes a bug in
  the clang -analyzer-checker-option-help option, which was not wrapping
  the help text correctly when stdout is not a TTY.
* If the stream contains multi-byte UTF-8 sequences, then the whole
  sequence needs to be considered to be a single character. This has the
  edge case that the buffer might fill up and be flushed part way
  through a character.
* If the stream contains East Asian wide characters, these will be
  rendered twice as wide as other characters, so we need to increase the
  column count to match.

This doesn't attempt to handle everything unicode can do (combining
characters, right-to-left markers, ...), but hopefully covers most
things likely to be common in messages and source code we might want to
print.

Differential revision: https://reviews.llvm.org/D76291

22 months ago[clangd] More complete fix for hover crashes on invalid record.
Haojian Wu [Mon, 6 Jul 2020 15:12:39 +0000 (17:12 +0200)]
[clangd] More complete fix for hover crashes on invalid record.

 We should not call getFieldOffset on invalid record decls.

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

22 months agoReland "[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an ...
Roman Lebedev [Mon, 6 Jul 2020 14:50:31 +0000 (17:50 +0300)]
Reland "[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an `sdiv`/`srem`"

This reverts commit d3e3f36ff1151f565730977ac4f663a2ccee48ae,
which reverter the original commit 2c16100e6f72075564ea1f67fa5a82c269dafcd3,
but with polly tests now actually passing.

22 months ago[lldb] Always round down in NSDate's formatter to match NSDate's builtin format
Raphael Isemann [Mon, 6 Jul 2020 14:31:56 +0000 (16:31 +0200)]
[lldb] Always round down in NSDate's formatter to match NSDate's builtin format

Summary:

When printing an NSDate (for example with `NSLog` or `po`) the seconds value is
always rounded down. LLDB's own formatter however isn't following that behaviour
which leads to situations where the formatted result is sometimes one second
off. For example:

```
(lldb) p [NSDate dateWithTimeIntervalSince1970:0.1]
(__NSTaggedDate *) $1 = [...] 1970-01-01 00:00:01 UTC
(lldb) po [NSDate dateWithTimeIntervalSince1970:0.1]
1970-01-01 00:00:00 +0000

(lldb) p [NSDate dateWithTimeIntervalSince1970:0.6]
(__NSTaggedDate *) $4 =[...] 1970-01-01 00:00:01 UTC
(lldb) po [NSDate dateWithTimeIntervalSince1970:0.6]
1970-01-01 00:00:00 +0000
```

This patch just always rounds down the seconds value we get from the NSDate
object.

Fixes rdar://65084800

Reviewers: mib, davide

Reviewed By: mib

Subscribers: JDevlieghere

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

22 months ago[ARM] MVE FP16 cost adjustments
David Green [Mon, 6 Jul 2020 13:25:16 +0000 (14:25 +0100)]
[ARM] MVE FP16 cost adjustments

This adjusts the MVE fp16 cost model, similar to how we already do for
integer casts. It uses the base cost of 1 per cvt for most fp extend /
truncates, but adjusts it for loads and stores where we know that a
extending load has been used to get the load into the correct lane, and
only an MVE VCVTB is then needed.

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

22 months ago[clang] Fix the incorrect dependence bits for DependentExtIntType.
Haojian Wu [Mon, 6 Jul 2020 14:29:16 +0000 (16:29 +0200)]
[clang] Fix the incorrect dependence bits for DependentExtIntType.

The error-bit was missing, and the unexpandedpack bit seemed to be
set incorrectly.

Reviewed By: sammccall, erichkeane

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

22 months agoRevert "[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an ...
Mikhail Goncharov [Mon, 6 Jul 2020 14:41:59 +0000 (16:41 +0200)]
Revert "[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an `sdiv`/`srem`"

Summary:
This reverts commit 2c16100e6f72075564ea1f67fa5a82c269dafcd3.

ninja check-polly fails:
  Polly :: Isl/CodeGen/MemAccess/generate-all.ll
  Polly :: ScopInfo/multidim_srem.ll

Reviewers: kadircet, bollu

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

22 months ago[LV] Pass dbgs() to verifyFunction call.
Florian Hahn [Mon, 6 Jul 2020 12:52:48 +0000 (13:52 +0100)]
[LV] Pass dbgs() to verifyFunction call.

This is done in other places of the pass already and improves the output
on verification failure.

22 months ago[OpenMP] Temporarily disable failing runtime tests for OpenMP 5.0
Saiyedul Islam [Mon, 6 Jul 2020 14:01:21 +0000 (14:01 +0000)]
[OpenMP] Temporarily disable failing runtime tests for OpenMP 5.0

Following tests are failing after upgrading to version 5.0 but are passing
for version 4.5:
1. openmp/runtime/test/env/kmp_set_dispatch_buf.c
2. openmp/runtime/test/worksharing/for/kmp_set_dispatch_buf.c

To be enabled as soon as these tests are fixed.

Reviewed By: ABataev

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

22 months ago[x86] add tests for vector select with non-splat bit-test condition; NFC
Sanjay Patel [Mon, 6 Jul 2020 13:49:50 +0000 (09:49 -0400)]
[x86] add tests for vector select with non-splat bit-test condition; NFC

Goes with D83181.

22 months ago[clang-tidy] Fix incorrect default option in fc3c693b61
Nathan James [Mon, 6 Jul 2020 13:44:03 +0000 (14:44 +0100)]
[clang-tidy] Fix incorrect default option in fc3c693b61

22 months ago[clang-tidy] Added alias llvm-else-after-return.
Nathan James [Mon, 6 Jul 2020 13:39:02 +0000 (14:39 +0100)]
[clang-tidy] Added alias llvm-else-after-return.

Added an alias llvm-else-after-return from readability-else-after-return to help enforce one of the llvm coding guidelines.

Reviewed By: aaron.ballman

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

22 months ago[analyzer] Don't allow hidden checkers to emit diagnostics
Kirstóf Umann [Wed, 27 May 2020 10:27:32 +0000 (12:27 +0200)]
[analyzer] Don't allow hidden checkers to emit diagnostics

Hidden checkers (those marked with Hidden in Checkers.td) are meant for
development purposes only, and are only displayed under
-analyzer-checker-help-developer, so users shouldn't see reports from them.

I moved StdLibraryFunctionsArg checker to the unix package from apiModeling as
it violated this rule. I believe this change doesn't deserve a different
revision because it is in alpha, and the name is so bad anyways I don't
immediately care where it is, because we'll have to revisit it soon enough.

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

22 months ago[ARM] Adjust default fp extend and trunc costs
David Green [Mon, 6 Jul 2020 10:35:01 +0000 (11:35 +0100)]
[ARM] Adjust default fp extend and trunc costs

This adds some default costs for fp extends and truncates, generally
costing them as 1 per lane. If the type is not legal then the cost will
include a call to an __aeabi_ function.

Some NEON code is also adjusted to make sure it applies to the expected
types, now that fp16 is a more common thing.

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

22 months agoGlobalISel: Move finalizeLowering call later
Matt Arsenault [Mon, 6 Jul 2020 03:21:30 +0000 (23:21 -0400)]
GlobalISel: Move finalizeLowering call later

This matches the DAG behavior where this is called after the loop
checking for calls. The AMDGPU implementation depends on knowing if
there are calls in the function or not, so move this later.

Another problem is finalizeLowering is actually called twice; I was
seeing weird inconsistencies since the first call would produce
unexpected results and the second run would correct them in some
contexts. Since this requires disabling the verifier, and it's useful
to serialize the MIR immediately after selection, FinalizeISel should
probably not be a real pass.

22 months agoAMDGPU/GlobalISel: Don't emit code for unused kernel arguments
Matt Arsenault [Sun, 5 Jul 2020 20:35:01 +0000 (16:35 -0400)]
AMDGPU/GlobalISel: Don't emit code for unused kernel arguments

22 months agoAMDGPU/GlobalISel: Fix hardcoded register number checks in test
Matt Arsenault [Sun, 5 Jul 2020 20:27:00 +0000 (16:27 -0400)]
AMDGPU/GlobalISel: Fix hardcoded register number checks in test

22 months agoAMDGPU: Fix fixed ABI SGPR arguments
Matt Arsenault [Sun, 5 Jul 2020 17:55:29 +0000 (13:55 -0400)]
AMDGPU: Fix fixed ABI SGPR arguments

The default constructor wasn't setting isSet o the ArgDescriptor, so
while these had the value set, they were treated as missing. This only
ended up mattering in the indirect call case (and for regular calls in
GlobalISel, which current doesn't have a way to support the variable
ABI).

22 months agoAMDGPU/GlobalISel: Add some missing return tests
Matt Arsenault [Mon, 6 Jul 2020 13:00:41 +0000 (09:00 -0400)]
AMDGPU/GlobalISel: Add some missing return tests

22 months ago[X86][XOP] Add XOP target vselect-pcmp tests
Simon Pilgrim [Mon, 6 Jul 2020 12:01:30 +0000 (13:01 +0100)]
[X86][XOP] Add XOP target vselect-pcmp tests

Noticed in the D83181 that XOP can probably do a lot more than other targets due to its vector shifts and vpcmov instructions

22 months agoRegenerate subreg liverange tests. NFC.
Simon Pilgrim [Mon, 6 Jul 2020 11:50:17 +0000 (12:50 +0100)]
Regenerate subreg liverange tests. NFC.

To simplify the diffs in a patch in development.

22 months agoRegenerate neon copy tests. NFC.
Simon Pilgrim [Mon, 6 Jul 2020 11:49:21 +0000 (12:49 +0100)]
Regenerate neon copy tests. NFC.

To simplify the diffs in a patch in development.

22 months ago[analyzer][NFC] Don't allow dependency checkers to emit diagnostics
Kirstóf Umann [Wed, 27 May 2020 10:27:32 +0000 (12:27 +0200)]
[analyzer][NFC] Don't allow dependency checkers to emit diagnostics

The thrilling conclusion to the barrage of patches I uploaded lately! This is a
big milestone towards the goal set out in http://lists.llvm.org/pipermail/cfe-dev/2019-August/063070.html.
I hope to accompany this with a patch where the a coreModeling package is added,
from which package diagnostics aren't allowed either, is an implicit dependency
of all checkers, and the core package for the first time can be safely disabled.

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

22 months ago[mlir][Vector] Add custom slt / SCF.if folding to VectorToSCF
Nicolas Vasilache [Mon, 6 Jul 2020 12:16:53 +0000 (08:16 -0400)]
[mlir][Vector] Add custom slt / SCF.if folding to VectorToSCF

scf.if currently lacks folding on true / false conditionals.
Such foldings are a bit more involved than can be addressed immediately.
This revision introduces an eager folding  for lowering vector.transfer operations in the presence of unrolling.

Differential revision: https://reviews.llvm.org/D83146

22 months ago[mlir][Vector] Add a VectorUnrollInterface and expose UnrollVectorPattern.
Nicolas Vasilache [Mon, 6 Jul 2020 10:28:50 +0000 (06:28 -0400)]
[mlir][Vector] Add a VectorUnrollInterface and expose UnrollVectorPattern.

The UnrollVectorPattern is can be used in a programmable fashion by:
```
OwningRewritePatternList patterns;
    patterns.insert<UnrollVectorPattern<AddFOp>>(ArrayRef<int64_t>{2, 2}, ctx);
    patterns.insert<UnrollVectorPattern<vector::ContractionOp>>(
        ArrayRef<int64_t>{2, 2, 2}, ctx);
    ...
    applyPatternsAndFoldGreedily(getFunction(), patterns);
```

Differential revision: https://reviews.llvm.org/D83064

22 months ago[PowerPC] Legalize SREM/UREM directly on P9.
Esme-Yi [Mon, 6 Jul 2020 11:47:31 +0000 (11:47 +0000)]
[PowerPC] Legalize SREM/UREM directly on P9.

Summary: As Bugzilla-35090 reported, the rationale for using custom lowering SREM/UREM should no longer be true. At the IR level, the div-rem-pairs pass performs the transformation where the remainder is computed from the result of the division when both a required. We should now be able to lower these directly on P9. And the pass also fixed the problem that divide is in a different block than the remainder. This is a patch to remove redundant code and make SREM/UREM legal directly on P9.

Reviewed By: lkail

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

22 months agoRemoved a RecursiveASTVisitor feature to visit operator kinds with different methods
Dmitri Gribenko [Fri, 3 Jul 2020 15:01:01 +0000 (17:01 +0200)]
Removed a RecursiveASTVisitor feature to visit operator kinds with different methods

Summary:
This feature was only used in two places, but contributed a non-trivial
amount to the complexity of RecursiveASTVisitor, and was buggy (see my
recent patches where I was fixing the bugs that I noticed). I don't
think the convenience benefit of this feature is worth the complexity.

Besides complexity, another issue with the current state of
RecursiveASTVisitor is the non-uniformity in how it handles different
AST nodes. All AST nodes follow a regular pattern, but operators are
special -- and this special behavior not documented. Correct usage of
RecursiveASTVisitor relies on shadowing member functions with specific
names and signatures. Near misses don't cause any compile-time errors,
incorrectly named or typed methods are just silently ignored. Therefore,
predictability of RecursiveASTVisitor API is quite important.

This change reduces the size of the `clang` binary by 38 KB (0.2%) in
release mode, and by 7 MB (0.3%) in debug mode. The `clang-tidy` binary
is reduced by 205 KB (0.3%) in release mode, and by 5 MB (0.4%) in debug
mode. I don't think these code size improvements are significant enough
to justify this change on its own (for me, the primary motivation is
reducing code complexity), but they I think are a nice side-effect.

Reviewers: rsmith, sammccall, ymandel, aaron.ballman

Reviewed By: rsmith, sammccall, ymandel, aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

22 months agoMake RecursiveASTVisitor call WalkUpFrom for operators when the data recursion queue...
Dmitri Gribenko [Fri, 3 Jul 2020 10:39:14 +0000 (12:39 +0200)]
Make RecursiveASTVisitor call WalkUpFrom for operators when the data recursion queue is absent

Reviewers: eduucaldas, ymandel, rsmith

Reviewed By: eduucaldas

Subscribers: gribozavr2, cfe-commits

Tags: #clang

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

22 months agoMake RecursiveASTVisitor call WalkUpFrom for unary and binary operators in post-order...
Dmitri Gribenko [Fri, 3 Jul 2020 10:39:03 +0000 (12:39 +0200)]
Make RecursiveASTVisitor call WalkUpFrom for unary and binary operators in post-order traversal mode

Reviewers: ymandel, eduucaldas, rsmith

Reviewed By: eduucaldas, rsmith

Subscribers: gribozavr2, cfe-commits

Tags: #clang

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

22 months agoRecursiveASTVisitor: don't call WalkUp unnecessarily in post-order traversal
Dmitri Gribenko [Fri, 3 Jul 2020 11:55:01 +0000 (13:55 +0200)]
RecursiveASTVisitor: don't call WalkUp unnecessarily in post-order traversal

Summary:
How does RecursiveASTVisitor call the WalkUp callback for expressions?

* In pre-order traversal mode, RecursiveASTVisitor calls the WalkUp
  callback from the default implementation of Traverse callbacks.

* In post-order traversal mode when we don't have a DataRecursionQueue,
  RecursiveASTVisitor also calls the WalkUp callback from the default
  implementation of Traverse callbacks.

* However, in post-order traversal mode when we have a DataRecursionQueue,
  RecursiveASTVisitor calls the WalkUp callback from PostVisitStmt.

As a result, when the user overrides the Traverse callback, in pre-order
traversal mode they never get the corresponding WalkUp callback. However
in the post-order traversal mode the WalkUp callback is invoked or not
depending on whether the data recursion optimization could be applied.

I had to adjust the implementation of TraverseCXXForRangeStmt in the
syntax tree builder to call the WalkUp method directly, as it was
relying on this behavior. There is an existing test for this
functionality and it prompted me to make this extra fix.

In addition, I had to fix the default implementation implementation of
RecursiveASTVisitor::TraverseSynOrSemInitListExpr to call WalkUpFrom in
the same manner as the implementation generated by the DEF_TRAVERSE_STMT
macro. Without this fix, the InitListExprIsPostOrderNoQueueVisitedTwice
test was failing because WalkUpFromInitListExpr was never called.

Reviewers: eduucaldas, ymandel

Reviewed By: eduucaldas, ymandel

Subscribers: gribozavr2, cfe-commits

Tags: #clang

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

22 months ago[TargetLowering] Improve expansion of FSHL/FSHR by non-zero amount
Jay Foad [Fri, 29 May 2020 09:57:42 +0000 (10:57 +0100)]
[TargetLowering] Improve expansion of FSHL/FSHR by non-zero amount

Use a simpler code sequence when the shift amount is known not to be
zero modulo the bit width.

Nothing much uses this until D77152 changes the translation of fshl and
fshr intrinsics.

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

22 months ago[TargetLowering] Improve expansion of ROTL/ROTR
Jay Foad [Fri, 3 Apr 2020 13:11:56 +0000 (14:11 +0100)]
[TargetLowering] Improve expansion of ROTL/ROTR

Using a negation instead of a subtraction from a constant can save an
instruction on some targets.

Nothing much uses this until D77152 changes the translation of fshl and
fshr intrinsics.

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

22 months ago[analyzer] Force dependency checkers to be hidden
Kirstóf Umann [Fri, 12 Jun 2020 18:54:24 +0000 (20:54 +0200)]
[analyzer] Force dependency checkers to be hidden

Since strong dependencies aren't user-facing (its hardly ever legal to disable
them), lets enforce that they are hidden. Modeling checkers that aren't
dependencies are of course not impacted, but there is only so much you can do
against developers shooting themselves in the foot :^)

I also made some changes to the test files, reversing the "test" package for,
well, testing.

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

22 months ago[Support] fix user_cache_directory on mac
Sam McCall [Mon, 6 Jul 2020 10:54:11 +0000 (12:54 +0200)]
[Support] fix user_cache_directory on mac

22 months ago[SystemZ/ZOS] Implement getMainExecutable() and is_local_impl()
Kai Nacke [Mon, 6 Jul 2020 09:53:29 +0000 (05:53 -0400)]
[SystemZ/ZOS] Implement getMainExecutable() and is_local_impl()

Adds implementation of getMainExecutable() and is_local_impl() to
Support/Unix/Path.inc. Both are needed to compile LLVM for z/OS.

Reviewed By: hubert.reinterpretcast, emaste

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

22 months ago[SystemZ/ZOS] Define Endian constants for z/OS.
Kai Nacke [Mon, 15 Jun 2020 11:16:52 +0000 (13:16 +0200)]
[SystemZ/ZOS] Define Endian constants for z/OS.

This is needed to build LLVM on z/OS, as there is no header file
which provides these constants.

Reviewed By: hubert.reinterpretcast

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

22 months ago[Scalarizer] visit{Insert,Extract}ElementInst(): avoid call arg evaluation order...
Roman Lebedev [Mon, 6 Jul 2020 10:42:11 +0000 (13:42 +0300)]
[Scalarizer] visit{Insert,Extract}ElementInst(): avoid call arg evaluation order deps

Compilers may evaluate call arguments in different order,
which would result in different order of IR, which would break the tests.

Spotted thanks to Dmitri Gribenko!

22 months ago[ARM] Add extra extend and trunc costs for cast instructions
David Green [Mon, 6 Jul 2020 10:00:43 +0000 (11:00 +0100)]
[ARM] Add extra extend and trunc costs for cast instructions

This expands the existing extend costs with a few extras for larger
types than legal, which will usually be split under MVE. It also adds
trunk support for the same thing. These should not have a large effect
on many things, but makes the costs explicit and keeps a certain balance
between the trunks and extends.

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

22 months ago[Support] Add path::user_config_directory for $XDG_CONFIG_HOME etc
Sam McCall [Fri, 3 Jul 2020 13:49:36 +0000 (15:49 +0200)]
[Support] Add path::user_config_directory for $XDG_CONFIG_HOME etc

Reviewers: hokein

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

22 months ago[Scalarizer] ExtractElement handling w/ variable insert index (PR46524)
Roman Lebedev [Mon, 6 Jul 2020 09:39:16 +0000 (12:39 +0300)]
[Scalarizer] ExtractElement handling w/ variable insert index (PR46524)

Summary:
Similar to D82961.

Reviewers: bjope, cameron.mcinally, arsenm, jdoerfert

Reviewed By: jdoerfert

Subscribers: arphaman, wdng, hiraditya, llvm-commits

Tags: #llvm

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

22 months ago[Scalarizer] InsertElement handling w/ variable insert index (PR46524)
Roman Lebedev [Mon, 6 Jul 2020 09:39:16 +0000 (12:39 +0300)]
[Scalarizer] InsertElement handling w/ variable insert index (PR46524)

Summary:
I'm interested in taking the original C++ input,
for which we currently are stuck with an alloca
and producing roughly the lower IR,
with neither an alloca nor a vector ops:
https://godbolt.org/z/cRRWaJ

For that, as intermediate step, i'd to somehow perform scalarization.
As per @arsenmn suggestion, i'm trying to see if scalarizer can help me
avoid writing a bicycle.

I'm not sure if it's really intentional that variable insert is not handled currently.
If it really is, and is supposed to stay that way (?), i guess i could guard it..

See [[ https://bugs.llvm.org/show_bug.cgi?id=46524 | PR46524 ]].

Reviewers: bjope, cameron.mcinally, arsenm, jdoerfert

Reviewed By: jdoerfert

Subscribers: arphaman, uabelho, wdng, hiraditya, llvm-commits

Tags: #llvm

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

22 months ago[Scalarizer] ExtractElement handling w/ constant extract index
Roman Lebedev [Mon, 6 Jul 2020 09:39:11 +0000 (12:39 +0300)]
[Scalarizer] ExtractElement handling w/ constant extract index

Summary:
It appears to be better IR-wise to aggressively scalarize it,
rather than relying on gathering it, and leaving it as-is.

Reviewers: jdoerfert, bjope, arsenm, cameron.mcinally

Reviewed By: jdoerfert

Subscribers: arphaman, wdng, hiraditya, llvm-commits

Tags: #llvm

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

22 months ago[Scalarizer] InsertElement handling w/ constant insert index
Roman Lebedev [Mon, 6 Jul 2020 09:39:06 +0000 (12:39 +0300)]
[Scalarizer] InsertElement handling w/ constant insert index

Summary: As it can be clearly seen from the diff, this results in nicer IR.

Reviewers: jdoerfert, arsenm, bjope, cameron.mcinally

Reviewed By: jdoerfert

Subscribers: arphaman, wdng, hiraditya, llvm-commits

Tags: #llvm

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

22 months ago[InstCombine] Lower infinite combine loop detection thresholds
Roman Lebedev [Mon, 6 Jul 2020 09:38:41 +0000 (12:38 +0300)]
[InstCombine] Lower infinite combine loop detection thresholds

Summary:
1000 iteratons is still kinda a lot.
Would it make sense to iteratively lower it, until it becomes `2`,
with some delay inbetween in order to let users actually potentially encounter it?

Reviewers: spatel, nikic, kuhar

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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