Commit Graph

284544 Commits

Author SHA1 Message Date
Rafael Espindola 81e911cd86 Don't treat .symver as a regular alias definition.
This patch starts simplifying the handling of .symver.

For now it just moves the responsibility for creating an alias down to
the streamer. With that the asm streamer can pass a .symver unchanged,
which is nice since gas cannot parse "foo@bar = zed".

In a followup I hope to move the handling down to the writer so that
we don't need special hacks for avoiding breaking names with @@@ on
windows.

llvm-svn: 327101
2018-03-09 03:13:37 +00:00
Matt Morehouse 5a91fc6f74 Attempt to fix vecreduce-propagate-sd-flags.ll test.
Buildbots have been failing since r327079.

llvm-svn: 327100
2018-03-09 02:04:30 +00:00
Richard Smith 69cf59ed26 PR36645: Go looking for an appropriate array bound when constant-evaluating a
name of an array object.

llvm-svn: 327099
2018-03-09 02:00:01 +00:00
Artem Dergachev ce5f2d3d42 [analyzer] MmapWriteExecChecker: Add support for mprotect().
mprotect() allows setting memory access flags similarly to mmap(),
causing similar security issues if these flags are needlessly broad.

Patch by David Carlier!

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

llvm-svn: 327098
2018-03-09 01:47:24 +00:00
Jason Molenda 250524f7ed I added CFLAGS etc to one part of the project file I should not have.
llvm-svn: 327097
2018-03-09 01:43:18 +00:00
Artem Dergachev 13f9664d2b [CFG] [analyzer] Add construction context for implicit constructor conversions.
Implicit constructor conversions such as A a = B() are represented by
surrounding the constructor for B() with an ImplicitCastExpr of
CK_ConstructorConversion kind, similarly to how explicit constructor conversions
are surrounded by a CXXFunctionalCastExpr. Support this syntax pattern when
extracting the construction context for the implicit constructor that
performs the conversion.

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

llvm-svn: 327096
2018-03-09 01:39:59 +00:00
Jason Molenda 4b7ea1f33c More cleanups of debugserver project file and the libpmenergy/libpmsample
stuff.  Activate it when an internal SDK is selected.  Update the name of
the LDFLAGS to match the rest of the settings.  Update the default arch for 
ios builds.

llvm-svn: 327095
2018-03-09 01:37:37 +00:00
Eric Christopher 3caa0fd050 Revert "[ThinLTO] Keep available_externally symbols live"
This reverts commit r327041 and the followup attempts at fixing the testcase as they're still failing.

llvm-svn: 327094
2018-03-09 01:25:18 +00:00
Craig Topper 784f1bbf5e [X86] Remove SRAs from v16i8 multiply lowering on sse2 targets
Previously we unpacked the even bytes of each input into the high byte of 16-bit elements then did an v8i16 arithmetic shift right by 8 bits to fill the upper bits of each word with sign bits. Then we did the v8i16 multiply and then masked to zero the upper 8-bits of each result. The similar was done for all the odd bytes. The results are then packed together with packuswb

Since we are masking each multiply result element to 8-bits, and those 8-bits are determined only by the lower 8-bits of each of the inputs, we don't need to fill the upper bits with sign bits. So we can just unpack into the low byte of each element and treat the upper bits as garbage. This is what gcc also does.

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

llvm-svn: 327093
2018-03-09 01:22:31 +00:00
Adrian Prantl 5b477be72a LowerDbgDeclare: ignore dbg.declares for allocas with volatile access
There is no point in lowering a dbg.declare describing an alloca that
has volatile loads or stores as users, since the alloca cannot be
elided. Lowering the dbg.declare will result in larger debug info that
may also have worse coverage than just describing the alloca.

rdar://problem/34496278

llvm-svn: 327092
2018-03-09 00:45:04 +00:00
Kuba Mracek ffb5014d9e Mark the -overlap tests are "UNSUPPORTED: android". Android test harness doesn't know how to handle suppression files.
llvm-svn: 327091
2018-03-09 00:41:29 +00:00
Douglas Yung 17d2ef90e0 [DOXYGEN] Fix doxygen and content issues in mmintrin.h
- Fix instruction mappings/listings for various intrinsics

