Commit Graph

311104 Commits

Author SHA1 Message Date
Philip Reames 2226e9a745 [LICM] Infer proper alignment from loads during scalar promotion
This patch fixes an issue where we would compute an unnecessarily small alignment during scalar promotion when no store is not to be guaranteed to execute, but we've proven load speculation safety. Since speculating a load requires proving the existing alignment is valid at the new location (see Loads.cpp), we can use the alignment fact from the load.

For non-atomics, this is a performance problem. For atomics, this is a correctness issue, though an *incredibly* rare one to see in practice. For atomics, we might not be able to lower an improperly aligned load or store (i.e. i32 align 1). If such an instruction makes it all the way to codegen, we *may* fail to codegen the operation, or we may simply generate a slow call to a library function. The part that makes this super hard to see in practice is that the memory location actually *is* well aligned, and instcombine knows that. So, to see a failure, you have to have a) hit the bug in LICM, b) somehow hit a depth limit in InstCombine/ValueTracking to avoid fixing the alignment, and c) then have generated an instruction which fails codegen rather than simply emitting a slow libcall. All around, pretty hard to hit.

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

llvm-svn: 355217
2019-03-01 18:45:05 +00:00
Rong Xu 06ed38517e [PGO] Remove the default parameter in ProfileSummary API. NFC
Remove the default parameter in setProfileSummary() and getSummary().
This is a follow-up of r355131.

llvm-svn: 355216
2019-03-01 18:36:24 +00:00
Philip Reames 1648f95eb1 [Tests] More missing atomicrmw combines
llvm-svn: 355215
2019-03-01 18:24:05 +00:00
Evgeniy Stepanov c7b322a3d9 [msan] Add an interceptor for ttyname().
llvm-svn: 355214
2019-03-01 18:22:44 +00:00
Jim Ingham 3139fc9767 Resubmit r354706 with a fix for process launch.
When the debugger is run in sync mode, you need to
be able to tell whether a hijacked resume is for some
special purpose (like waiting for the SIGSTOP on attach)
or just to perform a synchronous resume.  Target::Launch was doing
that wrong, and that caused stop-hooks on process launch
in source files to behave incorrectly.

<rdar://problem/48115661>

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

llvm-svn: 355213
2019-03-01 18:13:38 +00:00
Philip Reames 21f7c35df1 [Tests] Add tests for missed optimizations of saturating and idempotent FP atomicrmws
llvm-svn: 355212
2019-03-01 18:10:37 +00:00
Matt Davis b95daf0b77 [lld][test] Fix tests. llvm-readobj now emits symbol section names.
This is the result of patch 99e9c4cad08164b9c0ca565ab9ad48ce132e98e5
See the related patch https://reviews.llvm.org/D58796

llvm-svn: 355211
2019-03-01 18:01:41 +00:00
Philip Reames 77982868c5 [InstCombine] Extend "idempotent" atomicrmw optimizations to floating point
An idempotent atomicrmw is one that does not change memory in the process of execution.  We have already added handling for the various integer operations; this patch extends the same handling to floating point operations which were recently added to IR.

Note: At the moment, we canonicalize idempotent fsub to fadd when ordering requirements prevent us from using a load.  As discussed in the review, I will be replacing this with canonicalizing both floating point ops to integer ops in the near future.

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

llvm-svn: 355210
2019-03-01 18:00:07 +00:00
Rong Xu 39f6d7e616 [PGO] Use the explicit parameter in ProfileSummary API. NFC
Use the explicit parameter in setProfileSummary() and getSummary().
This is a follow-up of r355131.

llvm-svn: 355209
2019-03-01 17:50:20 +00:00
Thomas Lively d295f51469 Revert "[WebAssembly] Lower SIMD shifts since they are fixed in V8"
They weren't fixed in V8. Oops.

llvm-svn: 355208
2019-03-01 17:43:55 +00:00
Matt Davis 8a6f11f45f [llvm-readobj] Display section names for STT_SECTION symbols.
Summary:
This patch will obtain the section name for symbols that refer to a section.  Prior to this patch the Name field for STT_SECTIONs was blank, now it is populated.

Before:
```
Symbol table '.symtab' contains 6 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000000000     0 SECTION LOCAL  DEFAULT    1
     2: 0000000000000000     0 SECTION LOCAL  DEFAULT    3
     3: 0000000000000000     0 SECTION LOCAL  DEFAULT    4
     4: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _GLOBAL_OFFSET_TABLE_
     5: 0000000000000000     0 TLS     GLOBAL DEFAULT  UND sym
```

