Commit Graph

344651 Commits

Author SHA1 Message Date
kpdev 0dfcb23b05 [NFC][Test commit] Remove redundant point in docs 2020-03-07 10:30:42 +03:00
Rafael Ávila de Espíndola a5704f92b8 [Sema] Initialize IsSurrogate
This fixes https://bugs.llvm.org/show_bug.cgi?id=45096

Differential Revision: https://reviews.llvm.org/D75701
2020-03-07 12:24:35 -08:00
Ruyman 118b057f12 [SYCL] Driver option to select SYCL version
Summary:
User can select the version of SYCL the compiler will
use via the flag -sycl-std, similar to -cl-std.

The flag defines the LangOpts.SYCLVersion option to the
version of SYCL. The default value is undefined.
If driver is building SYCL code, flag is set to the default SYCL
version (1.2.1)

The preprocessor uses this variable to define CL_SYCL_LANGUAGE_VERSION macro,
which should be defined according to SYCL 1.2.1 standard.

Only valid value at this point for the flag is 1.2.1.

Co-Authored-By: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
Signed-off-by: Ruyman Reyes <ruyman@codeplay.com>

Subscribers: ebevhan, Anastasia, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D72857
2020-03-07 18:28:54 +03:00
Craig Topper ec1d1f6ae7 [X86] Use MVT instead of EVT in a couple shuffle lowering functions. 2020-03-07 09:50:53 -08:00
Mehdi Amini 8c70c42be2 Fix MLIR clang-tidy: when tweaking it does not inherit from the parent
It is almost identical to the top-level .clang-tidy, except that
{Member,Parameter,Variable}Case use camelBack.
2020-03-07 17:44:21 +00:00
Michał Górny 172d564c73 [lldb] Un-XFAIL two tests on NetBSD 2020-03-07 18:35:22 +01:00
Nikita Popov 51a466a61f [InstCombine] Fix known bits handling in SimplifyDemandedUseBits
Fixes a regression from D75801. SimplifyDemandedUseBits() is also
supposed to compute the known bits (of the demanded subset) of the
instruction. For unknown instructions it does so by directly calling
computeKnownBits(). For known instructions it will compute known
bits itself. However, for instructions where only some cases are
handled directly (e.g. a constant shift amount) the known bits
invocation for the unhandled case is sometimes missing. This patch
adds the missing calls and thus removes the main discrepancy with
ExpensiveCombines mode.

Differential Revision: https://reviews.llvm.org/D75804
2020-03-07 18:16:41 +01:00
Matt Arsenault a4e71f01c0 Assume ieee behavior without denormal-fp-math attribute 2020-03-07 12:10:56 -05:00
Nikita Popov f2419adc48 [InstCombine] Regenerate test checks; NFC 2020-03-07 17:58:33 +01:00
Nikita Popov d2dab92f01 [InstSimplify] Add tests for "returned" attribute; NFC 2020-03-07 17:17:21 +01:00
Nikita Popov 2904a332fe [InstCombine] Add additional known bits folding tests; NFC 2020-03-07 17:17:03 +01:00
Nikita Popov 4cfb4afb70 [InstCombine] Highlight tests using expensive combines; NFC 2020-03-07 17:16:47 +01:00
Sanjay Patel 89fdee87f7 [InstCombine] regenerate complete test checks; NFC 2020-03-07 10:20:38 -05:00
Sanjay Patel 564f5eed1a [InstCombine] add test for gep (select),... (PR45084); NFC 2020-03-07 10:00:31 -05:00
Sourabh Singh Tomar 498e37e786 [DebugInfo]: Added DWARFv5 macro header flags and corresponding helper
functions.
2020-03-07 17:53:01 +05:30
Stefanos Baziotis 01c48d7d11 [Attributor] Fold terminators before changing instructions to unreachable
It is possible that an instruction to be changed to unreachable is
in the same block with a terminator that can be constant-folded.
In this case, as of now, the instruction will be changed to
unreachable before the terminator is folded. But, then the
whole BB becomes invalidated and so when we go ahead to fold
the terminator, we trap.

Change the order of these two.

Differential Revision: https://reviews.llvm.org/D75780
2020-03-07 12:38:44 +02:00
River Riddle 320f0b0036 [mlir] Change EffectKind in unsigned for bitfield to avoid miscompile in
MSVC

MSVC has problems if the type of the bitfield is different, leading to
invalid code generation.
2020-03-06 23:01:49 -08:00
Mason Remy c3108404c1 [mlir][nfc] Fix building mlir_c_runner_utils for Windows
Summary:
On Windows, building `mlir_c_runner_utils` doesn't properly export
symbols, thus resulting in an implib not being created, which causes
an error when consuming LLVM from external projects.

