1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
Commit Graph

161247 Commits

Author SHA1 Message Date
Kuba Mracek
5d6d0b321c [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
Vlad Tsyrklevich
4fb6752278 Specify that test from r327041 requires asserts
llvm-svn: 327051
2018-03-08 19:46:19 +00:00
Zachary Turner
90316d769b Fix detection of COFF executable files.
One overload of this function would try to identify a file
by opening it and using the first 32 bytes to identify the magic
of the file.  This didn't work properly when more than 32 bytes
is actually needed for magic detection to succeed.  So now we
have this overload read in the entire file.

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

llvm-svn: 327050
2018-03-08 19:45:20 +00:00
Matt Davis
3cb5cd59ca [DebugInfo] Add verifier for DICompositeType vector
Summary:
This patch adds verification logic for DICompositeType vectors, ensuring that they only have one element, and that element is of type subrange.

This patch complements https://reviews.llvm.org/D44048

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: JDevlieghere, llvm-commits

Tags: #debug-info

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

llvm-svn: 327048
2018-03-08 19:31:37 +00:00
Vlad Tsyrklevich
48f1d4d6f4 Fix test failure introduced in r327041
The "Assertion: `...' failed" error message format is not identical
across platforms.

llvm-svn: 327047
2018-03-08 19:20:08 +00:00
Alina Sbirlea
19e6cd3171 [MemorySSA] Split PtrIntPair as this fails on win/arm.
Summary: Split PtrIntPair into Instruction and OptionalAlias<Result>. The latter needs 3 bits, which appear unavailable on certain archs.

Subscribers: sanjoy, jlebar, Prazek, llvm-commits, kristof.beyls

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

llvm-svn: 327046
2018-03-08 19:15:00 +00:00
Vlad Tsyrklevich
d437327e14 [ThinLTO] Keep available_externally symbols live
Summary:
This change fixes PR36483. The bug was originally introduced by a change
that marked non-prevailing symbols dead. This broke LowerTypeTests
handling of available_externally functions, which are non-prevailing.
LowerTypeTests uses liveness information to avoid emitting thunks for
unused functions.

Marking available_externally functions dead is incorrect, the functions
are used though the function definitions are not. This change keeps them
live, and lets the EliminateAvailableExternally/GlobalDCE passes remove
them later instead.

I've also enabled EliminateAvailableExternally for all optimization
levels, I believe it being disabled for O1 was an oversight.

Reviewers: pcc, tejohnson

Reviewed By: tejohnson

Subscribers: grimar, mehdi_amini, inglorion, eraman, llvm-commits

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

llvm-svn: 327041
2018-03-08 18:48:03 +00:00
Sanjay Patel
75cab9e2d9 [InstCombine] add min/max tests with not ops; NFC
These are based on:
https://bugs.llvm.org/show_bug.cgi?id=35875
It's not clear if/how instcombine can reduce these,
but we should have the tests here either way to 
document current behavior.

llvm-svn: 327039
2018-03-08 18:34:23 +00:00
Krzysztof Parzyszek
6f361c131d [Hexagon] Ignore indexed loads when handling unaligned loads
llvm-svn: 327037
2018-03-08 18:15:13 +00:00
David Zarzycki
1c17c0710c [Tests] Remove empty test file that causes the test suite to fail
This empty file was "created" by r327033, which attempted to revert
r327029, which introduced the file.

llvm-svn: 327036
2018-03-08 18:03:15 +00:00
Alina Sbirlea
0d82331cd7 Expose must/may alias info in MemorySSA.
Summary:
Building MemorySSA gathers alias information for Defs/Uses.
Store and expose this information when optimizing uses (when building MemorySSA),
and when optimizing defs or updating uses (getClobberingMemoryAccess).
Current patch does not propagate alias information through MemoryPhis.

Reviewers: gbiv, dberlin

Subscribers: Prazek, sanjoy, llvm-commits

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

llvm-svn: 327035
2018-03-08 18:03:14 +00:00
Sanjay Patel
3dc217b502 [AMDGPU] fix test to survive the most basic undef constant folding
This will likely need to be changed again for anything more than:
fmul undef, undef -> undef

llvm-svn: 327034
2018-03-08 17:34:25 +00:00
Kuba Mracek
588dfe9fbd Revert r327029
llvm-svn: 327033
2018-03-08 17:32:00 +00:00
Sanjay Patel
46536d8141 [x86] fix test to be independent of FP undef
llvm-svn: 327030
2018-03-08 17:24:30 +00:00
Kuba Mracek
a0a87d67d4 [asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [llvm part]
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: 327029
2018-03-08 17:24:06 +00:00
Sanjay Patel
afa25378b8 [StructurizeCFG] fix test to be independent of FP undef
llvm-svn: 327028
2018-03-08 17:13:57 +00:00
Andrea Di Biagio
90adf354a8 [llvm-mca] add override keyword to method ResourcePressureView::printView().
NFC.

llvm-svn: 327027
2018-03-08 17:02:28 +00:00
Sanjay Patel
2b8ccc911c [x86] regenerate checks; NFC
This test will fail if we fix FP undef constant folding.

llvm-svn: 327026
2018-03-08 16:56:49 +00:00
Andrea Di Biagio
b9a5c5c635 [llvm-mca] HWEventListener is a class, not struct.
This should appease the buildbots.

llvm-svn: 327025
2018-03-08 16:34:19 +00:00
Tom Stellard
c05bdf2d33 merge-request.sh: Update 6.0 metabug for 6.0.1
llvm-svn: 327024
2018-03-08 16:29:08 +00:00
Sanjay Patel
d64f9fbb18 [StructurizeCFG] auto-generate full checks; NFC
Not sure what the intent of this test is, but this will change when we fix FP undef constant folding.

llvm-svn: 327022
2018-03-08 16:25:37 +00:00
Stefan Pintilie
a767091619 [Power9] Add more missing instructions to the Power 9 scheduler
With this patch we should be able to mark the Power 9 model as complete.

llvm-svn: 327021
2018-03-08 16:24:33 +00:00
Matt Arsenault
e4700c1d8b AMDGPU/GlobalISel: Pass subtarget + TM to LegalizerInfo
These are the parameters x86 already uses.

llvm-svn: 327020
2018-03-08 16:24:16 +00:00
Andrea Di Biagio
84af6ac04f [llvm-mca] Unify the API for the various views. NFCI
This allows the customization of the performance report.

Users can specify their own custom sequence of views.
Each view contributes a portion of the performance report generated by the
BackendPrinter.

Internally, class BackendPrinter keeps a sequence of views; views are printed
out in sequence when method 'printReport()' is called. 

This patch addresses one of the two review comments from Clement in D43951.

llvm-svn: 327018
2018-03-08 16:08:43 +00:00
Daniel Sanders
a5190f65e4 Fix unused function warning in StatisticTest.cpp
llvm-svn: 327015
2018-03-08 15:52:45 +00:00
Sanjay Patel
7766c647cb [InstCombine] regenerate checks; NFC
We may not need any of these tests after rL327012, but leaving 
them here for now until that's confirmed.

llvm-svn: 327014
2018-03-08 15:46:38 +00:00
Sanjay Patel
4a6c633e20 [InstSimplify] add more tests for FP undef; NFC
llvm-svn: 327012
2018-03-08 15:39:39 +00:00
Pavel Labath
c8cf85ab7e DWARFVerifier: Basic verification of .debug_names
Summary:
This patch adds basic .debug_names verification capabilities to the
DWARF verifier. Right now, it checks that the headers and abbreviation
tables of the individual name indexes can be parsed correctly, it
verifies the buckets table and the cross-checks the CU lists for
consistency. I intend to add further checks in follow-up patches.

Reviewers: JDevlieghere, aprantl, probinson, dblaikie

Subscribers: vleschuk, echristo, clayborg, llvm-commits

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

llvm-svn: 327011
2018-03-08 15:34:42 +00:00
Andrea Di Biagio
e9587cc537 [llvm-mca] Emit the 'Instruction Info' table before the resource pressure view.
In future, both the summary information and the 'instruction info' table should
be moved into a separate "Summary" view.

llvm-svn: 327010
2018-03-08 15:34:38 +00:00
Michal Gorny
5407426370 [cmake] Append -Wl,-rpath-link conditionally to GNULD
Append -Wl,-rpath-link conditionally to whether GNU ld.bfd is used
rather than the Linux+!gold conditionals. Also move it out of 'else'
branch of *BSD handling. This fixes build failures with ld.bfd
on Gentoo/FreeBSD, and should cause no harm on other systems using
ld.bfd.

This patch improves the original logic by reusing results of linker
detection introduced in r307852.

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

llvm-svn: 327007
2018-03-08 15:09:38 +00:00
Sanjay Patel
65b8045fb3 [InstCombine, NewGVN] remove FP undef from tests
I'm trying to preserve the intent of these tests by using 
non-undef operands; if we fix FP undef folding these tests
will not pass.

llvm-svn: 327004
2018-03-08 14:57:08 +00:00
David Zarzycki
f83ac76723 [CMake] Add missing test dependency
This makes 'ninja clean ; ninja check-all' work again.

llvm-svn: 327002
2018-03-08 14:43:24 +00:00
Ed Maste
517c1e5898 Use ellipsis ... to indicate omitted commands
In an example like "clang -fxray-instrument .." the .. could be confused
with a literal .. (parent directory), which is used in commands like
"cmake -GNinja .."

llvm-svn: 327000
2018-03-08 13:52:04 +00:00
Andrea Di Biagio
355fd6f55a Add llvm-mca.rst to the table of contents in docs/CommandGuide.
This should fix the documentation error reported by builder llvm-sphinx-docs
(build #16407) after r326998.

llvm-svn: 326999
2018-03-08 13:43:11 +00:00
Andrea Di Biagio
45f0e5261e [llvm-mca] LLVM Machine Code Analyzer.
llvm-mca is an LLVM based performance analysis tool that can be used to
statically measure the performance of code, and to help triage potential
problems with target scheduling models.

llvm-mca uses information which is already available in LLVM (e.g. scheduling
models) to statically measure the performance of machine code in a specific cpu.
Performance is measured in terms of throughput as well as processor resource
consumption. The tool currently works for processors with an out-of-order
backend, for which there is a scheduling model available in LLVM.

The main goal of this tool is not just to predict the performance of the code
when run on the target, but also help with diagnosing potential performance
issues.

Given an assembly code sequence, llvm-mca estimates the IPC (instructions per
cycle), as well as hardware resources pressure. The analysis and reporting style
were mostly inspired by the IACA tool from Intel.

This patch is related to the RFC on llvm-dev visible at this link:
http://lists.llvm.org/pipermail/llvm-dev/2018-March/121490.html

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

llvm-svn: 326998
2018-03-08 13:05:02 +00:00
James Henderson
40bfd37ca7 [DWARF] Don't attempt to parse line tables at invalid offsets
Whilst working on improvements to the error handling of the debug line
parsing code, I noticed that if an invalid offset were to be specified
in a call to getOrParseLineTable(), an entry in the LineTableMap would
still be created, even if the offset was not within the section range.
The immediate parsing attempt afterwards would fail (it would end up
getting a version of 0), and thereafter, any subsequent calls to
getOrParseLineTable or getLineTable would return the default-
constructed, invalid line table. In reality, we shouldn't even attempt
to parse this table, and we should always return a nullptr from these
two functions for this situation.

I have tested this via a unit test, which required some new framework
for unit testing debug line. My plan is to add quite a few more unit
tests for the new error reporting mechanism that will follow shortly,
hence the reason why the supporting code for the tests are written the
way they are - I intend to extend the DwarfGenerator class to support
generating debug line. At that point, I'll make sure that there are a
few positive test cases for this and the parsing code too.

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

Reviewers: JDevlieghere, aprantl
llvm-svn: 326995
2018-03-08 10:53:34 +00:00
Jonas Devlieghere
e7334c5b3d [dsymutil] Embed toolchain in dSYM bundle
Allow us to embed the (Xcode) toolchain in the dSYM bundle's property
list.

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

llvm-svn: 326994
2018-03-08 10:39:12 +00:00
Andrea Di Biagio
26f1a2b29f [MCSchedule] Always generate processor resource names.
With this patch, the tablegen 'SubtargetEmitter' always generates processor
resource names. 
The impact of this patch on the code size of other llvm tools is small.  I have
observed an average increase of 0.03% in code size when doing a release build of
LLVM (on windows, using MSVC) with all the default backends.

This change is done in preparation for the upcoming llvm-mca patch.

llvm-svn: 326993
2018-03-08 10:38:45 +00:00
Craig Topper
289847993d [X86] Change X86::PMULDQ/PMULUDQ opcodes to take vXi64 type as input instead of vXi32.
This instruction can be thought of as reading either the even elements of a vXi32 input or the lower half of each element of a vXi64 input. We currently use the vXi32 interpretation, but vXi64 matches better with its broadcast behavior in EVEX.

I'm looking at moving MULDQ/MULUDQ creation to a DAG combine so we can do it when AVX512DQ is enabled without having to go through Custom lowering. But in some of the test cases we failed to use a broadcast load due to the size difference. This should help with that.

I'm also wondering if we can model these instructions in native IR and remove the intrinsics and I think using a vXi64 type will work better with that.

llvm-svn: 326991
2018-03-08 08:02:52 +00:00
Tony Tye
8ad3f17b78 [AMDGPU] Update AMDGOUUsage.rst descriptions
- Improve description of XNACK ELF flag.
- Rename all uses of wave to wavefront to be consistent.

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

llvm-svn: 326989
2018-03-08 05:46:01 +00:00
Heejin Ahn
b036a4a9f3 [WebAssembly] Add except_ref as a first-class type
Summary: Add except_ref as a first-class type, according to the [[https://github.com/WebAssembly/exception-handling/blob/master/proposals/Level-1.md | Level 1 exception handling proposal ]].

Reviewers: dschuff

Subscribers: jfb, sbc100, llvm-commits

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

llvm-svn: 326985
2018-03-08 04:05:37 +00:00
Heejin Ahn
c9e222b2d7 [WebAssembly] Add IntrNoReturn property to throw/rethrow intrinsics
Reviewers: dschuff

Subscribers: jfb, sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 326984
2018-03-08 03:47:52 +00:00
Daniel Sanders
82e836ee7f Support resetting STATISTIC() values using llvm::ResetStatistics()
Summary:
Most of the time, compiler statistics can be obtained using a process that
performs a single compilation and terminates such as llc. However, this isn't
always the case. JITs for example, perform multiple compilations over their
lifetime and STATISTIC() will record cumulative values across all of them.

Provide tools like this with the facilities needed to measure individual
compilations by allowing them to reset the STATISTIC() values back to zero using
llvm::ResetStatistics(). It's still the tools responsibility to ensure that they
perform compilations in such a way that the results are meaningful to their
intended use.

Reviewers: qcolombet, rtereshin, bogner, aditya_nandakumar

Reviewed By: bogner

Subscribers: llvm-commits

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

llvm-svn: 326981
2018-03-08 02:36:25 +00:00
Fangrui Song
804e3e7bc6 Add attributes and fix some keywords in llvm-mode.el
Reviewers: rafael, echristo

Reviewed By: echristo

Subscribers: llvm-commits

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

llvm-svn: 326978
2018-03-08 01:28:45 +00:00
Bob Haarman
6f58d8aefa Revert "[LTO] Support filtering by hotness threshold"
This reverts commit 1f3bd185c53beb6aa68446974b7e80837abd6ef0 (r326107)
because it fails
ThinLTO/X86/diagnostic-handler-remarks-with-hotness.ll.

llvm-svn: 326975
2018-03-08 01:13:10 +00:00
Rafael Auler
0e7b0fcc48 Reland "[DebugInfo] Support DWARF expressions in eh_frame"
Summary:
Original change was D43313 (r326932) and reverted by r326953 because it
broke an LLD test and a windows build. The LLD test was already fixed in
lld commit r326944 (thanks maskray). This is the original change with
the windows build fixed.

llvm-svn: 326970
2018-03-08 00:46:53 +00:00
Weiming Zhao
f016668754 [AArch64] Fix UB about shift amount exceeds data bit-width
Summary:
Fixes an UB caught by sanitizer. The shift amount might be larger than 32 so the operand should be 1ULL.
In this patch,  we replace the original expression with  existing API with uint64_t type.

Reviewers: eli.friedman, rengolin

Reviewed By: rengolin

Subscribers: rengolin, javed.absar, llvm-commits, kristof.beyls

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

llvm-svn: 326969
2018-03-08 00:28:25 +00:00
Craig Topper
aea705310a [X86] Fix some isel patterns that used aligned vector load instructions with unaligned predicates.
These patterns weren't checking the alignment of the load, but were using the aligned instructions. This will cause a GP fault if the data isn't aligned.

I believe these were introduced in r312450.

llvm-svn: 326967
2018-03-08 00:21:17 +00:00
Rafael Espindola
2e912cb9e3 Delete code that is probably dead since r249303.
With r249303 the expression evaluation should expand variables that
are not in sections (and so don't have an atom).

llvm-svn: 326966
2018-03-08 00:17:13 +00:00
Eugene Zemtsov
9f484eac98 Fix build broken by r326959
Adding Demangle to link time dependencies of Symbolize

llvm-svn: 326964
2018-03-08 00:07:26 +00:00