With this patch:
```
Symbol table '.symtab' contains 6 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000000000     0 SECTION LOCAL  DEFAULT    1 .text
     2: 0000000000000000     0 SECTION LOCAL  DEFAULT    3 .data
     3: 0000000000000000     0 SECTION LOCAL  DEFAULT    4 .bss
     4: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _GLOBAL_OFFSET_TABLE_
     5: 0000000000000000     0 TLS     GLOBAL DEFAULT  UND sym
```

This fixes PR40788

Reviewers: jhenderson, rupprecht, espindola

Reviewed By: rupprecht

Subscribers: emaste, javed.absar, arichardson, MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 355207
2019-03-01 17:31:32 +00:00
Sanjay Patel 12b1f2418d [InstCombine] add tests for add+umin/umax canonicalization; NFC
Fixing this should solve the biggest part of the vector problems seen in:
https://bugs.llvm.org/show_bug.cgi?id=14613

llvm-svn: 355206
2019-03-01 17:29:10 +00:00
Jonas Hahnfeld e071cd86df Hide two unused debugging methods, NFCI.
GCC correctly moans that PlainCFGBuilder::isExternalDef(llvm::Value*) and
StackSafetyDataFlowAnalysis::verifyFixedPoint() are defined but not used
in Release builds. Hide them behind 'ifndef NDEBUG'.

llvm-svn: 355205
2019-03-01 17:15:21 +00:00
Clement Courbet dd885eaf5f Reland "[compiler-rt] Intercept the bcmp() function."
Fix test issues on darwin: The REQUIRES for the test should be the same as the
guard for whether we intercept bcmp.

llvm-svn: 355204
2019-03-01 16:42:08 +00:00
Kostya Kortchinsky 6b79f3b1e2 [scudo][standalone] Fix tests makefile
Summary:
A missing `STATIC` entailed some annoying to debug failures wrt 32 vs 64
binaries. Additionally I noticed I was using the wrong variable (the Scudo
one as opposed to the Scudo Standalone one).

See https://reviews.llvm.org/D58184#1412417 and below for discussion.

Reviewers: vitalybuka, eugenis, brzycki

Reviewed By: vitalybuka, brzycki

Subscribers: mgorny, delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 355203
2019-03-01 15:46:23 +00:00
Manman Ren 576124a319 Try to fix NetBSD buildbot breakage introduced in D57463.
By including the header file in the source.

llvm-svn: 355202
2019-03-01 15:25:24 +00:00
Oliver Stannard 82fbbc21fd [ARM] Fix FP16 stack loads/stores for Thumb2 with frame pointer
The new addressing mode added for the v8.2A FP16 instructions uses bit 8 of the
immediate to encode the sign of the offset, like the other FP loads/stores, so
need to be treated the same way.

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

llvm-svn: 355201
2019-03-01 14:20:28 +00:00
Eric Liu 9f7a767a81 [clangd] Enable SuggestMissingIncludes by default.
Summary: This seems to work stably now. Turn on by default.

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 355200
2019-03-01 14:17:55 +00:00
Oliver Stannard e019e6223b [ARM] Consider undefined-on-NaN conditions in checkVSELConstraints
This function was not checking for the condition code variants which are
undefined if either input is NaN, so we were missing selection of the VSEL
instruction in some cases when using -fno-honor-nans or -ffast-math.

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

llvm-svn: 355199
2019-03-01 13:58:25 +00:00
Simon Pilgrim 1a059e6619 [X86] Regenerate legalize test files
Noticed while getting update_mir_test_checks.py to work on python3

llvm-svn: 355198
2019-03-01 13:13:40 +00:00
Simon Pilgrim 69c670e4e3 [Thumb] Add some integer abs testcases for different typesizes.
Committed on behalf of @ikulagin (Ivan Kulagin)

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

llvm-svn: 355197
2019-03-01 12:08:50 +00:00
George Rimar aee005291c [LLD][ELF] - Convert 3 testcases to use yaml instead of binaries.
This change makes 3 tests to use yaml instead of binaries.

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

llvm-svn: 355196
2019-03-01 10:58:45 +00:00
Peter Smith 22ce712c19 [ELF][ARM] Fix clang-armv7-linux-build-cache builds of LLD [NFC]
r355153 introduced a build failure on a build bot that uses clang natively
on an armv7-a machine. This a temporary fix to use size_t rather than
uint64_t.

llvm-svn: 355195
2019-03-01 10:52:25 +00:00
George Rimar f56def4ea4 [LLD][ELF] - Convert invalid/undefined-local-symbol-in-dso.test to use YAML
This removes a binary from the inputs and reduces the test case.

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

llvm-svn: 355194
2019-03-01 10:37:51 +00:00
George Rimar a7ba1a0f81 [yaml2obj] - Allow setting custom sh_info for RawContentSection sections.
This is for tweaking SHT_SYMTAB sections.
Their sh_info contains the (number of symbols + 1) usually.
But for creating invalid inputs for test cases it would be convenient
to allow explicitly override this field from YAML.

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

