Commit Graph

344326 Commits

Author SHA1 Message Date
hsmahesha cac068600e [HIP] Make sure, unused hip-pinned-shadow global var is kept within device code
Summary:
hip-pinned-shadow global var should remain in the final code object irrespective
of whether it is used or not within the code. Add it to used list, so that it
will not get eliminated when it is unused.

Reviewers: yaxunl, tra, hliao

Reviewed By: yaxunl

Subscribers: hliao, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75402
2020-03-04 10:54:26 +05:30
Juneyoung Lee 952ad4701c [ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into branch conditions of dominating blocks' terminators
Summary:
```
  br i1 c, BB1, BB2:
BB1:
  use1(c)
BB2:
  use2(c)
```

In BB1 and BB2, c is never undef or poison because otherwise the branch would have triggered UB.

Checked with Alive2

Reviewers: xbolva00, spatel, lebedev.ri, reames, jdoerfert, nlopes, sanjoy

Reviewed By: reames

Subscribers: jdoerfert, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75401
2020-03-04 11:43:31 +09:00
Amara Emerson e91e1df6ab [GlobalISel][Localizer] Enable intra-block localization of already-local uses.
This changes the localizer to attempt intra-block localizer of instructions
that have local uses. This is useful because sometimes the entry block itself
has many uses of constant-like instructions, which would benefit from shortening
live ranges. Previously if an inst had no non-local uses, we wouldn't add it to
the list of instructions to attempt further intra-block localization.

This gives a 0.7% geomean code size improvement on CTMark.

Differential Revision: https://reviews.llvm.org/D75555
2020-03-03 18:14:57 -08:00
Fangrui Song 7af4374ff8 [MC][test] Improve some llvm-objdump -t tests
Delete two redundant tests.
2020-03-03 17:27:06 -08:00
Frank Laub 216ef5b9ab [MLIR][NFC] Fix for VS2017 bug.
Apparently there is a bug in VS2017 concerning compile-time constant
expressions.
https://developercommunityapi.westus.cloudapp.azure.com/content/problem/110435/not-compile-time-constant-expression.html

This change works with any C++11 compiler (including VS2017) and is a little bit
easier to read.

Reviewers: stella.stamenova, nicolasvasilache

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75584
2020-03-03 17:06:22 -08:00
Fangrui Song 1a5da3f0b2 [gn build] Fix llvm-gsymutil after D75291 2020-03-03 16:37:52 -08:00
Fangrui Song 90acc505ed [MCDwarf] Change emitListsTableHeaderStart to use a reference and fold Start/End symbols generation into it
Apply @dblaikie's suggestions in a post-commit review for D75375

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D75568
2020-03-03 16:20:40 -08:00
Lang Hames 31e0331763 [ORC] Skip ST_File symbols in MaterializationUnit interfaces / resolution.
ST_File symbols aren't relevant for linking purposes, but can end up shadowing
real symbols if they're not filtered.

No test case yet: The ideal testcase for this would be an ELF llvm-jitlink test,
but llvm-jitlink support for ELF is still under development. We should add a
testcase for this once support lands in tree.
2020-03-03 16:15:44 -08:00
Stefanos Baziotis 6f5d5d6602 [LoopTerminology][NFC] Fix typo 2020-03-04 02:12:33 +02:00
Richard Smith ad18665e37 PR45087: Fix check for emptiness when determining whether a trivial copy
operation needs to read from its operand.
2020-03-03 15:57:48 -08:00
Greg Clayton de2c586a12 Fix buildbots by including MC for StringTableBuilder. 2020-03-03 15:52:51 -08:00
Alexander Belyaev e0ce852277 [MLIR] Expose makeCanonicalStridedLayoutExpr in StandardTypes.h.
Differential Revision: https://reviews.llvm.org/D75575
2020-03-04 00:40:33 +01:00
Richard Smith bdad0a1b79 PR45083: Mark statement expressions as being dependent if they appear in
dependent contexts.

We previously assumed they were neither value- nor
instantiation-dependent under any circumstances, which would lead to
crashes and other misbehavior.
2020-03-03 15:20:40 -08:00
Martijn Vels 8cf76e913b Partially inline basic_string copy constructor in UNSTABLE
his change splits the copy constructor up inlining short initialization, and explicitly outlining long initialization into __init_copy_ctor_external() which is the externally instantiated slow path.

For unstable ABI, this has the following changes:

remove basic_string(const basic_string&)
remove basic_string(const basic_string&, const Allocator&)
add __init_copy_ctor_external(const value_type*, size_type)
Quick local benchmark for Copy:

Master
```
---------------------------------------------------------------
Benchmark                    Time             CPU   Iterations
---------------------------------------------------------------
BM_StringCopy_Empty       3.50 ns         3.51 ns    199326720
BM_StringCopy_Small       3.50 ns         3.51 ns    199510016
BM_StringCopy_Large       15.7 ns         15.7 ns     45230080
BM_StringCopy_Huge        1503 ns         1503 ns       464896
```

```
---------------------------------------------------------------
Benchmark                    Time             CPU   Iterations
---------------------------------------------------------------
BM_StringCopy_Empty       1.99 ns         2.00 ns    356471808
BM_StringCopy_Small       3.29 ns         3.30 ns    203425792
BM_StringCopy_Large       13.3 ns         13.3 ns     52948992
BM_StringCopy_Huge        1472 ns         1472 ns       475136
```

Author: Martijn Vels <martijn.vels@gmail.com>

Reviewers: EricWF, mclow.list

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73223
2020-03-03 17:49:25 -05:00
Lang Hames 14ac84e5c5 [JITLink] Add a -slab-address option to llvm-jitlink.
This option can be used to for JITLink to link as-if the target memory slab were
allocated at a specific start address. This can be used to both verify that
cross-address space linking is working correctly, and to ensure that certain
address-sensitive optimizations (e.g. GOT and stub elimination) either do or do
not fire, depending on the requirements of the test case.

This argument is only valid for testing in conjunction with -noexec -slab-alloc,
and will produce an error if used without those arguments.
2020-03-03 14:25:51 -08:00
Jonathan Coe 736fef97c7 [clang-format] Do not format C# array subscript operators as attributes
Summary:
Fix misidentification of C# array subscript operators.

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: cfe-commits, MyDeveloperDay

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D75517
2020-03-03 22:21:33 +00:00
Jonathan Coe 900dee8c8e [clang-format] Do not merge target-name and : for C# attributes
Summary:
Re-use token type `TT_AttributeColon` for C# attribute target colons.

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: MyDeveloperDay, cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D75465
2020-03-03 22:17:25 +00:00
Matt Arsenault f9047ede58 LICM: Reorder condition checks
Check the fast math flag before the more expensive loop check.
2020-03-03 17:15:57 -05:00
Matt Arsenault 88aced1e45 AMDGPU: Fix computation for getOccupancyWithLocalMemSize
The computation here didn't really make sense to me, and reported
wildy different results depending on the flat work group size
attribute.

I think this should really report a range derived from the possible
work group size bounds, and only allow an occupancy that is a multiple
of the group size.
2020-03-03 17:15:57 -05:00
Michael Spencer 27a3ecee45 [clang][Modules] Add -fsystem-module flag
The -fsystem-module flag is used when explicitly building a module. It
forces the module to be treated as a system module. This is used when
converting an implicit build to an explicit build to match the
systemness the implicit build would have had for a given module.

Differential Revision: https://reviews.llvm.org/D75395
2020-03-03 14:14:24 -08:00
Brian Gesiak aa85b437a9 [Coroutines] Use dbg.declare for frame variables
Summary:
https://gist.github.com/modocache/ed7c62f6e570766c0f39b35dad675c2f
is an example of a small C++ program that uses C++20 coroutines that
is difficult to debug, due to the loss of debug info for variables that
"spill" across coroutine suspension boundaries. This patch addresses
that issue by inserting 'llvm.dbg.declare' intrinsics that point the
debugger to the variables' location at an offset to the coroutine frame.

With this patch, I confirmed that running the 'frame variable' commands in
https://gist.github.com/modocache/ed7c62f6e570766c0f39b35dad675c2f at
the specified breakpoints results in the correct values being printed
for coroutine frame variables 'i' and 'j' when using an lldb built from
trunk, as well as with gdb 8.3 (lldb 9.0.1, however, could not print the
values). The added test case also verifies this improved behavior.

The existing coro-debug.ll test case is also modified to reflect the
locations at which Clang actually places calls to 'dbg.declare', and
additional checks are added to ensure this patch works as intended in that
example as well.

Reviewers: vsk, jmorse, GorNishanov, lewissbaker, wenlei

Subscribers: EricWF, aprantl, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75338
2020-03-03 17:13:46 -05:00
Greg Clayton 90e40a0bda Rename "llvm-gsym" to "llvm-gsymutil" and fix dependencies.
Summary: This patch renames the "llvm-gsym" tool directory to "llvm-gsymutil". Dependencies are also reduced to the bare minimum for llvm-gsymutil.

Reviewers: aprantl, thakis

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75291
2020-03-03 14:13:29 -08:00
Amy Huang 5b3b21f025 [DebugInfo] Fix for adding "returns cxx udt" option to functions in CodeView.
Summary:
This change checks for the return type in the frontend and adds a flag
to the DISubroutineType to indicate that the option should be added in
CodeViewDebug.

Previously function types sometimes appeared twice in the PDB: once with
"returns cxx udt" and once without.
See https://bugs.llvm.org/show_bug.cgi?id=44785.

Reviewers: rnk, asmith

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D75215
2020-03-03 14:00:08 -08:00
Lang Hames ab16ef17e8 [JITLink] Fix a pointer-to-integer cast in jitlink::InProcessMemoryManager.
reinterpret_cast'ing the block base address directly to a uint64_t leaves the
high bits in an implementation-defined state, but JITLink expects them to be
zero. Switching to pointerToJITTargetAddress for the cast should fix this.

This should fix the jitlink test failures that we have seen on some of the
32-bit testers.
2020-03-03 13:53:00 -08:00
Adrian Prantl a7fa8b022f Doxygenify CompilerType.h (NFC) 2020-03-03 13:43:25 -08:00
Sanjay Patel f95095e9f6 [AArch64] add tests for nnan/ninf/undef FP simplifications; NFC 2020-03-03 16:38:58 -05:00
Vedant Kumar b5b21812dc test: Adjust no-dbg-value-after-terminator.mir to use `not --crash` 2020-03-03 13:30:31 -08:00
Matthias Kramm cb530ec8b8 [mlir][Tutorial] Make parsing an empty file print a better error.
Summary:
Previously, we would, for an empty file, print the somewhat confusing
  Assertion `tok == curTok [...]' failed.
With this change, we now print
  Parse error [...]: expected 'def' [...]

This only affects the parser from chapters 1-6, since the more advanced
chapter 7 parser is actually able to generate an empty module from an
empty file.  Nonetheless, this commit also adds the additional check to
the chapter 7 parser, for consistency.

Differential Revision: https://reviews.llvm.org/D75534
2020-03-03 13:21:05 -08:00
River Riddle c10896682d [mlir] Generate CmpFPredicate as an EnumAttr in tablegen
Summary: This allows for attaching the attribute to CmpF as a proper argument, and thus enables the removal of a bunch of c++ code.

Differential Revision: https://reviews.llvm.org/D75539
2020-03-03 13:19:25 -08:00
Reid Kleckner 5d3a995938 Port ubsan nullability.c test to Windows
Two issues:
- Need to add env prefix to be compatible with the lit internal shell
- Need to quote the colon in Windows paths with '"%t.supp"'
2020-03-03 13:18:58 -08:00
Alex Langford e566dd733d [lldb] Delete some commented out code in ClangASTSource.cpp 2020-03-03 13:17:21 -08:00
Sanjay Patel 5f5fce06b9 [PowerPC] adjust test to avoid getting zapped completely; NFC
div-by-0 -> Inf
The math ops are 'fast' so 'ninf' applies and the whole thing is undef.
2020-03-03 16:15:48 -05:00
Vedant Kumar f002ee55c7 [MachineVerifier] Remove placement rule exception for debug entry values
There should not be an exception allowing debug entry values to be
placed after a terminator.

Differential Revision: https://reviews.llvm.org/D75559
2020-03-03 13:02:18 -08:00
Vedant Kumar 2bf496620c [LiveDebugValues] Do not insert DBG_VALUEs after a MBB terminator
This fixes a miscompile that happened because a DBG_VALUE interfered
with the MachineOutliner's liveness analysis.

Inserting a DBG_VALUE after a terminator breaks predicates on MBB such
as isReturnBlock(). And the resulting DBG_VALUE cannot be "live".

I plan to introduce a MachineVerifier check for this situation in a
follow up.

rdar://59859175

Testing: check-llvm, LNT build with a stage2 compiler & entry values
enabled

Differential Revision: https://reviews.llvm.org/D75548
2020-03-03 13:00:52 -08:00
Nathan Ridge e70a9f3850 [clangd] Handle go-to-definition in macro invocations where the target appears in the expansion multiple times
Fixes https://github.com/clangd/clangd/issues/234

Reviewers: sammccall

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D72041
2020-03-03 15:52:05 -05:00
George Rokos fca49fe8e3 [clang-offload-wrapper] Lower priority of __tgt_register_lib in favor of __tgt_register_requires
Lower priority of __tgt_register_lib in order to make sure that __tgt_register_requires is called before loading a libomptarget plugin.
We want to know beforehand which requirements the user has asked for so that upon loading the plugin libomptarget can report how many devices there are that can satisfy these requirements.

Differential Revision: https://reviews.llvm.org/D75223
2020-03-03 12:31:40 -08:00
Alex Zinenko 8fc3e5c488 [mlir] Format AffineOps.td. NFC
Drop trailing spaces and reflow text to fit 80 columns.
2020-03-03 21:30:17 +01:00
Craig Topper 02f03a6fd4 [X86] Match vpmullq latency to uops.info. Correct port usage for 512-bit memory form
uops.info says these should be 15 cycle instructions. Uops.info also shows the 512-bit form uses port 0 and 5 for both register and memory. We had memory using 0 and 1.

Differential Revision: https://reviews.llvm.org/D75549
2020-03-03 12:16:03 -08:00
Jacques Pienaar 1bedb23407 [mlir][ods] Add query for derived attribute
For ODS generated operations enable querying whether there is a derived
attribute with a given name.

Rollforward of commit 5aa57c2 without using llvm::is_contained.
2020-03-03 12:04:16 -08:00
Stefan Stipanovic 13fd50cc26 Revert "Revert "[lldb/Docs] Mark both Python 3.6 and 3.8 as supported on Windows""
This reverts commit 78a734e279.
2020-03-03 20:43:16 +01:00
Stefan Stipanovic a8fcf8d217 Revert "[OpenMP] Adding InaccessibleMemOnly and InaccessibleMemOrArgMemOnly for runtime calls."
This reverts commit 9989b859ef.
2020-03-03 20:42:05 +01:00
Stefan Stipanovic 78a734e279 Revert "[lldb/Docs] Mark both Python 3.6 and 3.8 as supported on Windows"
This reverts commit 3270ea9042.
2020-03-03 20:41:18 +01:00
Stefan Stipanovic 9989b859ef [OpenMP] Adding InaccessibleMemOnly and InaccessibleMemOrArgMemOnly for runtime calls.
Summary: Attempt to add more attributes for runtime calls.

Reviewers: jdoerfertA, ggeorgakoudis, lebedev.ri, dreachem

Subscribers:
2020-03-03 20:32:22 +01:00
Jonas Devlieghere 3270ea9042 [lldb/Docs] Mark both Python 3.6 and 3.8 as supported on Windows
Haibo told me he didn't have any issues with Python 3.8 and I was able
to confirm that. Even though we don't have bot running with 3.8, I think
it safe to mark it as supported in the docs.
2020-03-03 11:26:00 -08:00
Alexey Bataev 82f7c207f5 [OPENMP50]Support 'update' clause for 'depobj' directive.
Added basic support (parsing/sema/serialization) for 'update' clause in
'depobj' directive.
2020-03-03 13:59:32 -05:00
Raphael Isemann 531515198e [lldb][NFC] Remove some commented out code in TypeSystemClang
Summary: I don't see why we want to keep that code around.

Reviewers: #lldb, JDevlieghere

Reviewed By: #lldb, JDevlieghere

Subscribers: davide

Differential Revision: https://reviews.llvm.org/D75496
2020-03-03 10:50:48 -08:00
Craig Topper 3c4e635593 [X86] Always emit an integer vbroadcast_load from lowerBuildVectorAsBroadcast regardless of AVX vs AVX2
If we go with D75412, we no longer depend on the scalar type directly. So we don't need to avoid using i64. We already have AVX1 fallback patterns with i32 and i64 scalar types so we don't need to avoid using integer types on AVX1.

Differential Revision: https://reviews.llvm.org/D75413
2020-03-03 10:39:11 -08:00
Craig Topper 56cd3bc209 [X86] Directly emit VBROADCAST_LOAD from constant pool in lowerBuildVectorAsBroadcast
Also add a DAG combine to combine different sized broadcasts from
constant pool to avoid a regression.

Differential Revision: https://reviews.llvm.org/D75412
2020-03-03 10:39:10 -08:00
LLVM GN Syncbot 22dd23583a [gn build] Port c84532a70a 2020-03-03 18:25:30 +00:00
Whitney Tsang c84532a70a [LoopNest]: Analysis to discover properties of a loop nest.
Summary: This patch adds an analysis pass to collect loop nests and
summarize properties of the nest (e.g the nest depth, whether the nest
is perfect, what's the innermost loop, etc...).

The motivation for this patch was discussed at the latest meeting of the
LLVM loop group (https://ibm.box.com/v/llvm-loop-nest-analysis) where we
discussed
the unimodular loop transformation framework ( “A Loop Transformation
Theory and an Algorithm to Maximize Parallelism”, Michael E. Wolf and
Monica S. Lam, IEEE TPDS, October 1991). The unimodular framework
provides a convenient way to unify legality checking and code generation
for several loop nest transformations (e.g. loop reversal, loop
interchange, loop skewing) and their compositions. Given that the
unimodular framework is applicable to perfect loop nests this is one
property of interest we expose in this analysis. Several other utility
functions are also provided. In the future other properties of interest
can be added in a centralized place.
Authored By: etiotto
Reviewer: Meinersbur, bmahjour, kbarton, Whitney, dmgreen, fhahn,
reames, hfinkel, jdoerfert, ppc-slack
Reviewed By: Meinersbur
Subscribers: bryanpkc, ppc-slack, mgorny, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D68789
2020-03-03 18:25:19 +00:00