Commit Graph

343154 Commits

Author SHA1 Message Date
Fady Ghanim ba3f863dfb [OpenMP][OMPIRBuilder] Introducing the `OMPBuilderCBHelpers` helper class
This patch introduces a new helper class `OMPBuilderCBHelpers`,
which will contain all reusable C/C++ language specific function-
alities required by the `OMPIRBuilder`.

Initially, this helper class contains the body and finalization
codegen functionalities implemented using callbacks which were
moved here for reusability among the different directives
implemented in the `OMPIRBuilder`, along with RAIIs for preserving
state prior to emitting outlined and/or inlined OpenMP regions.

In the future this helper class will also contain all the different
call backs required by OpenMP clauses/variable privatization.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D74562
2020-02-19 14:11:17 -06:00
Nikita Popov f6875c434e Reapply [IRBuilder] Always respect inserter/folder
Some IRBuilder methods that were originally defined on
IRBuilderBase do not respect custom IRBuilder inserters/folders,
because those were not accessible prior to D73835. Fix this by
making use of existing (and now accessible) IRBuilder methods,
which will handle inserters/folders correctly.

There are some changes in OpenMP and Instrumentation tests, where
bitcasts now get constant folded. I've also highlighted one
InstCombine test which now finishes in two rather than three
iterations, thanks to new instructions being inserted into the
worklist.

Differential Revision: https://reviews.llvm.org/D74787
2020-02-19 20:51:38 +01:00
aartbik 0ba9ee9f0e [mlir] [VectorOps] Framework for progressive lowering of vector.contract
Summary:
Lowers all free/batch dimensions in a vector.contract progressively
into simpler vector.contract operations until a direct vector.reduction
operation is reached. Then lowers 1-D reductions into vector.reduce.

Still TBD:
multi-dimensional contractions that remain after removing all the parallel dims

Reviewers: nicolasvasilache, andydavis1, rriddle

Reviewed By: andydavis1

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74797
2020-02-19 11:36:11 -08:00
Bill Wendling 129c911efa Include static prof data when collecting loop BBs
Summary:
If the programmer adds static profile data to a branch---i.e. uses
"__builtin_expect()" or similar---then we should honor it. Otherwise,
"__builtin_expect()" is ignored in crucial situations. So we trust that
the programmer knows what they're doing until proven wrong.

Subscribers: hiraditya, JDevlieghere, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74809
2020-02-19 11:33:48 -08:00
Max Moroz 076475713c [libFuzzer] Fix denominator in the "inputs have DFT" log line.
Summary:
The number of "inputs have the Data Flow Trace" cannot be greater than
the number of inputs touching the focus function. The existing message is rather
confusing as the same log would mention a greater total number of traces a few
lines above.

Reviewers: kcc, metzman

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D74779
2020-02-19 11:05:14 -08:00
Simon Pilgrim 025ff5a4ea [AMDGPU] Regenerate immediate constant tests 2020-02-19 18:58:44 +00:00
Simon Pilgrim 59982a6d8f [UpdateTestChecks] Add support for '.' in ir function names
Will let us regenerate from amdgpu float constant tests
2020-02-19 18:58:44 +00:00
Louis Dionne 84f80b1faa [CMake] Only detect the linker once in AddLLVM.cmake
Summary:
Otherwise, the build output contains a bunch of "Linker detection: <xxx>"
lines that are really redundant. We also make redundant calls to the
linker, although that is a smaller concern.

Reviewers: smeenai

Subscribers: mgorny, fedor.sergeev, jkorous, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68648
2020-02-19 13:53:38 -05:00
Diego Caballero 376c68539c [mlir][NFC] Fix 'gatherLoops' utility
It replaces DenseMap output with a SmallVector and it
removes empty loop levels from the output.

Reviewed By: andydavis1, mehdi_amini

Differential Revision: https://reviews.llvm.org/D74658
2020-02-19 10:48:14 -08:00
Bardia Mahjour 0a2626d0cd [DDG] Data Dependence Graph - Graph Simplification
Summary:
This is the last functional patch affecting the representation of DDG.
Here we try to simplify the DDG to reduce the number of nodes and edges by
iteratively merging pairs of nodes that satisfy the following conditions,
until no such pair can be identified. A pair of nodes consisting of a and b
can be merged if:

    1. the only edge from a is a def-use edge to b and
    2. the only edge to b is a def-use edge from a and
    3. there is no cyclic edge from b to a and
    4. all instructions in a and b belong to the same basic block and
    5. both a and b are simple (single or multi instruction) nodes.

These criteria allow us to fold many uninteresting def-use edges that
commonly exist in the graph while avoiding the risk of introducing
dependencies that didn't exist before.