llvm-svn: 355193
2019-03-01 10:18:16 +00:00
Alexey Lapshin b0224b1f1d Attempt to fix buildbot after r354972 [#2]. NFCI.
llvm-svn: 355192
2019-03-01 10:15:18 +00:00
Diana Picus 54829ec5d0 [ARM GlobalISel] Support G_CTLZ for Thumb2
Same as ARM mode but with different opcode.

llvm-svn: 355191
2019-03-01 10:12:28 +00:00
Pierre Gousseau ae5303d010 [Driver] Allow enum SanitizerOrdinal to represent more than 64 different sanitizer checks, NFC.
enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks.
This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare".

This is a recommit of r354873 but with a fix for unqualified lookup error in lldb cmake build bot.

Fixes: https://llvm.org/PR39425

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

llvm-svn: 355190
2019-03-01 10:05:15 +00:00
Diana Picus afb3398da0 [ARM GlobalISel] Check target flags in test. NFCI
There was a time when we couldn't dump target-specific flags such as
arm-sbrel etc, so the tests didn't check for them. We can now be more
specific in our tests.

llvm-svn: 355189
2019-03-01 10:01:22 +00:00
Fangrui Song ffe9f00cfe Fix file headers. NFC
llvm-svn: 355188
2019-03-01 09:52:53 +00:00
Nicola Zaghen a896756955 [Tablegen] Add support for the !mul operator.
This is a small addition to arithmetic operations that improves
expressiveness of the language.

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

llvm-svn: 355187
2019-03-01 09:46:29 +00:00
Oliver Stannard 1ed7d8ae36 [ARM] Add armv8a triple to test check updaters
llvm-svn: 355186
2019-03-01 09:26:21 +00:00
Igor Kudrin a38432cefb [CommandLine] Allow grouping options which can have values.
This patch allows all forms of values for options to be used at the end
of a group. With the fix, it is possible to follow the way GNU binutils
tools handle grouping options better. For example, the -j option can be
used with objdump in any of the following ways:

$ objdump -d -j .text a.o
$ objdump -d -j.text a.o
$ objdump -dj .text a.o
$ objdump -dj.text a.o

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

llvm-svn: 355185
2019-03-01 09:22:42 +00:00
Igor Kudrin 875f05828d [CommandLine] Do not crash if an option has both ValueRequired and Grouping.
If an option, which requires a value, has a `cl::Grouping` formatting
modifier, it works well as far as it is used at the end of a group,
or as a separate argument. However, if the option appears accidentally
in the middle of a group, the program just crashes. This patch prints
an error message instead.

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

llvm-svn: 355184
2019-03-01 09:20:56 +00:00
James Henderson 88c643abf1 [llvm-readobj]Add test showing behaviour of thin archive member path printing
This was a test requested in https://reviews.llvm.org/D58677.

Reviewed by: rupprecht, grimar, Higuoxing

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

llvm-svn: 355183
2019-03-01 09:12:38 +00:00
Paul Hoad 5bcf99b4bd [clang-format] [NFC] clang-format the Format library
Previously revisions commited non-clang-formatted changes to the Format library, this means submitting any revision e.g. {D55170} can cause additional whitespace changes to potentially be included in a revision.

Commit a non functional change using latest build Windows clang-format r351376 with no other changes, to remove these differences

All FormatTests
pass [==========] 652 tests from 20 test cases ran.

llvm-svn: 355182
2019-03-01 09:09:54 +00:00
Alexander Potapenko fa61dddf5d CodeGen: Fix PR40605 by splitting constant struct initializers
When emitting initializers for local structures for code built with
-ftrivial-auto-var-init, replace constant structures with sequences of
stores.

This appears to greatly help removing dead initialization stores to those
locals that are later overwritten by other data.
This also removes a lot of .rodata constants (see PR40605), replacing most
of them with immediate values (for Linux kernel the .rodata size is
reduced by ~1.9%)

llvm-svn: 355181
2019-03-01 09:00:41 +00:00
Martin Storsjo 90641b5581 [sanitizers] Explicitly use GetModuleFileNameW with wchar_t
Alternatively we could define the string as TCHAR.

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

llvm-svn: 355180
2019-03-01 08:08:11 +00:00
Stanislav Mekhanoshin bb98841399 [AMDGPU] Mark ds instructions as meybeAtomic
These were not recognized as potential atomics by memory legalizer.
The test was working not because legalizer did a right thing, but
because it has skipped all these instructions. When I have fixed
DS desciption test started to fail because region address has
changed from 4 to 2 a while ago.

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

llvm-svn: 355179
2019-03-01 07:59:17 +00:00
Petar Avramovic 9bf43b5c26 [MIPS GlobalISel] Fix mul operands
Unsigned mul high for MIPS32 is selected into two PseudoInstructions:
PseudoMULTu and PseudoMFHI that use accumulator register class ACC64 for
some of its operands. Registers in this class have appropriate hi and lo
register as subregisters: $lo0 and $hi0 are subregisters of $ac0 etc.
mul instruction implicit-defs $lo0 and $hi0 according to MipsInstrInfo.td.
In functions where mul and PseudoMULTu are present fastRegisterAllocator
will "run out of registers during register allocation" because
'calcSpillCost' for $ac0 will return spillImpossible because subregisters
$lo0 and $hi0 of $ac0 are reserved by mul instruction above. A solution is
to mark implicit-defs of $lo0 and $hi0 as dead in mul instruction.

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

llvm-svn: 355178
2019-03-01 07:35:57 +00:00
Petar Avramovic a48285a190 [MIPS GlobalISel] Select G_UMULH
Legalize G_UMULO and select G_UMULH for MIPS32.

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

llvm-svn: 355177
2019-03-01 07:25:44 +00:00
Fangrui Song 524b3c1810 Fix file headers. NFC
llvm-svn: 355176
2019-03-01 06:49:51 +00:00
Akira Hatanaka 78be8b6d53 [Sema][ObjC] Allow silencing -Wobjc-designated-initializers warnings by
declaring an unavailable method in the subclass's extension that
overrides the designated initializer in the base class.

r243676 made changes to allow declaring the unavailable method in the
subclass interface to silence the warning. This commit additionally
allows declaring the unavailable method in the class extension.

rdar://problem/42731306

llvm-svn: 355175
2019-03-01 06:43:20 +00:00
Fangrui Song f4b25f700a [ConstantHoisting] Call cleanup() in ConstantHoistingPass::runImpl to avoid dangling elements in ConstIntInfoVec for new PM
Summary:
ConstIntInfoVec contains elements extracted from the previous function.
In new PM, releaseMemory() is not called and the dangling elements can
cause segfault in findConstantInsertionPoint.

Rename releaseMemory() to cleanup() to deliver the idea that it is
mandatory and call cleanup() in ConstantHoistingPass::runImpl to fix
this.

Reviewers: ormris, zzheng, dmgreen, wmi

Reviewed By: ormris, wmi

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 355174
2019-03-01 05:27:01 +00:00
Fangrui Song 7507208a9a [ELF] Explain some options in ld.lld.1
Reviewers: ruiu, grimar

Reviewed By: ruiu

Subscribers: srhines, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355173
2019-03-01 04:49:42 +00:00
Julian Lettner 13c4bc5671 [NFC][Sanitizer] Add new BufferedStackTrace::Unwind API
Retrying without replacing call sites in sanitizer_common (which might
not have a symbol definition).

Add new Unwind API. This is the final envisioned API with the correct
abstraction level. It hides/slow fast unwinder selection from the caller
and doesn't take any arguments that would leak that abstraction (i.e.,
arguments like stack_top/stack_bottom).

