Commit Graph

344204 Commits

Author SHA1 Message Date
Roman Lebedev 9e1443e6f6
[NFC][InstCombine] Add test with non-CSE'd casts of load
in @t0 we can still change type of load and get rid of casts.
2020-03-03 11:27:27 +03:00
Georgii Rymar e93f7e6d1a [obj2yaml] - Split sections dumping to a new ELFDumper<ELFT>::dumpSections() method.
ELFDumper<ELFT>::dump() is too large and deserves splitting.

Differential revision: https://reviews.llvm.org/D75172
2020-03-03 11:11:21 +03:00
Siva Chandra Reddy 80aba2b262 [libc] Add `errno_h` as a dependency to `sigaddset` and `sigemptyset`.
Summary: The bots are catching this missing dependency.

Reviewers: PaulkaToast, abrachet

Subscribers: mgorny, MaskRay, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D75502
2020-03-02 23:46:30 -08:00
Awanish Pandey 1cb0e01e42 [DebugInfo][DWARF5]: Added support for debuginfo generation for defaulted parameters
This patch adds support for dwarf emission/dumping part of debuginfo
generation for defaulted parameters.

Reviewers: probinson, aprantl, dblaikie

Reviewed By: aprantl, dblaikie

Differential Revision: https://reviews.llvm.org/D73462
2020-03-03 13:09:53 +05:30
Sameer Sahasrabuddhe 534d8866a1 [AMDGPU] add generated checks for some LIT tests
This is in prepration for further changes that affect these tests.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D75403
2020-03-03 11:47:05 +05:30
Alok Kumar Sharma 6f029dadf6 [DebugInfo] Avoid generating duplicate llvm.dbg.value
Summary:
This is to avoid generating duplicate llvm.dbg.value instrinsic if it already exists after the Instruction.

Before inserting llvm.dbg.value instruction, LLVM checks if the same instruction is already present before the instruction to avoid duplicates.
Currently it misses to check if it already exists after the instruction.
flang generates IR like this.

%4 = load i32, i32* %i1_311, align 4, !dbg !42
call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33
When this IR is processed in llvm, it ends up inserting duplicates.
%4 = load i32, i32* %i1_311, align 4, !dbg !42
call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33
call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33
We have now updated LdStHasDebugValue to include the cases when instruction is already
followed by same dbg.value instruction we intend to insert.

Now,

Definition and usage of function LdStHasDebugValue are deleted.
RemoveRedundantDbgInstrs is called for the cleanup of duplicate dbg.value's

Testing:
Added unit test for validation
check-llvm
check-debuginfo (the debug info integration tests)

Reviewers: aprantl, probinson, dblaikie, jmorse, jini.susan.george
SouraVX, awpandey, dstenb, vsk

Reviewed By: aprantl, jmorse, dstenb, vsk

Differential Revision: https://reviews.llvm.org/D74030
2020-03-03 09:56:45 +05:30
Eric Christopher 57397eba7a Revert "[mlir] Add padding to 1-D Vector in CRunnerUtils.h"
Due to Werror breakage.

This reverts commits a68235d583 and
bcee8982a2.
2020-03-02 20:12:12 -08:00
Nicolas Vasilache bcee8982a2 [mlir] Hotfix - Fix Windows build
This revision adds a static `mlir_c_runner_utils_static` library
for the sole purpose of being linked into `mlir_runner_utils` on
Windows.

It was previously reported that:
```

`add_llvm_library(mlir_c_runner_utils SHARED CRunnerUtils.cpp)`

produces *only* a dll on windows, the linking of mlir_runner_utils fails
because target_link_libraries is looking for a .lib file as opposed to a
.dll file. I think this may be a case where either we need to use
LINK_LIBS or explicitly build a static lib as well, but I haven't tried
either yet.
```
2020-03-02 22:47:16 -05:00
Nicolas Vasilache a68235d583 [mlir] Add padding to 1-D Vector in CRunnerUtils.h
Summary:
This revision fixes a -Wzero-length-array compile error that
caused e459596917 which reverted
78f9e5d098.

This revision adds padding for 1-D Vector in the common case of x86
execution with a stadard data layout. This supports properly interfacing
codegen with arrays of e.g. `vector<9xf32>`.

Such vectors are already assumed padded to the next power of 2 by LLVM
codegen with the default x86 data layout:
```
define void @test_vector_add_1d_2_3(<3 x float>* nocapture readnone %0,
<3 x float>* nocapture readonly %1, i64 %2, i64 %3, i64 %4, <3 x float>*
nocapture readnone %5, <3 x float>* nocapture readonly %6, i64 %7, i64
%8, i64 %9, <3 x float>* nocapture readnone %10, <3 x float>* nocapture
%11, i64 %12, i64 %13, i64 %14) local_unnamed_addr {
  %16 = getelementptr <3 x float>, <3 x float>* %6, i64 1
  %17 = load <3 x float>, <3 x float>* %16, align 16
  %18 = getelementptr <3 x float>, <3 x float>* %1, i64 1
  %19 = load <3 x float>, <3 x float>* %18, align 16
  %20 = fadd <3 x float> %17, %19
  %21 = getelementptr <3 x float>, <3 x float>* %11, i64 1
```