Authored By: bmahjour

Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

Reviewed By: Meinersbur

Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto, ppc-slack

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72350
2020-02-19 13:41:51 -05:00
River Riddle fd0e8b4c0c [mlir][NFC] Fix warning for mismatched sign comparison. 2020-02-19 10:40:41 -08:00
Florian Hahn c7fc0e5da6 Revert "[PatternMatch] Match XOR variant of unsigned-add overflow check."
This reverts commit e01a3d49c2.
and commit a6a585b803.

This causes a failure on GreenDragon:
http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/9597
2020-02-19 19:37:08 +01:00
River Riddle 4a7364f1c2 [mlir][Parser] Use APFloat instead of FloatAttr when parsing DenseElementsAttrs.
Summary: DenseElementsAttr stores float values as raw bits internally, so creating attributes just to have them unwrapped is extremely inefficient.

Differential Revision: https://reviews.llvm.org/D74818
2020-02-19 10:30:07 -08:00
River Riddle 6b6c96695c [mlir][ODS] Add a new trait `TypesMatchWith`
Summary:
This trait takes three arguments: lhs, rhs, transformer. It verifies that the type of 'rhs' matches the type of 'lhs' when the given 'transformer' is applied to 'lhs'. This allows for adding constraints like: "the type of 'a' must match the element type of 'b'". A followup revision will add support in the declarative parser for using these equality constraints to port more c++ parsers to the declarative form.

Differential Revision: https://reviews.llvm.org/D74647
2020-02-19 10:18:58 -08:00
Jonas Devlieghere df590f51b6 [lldb/Core] Remove locking in the PluginManager
Remove locking as all the plugin registration takes place from a single
thread. Addresses Pavel's feedback in D74816.
2020-02-19 10:04:05 -08:00
Tyker 170ae68fef [AssumeBundle] Add documentation for the operand bundles of an llvm.assume
Summary:
Operand bundles on an llvm.assume allows representing
assumptions that an attribute holds for a certain value at a certain position.
Operand bundles enable assumptions that are either hard or impossible to
represent as a boolean argument of an llvm.assume.

Reviewers: jdoerfert, fhahn, nlopes, reames, regehr, efriedma

Reviewed By: jdoerfert

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74209
2020-02-19 18:53:15 +01:00
Jonas Paulsson 0eddeeab29 [ValueTracking] Improve isKnownNonNaN() to recognize zero splats.
isKnownNonNaN() could not recognize a zero splat because that is a
ConstantAggregateZero which is-a ConstantData but not a ConstantDataVector.

Patch makes a ConstantAggregateZero return true.

Review: Thomas Lively

Differential Revision: https://reviews.llvm.org/D74263
2020-02-19 09:35:36 -08:00
Nico Weber 187204cd74 [gn build] use \bfoo\b instead of \<foo\> in sync script
\<foo\> is more correct, but since we use shell=True on Windows,
the < and > get interpreted as redirection operators.

Rather than adding cmd escaping, just use \bfoo\b, which is Good
Enough Often Enough.
2020-02-19 12:32:02 -05:00
LLVM GN Syncbot 069b85fed1 [gn build] Port a54d81f597 2020-02-19 17:28:29 +00:00
Sean Silva e84aa5922b Fix Block::eraseArgument when block arg is also a successor operand.
Summary:
This could trigger an assertion due to the block argument being used by
this block's own successor operands.

Reviewers: rriddle!

Subscribers: mehdi_amini, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74583
2020-02-19 09:25:06 -08:00
Nico Weber f14f9bd22e [gn build] Set up include_dirs for a54d81f597 (first checker in a subdir) 2020-02-19 12:24:01 -05:00
Craig Topper f559cecc3e [X86] Add DCI.isBeforeLegalize() check to the v64i1 constant splitting code in combineStore.
We only need to split after type legalization. If we're before
we can just use a wide store and type legalization will split it.

Add a v128i1 test to exercise it post type legalization.
2020-02-19 09:18:16 -08:00
Zurab Tsinadze a54d81f597 [analyzer] CERT: POS34-C
Summary:
This patch introduces a new checker:
`alpha.security.cert.pos.34c`

This checker is implemented based on the following rule:
https://wiki.sei.cmu.edu/confluence/x/6NYxBQ
The check warns if  `putenv` function is
called with automatic storage variable as an argument.

Differential Revision: https://reviews.llvm.org/D71433
2020-02-19 18:12:19 +01:00
Stanislav Mekhanoshin ada205e91e [AMDGPU] Fix assumption about LaneBitmask content
Yet another assumption about an actual LaneBitmask content
is fixed.