GetStackTrace will become an implementation detail (private method) of
the BufferedStackTrace class.

Reviewers: vitalybuka

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

> llvm-svn: 355168

llvm-svn: 355172
2019-03-01 04:03:38 +00:00
Julian Lettner e6ec6bd8e0 Revert "[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API"
This reverts commit 6112f37e75.

llvm-svn: 355171
2019-03-01 03:35:05 +00:00
Jason Molenda 7cdaf1e06b Update com.apple.diagnosticd.diagnostic entitlement
name to the newer com.apple.private.logging.diagnostic.

<rdar://problem/47183116> 

llvm-svn: 355170
2019-03-01 03:34:51 +00:00
Jason Molenda e772052edf Increase timeout in Symbols::DownloadObjectAndSymbolFile
from 30 seconds to 120 seconds.  We've seen cases where
this symbol lookup can exceed 30 seconds for people
working remotely.

<rdar://problem/48460476> 

llvm-svn: 355169
2019-03-01 03:24:59 +00:00
Julian Lettner 6112f37e75 [NFC][Sanitizer] Add new BufferedStackTrace::Unwind API
Add new Unwind API. This is the final envisioned API with the correct
abstraction level. It hides/slow fast unwinder selection from the caller
and doesn't take any arguments that would leak that abstraction (i.e.,
arguments like stack_top/stack_bottom).

GetStackTrace will become an implementation detail (private method) of
the BufferedStackTrace class.

Reviewers: vitalybuka

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

llvm-svn: 355168
2019-03-01 03:08:34 +00:00