This patch was made by Craig Flores

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

llvm-svn: 327090
2018-03-09 00:38:51 +00:00
Vedant Kumar e96dc75339 [test] Skip a test which sporadically fails in its dsym variant
There is a mailing list discussion re: r325927 about why this test fails
in the dsym variant. I've marked it skipped for now, until the issue is
resolved.

llvm-svn: 327089
2018-03-09 00:34:43 +00:00
Jason Molenda fc7321197e Remove unneeded per-arch sdk specifications from debugserver xcode project file.
llvm-svn: 327088
2018-03-09 00:32:56 +00:00
Jason Molenda c13a14ac26 Remove the explicit dependency on libpmenergy and libpmsample.
llvm-svn: 327087
2018-03-09 00:28:51 +00:00
Eric Christopher 3390a8f63d Fix header comment on SHA1 code.
llvm-svn: 327086
2018-03-09 00:23:35 +00:00
Jason Molenda a608510b13 Fixed two more sdk inconsistencies with the pmenergy stuff.
llvm-svn: 327085
2018-03-09 00:23:29 +00:00
Jason Molenda 917f5b9944 Three little cleanups in the debugserver xcode project file.
1. Link against libpmenergy and pmsample unconditionally.  It is available on 
macOS 10.10 ("Yosemite") and newer.  We're already linking against libcompression
unconditionally which is only available on macOS 10.11 & newer.

2. Change a few "sdk=macosx.internal"'s to sdk=macosx.

3. Clean up a few places where libcompression was being enabled inconsistently.


Note: the -DLLDB_ENERGY define is only set when building against the macosx.internal
SDK; it includes a header file that is not public.  We link against the dylibs
unconditionally for simplicity.

llvm-svn: 327084
2018-03-09 00:17:22 +00:00
Paul Robinson b45fd56734 Revert "[DWARF] Fix mixing assembler -g with DWARF .file directives."
This reverts commit d6d9ac1ab5039ba1fe0f63c36eac2bdd9f0a79c9.
aka r327073

llvm-svn: 327083
2018-03-09 00:11:54 +00:00
Saleem Abdulrasool d5453b2c3f utils: add a helper class to lit for captured substitutions
On Windows, if the substitution contains a back reference, it would
removed due to the replacement of the escape character in lit. Create a
helper class to avoid this which will simply ignore the replacement and
mark the substitution as having capture groups being referenced.

