platform/upstream/llvm.git
4 years agoAdd missing include
Adrian Prantl [Wed, 15 Jul 2020 22:25:50 +0000 (15:25 -0700)]
Add missing include

4 years ago[LLDB] Disable lldb-vscode test_terminate_commands test on Arm
Muhammad Omair Javaid [Wed, 15 Jul 2020 22:06:53 +0000 (03:06 +0500)]
[LLDB] Disable lldb-vscode test_terminate_commands test on Arm

Summary:
test_terminate_commands is flaky on LLDB Arm buildbot as well. It was already
being skipped for aarch64. I am going to mark it skipped for Arm too.

Tags: #lldb

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

4 years ago[NFCI] createCFGSimplificationPass(): migrate to also take SimplifyCFGOptions
Roman Lebedev [Wed, 15 Jul 2020 22:19:17 +0000 (01:19 +0300)]
[NFCI] createCFGSimplificationPass(): migrate to also take SimplifyCFGOptions

Taking so many parameters is simply unmaintainable.

We don't want to include the entire llvm/Transforms/Utils/Local.h into
llvm/Transforms/Scalar.h so i've split SimplifyCFGOptions into
it's own header.

4 years ago[NFCI] CFGSimplifyPass: change (the only) constructor to take SimplifyCFGOptions
Roman Lebedev [Wed, 15 Jul 2020 21:48:36 +0000 (00:48 +0300)]
[NFCI] CFGSimplifyPass: change (the only) constructor to take SimplifyCFGOptions

Taking that long list of parameters is already simply unmaintainable.

4 years ago[X86] Teach assembler parser to accept lsl and lar with a 64 or 32 source register...
Craig Topper [Wed, 15 Jul 2020 22:14:46 +0000 (15:14 -0700)]
[X86] Teach assembler parser to accept lsl and lar with a 64 or 32 source register when the destination is a 64 register.

Previously we only accepted a 32-bit source with a 64-bit dest.

Accepting 64-bit as well is more consistent with gas behavior. I
think maybe we should accept 16 bit register as well, but I'm not
sure.

4 years ago[flang] Don't use-associate intrinsics
Tim Keith [Wed, 15 Jul 2020 22:08:07 +0000 (15:08 -0700)]
[flang] Don't use-associate intrinsics

When an intrinsic is referenced in a module scope, a symbol for it is
added. When that module is USEd, the intrinsic should not be included.
Otherwise we can get ambiguous reference errors with the same intrinsic
coming from two difference modules.

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

4 years ago[CodeGen] Emit a call instruction instead of an invoke if the called
Akira Hatanaka [Wed, 15 Jul 2020 21:47:45 +0000 (14:47 -0700)]
[CodeGen] Emit a call instruction instead of an invoke if the called
llvm function is marked nounwind

This fixes cases where an invoke is emitted, despite the called llvm
function being marked nounwind, because ConstructAttributeList failed to
add the attribute to the attribute list. llvm optimization passes turn
invokes into calls and optimize away the exception handling code, but
it's better to avoid emitting the code in the front-end if the called
function is known not to raise an exception.

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

4 years ago[NFC][SimplifyCFG] HoistThenElseCodeToIf(): after hoisting terminator, do return...
Roman Lebedev [Wed, 15 Jul 2020 21:27:36 +0000 (00:27 +0300)]
[NFC][SimplifyCFG] HoistThenElseCodeToIf(): after hoisting terminator, do return Changed, not just true

Otherwise, if Changed was still false before that,
we would not account for that hoist in NumHoistCommonCode statistic.

4 years ago[MLIR] Add RegionKindInterface
Stephen Neuendorffer [Fri, 15 May 2020 17:33:13 +0000 (10:33 -0700)]
[MLIR] Add RegionKindInterface

Some dialects have semantics which is not well represented by common
SSA structures with dominance constraints.  This patch allows
operations to declare the 'kind' of their contained regions.
Currently, two kinds are allowed: "SSACFG" and "Graph".  The only
difference between them at the moment is that SSACFG regions are
required to have dominance, while Graph regions are not required to
have dominance.  The intention is that this Interface would be
generated by ODS for existing operations, although this has not yet
been implemented. Presumably, if someone were interested in code
generation, we might also have a "CFG" dialect, which defines control
flow, but does not require SSA.

The new behavior is mostly identical to the previous behavior, since
registered operations without a RegionKindInterface are assumed to
contain SSACFG regions.  However, the behavior has changed for
unregistered operations.  Previously, these were checked for
dominance, however the new behavior allows dominance violations, in
order to allow the processing of unregistered dialects with Graph
regions.  One implication of this is that regions in unregistered
operations with more than one op are no longer CSE'd (since it
requires dominance info).

I've also reorganized the LangRef documentation to remove assertions
about "sequential execution", "SSA Values", and "Dominance".  Instead,
the core IR is simply "ordered" (i.e. totally ordered) and consists of
"Values".  I've also clarified some things about how control flow
passes between blocks in an SSACFG region. Control Flow must enter a
region at the entry block and follow terminator operation successors
or be returned to the containing op.  Graph regions do not define a
notion of control flow.

see discussion here:
https://llvm.discourse.group/t/rfc-allowing-dialects-to-relax-the-ssa-dominance-condition/833/53

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

4 years ago[NFC][SimplifyCFG] HoistThenElseCodeToIf(): count number of common instruction "block...
Roman Lebedev [Wed, 15 Jul 2020 21:10:20 +0000 (00:10 +0300)]
[NFC][SimplifyCFG] HoistThenElseCodeToIf(): count number of common instruction "blocks" hoisted

I.e. out of all the times HoistThenElseCodeToIf() was called,
how many times did it actually hoist something?

4 years ago[NFC][SimplifyCFG] HoistThenElseCodeToIf(): count number of common instructions hoisted
Roman Lebedev [Wed, 15 Jul 2020 21:05:25 +0000 (00:05 +0300)]
[NFC][SimplifyCFG] HoistThenElseCodeToIf(): count number of common instructions hoisted