The pointer addressing a `vector<3xf32>` is assumed aligned `@16`.
Similarly, the pointer addressing a `vector<65xf32>` is assumed aligned
`@512`.

This revision allows using objects such as `vector<3xf32>` properly with
the standard x86 data layout used in the JitRunner. Integration testing
is done out of tree, at the moment such testing fails without this
change.

Differential Revision: https://reviews.llvm.org/D75459
2020-03-02 22:45:50 -05:00
David Blaikie 4ce3e5074b DebugInfo: Separate different debug_macinfo contributions & print the offset of a contribution 2020-03-02 19:30:30 -08:00
Juneyoung Lee 9f1f244d3c [LICM] Allow freeze to hoist/sink out of a loop
Summary: This patch allows LICM to hoist/sink freeze instructions out of a loop.

Reviewers: reames, fhahn, efriedma

Reviewed By: reames

Subscribers: jfb, lebedev.ri, hiraditya, asbirlea, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75400
2020-03-03 12:29:39 +09:00
Shengchen Kan af57b139a0 Temporarily Revert [X86] Not track size of the boudaryalign fragment during the layout
Summary: This reverts commit 2ac19feb15.
This commit causes some test cases to run fail when branch is aligned.
2020-03-03 11:15:56 +08:00
Nico Weber ff9bc0c091 fix typo 2020-03-02 21:01:50 -05:00
Fred Riss 138c7ac5b6 [lldb/GDBRemote] Fix obvious typo in error message.
It's unlikely that `errno` is the value the user wants to see in this
error message.
2020-03-02 17:53:39 -08:00
Fangrui Song 08ff4dc9ad [LTO] onfig::addSaveTemps: clear ResolutionFile upon an error
Otherwise ld.lld -save-temps will crash when writing to ResolutionFile.

llvm-lto2 -save-temps does not crash because it exits immediately.

Reviewed By: evgeny777

Differential Revision: https://reviews.llvm.org/D75426
2020-03-02 17:49:04 -08:00
Fred Riss 20ce8affce [lldb/API] NFC: Reformat and simplify SBThread::GetStopDescription()
Summary:
This gets rid of some nesting and of the raw char* variable that caused
the memory management bug we hit recently.

This commit also removes the fallback code which should trigger when
the StopInfo provides no stop description. All currently implemented
StopInfos have a `GetDescription()` method that shouldn't return an
empty description.

Reviewers: JDevlieghere, labath, mib

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74157
2020-03-02 17:43:35 -08:00
Jim Lin c0a2da9460 [AVR] Add missing ROLLOOP and RORLOOP into getTargetNodeName 2020-03-03 09:43:52 +08:00
Cyndy Ishida b796acbba2 [llvm][MachO] fix adding weak def syms
the weak defined symbol flag was missing from the call site for adding
symbols which didn't cause issues because it invoked the default
parameter.
2020-03-02 17:00:24 -08:00
Vedant Kumar d64a22a2ad [LiveDebugValues] Prevent some misuse of LocIndex::fromRawInteger, NFC
Make it a compile-time error to pass an int/unsigned/etc to
fromRawInteger.

Hopefully this prevents errors of the form:

```
for (unsigned ID : getVarLocs()) {
  auto VL = LocMap[LocIndex::fromRawInteger(ID)];
  ...
```
2020-03-02 16:59:09 -08:00
Erik Pilkington 29a4239d31 [Sema] Fix a crash when attaching comments to an implicit decl
When an implicitly generated decl was the first entry in the group, we
attempted to lookup comments with an empty FileID, leading to crashes. Avoid
this by trying to use the other declarations in the group, and then bailing out
if none are valid.

rdar://59919733
Differential revision: https://reviews.llvm.org/D75483
2020-03-02 16:49:53 -08:00
Huihui Zhang 44fa47c9e7 [ARM][ConstantIslands] Fix stack mis-alignment caused by undoLRSpillRestore.
Summary:
It is not safe for ARMConstantIslands to undoLRSpillRestore. PrologEpilogInserter is
the one to ensure stack alignment, taking into consideration LR is spilled or not.

For noreturn function with StackAlignment 8 (function contains call/alloc),
undoLRSpillRestore cause stack be mis-aligned. Fixing stack alignment in
ARMConstantIslands doesn't give us much benefit, as undo LR spill/restore only
occur in large function with near branches only, also doesn't have callee-saved LR spill.