Differential Revision: https://reviews.llvm.org/D74805
2020-02-19 09:07:11 -08:00
Eric Fiselier a829443cc7 [libc++] Fix ABI break in __bit_reference.
The libc++ __bit_iterator type has weird ABI calling conventions as a
quirk
of the implementation. The const bit iterator is trivial, but the
non-const
bit iterator is not because it declares a user-defined copy constructor.

Changing this now is an ABI break, so this test ensures that each type
is trivial/non-trivial as expected.

The definition of 'non-trivial for the purposes of calls':
  A type is considered non-trivial for the purposes of calls if:
      * it has a non-trivial copy constructor, move constructor, or
            destructor, or
	        * all of its copy and move constructors are deleted.
2020-02-19 12:02:06 -05:00
Jordan Rupprecht 3f7d0e7e31 [NFC][compiler-rt][test] Fully qualify string -> std::string 2020-02-19 08:59:26 -08:00
Nikita Popov b92b1701cd Revert "[IRBuilder] Always respect inserter/folder"
This reverts commit f12fb2d99b.

I missed some changes in instrumentation test cases.
2020-02-19 17:51:55 +01:00
Alexandre Eichenberger 476ca094c8 [mlir][ods] Adding attribute setters generation
In some dialects, attributes may have default values that may be
determined only after shape inference. For example, attributes that
are dependent on the rank of the input cannot be assigned a default
value until the rank of the tensor is inferred.

While we can set attributes without explicit setters, referring to
the attributes via accessors instead of having to use the string
interface is better for compile time verification.

The proposed patch add one method per operation attribute that let us
set its value. The code is a very small modification of the existing
getter methods.

Differential Revision: https://reviews.llvm.org/D74143
2020-02-19 11:49:34 -05:00
Nikita Popov 6b5ce0de7e [InstCombine] Fix removal from deferred instructions
Make sure we don't skip the Deferred.remove() call if the
instruction is not in the worklist. Both of those are separate.

We don't have any cases where deferred instructions get removed
right now, but may cause problems in the future.
2020-02-19 17:48:28 +01:00
David Goldman f50fe5eb6d [Sema][CodeComplete] Handle symlinks for include code completion
Summary:
Previously any symlinks would be ignored since the directory
traversal doesn't follow them.

With this change we now follow symlinks (via a `stat` call
in order to figure out the target type of the symlink if it
is valid).

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D74790
2020-02-19 11:45:58 -05:00
Nikita Popov f12fb2d99b [IRBuilder] Always respect inserter/folder
Some IRBuilder methods that were originally defined on
IRBuilderBase do not respect custom IRBuilder inserters/folders,
because those were not accessible prior to D73835. Fix this by
making use of existing (and now accessible) IRBuilder methods,
which will handle inserters/folders correctly.

There are some changes in OpenMP tests, where bitcasts now get
constant folded. I've also highlighted one InstCombine test which
now finishes in two rather than three iterations, thanks to new
instructions being inserted into the worklist.

Differential Revision: https://reviews.llvm.org/D74787
2020-02-19 17:44:43 +01:00
Simon Pilgrim 7a554270c0 [SystemZ] Regenerate risbg tests. NFCI.
Pre-commit for some upcoming SimplifyDemandedBits bitrotate handling.
2020-02-19 16:39:28 +00:00
Denis Khalikov 896ee361a6 [mlir][spirv] Add mlir-vulkan-runner
Add an initial version of mlir-vulkan-runner execution driver.
A command line utility that executes a MLIR file on the Vulkan by
translating MLIR GPU module to SPIR-V and host part to LLVM IR before
JIT-compiling and executing the latter.

Differential Revision: https://reviews.llvm.org/D72696
2020-02-19 11:37:26 -05:00
Raphael Isemann bb61021a8f [lldb][NFC] Remove giant do{...}while(false); in ClangASTSource::FindExternalVisibleDecls 2020-02-19 17:35:07 +01:00
Daniel Fava 9b91bcf6c6 tsan: removing redundant loop in ThreadClock::release()
The removed loop clears reused for entries at the tail of a SyncClock.
The loop is redundant since those entries were already cleared by the
immediately preceding loop, which iterates over all entries in the
SyncClock (including the tail entries).
2020-02-19 17:30:00 +01:00
Alex Zinenko d97d409277 [mlir] NFC: use ValueRange for BlockArgument in ConvertStandardToLLVM
When the conversion was implemented, ValueRange did not support
BlockArguments the code materialized a vector. This is no longer
necessary.
2020-02-19 17:26:30 +01:00
Mikhail Maltsev 461fd94f00 [ARM,MVE] Fix predicate types of some intrinsics
Summary:
Some predicated MVE intrinsics return a vector with element size
different from the input vector element size. In this case the
predicate must type correspond to the output vector type.