4 years ago[NFC][SimplifyCFG] SinkCommonCodeFromPredecessors(): count number of instruction...
Roman Lebedev [Wed, 15 Jul 2020 20:55:15 +0000 (23:55 +0300)]
[NFC][SimplifyCFG] SinkCommonCodeFromPredecessors(): count number of instruction "blocks" actually sunk

Out of all the times the function was called,
how many times did we actually sink anything?

4 years ago[NFC][SimplifyCFG] SinkCommonCodeFromPredecessors(): add debug output when failing...
Roman Lebedev [Wed, 15 Jul 2020 20:48:31 +0000 (23:48 +0300)]
[NFC][SimplifyCFG] SinkCommonCodeFromPredecessors(): add debug output when failing to actually sink instr

4 years ago[NFC][SimplifyCFG] SinkCommonCodeFromPredecessors(): early return if nothing to sink
Roman Lebedev [Wed, 15 Jul 2020 20:46:35 +0000 (23:46 +0300)]
[NFC][SimplifyCFG] SinkCommonCodeFromPredecessors(): early return if nothing to sink

If we can't sink even one instruction, early return, to increase readability.

4 years ago[NFC][SimplifyCFG] Rename statistic NumSinkCommons into NumSinkCommonInstrs
Roman Lebedev [Wed, 15 Jul 2020 20:42:40 +0000 (23:42 +0300)]
[NFC][SimplifyCFG] Rename statistic NumSinkCommons into NumSinkCommonInstrs

It really counts instructions added into common block,
not number of instruction groups sunk.

4 years ago[NFC][LoopRotate] Add a statistic for how many times rotation failed due to the heade...
Roman Lebedev [Wed, 15 Jul 2020 20:38:43 +0000 (23:38 +0300)]
[NFC][LoopRotate] Add a statistic for how many times rotation failed due to the header size

4 years ago[jitlink] Adding support for PCRel32GOTLoad in ELF x86 for the jitlinker
Jared Wyles [Tue, 14 Jul 2020 06:57:59 +0000 (16:57 +1000)]
[jitlink] Adding support for PCRel32GOTLoad in ELF x86 for the jitlinker

Summary: This adds the basic support for GOT in elf x86.
Was able to just get away using the macho code by generalising the edges.
There will be a follow up patch to turn that into a generic utility for both of the x86 and Mach-O code.

This patch also lands support for relocations relative to symbol.

Reviewers: lhames

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoDocument the testing of Analyses in the LLVM testing guide (NFC)
Mehdi Amini [Wed, 15 Jul 2020 21:11:39 +0000 (21:11 +0000)]
Document the testing of Analyses in the LLVM testing guide (NFC)

This came up in a recent review, someone was wondering were was
this all documented and I couldn't find a reference to provide.

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

4 years agoClarify a bit the guideline on omitting braces, including more examples (NFC)
Mehdi Amini [Wed, 15 Jul 2020 21:11:30 +0000 (21:11 +0000)]
Clarify a bit the guideline on omitting braces, including more examples (NFC)

Like most readability rules, it isn't absolute and there is a matter of taste
to it. I think more recent part of the project may be more consistent in the
current application of the guideline. I suspect sources like
mlir/lib/Dialect/StandardOps/IR/Ops.cpp may be examples of this at the moment.

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

4 years ago[lldb/Test] Remove custom tearDownHooks from GDB Remote tests
Jonas Devlieghere [Wed, 15 Jul 2020 16:59:54 +0000 (09:59 -0700)]
[lldb/Test] Remove custom tearDownHooks from GDB Remote tests

Remove custom tearDownHooks from GDB Remote tests as we now cleanup
subprocesses unconditionally. This also changes the termination order to
be the reverse of the creation order. I don't think anything is relying
on that right now, but it better fits the setup/teardown paradigm.

4 years ago[NFC] [AIX] [z/OS] Fix build failure on AIX and z/OS
Abhina Sreeskantharajan [Wed, 15 Jul 2020 18:00:57 +0000 (14:00 -0400)]
[NFC] [AIX] [z/OS] Fix build failure on AIX and z/OS

Summary: This PR contains a build failure fix that occurs on both AIX and z/OS as a result of this commit https://reviews.llvm.org/rG670915094462d831e3733e5b01a76471b8cf6dd8.

Reviewers: uweigand, Kai, hubert.reinterpretcast, daltenty, lhames

Reviewed By: Kai, hubert.reinterpretcast, daltenty

Subscribers: SeanP, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[flang] Fix erroneous application of SAVE statement
Tim Keith [Wed, 15 Jul 2020 20:02:32 +0000 (13:02 -0700)]
[flang] Fix erroneous application of SAVE statement

A SAVE statement with no entity list applies the SAVE attribute only to
the entities that it is allowed on. We were applying it to automatic
data objects and reporting an error that they can't have SAVE.

The fix is to change `DeclarationVisitor::CheckSaveAttr` to check for
automatic objects. That controls both checking and setting the
attribute. This allows us to remove the check from `CheckSpecExpr`
(along with `symbolBeingChecked_`). Also, it was only called on constant
objects so the non-const overload can be eliminated.

The check in `CheckSpecExpr` is replaced by an explicit check for
automatic objects in modules. This caught an error in modfile03.f90 so
that part of the test was eliminated.

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

4 years ago[LoopUnroll] Update branch weight for remainder loop
Hongtao Yu [Sun, 5 Jul 2020 03:24:11 +0000 (20:24 -0700)]
[LoopUnroll] Update branch weight for remainder loop

Unrolling a loop with compile-time unknown trip count results in a remainder loop. The remainder loop executes the remaining iterations of the original loop when the original trip count is not a multiple of the unroll factor. For better profile counts maintenance throughout the optimization pipeline, I'm assigning an artificial weight to the latch branch of the remainder loop.

A remainder loop runs up to as many times as the unroll factor subtracted by 1. Therefore I'm assigning the maximum possible trip count as the back edge weight. This should be more accurate than the default non-profile weight, which assumes the back edge runs much more frequently than the exit edge.

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

4 years ago[OPENMP]Fix PR46593: Reduction initializer missing construnctor call.
Alexey Bataev [Tue, 7 Jul 2020 18:52:45 +0000 (14:52 -0400)]
[OPENMP]Fix PR46593: Reduction initializer missing construnctor call.