Reviewers: t.p.northover, rengolin, efriedma, apazos, samparker, ostannard

Reviewed By: ostannard

Subscribers: dmgreen, ostannard, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75288
2020-03-02 16:28:57 -08:00
Petr Hosek dffbaa4014 [libcxx] Drop -D option from libtool when merging archives
This is a follow up to D74108. This option is not supported by older
versions of libtool so remove it. We keep the -s option to build the
index.
2020-03-02 16:07:18 -08:00
Jonas Devlieghere 7ad30f4249 [lldb/Utility] Use emplace_back instead of push_back (NFC)
Use emplace_back to allow for in-place construction of the
BroadcastEventSpec instead of copying it.
2020-03-02 15:54:00 -08:00
Greg Clayton 8d41f1a023 Fix GSYM tests to run the yaml files and fix test failures on some machines.
YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data. Also fixed an issue where strings for files in the file table could be added in opposite order due to parameters to function calls not having a strong ordering, which caused tests to fail. Added new arch specfic directories so when targets are not enabled, we continue to function just fine.

Differential Revision: https://reviews.llvm.org/D75390
2020-03-02 15:40:11 -08:00
Raphael Isemann b6b3fcdcb8 [lldb] Don't iterate over a std::set<Type*> in SymbolFileDWARF::GetTypes to make it deterministic
Summary:
Currently `SymbolFileDWARF::TypeSet` is a typedef to a `std::set<Type *>`.
In `SymbolFileDWARF::GetTypes` we iterate over a TypeSet variable when finding
types so that logic is non-deterministic as it depends on the actual pointer address values.

This patch changes the `TypeSet` to a `llvm::UniqueVector` which always iterates in
the order in which we inserted the types into the list.

Reviewers: JDevlieghere, aprantl

Reviewed By: JDevlieghere

Subscribers: mgrang, abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D75481
2020-03-02 15:03:45 -08:00
Philip Reames 5565820e6e Use range-for in MCAssembler [NFC] 2020-03-02 14:57:35 -08:00
Davide Italiano eddf59ae71 [docs] Use 0 as version placeholder instead of a made up number.
While here, explain that this is not really used. Probably NFC.
2020-03-02 14:55:05 -08:00
Eric Christopher e459596917 Temporarily Revert "[mlir] Add padding to 1-D Vector in CRunnerUtils.h"
as it broke the Werror build:

.../sources/llvm-project/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h:85:16: error: zero size arrays are an extension [-Werror,-Wzero-length-array]
  char padding[detail::nextPowerOf2<sizeof(T[Dim])>() - sizeof(T[Dim])];
               ^~~~~~~~~~~~~~~

This reverts commit 78f9e5d098.
2020-03-02 14:47:21 -08:00
Philip Reames 7049cf6496 [BranchAlign] Fix bug w/nop padding for SS manipulation
X86 has several instructions which are documented as enabling interrupts exactly one instruction *after* the one which changes the SS segment register. Inserting a nop between these two instructions allows an interrupt to arrive before the execution of the following instruction which changes semantic behaviour.

The list of instructions is documented in "Table 24-3. Format of Interruptibility State" in Volume 3c of the Intel manual. They basically all come down to different ways to write to the SS register.

Differential Revision: https://reviews.llvm.org/D75359
2020-03-02 14:40:25 -08:00
Sumanth Gundapaneni 9897daa6bf Update LSR's logic that identifies a post-increment SCEV value.
One of the checks has been removed as it seem invalid.
The LoopStep size is always almost a 32-bit.

Differential Revision: https://reviews.llvm.org/D75079
2020-03-02 16:34:18 -06:00
Jordan Rupprecht d7803c3832 Add default case to fix -Wswitch errors 2020-03-02 14:23:46 -08:00
Jonas Devlieghere c77fc00eec [lldb/Docs] Remove the version from the home page 2020-03-02 14:23:05 -08:00
Craig Topper adc69729ec [TargetLowering] Fix what look like copy/paste mistakes in compare with infinity handling SimplifySetCC.
I expect that the isCondCodeLegal checks should match that CC of
the node that we're going to create.

Rewriting to a switch to minimize repeated mentions of the same
constants.
2020-03-02 14:12:16 -08:00
Teresa Johnson 80bf137fa1 Revert "Restore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP""
This reverts commit 80d0a137a5, and the
follow on fix in 873c0d0786. It is
causing test failures after a multi-stage clang bootstrap. See
discussion on D73242 and D75201.
2020-03-02 14:02:13 -08:00
Joerg Sonnenberger eb812efa12 Explicitly include <cassert> when using assert
Depending on the OS used, a module-enabled build can fail due to the
special handling <cassert> gets as textual header.
2020-03-02 22:45:28 +01:00
Luboš Luňák c61401b897 Revert "[clang] detect switch fallthrough marked by a comment (PR43465)"
This reverts commit 398b4ed87d.
As requested in https://bugs.llvm.org/show_bug.cgi?id=43465#c37 .
2020-03-02 22:33:25 +01:00
Jacques Pienaar 5aa57c2812 [mlir][ods] Add query for derived attribute
For ODS generated operations enable querying whether there is a derived
attribute with a given name.
2020-03-02 13:31:35 -08:00
Greg Clayton e3afe5952d Revert "Fix GSYM tests to run the yaml files and fix test failures on some machines."
This reverts commit 57688350ad.