Differential Revision: https://reviews.llvm.org/D75769
2020-03-06 22:44:45 -08:00
Uday Bondhugula 91153e0624 [mlir][NFC] remove stray decl of toAffineExpr, rename for readability
Summary:
- remove stray toAffineExpr decl in affine analysis (name duplicate of
  mlir::toAffineExpr)

- rename mlir::toAffineExpr for better readability

- related NFC changes

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>

Differential Revision: https://reviews.llvm.org/D75694
2020-03-06 22:38:47 -08:00
Amara Emerson c1a97e992d Revert "Revert "[GlobalISel][Localizer] Enable intra-block localization of already-local uses.""
This reverts commit 5583c2f2fb.

The lldb bot failure was a test that was fragile and sensitive to irrelevant
changes in instruction ordering. Re-committing this as the test should have
been skipped for AArch64 now.

Differential Revision: https://reviews.llvm.org/D75555
2020-03-06 21:35:08 -08:00
Hal Finkel fa913f8980 Add the CodeReview Documentation to GettingInvolved TOC 2020-03-07 04:55:46 +00:00
Hal Finkel 4d0339aecb High-Level Code-Review Documentation Update
This is an update to the documentation of our community code-review process.
Based on the RFC: High-Level Code-Review Documentation Update
(http://lists.llvm.org/pipermail/llvm-dev/2019-November/136808.html).

In this patch, I've pulled out the documentation into a separate file, and
broken it into a number of subsections. This is, of course, just one further
step in better documenting our community processes. I expect we'll continue to
improve this over time. Thank you to everyone who provided feedback!

Differential Revision: https://reviews.llvm.org/D71916
2020-03-07 04:20:18 +00:00
River Riddle f240d303c2 [mlir] Explicitly qualify Effect to avoid MSVC build failure
MSVC qualifies the Effect reference contextually depending on where the
template is instantiated, leading to compiler failures if there is a
different Effect class defined.
2020-03-06 19:18:13 -08:00
Nico Weber 8fef67a2c5 [gn build] copy compiler-rt headers to clang include dir on all platforms 2020-03-06 21:55:56 -05:00
Raphael Isemann 6bbdecc5cf [lldb][NFC] Make TestStats.py not an inline test
There is still the bug that empty lines seem to skip any following expressions
and it makes it harder to commend between all the comments. Let's make this
a normal test instead which is just slightly more verbose but can be properly
formatted.
2020-03-06 18:47:59 -08:00
Raphael Isemann 8f7c911b58 [lldb][NFC] Refactor our option generation out of EvaluateExpression 2020-03-06 18:32:16 -08:00
Greg Clayton eb61ab1bd9 Fix a copy and paste error that would cause a crash.
Summary: The wrong variable was being checked for an error, which mean a llvm::Error went unchecked and crashes dsymutil. Discovered this when trying to feed an ELF file to "dsymutil --update" and running into the crash.

Reviewers: aprantl, JDevlieghere

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75777
2020-03-06 18:07:36 -08:00
Petr Hosek 7003f64c1e [clang-doc] Improving Markdown Output
This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.

The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.

Patch By: Clayton

Differential Revision: https://reviews.llvm.org/D72954
2020-03-06 17:37:08 -08:00
Raphael Isemann 4e7c686e46 [lldb] Never compile the debugserver with Clang module flags
Summary:
Compiling ObjC++ with Clang modules is usually not working well and compiling
the small debugserver with modules is not worth the trouble.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: mgorny, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74891
2020-03-06 17:26:39 -08:00
Raphael Isemann ce1bc00f37 [lldb][cmake] Move remove_module_flags macro to AddLLDB.cmake
Summary: This is currently hidden in the Host CMakeLists but we should also use this macro in other parts of LLDB where we have ObjC++ sources (see D74891)

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D75164
2020-03-06 17:21:24 -08:00
Raphael Isemann 2bba1c22e7 tab completion for process signal
Summary: Provide a list of Unix signals for the tap completion for command "process signal".

Reviewers: teemperor

Subscribers: labath, jingham, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D75418
2020-03-06 17:05:25 -08:00
Akira Hatanaka f4d791f833 [CodeGen][ObjC] Extend lifetime of ObjC pointers passed to calls to
__builtin_os_log_format

This is needed to keep all the objects, including temporaries returned
by function calls, written to the buffer alive until os_log_pack_send is
called.

rdar://problem/60105410
2020-03-06 16:46:50 -08:00
Stephen Neuendorffer d774fbc350 [MLIR] Add document about creating a dialect.
Goal is also to document best naming practices from here:
https://llvm.discourse.group/t/rfc-canonical-file-paths-to-dialects/621

Differential Revision: https://reviews.llvm.org/D75762
2020-03-06 16:37:57 -08:00
Raphael Isemann 53b135eeb4 [lldb][NFC] Refactor TestSafeFuncCalls.py
Summary:
This patch inlines all the single-line functions that we only use once in the test
and replaces the assertTrue with an assertEquals to improve the error message
when this test fails.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D75497
2020-03-06 15:46:36 -08:00
Stephen Neuendorffer 7264cf4e45 [MLIR] Add missing DEPENDS line for MLIRSPIRV
This line was inadvertantly left off, which results in missing dependencies
and a potentially broken build
2020-03-06 15:10:14 -08:00
Andrew Monshizadeh c5a06019d2 Extend TimeTrace to LLVM's new pass manager
With the addition of the LLD time tracing it made sense to include coverage
for LLVM's various passes. Doing so ensures that ThinLTO is also covered
with a time trace.

Before:
{F11333974}

After:
{F11333928}

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D74516
2020-03-06 14:45:19 -08:00
Andrew Monshizadeh 3669f0ed4f Refactor TimeProfiler write methods (NFC)
Added a write method for TimeTrace that takes two strings representing
file names. The first is any file name that may have been provided by the
user via `time-trace-file` flag, and the second is a fallback that should
be configured by the caller. This method makes it cleaner to write the
trace output because there is no longer a need to check file names at the
caller and simplifies future TimeTrace usages.

Reviewed By: modocache

Differential Revision: https://reviews.llvm.org/D74514
2020-03-06 14:34:56 -08:00
Thomas Lively d43fcd0c04 [WebAssembly] Add SIMD integer min/max builtins
Summary:
Although SIMD integer min/max operations can be expressed using the ?:
operator in C++, that operator is disallowed for vectors in C. As a
workaround, this change introduces new WebAssembly-specific builtin
functions that lower to the desired vector icmp/select sequences.

Reviewers: aheejin, dschuff, kripken

Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75770
2020-03-06 14:28:52 -08:00
River Riddle 20dca52288 [mlir][SideEffects] Enable specifying side effects directly on the arguments/results of an operation.
Summary:
New classes are added to ODS to enable specifying additional information on the arguments and results of an operation. These classes, `Arg` and `Res` allow for adding a description and a set of 'decorators' along with the constraint. This enables specifying the side effects of an operation directly on the arguments and results themselves.

Example:
```
def LoadOp : Std_Op<"load"> {
  let arguments = (ins Arg<AnyMemRef, "the MemRef to load from",
                           [MemRead]>:$memref,
                       Variadic<Index>:$indices);
}
```

Differential Revision: https://reviews.llvm.org/D74440
2020-03-06 14:04:36 -08:00
River Riddle f8923584da [mlir][SideEffects] Define a set of interfaces and traits for defining side effects
This revision introduces the infrastructure for defining side-effects and attaching them to operations. This infrastructure allows for defining different types of side effects, that don't interact with each other, but use the same internal mechanisms. At the base of this is an interface that allows operations to specify the different effect instances that are exhibited by a specific operation instance. An effect instance is comprised of the following:

* Effect: The specific effect being applied.
  For memory related effects this may be reading from memory, storing to memory, etc.

* Value: A specific value, either operand/result/region argument, the effect pertains to.

* Resource: This is a global entity that represents the domain within which the effect is being applied.

MLIR serves many different abstractions, which cover many different domains. Simple effects are may have very different context, for example writing to an in-memory buffer vs a database. This revision defines uses this infrastructure to define a set of initial MemoryEffects. The are effects that generally correspond to memory of some kind; Allocate, Free, Read, Write.

This set of memory effects will be used in follow revisions to generalize various parts of the compiler, and make others more powerful(e.g. DCE).

This infrastructure was originally proposed here:
https://groups.google.com/a/tensorflow.org/g/mlir/c/v2mNl4vFCUM

Differential Revision: https://reviews.llvm.org/D74439
2020-03-06 14:04:36 -08:00
Fangrui Song 7b8341b257 [ELF][test] Improve MEMORY tests 2020-03-06 14:01:20 -08:00
Shivam Gupta dafc7a5492 Correct the Bjarne Stroustrup's C++ Page link
Summary: Bjarne Stroustrup's C++ Page link pointing to wrong AT&T page.

Reviewers: jyknight, sanjoy, silvas, hubert.reinterpretcast

Reviewed By: hubert.reinterpretcast

Subscribers: hubert.reinterpretcast, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75709
2020-03-06 16:59:50 -05:00
Michael Spencer 16af23fae8 [clang][Headers] Use __has_builtin instead of _MSC_VER.
arm_acle.h relied on `_MSC_VER` to determine if a given function was
already defined as a builtin. This was incorrect because
`-fms-extensions` enables these builtins, but is not responsible for
defining `_MSC_VER` on any target. The next closest thing is
`_MSC_EXTENSIONS`, which is only defined on Windows targets, but even
this is suboptimal. What this conditional is actually trying to
determine is if the given functions are defined as builtins, so just
check that directly.

I also attempted to do this for `__nop`, but in that case intrin.h,
which is only includable if `_MSC_VER` is defined, has its own
definition. So in that case `_MSC_VER` is correct.

Differential Revision: https://reviews.llvm.org/D75719
rdar://60102353
2020-03-06 13:48:09 -08:00
Fangrui Song c3de1d0b1f [gold][test] Fix tests after D75713 and D74749 2020-03-06 13:38:04 -08:00
Reid Kleckner 65b21282c7 Avoid emitting unreachable SP adjustments after `throw`
In 172eee9c, we tried to avoid these by modelling the callee as
internally resetting the stack pointer.

However, for the majority of functions with reserved stack frames, this
would lead LLVM to emit extra SP adjustments to undo the callee's
internal adjustment. This lead us to fix the problem further on down the
pipeline in eliminateCallFramePseudoInstr. In 5b79e603d3, I added
use a heuristic to try to detect when the adjustment would be
unreachable.

This heuristic is imperfect, and when exception handling is involved, it
fails to fire. The new test is an example of this. Simply throwing an
exception with an active cleanup emits dead SP adjustments after the
throw. Not only are they dead, but if they were executed, they would be
incorrect, so they are confusing.

This change essentially reverts 172eee9c and makes the 5b79e603d3
heuristic responsible for preventing unreachable stack adjustments. This
means we may emit unreachable stack adjustments for functions using EH
with unreserved call frames, but that is not very many these days. Back
in 2016 when this change was added, we were focused on 32-bit, which we
observed to have fewer reserved frames.

Fixes PR45064

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D75712
2020-03-06 13:33:45 -08:00
Anna Thomas 59029b9eef [RS4GC] Handle uses of extractelement for conversion from vector to scalar base
As mentioned in the comments, extractelement is special
since we actually want a scalar base for that element we extracted from
the vector (i.e. not a vector base).
This same logic should apply to uses of the extractelement such as phis
and selects which have the same BDV as the extractelement.
Howeber, for these uses we conservatively mark the BDV state as
conflict, since setting the EE's new base BDV does not always dominate
these uses.

Added testcase showcases the problem where the BDV identification chokes
on the incorrect cast from vector to scalar for the phi use of
extractelement.

Tests-Run: make check, internal fuzzer testing

Reviewers: reames, skatkov, dantrushin
Reviewed-By: dantrushin

Differential Revision: https://reviews.llvm.org/D75704
2020-03-06 16:28:49 -05:00
Sterling Augustine eb755df5c2 Split findUnwindSectionsByPhdr into target-specific functions.
Summary:
This further cleans up the control flow and makes it easier to
optimize and replace portions in a subsequent patch.

This should be NFC, but given the amount of #ifdeffing here,
it may not be. So will watch the buildbots closely.

Also, as this is purely moving existing code around, I plan to
ignore the lint errors.

Reviewers: compnerd, miyuki, mstorsjo

Subscribers: libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D75705
2020-03-06 13:28:09 -08:00
Benjamin Barenblat f0f4d41631 [lld][test] Make tests pass when the test directory matches `bar`
Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D72360
2020-03-06 13:27:02 -08:00
Stephen Neuendorffer 9f979d7ad5 [MLIR] Fixes for BUILD_SHARED_LIBS=on
Differential Revision: https://reviews.llvm.org/D75308
2020-03-06 13:25:18 -08:00
Valentin Churavy 7c64f6bf52 [MLIR] Add support for libMLIR.so
Putting this up mainly for discussion on
how this should be done. I am interested in MLIR from
the Julia side and we currently have a strong preference
to dynamically linking against the LLVM shared library,
and would like to have a MLIR shared library.

This patch adds a new cmake function add_mlir_library()
which accumulates a list of targets to be compiled into
libMLIR.so.  Note that not all libraries make sense to
be compiled into libMLIR.so.  In particular, we want
to avoid libraries which primarily exist to support
certain tools (such as mlir-opt and mlir-cpu-runner).

Note that the resulting libMLIR.so depends on LLVM, but
does not contain any LLVM components.  As a result, it
is necessary to link with libLLVM.so to avoid linkage
errors. So, libMLIR.so requires LLVM_BUILD_LLVM_DYLIB=on

FYI, Currently it appears that LLVM_LINK_LLVM_DYLIB is broken
because mlir-tblgen is linked against libLLVM.so and
and independent LLVM components.

Previous version of this patch broke depencies on TableGen
targets.  This appears to be because it compiled all
libraries to OBJECT libraries (probably because cmake
is generating different target names).  Avoiding object
libraries results in correct dependencies.

(updated by Stephen Neuendorffer)

Differential Revision: https://reviews.llvm.org/D73130
2020-03-06 13:25:18 -08:00