Summary:
If user-defined reductions with the initializer are used with classes,
the compiler misses the constructor call when trying to create a private
copy of the reduction variable.

Reviewers: jdoerfert

Subscribers: cfe-commits, yaxunl, guansong, caomhin

Tags: #clang

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

4 years ago[NFC] Fixed typo in tests parameters
dfukalov [Wed, 15 Jul 2020 15:55:56 +0000 (18:55 +0300)]
[NFC] Fixed typo in tests parameters

Summary:
llc reports `fp32-denormals` is not recognized. I guess it was intended to be
`-denormal-fp-math-f32={preserve-sign|ieee} -mattr=+mad-mac-f32-insts`

Reviewers: rampitec

Reviewed By: rampitec

Subscribers: jvesely, nhaehnle, llvm-commits, kerbowa

Tags: #llvm

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

4 years ago[MLIR][NFC] Fix clang tidy warnings in misc utilities
Uday Bondhugula [Wed, 15 Jul 2020 10:41:08 +0000 (16:11 +0530)]
[MLIR][NFC] Fix clang tidy warnings in misc utilities

Fix clang tidy warnings in misc utilities - missing const or a star in
declaration.

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

4 years ago[OPENMP]Fix PR46688: cast the type of the allocated variable to the initial one.
Alexey Bataev [Mon, 13 Jul 2020 16:56:18 +0000 (12:56 -0400)]
[OPENMP]Fix PR46688: cast the type of the allocated variable to the initial one.

Summary:
If the original variable is marked for allocation in the different
address space using #pragma omp allocate, need to cast the allocated
variable to its original type with the original address space.
Otherwise, the compiler may crash trying to bitcast the type of the new
allocated variable to the original type in some cases, like passing this
variable as an argument in function calls.

Reviewers: jdoerfert

Subscribers: jholewinski, cfe-commits, yaxunl, guansong, caomhin

Tags: #clang

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

4 years ago[PGO][PGSO] Add profile guided size optimization to loop vectorization legality.
Hiroshi Yamauchi [Tue, 7 Jul 2020 18:26:25 +0000 (11:26 -0700)]
[PGO][PGSO] Add profile guided size optimization to loop vectorization legality.

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

4 years ago[lldb][NFC] Add 'override' where missing in source/ and tools/
Logan Smith [Wed, 15 Jul 2020 18:33:15 +0000 (11:33 -0700)]
[lldb][NFC] Add 'override' where missing in source/ and tools/

These were found by Clang's new -Wsuggest-override.

This patch doesn't touch any code in unittests/, since much of it intentionally doesn't use override to avoid massive warning spam from -Winconsistent-missing-override due to the use of MOCK_*** macros.

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

4 years agoFix "unused variable" warning from recent GCC.
Richard Smith [Wed, 15 Jul 2020 18:33:07 +0000 (11:33 -0700)]
Fix "unused variable" warning from recent GCC.

4 years ago[MLIR] Add type checking capability to RegionBranchOpInterface
Rahul Joshi [Wed, 15 Jul 2020 18:12:38 +0000 (11:12 -0700)]
[MLIR] Add type checking capability to RegionBranchOpInterface

- Add function `verifyTypes` that Op's can call to do type checking verification
  along the control flow edges described the Op's RegionBranchOpInterface.
- We cannot rely on the verify methods on the OpInterface because the interface
  functions assume valid Ops, so they may crash if invoked on unverified Ops.
  (For example, scf.for getSuccessorRegions() calls getRegionIterArgs(), which
  dereferences getBody() block. If the scf.for is invalid with no body, this
  can lead to a segfault). `verifyTypes` can be called post op-verification to
  avoid this.

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

4 years ago[InstCombine] prevent infinite looping in or-icmp fold (PR46712)
Sanjay Patel [Wed, 15 Jul 2020 18:09:46 +0000 (14:09 -0400)]
[InstCombine] prevent infinite looping in or-icmp fold (PR46712)

I'm not sure if the test is truly minimal, but we need to
induce a situation where a value becomes a constant but is
not immediately folded before getting to the 'or' transform.

4 years ago[InstCombine] update datalayout in test file; NFC
Sanjay Patel [Wed, 15 Jul 2020 17:32:59 +0000 (13:32 -0400)]
[InstCombine] update datalayout in test file; NFC

We need to specify legal integer widths to trigger PR46712,
so add those here. This doesn't appear to affect any existing
tests, and it's not clear why a datalayout would not include
any legal integer widths.

While here, change some variable names that include 'tmp' to
avoid warnings from the auto-generating script for CHECK lines.

4 years ago[gn build] Port 4a539faf74b
LLVM GN Syncbot [Wed, 15 Jul 2020 17:53:38 +0000 (17:53 +0000)]
[gn build] Port 4a539faf74b

4 years ago[PGO] Extend the value profile buckets for mem op sizes.
Hiroshi Yamauchi [Thu, 25 Jun 2020 19:19:30 +0000 (12:19 -0700)]
[PGO] Extend the value profile buckets for mem op sizes.

Extend the memop value profile buckets to be more flexible (could accommodate a
mix of individual values and ranges) and to cover more value ranges (from 11 to
22 buckets).

Disabled behind a flag (to be enabled separately) and the existing code to be
removed later.

4 years ago[PGO][PGSO] Add profile guided size optimization to LegalizeDAG.
Hiroshi Yamauchi [Tue, 7 Jul 2020 18:13:55 +0000 (11:13 -0700)]
[PGO][PGSO] Add profile guided size optimization to LegalizeDAG.

Reviewers: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[mlir][shape] Fold shape.broadcast with one scalar operand
Stephan Herhut [Wed, 15 Jul 2020 07:25:39 +0000 (09:25 +0200)]
[mlir][shape] Fold shape.broadcast with one scalar operand

This folds shape.broadcast where at least one operand is a scalar to the
other operand.

Also add an assemblyFormat for shape.broadcast and shape.concat.

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