Need to conditionalize for ARM targets, this is failing on machines that don't have ARM targets.
2020-03-02 13:07:58 -08:00
Greg Clayton 57688350ad Fix GSYM tests to run the yaml files and fix test failures on some machines.
YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data. Also fixed an issue where strings for files in the file table could be added in opposite order due to parameters to function calls not having a strong ordering, which caused tests to fail.

Differential Revision: https://reviews.llvm.org/D75390
2020-03-02 12:52:53 -08:00
Hiroshi Yamauchi 4d6f3ee2ba [PSI] Add the isCold query support with a given percentile value.
Summary: This follows up D67377 that added the isHot side.

Reviewers: davidxl

Subscribers: eraman, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75283
2020-03-02 12:50:15 -08:00
Alexandre Ganea 7e77cf473a [Clang] Fix Hurd toolchain test on a two-stage build with ThinLTO
A two-stage ThinLTO build previously failed the clang/test/Driver/hurd.c test because of a static_cast in "tools::gnutools::Linker::ConstructJob()" which wrongly converted an instance of "clang::driver::toolchains::Hurd" into that of "clang::driver::toolchains::Linux". ThinLTO would later devirtualize the "ToolChain.getDynamicLinker(Args)" call and use "Linux::getDynamicLinker()" instead, causing the test to generate a wrong "-dynamic-linker" linker flag (/lib/ld-linux.so.2 instead of /lib/ld.so)

Fixes PR45061.

Differential Revision: https://reviews.llvm.org/D75373
2020-03-02 15:42:33 -05:00
Alexey Bataev c4a9d976c1 [LIBOMPTARGET]Lower priority of global constructor/destructor to silence the warning from gcc.
Summary: fixed the warning from gcc since prios 0-100 are reserved for the internal use.

Reviewers: grokos

Subscribers: kkwli0, caomhin, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D75458
2020-03-02 15:15:11 -05:00
Stanislav Mekhanoshin 1bacdcf48d Extend LaneBitmask to 64 bit
This is needed for D74873, AMDGPU going to have 16 bit subregs
and the largest tuple is 32 VGPRs, which results in 64 lanes.

Differential Revision: https://reviews.llvm.org/D75378
2020-03-02 12:10:52 -08:00
Sid Manning 0858eebd2a Revert "Add default paths to support musl target"
This reverts commit 6377676651.
Need to fix the testcase.
2020-03-02 14:09:52 -06:00
Vedant Kumar 0eb5b6e88c [test/compiler-rt] Disable ubsan/TestCases/Misc/nullability.c on Android
It looks like the suppression file isn't being copied over to the
device.
2020-03-02 12:01:09 -08:00
Vedant Kumar 80cd518b80 [Coverage] Collect all function records in an object (D69471 followup)
After the format change from D69471, there can be more than one section
in an object that contains coverage function records. Look up each of
these sections and concatenate all the records together.

This re-enables the instrprof-merging.cpp test, which previously was
failing on OSes which use comdats.

Thanks to Jeremy Morse, who very kindly provided object files from the
bot I broke to help me debug.
2020-03-02 12:01:09 -08:00
Alexey Bataev 375437ab92 [OPENMP50]Support 'destroy' clause on 'depobj' directives.
Added basic support (parsing/sema/serialization) for 'destroy' clause in
depobj directives.
2020-03-02 14:40:53 -05:00
Sid Manning 6377676651 Add default paths to support musl target
Pickup the default crt and libs when the target is musl.

Differential Revision: https://reviews.llvm.org/D75139
2020-03-02 13:39:42 -06:00
Erik Pilkington e392dcd570 [Sema] Look through OpaqueValueExpr when checking implicit conversions
Specifically, this fixes a false-positive in -Wobjc-signed-char-bool.
rdar://57372317

Differential revision: https://reviews.llvm.org/D75387
2020-03-02 11:24:36 -08:00
Petr Hosek 603acd9626 [libcxx] When merging archives, build index even on Darwin
We always want to build the table of contents. Additionally, we also
set the flag to make the output deterministic which is already the
default for llvm-ar.

Differential Revision: https://reviews.llvm.org/D74108
2020-03-02 11:02:42 -08:00