The following intrinsics use the incorrect predicate type:
* llvm.arm.mve.mull.int.predicated
* llvm.arm.mve.mull.poly.predicated
* llvm.arm.mve.vshll.imm.predicated

This patch fixes the issue.

Reviewers: simon_tatham, dmgreen, ostannard, MarkMurrayARM

Reviewed By: MarkMurrayARM

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D74838
2020-02-19 16:24:54 +00:00
Cameron McInally 3931734990 [AArch64][SVE] Add initial backend support for FP splat_vector
Differential Revision: https://reviews.llvm.org/D74632
2020-02-19 10:19:11 -06:00
Nico Weber bde0e320bc [gn build] revert e8e078c8bf
Now that I've updated ancient goma clients on the bots, this should
work. (Internal goma bug: b/139410332, fixed months ago.)
2020-02-19 11:11:25 -05:00
Jay Foad b329d1b06e [AMDGPU][ConstantFolding] Fold llvm.amdgcn.fmul.legacy intrinsic
Reviewers: arsenm, rampitec, nhaehnle

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74835
2020-02-19 16:01:30 +00:00
Stefan Pintilie 440ca29ea2 [Hexagon][NFC] Rename VK_Hexagon_PCREL to VK_PCREL
On PowerPC we will soon need to use pcrel to indicate PC Relative addressing.
Renamed the Hexagon specific variant kind to a non target specific VK so that
it can be used on both Hexagon and PowerPC.

Differential Revision: https://reviews.llvm.org/D74788
2020-02-19 09:52:58 -06:00
Krzysztof Parzyszek bc23e83e45 Add <128 x i1> as an intrinsic type 2020-02-19 09:38:13 -06:00
Florian Hahn a6a585b803 [CGP] Adjust CodeGen tests after e01a3d49c2 2020-02-19 16:05:00 +01:00
Florian Hahn e01a3d49c2 [PatternMatch] Match XOR variant of unsigned-add overflow check.
Instcombine folds (a + b <u a) to (a ^ -1 <u b) and that does not match
the expected pattern in CodeGenPerpare via UAddWithOverflow.

This causes a regression over Clang 7 on both X86 and AArch64:
https://gcc.godbolt.org/z/juhXYV

This patch extends UAddWithOverflow to also catch the XOR case, if the
XOR is only used in the ICMP. This covers just a single case, but I'd
like to make sure I am not missing anything before tackling the other
cases.

Reviewers: nikic, RKSimon, lebedev.ri, spatel

Reviewed By: nikic, lebedev.ri

Differential Revision: https://reviews.llvm.org/D74228
2020-02-19 15:25:18 +01:00
Matt Arsenault ff4639f060 AMDGPU/GlobalISel: Select MUBUF path for global atomic cmpxchg
I'm not sure why this isn't a pattern, but the DAG manually selects
this.
2020-02-19 06:19:22 -08:00
Pierre-vh 39cecabece [AArch64][ASMParser] Refuse equal source/destination for LDRAA/LDRAB
Differential Revision: https://reviews.llvm.org/D74822
2020-02-19 14:15:17 +00:00
Raphael Isemann 53eece04bd [lldb][NFC] Modernize test setup code in several lang/cpp tests
All these tests can just call lldbutil.run_to_source_breakpoint
instead of reimplementing it.
2020-02-19 15:07:26 +01:00
Raphael Isemann 1b2deb9ae0 [lldb] Remove Windows X-fail for TestCPPAuto and TestStepTarget
TestCPPAuto was only failing on windows due to the std::string
copying (which was not related at all to 'auto' functionality).

TestStepTarget is now also passing but that seems more that we
now have by accident the right behavior in Windows. I'll remove
the x-fail just to make the bot green again.
2020-02-19 15:05:36 +01:00
Jay Foad a912275864 [TableGen] Diagnose undefined fields when generating searchable tables
Summary:
Previously TableGen would crash trying to print the undefined value as
an integer.

Change-Id: I3900071ceaa07c26acafb33bc49966d7d7a02828

Reviewers: nhaehnle

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74210
2020-02-19 14:03:48 +00:00
Sven van Haastregt 81e8b60b72 [OpenCL] Only declare _sat conversions for integer types
The `-fdeclare-opencl-builtins` option was accepting saturated
conversions for non-integer types, which contradicts both the OpenCL
specification (v2.0 s6.2.3) and Clang's opencl-c.h file.
2020-02-19 13:52:58 +00:00