4 years ago[AMDGPU][MC] Corrected MTBUF parsing and decoding
Dmitry Preobrazhensky [Wed, 15 Jul 2020 16:44:07 +0000 (19:44 +0300)]
[AMDGPU][MC] Corrected MTBUF parsing and decoding

MTBUF implementation has many issues and this change addresses most of these:
- refactored duplicated code;
- hardcoded constants moved out of high-level code;
- fixed a decoding error when nfmt or dfmt are zero (bug 36932);
- corrected parsing of operand separators (bug 46403);
- corrected handling of missing operands (bug 46404);
- corrected handling of out-of-range modifiers (bug 46421);
- corrected default value (bug 46467).

Reviewers: arsenm, rampitec, vpykhtin, artem.tamazov, kzhuravl

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

4 years ago[NPM][IVUsers] Rename ivusers -> iv-users
Arthur Eubanks [Wed, 15 Jul 2020 16:34:44 +0000 (09:34 -0700)]
[NPM][IVUsers] Rename ivusers -> iv-users

 LPM passes were named iv-users, which seems nicer than ivusers.

Reviewed By: hans

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

4 years ago[mlir][shape] Mark some operations as commutative
Stephan Herhut [Wed, 15 Jul 2020 07:31:48 +0000 (09:31 +0200)]
[mlir][shape] Mark some operations as commutative

Summary:
This makes sure that their constant arguments are sorted to the back
and hence eases the specification of rewrite patterns.

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

4 years ago[CMake][runtimes] Pass the CMAKE_ARGS to runtimes build correctly
Petr Hosek [Wed, 15 Jul 2020 02:24:22 +0000 (19:24 -0700)]
[CMake][runtimes] Pass the CMAKE_ARGS to runtimes build correctly

We were relying on CMAKE_ARGS argument to be passed to subbuild, but
this argument was never properly defined. This patch addresses that.

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

4 years ago[lldb][test] Prevent infinite loop while looking for use_lldb_suite_root.py.
Jordan Rupprecht [Wed, 15 Jul 2020 16:16:30 +0000 (09:16 -0700)]
[lldb][test] Prevent infinite loop while looking for use_lldb_suite_root.py.

Several scripts (two copies of use_lldb_suite.py, and an __init__.py) look for use_lldb_suite_root.py by checking parent directories. If for some reason it doesn't exist, it keeps checking parent directories until it finds it.

However, this only breaks when the parent directory is None, but at least on Linux, dirname('/') == '/', so this will never be None.

This changes the lookup to stop if the dirname(lldb_root) is unchanged. This was previously fixed in 67f6d842fab6d3ac8c949721be8e131cf6b17578, but only in one copy of this script.

Additionally, this makes the failure mode more visible -- if the root is not found, it complains loudly instead of silently failing, and having later modules that need lldb_root fail.

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

4 years ago[MLIR][Standard] Update `assert` documentation post commit
Frederik Gossen [Wed, 15 Jul 2020 16:13:10 +0000 (16:13 +0000)]
[MLIR][Standard] Update `assert` documentation post commit

Update line wrapping.

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

4 years ago[NFC] Add float aggregate ABI test for PowerPC
Qiu Chaofan [Wed, 15 Jul 2020 16:05:25 +0000 (00:05 +0800)]
[NFC] Add float aggregate ABI test for PowerPC

4c5a93bd landed adjustment to handle C++20 no_unique_address attribute
correctly, clang treats empty members in aggregate type differently if
having this attribute. This commit adds necessary test for PowerPC
target to reflect this change.

4 years ago[Legalize] Hoist invariant condition in ExpandVectorBuildThroughStack(...)
Cameron McInally [Wed, 15 Jul 2020 16:04:22 +0000 (11:04 -0500)]
[Legalize] Hoist invariant condition in ExpandVectorBuildThroughStack(...)

The operands of a BUILD_VECTOR must all have the same type, so we can hoist this invariant condition out of the loop.

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

4 years ago[lldb/Test] Remove support for forking a subprocess from the test suite.
Jonas Devlieghere [Wed, 15 Jul 2020 15:51:24 +0000 (08:51 -0700)]
[lldb/Test] Remove support for forking a subprocess from the test suite.

Remove the forkSubprocess method and its bookkeeping.
TestCreateAfterAttach is the only test using the fork method and I'm not
convinced it adds enough to warrant the maintenance. Pavel suggested the
same thing in D83815.

4 years agoRevert "[TSan] Optimize handling of racy address"
Joachim Protze [Wed, 15 Jul 2020 15:39:30 +0000 (17:39 +0200)]
Revert "[TSan] Optimize handling of racy address"

This reverts commit 00e3a1ddec95c0b48ce216220d7e3481dab3bc78.
The commit broke most build bots, investigating.

4 years ago[MLIR][Shape] Fix `shape_of` lowering to `scf`
Frederik Gossen [Wed, 15 Jul 2020 15:37:13 +0000 (15:37 +0000)]
[MLIR][Shape] Fix `shape_of` lowering to `scf`

The use of the `scf.for` callback builder does not allow for a rollback of the
emitted conversions. Instead, we populate the loop body through the conversion
rewriter directly.

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

4 years ago[HardwareLoops] Add sibling loop test.
David Green [Wed, 15 Jul 2020 13:49:57 +0000 (14:49 +0100)]
[HardwareLoops] Add sibling loop test.

This missed being part of 9e03547cab69.

4 years ago[OpenMP][Docs] Update `present` map type modifier status
Joel E. Denny [Wed, 15 Jul 2020 15:17:00 +0000 (11:17 -0400)]
[OpenMP][Docs] Update `present` map type modifier status

4 years ago[TSan] Optimize handling of racy address
Joachim Protze [Wed, 15 Jul 2020 14:45:27 +0000 (16:45 +0200)]
[TSan] Optimize handling of racy address

This patch splits the handling of racy address and racy stack into separate
functions. If a race was already reported for the address, we can avoid the
cost for collecting the involved stacks.

This patch also removes the race condition in storing the racy address / racy
stack. This race condition allowed all threads to report the race.

This patch changes the transitive suppression of reports. Previously
suppression could transitively chain memory location and racy stacks.
Now racy memory and racy stack are separate suppressions.

Reviewed by: dvyukov

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