llvm-svn: 327082
2018-03-09 00:06:10 +00:00
Kuba Mracek 08126e7eaa Mark strcat-overlap.cc as "UNSUPPORTED: win32"
llvm-svn: 327081
2018-03-09 00:03:09 +00:00
Kuba Mracek f9ee716299 Move lto-constmerge-odr.cc to Posix (it's failing on Windows).
llvm-svn: 327080
2018-03-08 23:53:29 +00:00
Sameer AbuAsal 986865c090 Propagate flags to SDValue in SplitVecOp_VECREDUCE
This patch is a fix for PR36642.

 While legalizing long vector types, make sure the smaller types get the
 flags of the wider type.

 bugzilla link: https://bugs.llvm.org/show_bug.cgi?id=36642

Change-Id: I0c2829639f094c862c10a6b51b342d4c2563e1fa
llvm-svn: 327079
2018-03-08 23:41:40 +00:00
Adrian Prantl 69fce12c38 Add a debug info testcase for the trvial_abi attribute.
llvm-svn: 327078
2018-03-08 23:11:46 +00:00
Kevin Enderby 299cd890fe For llvm-objdump and Mach-O files, update the printing of some thread states
from core files.  I tested this against the couple of core files that were
getting errors about unknown thread flavors and it now produce the same output as
the Xcode otool-classic(1) tool.  Since the core files are huge I didn’t include
them as test cases.

rdar://38216356

llvm-svn: 327077
2018-03-08 23:10:38 +00:00
Jan Vesely f96b1b88f8 amdgcn/fmax: fcanonicalize operands
v_max instruction needs canonicalized operands.
Passes CTS on carrizo

Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327076
2018-03-08 23:01:01 +00:00
Jan Vesely e724e346ab amdgcn/fmin: fcanonicalize operands
v_min instruction needs canonicalized operands.
Passes CTS on carrizo

Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 327075
2018-03-08 23:00:58 +00:00
Eugene Zelenko 9f103a1a27 [StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 327074
2018-03-08 22:45:13 +00:00
Paul Robinson 43095b2885 [DWARF] Fix mixing assembler -g with DWARF .file directives.
We were effectively overriding an explicit '.file' directive with info
for the assembler source.  That shouldn't happen.

Fixes PR36636.

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

llvm-svn: 327073
2018-03-08 22:39:47 +00:00
Matt Davis 4c77cb7d12 [DebugInfo] Add DW_AT_byte_size to vectors
Summary:
This patch adds the DW_AT_byte_size dwarf attribute to vectors.
This fixes PR21924

LLVM will round a vector up to the next alignable address, which can result in
the vector's representation in the object file being larger than what the
debugger will calculate via NumberOfElements * ElementSize. In such a case calling sizeof(MyVec) in the source will result in a different value than what a debugger might present. This situation can occur because LLVM permits non-power of two 'vector_size' attributes.

Reviewers: echristo, dexonsmith, aprantl

Reviewed By: aprantl

Subscribers: probinson, aprantl, llvm-commits, JDevlieghere

Tags: #debug-info

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

llvm-svn: 327072
2018-03-08 22:22:26 +00:00
Sanjay Patel ee770e9c4e [Reassociate] fix test to be independent of FP undef
llvm-svn: 327071
2018-03-08 22:05:27 +00:00
Benjamin Kramer 38a77ae91f [Support] Pacify -Wsign-compare in unit test.
llvm-svn: 327070
2018-03-08 21:54:30 +00:00
Craig Topper 3d2af5038a [TargetLowering] Remove redundant if condition in SimplifySetcc. NFC
We were checking the condition code a second time when we were already in a block with this same condition code check.

llvm-svn: 327069
2018-03-08 21:53:36 +00:00
Dan Liew 0faaa99e4d [asan] Fix bug where suppression of overlapping accesses was ignored on
`strcpy()`, `strncpy()`, `strcat()`, and `strncat()`.

rdar://problem/35576899

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

llvm-svn: 327068
2018-03-08 21:50:22 +00:00
Benjamin Kramer 70e6faaa0d [DebugInfo] Move RangeListEntries instead of copying.
This is needed for correctness as RangeListEntry is not copy-assignable,
which std::vector might rely on.

llvm-svn: 327067
2018-03-08 21:31:10 +00:00
Sanjay Patel 672ad3269b [AMDGPU] fix test to survive more FP undef constant folding
llvm-svn: 327066
2018-03-08 21:30:56 +00:00
Philip Reames fbffd126b8 [NFC] Factor out a helper function for checking if a block has a potential early implicit exit.
llvm-svn: 327065
2018-03-08 21:25:30 +00:00
Vedant Kumar fb36d079e5 Low-hanging fruit optimization in string::__move_assign().
shrink_to_fit() ends up doing a lot work to get information that we
already know since we just called clear(). This change seems concise
enough to be worth the couple extra lines and my benchmarks show that it
is indeed a pretty decent win. It looks like the same thing is going on
twice in __copy_assign_alloc(), but I didn't want to go overboard since
this is my first contribution to llvm/libc++.

Patch by Timothy VanSlyke!

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

llvm-svn: 327064
2018-03-08 21:15:26 +00:00
Zachary Turner 145bc6e0d3 Fix compilation failure with MSVC.
llvm-svn: 327063
2018-03-08 21:07:30 +00:00
Kuba Mracek e70e5fcc7e [asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [compiler-rt part, take 3]
This fixes a false positive ODR violation that is reported by ASan when using LTO. In cases, where two constant globals have the same value, LTO will merge them, which breaks ASan's ODR detection. See the included testcase for an example.

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

llvm-svn: 327062
2018-03-08 21:02:52 +00:00
Kuba Mracek 8842da8e07 [asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [llvm part, take 3]
This fixes a false positive ODR violation that is reported by ASan when using LTO. In cases, where two constant globals have the same value, LTO will merge them, which breaks ASan's ODR detection.

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

llvm-svn: 327061
2018-03-08 21:02:18 +00:00
Zachary Turner 0f701c4a95 Fix signed-unsigned comparison warning.
llvm-svn: 327060
2018-03-08 20:57:37 +00:00
Wolfgang Pieb a0729d4126 [DWARF v5] Support for verbose dumping of .debug_rnglist entries
Adding verbose dumping to the recent implementation of dumping of v5 range list entries. 
We're capturing the entries as is as they come in during extraction, including their file offset,
so we can dump them in more detail.
The offset table entries which are table-relative are shown as is (as in non-verbose mode)
and with the actual file offset they map to.

Reviewers: dblaikie, aprantl, jdevlieghere, jhenderson

Subscribers: llvm-commits

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

llvm-svn: 327059
2018-03-08 20:52:35 +00:00
Sanjay Patel 2ee7b9349d [ConstantFold] fp_binop undef, undef --> undef
These are uncontroversial and independent of a proposed LangRef edits (D44216).

I tried to fix tests that would fold away:
rL327004
rL327028
rL327030
rL327034

I'm not sure if the Reassociate tests are meaningless yet, but they probably will be 
as we add more folds, so if anyone has suggestions or wants to fix those, please do.

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

llvm-svn: 327058
2018-03-08 20:42:49 +00:00
Zachary Turner adad33011f [Support] Add WriteThroughMemoryBuffer.
This is like MemoryBuffer (read-only) and WritableMemoryBuffer
(writable private), but where the underlying file can be modified
after writing.  This is useful when you want to open a file, make
some targeted edits, and then write it back out.

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

llvm-svn: 327057
2018-03-08 20:34:47 +00:00
Andrea Di Biagio 373c38a2db [llvm-mca] Fix handling of zero-latency instructions.
This patch fixes a problem found when testing zero latency instructions on
target AArch64 -mcpu=exynos-m3 / -mcpu=exynos-m1.

On Exynos-m3/m1, direct branches are zero-latency instructions that don't consume
any processor resources.  The DispatchUnit marks zero-latency instructions as
"executed", so that no scheduling is required.  The event of instruction
executed is then notified to all the listeners, and the reorder buffer (managed
by the RetireControlUnit) is updated. In particular, the entry associated to the
zero-latency instruction in the reorder buffer is marked as executed.

Before this patch, the DispatchUnit forgot to assign a retire control unit token
(RCUToken) to the zero-latency instruction. As a consequence, the RCUToken was
used uninitialized. This was causing a crash in the RetireControlUnit logic.

Fixes PR36650.

llvm-svn: 327056
2018-03-08 20:21:55 +00:00
Kuba Mracek f0bcbfef5c Revert r327053.
llvm-svn: 327055
2018-03-08 20:13:39 +00:00
Simon Pilgrim c286680032 [X86][AVX] Pull out variable permute creation from LowerBUILD_VECTORAsVariablePermute. NFCI.
This will make it easier to handle more complex cases than basic scaling or index masks.

llvm-svn: 327054
2018-03-08 20:07:06 +00:00
Kuba Mracek 584bd10803 [asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [llvm part, take 2]
This fixes a false positive ODR violation that is reported by ASan when using LTO. In cases, where two constant globals have the same value, LTO will merge them, which breaks ASan's ODR detection.

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

llvm-svn: 327053
2018-03-08 20:05:45 +00:00
Vedant Kumar 45ae11cd80 [test] Skip a test when using an out-of-tree debugserver
The test "test_fp_special_purpose_register_read" in TestRegisters.py
fails on Darwin machines configured to use an out-of-tree debugserver.

The error message is: 'register read ftag' returns expected result, got
'ftag = 0x80'. This indicates that the debugserver in use is too old.

This commit introduces a decorator which can be used to skip tests which
rely on having a just-built debugserver. This resolves the issue:

$ ./bin/llvm-dotest -p TestRegisters.py -v
  1 out of 617 test suites processed - TestRegisters.py
  Test Methods:          7
  Success:               6
  Skip:                  1
...

llvm-svn: 327052
2018-03-08 19:46:39 +00:00