4 years agoRevert "[lldb] Use the basename of the Python test for the log name instead of the...
Raphael Isemann [Wed, 15 Jul 2020 14:26:37 +0000 (16:26 +0200)]
Revert "[lldb] Use the basename of the Python test for the log name instead of the class name"

This reverts commit 29aab9b5c748b28b231e2ca0f9b95453638ade1a.

It seems on Windows the file name is just always "lldbsuite.test.lldbtest" for
all tests and that breaks pretty much everything. Reverting until we have
a better solution.

4 years agoCodeGenPrep: remove AssertingVH references before deleting dead instructions.
Tim Northover [Wed, 15 Jul 2020 08:49:49 +0000 (09:49 +0100)]
CodeGenPrep: remove AssertingVH references before deleting dead instructions.

CodeGenPrepare keeps fairly close track of various instructions it's
seen, particularly GEPs, in maps and vectors. However, sometimes those
instructions become dead and get removed while it's still executing.
This triggers AssertingVH references to them in an asserts build and
could lead to miscompiles in a release build (I've only seen a later
segfault though).

So this patch adds a callback to
RecursivelyDeleteTriviallyDeadInstructions which can make sure the
instruction about to be deleted is removed from CodeGenPrepare's data
structures.

4 years ago[lldb/test] Remove JOIN_CMD from Makefile.rules
Pavel Labath [Wed, 15 Jul 2020 13:42:00 +0000 (15:42 +0200)]
[lldb/test] Remove JOIN_CMD from Makefile.rules

It's possible to achieve the same effect by providing multi-step recipe
instead of a single-step recipe where the step happens to contain
multiple commands.

4 years ago[lldb] Delete useless assertion
Pavel Labath [Wed, 15 Jul 2020 13:42:53 +0000 (15:42 +0200)]
[lldb] Delete useless assertion

It served a puprose while we were using the test name to provide a name
for the created file. Now that the files are created in memory, we don't
need that.

4 years ago[clangd] Use llvm::errs() instead of outs() for errors
Kirill Bobyrev [Wed, 15 Jul 2020 12:34:23 +0000 (14:34 +0200)]
[clangd] Use llvm::errs() instead of outs() for errors

Summary: errs() is more appropriate for error messages in dexp and clangd-index-server.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[lldb] Make expect_expr fall back to the dummy target if no target is selected
Raphael Isemann [Wed, 15 Jul 2020 11:55:32 +0000 (13:55 +0200)]
[lldb] Make expect_expr fall back to the dummy target if no target is selected

Summary:

Currently expect_expr will not run the expression if no target is selected. This
patch changes this behavior so that expect_expr will instead fall back to the
dummy target similar to what the `expression` command is doing. This way we
don't have to compile an empty executable to be able to use `expect_expr` (which
is a waste of resources for tests that just test generic type system features).

As a test I modernized the TestTypeOfDeclTypeExpr into a Python test +
expect_expr (as it relied on the dummy target fallback of the expression
command).

Reviewers: labath, JDevlieghere

Reviewed By: labath

Subscribers: abidh

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

4 years ago[lldb] Use the basename of the Python test for the log name instead of the class...
Raphael Isemann [Wed, 15 Jul 2020 11:53:44 +0000 (13:53 +0200)]
[lldb] Use the basename of the Python test for the log name instead of the class name

Summary:

From what I know we already have the restriction that every test in the test
suite needs to have a unique file name as that's used for generating the unique
build directory for a test. It seems there is also a restriction that every test
case class in the test suite needs to have a unique name as that's used to
generate the unique log file name for the test run.

This changes the log file format to use the basename of the test file instead so
that we only have to keep worrying about the 'unique file name' restriction from
now on.

This came up because I started naming the test classes "TestCase" (as repeating
the file name in the test class seems like redudant information that just makes
renaming tests a pain).

Reviewers: labath, JDevlieghere

Reviewed By: labath

Subscribers: mgorny, abidh

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

4 years ago[mips] Rename FeatureMadd4 to FeatureNoMadd4. NFC
YunQiang Su [Wed, 15 Jul 2020 09:11:36 +0000 (12:11 +0300)]
[mips] Rename FeatureMadd4 to FeatureNoMadd4. NFC

`FeatureMadd4` is used to disable `madd4`, and the corresponding feature
option is `(+-)nomadd4`. Renaming to the `FeatureNoMadd4` makes its
purpose clear.

Patch by YunQiang Su.

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

4 years ago[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbt asm instructions
lewis-revill [Wed, 15 Jul 2020 10:59:47 +0000 (11:59 +0100)]
[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbt asm instructions

This patch provides optimization of bit manipulation operations by
enabling the +experimental-b target feature.
It adds matching of single block patterns of instructions to specific
bit-manip instructions from the ternary subset (zbt subextension) of the
experimental B extension of RISC-V.
It adds also the correspondent codegen tests.

This patch is based on Claire Wolf's proposal for the bit manipulation
extension of RISCV:
https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-0.92.pdf

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

4 years ago[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbs asm instructions
lewis-revill [Wed, 15 Jul 2020 10:57:29 +0000 (11:57 +0100)]
[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbs asm instructions

This patch provides optimization of bit manipulation operations by
enabling the +experimental-b target feature.
It adds matching of single block patterns of instructions to specific
bit-manip instructions from the single-bit subset (zbs subextension) of
the experimental B extension of RISC-V.
It adds also the correspondent codegen tests.

This patch is based on Claire Wolf's proposal for the bit manipulation
extension of RISCV:
https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-0.92.pdf

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

4 years ago[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions
lewis-revill [Wed, 15 Jul 2020 10:55:44 +0000 (11:55 +0100)]
[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions

This patch provides optimization of bit manipulation operations by
enabling the +experimental-b target feature.
It adds matching of single block patterns of instructions to specific
bit-manip instructions belonging to both the permutation and the base
subsets of the experimental B extension of RISC-V.
It adds also the correspondent codegen tests.

This patch is based on Claire Wolf's proposal for the bit manipulation
extension of RISCV:
https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-0.92.pdf

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

4 years ago[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbp asm instructions
lewis-revill [Wed, 15 Jul 2020 10:53:06 +0000 (11:53 +0100)]
[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbp asm instructions

This patch provides optimization of bit manipulation operations by
enabling the +experimental-b target feature.
It adds matching of single block patterns of instructions to specific
bit-manip instructions from the permutation subset (zbp subextension) of
the experimental B extension of RISC-V.
It adds also the correspondent codegen tests.

This patch is based on Claire Wolf's proposal for the bit manipulation
extension of RISCV:
https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-0.92.pdf

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

4 years ago[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions
lewis-revill [Wed, 15 Jul 2020 10:50:03 +0000 (11:50 +0100)]
[RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions

This patch provides optimization of bit manipulation operations by
enabling the +experimental-b target feature.
It adds matching of single block patterns of instructions to specific
bit-manip instructions from the base subset (zbb subextension) of the
experimental B extension of RISC-V.
It adds also the correspondent codegen tests.

This patch is based on Claire Wolf's proposal for the bit manipulation
extension of RISCV:
https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-0.92.pdf

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

4 years ago[DSE,MSSA] Recognise init_trampoline in getLocForWriteEx
John Brawn [Wed, 15 Jul 2020 11:17:31 +0000 (12:17 +0100)]
[DSE,MSSA] Recognise init_trampoline in getLocForWriteEx

This fixes an instance where MemorySSA-using Dead Store Elimination is failing
to do a transformation that the non-MemorySSA-using version does.

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

4 years ago[DWARFYAML] Remove useless conditional statement. NFC.
Xing GUO [Wed, 15 Jul 2020 10:53:55 +0000 (18:53 +0800)]
[DWARFYAML] Remove useless conditional statement. NFC.

The conditional statement is useless after
3a48a632d00ef1c98042140f402337fe13cdff52.

4 years ago[LoopRotate] Remove unnecessary verifyMemorySSA calls.
Florian Hahn [Wed, 15 Jul 2020 10:49:24 +0000 (11:49 +0100)]
[LoopRotate] Remove unnecessary verifyMemorySSA calls.

The actual rotation happens in processLoop, so the second removed
call to verifyMemorySSA was unnecessary.

In fact, processLoop/rotateLoop already verify MemorySSA before
and after transforming each loop. Hence, both calls can be removed.

Pointed out by @lebedev.ri post-commit D51718.

4 years ago[MLIR][Shape] Add `shape.shape_eq` operation
Frederik Gossen [Wed, 15 Jul 2020 10:28:29 +0000 (10:28 +0000)]
[MLIR][Shape] Add `shape.shape_eq` operation

Add `shape.shape_eq` operation to the shape dialect.
The operation allows to test shapes and extent tensors for equality.

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

4 years ago[clangd] Config: also propagate in sync (testing) mode
Sam McCall [Tue, 14 Jul 2020 18:24:32 +0000 (20:24 +0200)]
[clangd] Config: also propagate in sync (testing) mode

Summary:
I hit this while trying to add a config-over-LSP lit test, which I think
is an appropriate way to test this feature.

That needs a few more changes though...

Reviewers: kadircet

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[Analyzer] Report every bug if only uniqueing location differs.
Balázs Kéri [Wed, 15 Jul 2020 09:05:22 +0000 (11:05 +0200)]
[Analyzer] Report every bug if only uniqueing location differs.

Summary:
Two CSA bug reports where only the uniqueing location is different
should be treated as different problems. The role of uniqueing location
is to differentiate bug reports.

Reviewers: Szelethus, baloghadamsoftware, NoQ, vsavchenko, xazax.hun, martong

Reviewed By: NoQ

Subscribers: NoQ, rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits

Tags: #clang

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

4 years agoBump the trunk major version to 12 llvmorg-12-init
Hans Wennborg [Wed, 15 Jul 2020 09:40:53 +0000 (11:40 +0200)]
Bump the trunk major version to 12

and clear the release notes.

4 years ago[LLD][ELF] - Update test after yaml2obj change. NFC.
Georgii Rymar [Wed, 15 Jul 2020 10:00:02 +0000 (13:00 +0300)]
[LLD][ELF] - Update test after yaml2obj change. NFC.

Names of YAML keys changed in rG7a587ca93200c49e47fe205ce037895c81c5a542

4 years ago[RISCV] Duplicate pseudo expansion comment to RISCVMCCodeEmitter
Jessica Clarke [Wed, 15 Jul 2020 09:52:42 +0000 (10:52 +0100)]
[RISCV] Duplicate pseudo expansion comment to RISCVMCCodeEmitter

Follow-on from D77443. Although we're not fixing any of these
pseudo-instructions, the potential for them to be out of sync still
exists.

4 years ago[RISCV] Fix RISCVInstrInfo::getInstSizeInBytes for atomics pseudos
Jessica Clarke [Wed, 15 Jul 2020 09:48:41 +0000 (10:48 +0100)]
[RISCV] Fix RISCVInstrInfo::getInstSizeInBytes for atomics pseudos

Summary:
Without these, the generic branch relaxation pass will underestimate the
range required for branches spanning these and we can end up with
"fixup value out of range" errors rather than relaxing the branches.
Some of the instructions in the expansion may end up being compressed
but exactly determining that is awkward, and these conservative values
should be safe, if slightly suboptimal in rare cases.

Reviewers: asb, lenary, luismarques, lewis-revill

Reviewed By: asb, luismarques

Subscribers: hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, jfb, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, sameer.abuasal, apazos, evandro, llvm-commits

Tags: #llvm

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

4 years ago[yaml2obj] - Rename FileHeader::SH* fields.
Georgii Rymar [Tue, 14 Jul 2020 12:48:03 +0000 (15:48 +0300)]
[yaml2obj] - Rename FileHeader::SH* fields.

In D83482 we agreed to name e_* fields that are used for overriding
values (like e_phoff) as EPh* (e.g. EPhOff).

Currently we have a set of e_sh* fields that are named inconsistently
with this rule. This patch renames all of them.

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

4 years ago[Matrix] Only pass vector arg as overloaded type in MatrixBuilder.
Florian Hahn [Wed, 15 Jul 2020 09:30:48 +0000 (10:30 +0100)]
[Matrix] Only pass vector arg as overloaded type in MatrixBuilder.

In 2b3c505, the pointer arguments for the matrix load and store
intrinsics was changed to always be the element type of the vector
argument.

This patch updates the MatrixBuilder to not add the pointer type to the
overloaded types and adjusts the clang/mlir tests.

This should fix a few build failures on GreenDragon, including
 http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-x86_64-O0-g/7891/

4 years ago[llvm-readobj] - Verify the location of program headers better.
Georgii Rymar [Tue, 14 Jul 2020 14:14:06 +0000 (17:14 +0300)]
[llvm-readobj] - Verify the location of program headers better.

This improves condition in the ELFFile::program_headers().
Previously if was possible to read the headers from the wrong place when
the value of e_phoff was so large that computation overflowed.

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

4 years ago[Support] Fix Windows directory_iterator_construct out of bounds
Andrew Ng [Mon, 13 Jul 2020 12:36:33 +0000 (13:36 +0100)]
[Support] Fix Windows directory_iterator_construct out of bounds

Fix incorrect use of the size of Path when accessing PathUTF16, as the
UTF-16 path can be shorter. Added unit test for coverage of this test
case.

Thanks to Ding Fei (danix800) for the code fix, see
https://reviews.llvm.org/D83321.

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

4 years ago[clangd] Fix use-after-free in ArgStripper
Sam McCall [Wed, 15 Jul 2020 09:03:11 +0000 (11:03 +0200)]
[clangd] Fix use-after-free in ArgStripper

4 years agoFix typo in identifier in assert.
Tim Northover [Wed, 15 Jul 2020 08:57:53 +0000 (09:57 +0100)]
Fix typo in identifier in assert.

4 years agoAArch64+ARM: make LLVM consider system registers volatile.
Tim Northover [Wed, 15 Jul 2020 08:11:36 +0000 (09:11 +0100)]
AArch64+ARM: make LLVM consider system registers volatile.

Some of the system registers readable on AArch64 and ARM platforms
return different values with each read (for example a timer counter),
these shouldn't be hoisted outside loops or otherwise interfered with,
but the normal @llvm.read_register intrinsic is only considered to read
memory.

This introduces a separate @llvm.read_volatile_register intrinsic and
maps all system-registers on ARM platforms to use it for the
__builtin_arm_rsr calls. Registers declared with asm("r9") or similar
are unaffected.

4 years ago[clang][Driver] Fix tool path priority test failures
David Spickett [Thu, 2 Jul 2020 15:04:06 +0000 (16:04 +0100)]
[clang][Driver] Fix tool path priority test failures

Summary:
Failure type 1:
This test can fail when the path of the build includes the strings
we're checking for. E.g "/gcc" is found in ".../gcc_7.3.0/..."

To correct this look for '"' on the end of all matches. So that we
only match the end of paths printed by clang -###.
(which would be ".../gcc_7.3.0/.../gcc" for the example)

Also look for other gcc names like gcc-x.y.z in the first check.
This confirms that the copy of clang we made is isolated as expected.

Failure type 2:
If you use a triple like "powerpc64le-linux-gnu" clang actually reports
"powerpc64le-unknown-linux-gnu". Then it searches for the
former.

That combined with Mac OS adding a version number to cmake's triple
means we can't trust cmake or clang to give us the one default triple.
To fix the test, write to both names. As they don't overlap with our
fake triple, we're still showing that the lookup works.

Reviewers: MaskRay, stevewan

Reviewed By: stevewan

Subscribers: miyuki, JDevlieghere, steven.zhang, stevewan, cfe-commits

Tags: #clang

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

4 years ago[lldb][formatters] Add support for printing NSConstantDate and fix distantPast value
Raphael Isemann [Tue, 14 Jul 2020 12:26:59 +0000 (14:26 +0200)]
[lldb][formatters] Add support for printing NSConstantDate and fix distantPast value

Summary:

Certain `NSDate` constructors return a special `NSConstantDate` class which
currently ends up being unformatted as it's not in the list of supported classes
for the NSDate formatter. This patch adds that class to the supported class list
so LLDB produces a summary for it.

One of these special constructors is `[NSDate distantPast]` which returns the
date for `0001-01-01 00:00:00 UTC`. LLDB has a special case for formatting this
date but for some reason we did hardcode the wrong summary string in that
special case. Maybe the summary string was correct back when the code was
written but it isn't correct anymore (`distantPast` isn't actually defined to be
a special date but just some 'a guaranteed temporal boundary.' so maybe someone
changed the value in the last 10 years).

If someone else is wondering why we even have this special case for
`distantPast` but not for the future. The reason seems to be that our date
formatting for really old dates is off by 24 hours. So for example, adding one
second to `distantPast` will cause LLDB to print `0000-12-30 00:00:01 UTC`
(which is 24 hours behind the expected result). So to make our code appear to be
correct it seems we just hardcoded the most common NSDate result from that time
span. I'll replace that logic with a generic solution in a probably more
invasive follow up patch.

I also took the freedom to replace the magic value `-63114076800` with some
constant + documentation. I heard there are some people that don't know from the
top of their head that there are 63114076800 seconds between 1. Jan 0001 and 1.
January 2001 in whatever calendar system NSDate is using.

Reviewers: mib, davide

Reviewed By: mib

Subscribers: JDevlieghere

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

4 years ago[RISCV] Add error checking for extensions missing separating underscores
Simon Cook [Wed, 15 Jul 2020 08:23:35 +0000 (09:23 +0100)]
[RISCV] Add error checking for extensions missing separating underscores

Currently if two multi-letter extensions are provided in a -march=
string, the verification code checks the version of the first and
consumes the second, resulting in that part of the architecture
string being ignored. This adds a test that when a version number has
been parsed for an extension, there are no subsequent characters.

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

4 years ago[DAGCombiner] Rebuild (setcc x, y, ==) from (xor (xor x, y), 1)
Roger Ferrer Ibanez [Wed, 7 Aug 2019 15:31:29 +0000 (15:31 +0000)]
[DAGCombiner] Rebuild (setcc x, y, ==) from (xor (xor x, y), 1)

The existing code already considered this case. Unfortunately a typo in
the condition prevents it from triggering. Also the existing code, had
it run, forgot to do the folding.

This fixes PR42876.

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

4 years ago[NFC] Add tests for boolean comparisons
Roger Ferrer Ibanez [Wed, 7 Aug 2019 12:43:07 +0000 (12:43 +0000)]
[NFC] Add tests for boolean comparisons

They currently show that the not equal case may be improved.

See PR42876

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

4 years ago[MLIR][SPIRVToLLVM] SPIRV function fix and nits
George Mitenkov [Wed, 15 Jul 2020 07:02:01 +0000 (10:02 +0300)]
[MLIR][SPIRVToLLVM] SPIRV function fix and nits

This patch addresses the comments from https://reviews.llvm.org/D83030 and
https://reviews.llvm.org/D82639. `this->` is removed when not inside the
template. Also, type conversion for `spv.func` takes `convertRegionTypes()`
in order to apply type conversion on all blocks within the function.

Reviewed By: rriddle

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

4 years agoMake linalg::ReshapeOp implement ViewLikeOpInterface
Stephan Herhut [Tue, 14 Jul 2020 14:23:19 +0000 (16:23 +0200)]
Make linalg::ReshapeOp implement ViewLikeOpInterface

Summary: A reshape aliases its input memref, so it acts like a view.

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

4 years ago[IndVarSimplify] Uniformly use emplace_back for DeadInsts, nfc
Chen Zheng [Wed, 15 Jul 2020 06:44:17 +0000 (02:44 -0400)]
[IndVarSimplify] Uniformly use emplace_back for DeadInsts, nfc

4 years ago[OpenMPOpt][NFC] Update checks for parallel_deletion test
Giorgis Georgakoudis [Wed, 15 Jul 2020 06:15:59 +0000 (23:15 -0700)]
[OpenMPOpt][NFC] Update checks for parallel_deletion test

4 years ago[mlir][Vector] Degrade masking information when forwarding linalg.copy to vector...
Nicolas Vasilache [Tue, 14 Jul 2020 15:45:59 +0000 (11:45 -0400)]
[mlir][Vector] Degrade masking information when forwarding linalg.copy to vector.transfer

Summary:
linalg.copy + linalg.fill can be used to create a padded local buffer.
The `masked` attribute is only valid on this padded buffer.
When forwarding to vector.transfer ops, the attribute must be reset
conservatively.

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

4 years ago[OpenMPOpt] Fix preserved analyses return
Giorgis Georgakoudis [Wed, 15 Jul 2020 00:01:15 +0000 (17:01 -0700)]
[OpenMPOpt] Fix preserved analyses return

4 years ago[LLD] [MinGW] Implement the --file-alignment and --section-alignment options
Martin Storsjö [Mon, 13 Jul 2020 21:12:13 +0000 (00:12 +0300)]
[LLD] [MinGW] Implement the --file-alignment and --section-alignment options

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

4 years ago[llvm][NFC] Hide the tensorflow dependency from headers.
Mircea Trofin [Wed, 15 Jul 2020 02:32:37 +0000 (19:32 -0700)]
[llvm][NFC] Hide the tensorflow dependency from headers.

Summary:
This change avoids exposing tensorflow types when including TFUtils.h.
They are just an implementation detail, and don't need to be used
directly when implementing an analysis requiring ML model evaluation.

The TFUtils APIs, while generically typed, are still not exposed unless
the tensorflow C library is present, as they currently have no use
otherwise.

Reviewers: mehdi_amini, davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[Attributor] Fix build of unittest with DBUILD_SHARED_LIBS=True
Alex Bradbury [Wed, 15 Jul 2020 04:04:09 +0000 (05:04 +0100)]
[Attributor] Fix build of unittest with DBUILD_SHARED_LIBS=True

The dependencies in llvm/unittests/Transforms/IPO/CMakeLists.txt
introduced in revision 0750757e were incomplete, leading to link errors
for a DBUILD_SHARED_LIBS=True build.

4 years ago[OpenMP][FIX] Check only for deterministic part of a generated function name
Johannes Doerfert [Wed, 15 Jul 2020 03:46:38 +0000 (22:46 -0500)]
[OpenMP][FIX] Check only for deterministic part of a generated function name

4 years agoRevert "[Attributor] Track AA dependency using dependency graph"
Luofan Chen [Wed, 15 Jul 2020 03:48:08 +0000 (11:48 +0800)]
Revert "[Attributor] Track AA dependency using dependency graph"

This reverts commit 8df7af560aebce3f3de3541d039e17331c479831.

4 years ago[OpenMP][IRBuilder] Support nested parallel regions
Johannes Doerfert [Sun, 28 Jun 2020 18:41:33 +0000 (13:41 -0500)]
[OpenMP][IRBuilder] Support nested parallel regions

During code generation we might change/add basic blocks so keeping a
list of them is fairly easy to break. Nested parallel regions were
enough. The new scheme does recompute the list of blocks to be outlined
once it is needed.

Reviewed By: anchu-rajendran

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

4 years ago[CallGraph] Update callback call sites in RefreshCallGraph
Johannes Doerfert [Tue, 14 Jul 2020 02:35:03 +0000 (21:35 -0500)]
[CallGraph] Update callback call sites in RefreshCallGraph

Since D82572, we keep "reference" edges for callback call sites. While
not strictly necessary they can improve the traversal order. However, we
did not update them properly in case a pass removed the callback call
site which caused a verification error (PR46687). With this patch we
update these reference edges properly during the invocation of
`CallGraphSCCPass::RefreshCallGraph` in non-checking mode.

Reviewed By: sdmitriev

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

4 years ago[OpenMP] Emit remarks during GPU state machine optimization
Johannes Doerfert [Wed, 15 Jul 2020 00:11:30 +0000 (19:11 -0500)]
[OpenMP] Emit remarks during GPU state machine optimization

Since D83271 we can optimize the GPU state machine to avoid spurious
call edges that increase the register usage of kernels. With this patch
we inform the user why and if this optimization is happening and when it
is not.

Reviewed By: ye-luo

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