OSDN Git Service

android-x86/external-llvm.git
6 years agoutils: add a helper class to lit for captured substitutions
Saleem Abdulrasool [Fri, 9 Mar 2018 00:06:10 +0000 (00:06 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327082 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoPropagate flags to SDValue in SplitVecOp_VECREDUCE
Sameer AbuAsal [Thu, 8 Mar 2018 23:41:40 +0000 (23:41 +0000)]
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.

link: https://bugs.llvm.org/show_bug.cgi?id=36642
Change-Id: I0c2829639f094c862c10a6b51b342d4c2563e1fa

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327079 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFor llvm-objdump and Mach-O files, update the printing of some thread states
Kevin Enderby [Thu, 8 Mar 2018 23:10:38 +0000 (23:10 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327077 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] Fix mixing assembler -g with DWARF .file directives.
Paul Robinson [Thu, 8 Mar 2018 22:39:47 +0000 (22:39 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327073 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Add DW_AT_byte_size to vectors
Matt Davis [Thu, 8 Mar 2018 22:22:26 +0000 (22:22 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327072 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Reassociate] fix test to be independent of FP undef
Sanjay Patel [Thu, 8 Mar 2018 22:05:27 +0000 (22:05 +0000)]
[Reassociate] fix test to be independent of FP undef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327071 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support] Pacify -Wsign-compare in unit test.
Benjamin Kramer [Thu, 8 Mar 2018 21:54:30 +0000 (21:54 +0000)]
[Support] Pacify -Wsign-compare in unit test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327070 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TargetLowering] Remove redundant if condition in SimplifySetcc. NFC
Craig Topper [Thu, 8 Mar 2018 21:53:36 +0000 (21:53 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327069 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Move RangeListEntries instead of copying.
Benjamin Kramer [Thu, 8 Mar 2018 21:31:10 +0000 (21:31 +0000)]
[DebugInfo] Move RangeListEntries instead of copying.

This is needed for correctness as RangeListEntry is not copy-assignable,
which std::vector might rely on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327067 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] fix test to survive more FP undef constant folding
Sanjay Patel [Thu, 8 Mar 2018 21:30:56 +0000 (21:30 +0000)]
[AMDGPU] fix test to survive more FP undef constant folding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327066 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Factor out a helper function for checking if a block has a potential early...
Philip Reames [Thu, 8 Mar 2018 21:25:30 +0000 (21:25 +0000)]
[NFC] Factor out a helper function for checking if a block has a potential early implicit exit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327065 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix compilation failure with MSVC.
Zachary Turner [Thu, 8 Mar 2018 21:07:30 +0000 (21:07 +0000)]
Fix compilation failure with MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327063 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [llvm part...
Kuba Mracek [Thu, 8 Mar 2018 21:02:18 +0000 (21:02 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327061 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix signed-unsigned comparison warning.
Zachary Turner [Thu, 8 Mar 2018 20:57:37 +0000 (20:57 +0000)]
Fix signed-unsigned comparison warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327060 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF v5] Support for verbose dumping of .debug_rnglist entries
Wolfgang Pieb [Thu, 8 Mar 2018 20:52:35 +0000 (20:52 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327059 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ConstantFold] fp_binop undef, undef --> undef
Sanjay Patel [Thu, 8 Mar 2018 20:42:49 +0000 (20:42 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327058 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support] Add WriteThroughMemoryBuffer.
Zachary Turner [Thu, 8 Mar 2018 20:34:47 +0000 (20:34 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327057 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] Fix handling of zero-latency instructions.
Andrea Di Biagio [Thu, 8 Mar 2018 20:21:55 +0000 (20:21 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327056 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r327053.
Kuba Mracek [Thu, 8 Mar 2018 20:13:39 +0000 (20:13 +0000)]
Revert r327053.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327055 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX] Pull out variable permute creation from LowerBUILD_VECTORAsVariablePermute...
Simon Pilgrim [Thu, 8 Mar 2018 20:07:06 +0000 (20:07 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327054 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [llvm part...
Kuba Mracek [Thu, 8 Mar 2018 20:05:45 +0000 (20:05 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327053 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSpecify that test from r327041 requires asserts
Vlad Tsyrklevich [Thu, 8 Mar 2018 19:46:19 +0000 (19:46 +0000)]
Specify that test from r327041 requires asserts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327051 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix detection of COFF executable files.
Zachary Turner [Thu, 8 Mar 2018 19:45:20 +0000 (19:45 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327050 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Add verifier for DICompositeType vector
Matt Davis [Thu, 8 Mar 2018 19:31:37 +0000 (19:31 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327048 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix test failure introduced in r327041
Vlad Tsyrklevich [Thu, 8 Mar 2018 19:20:08 +0000 (19:20 +0000)]
Fix test failure introduced in r327041

The "Assertion: `...' failed" error message format is not identical
across platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327047 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MemorySSA] Split PtrIntPair as this fails on win/arm.
Alina Sbirlea [Thu, 8 Mar 2018 19:15:00 +0000 (19:15 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327046 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ThinLTO] Keep available_externally symbols live
Vlad Tsyrklevich [Thu, 8 Mar 2018 18:48:03 +0000 (18:48 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327041 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add min/max tests with not ops; NFC
Sanjay Patel [Thu, 8 Mar 2018 18:34:23 +0000 (18:34 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327039 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Ignore indexed loads when handling unaligned loads
Krzysztof Parzyszek [Thu, 8 Mar 2018 18:15:13 +0000 (18:15 +0000)]
[Hexagon] Ignore indexed loads when handling unaligned loads

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327037 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Tests] Remove empty test file that causes the test suite to fail
David Zarzycki [Thu, 8 Mar 2018 18:03:15 +0000 (18:03 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327036 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoExpose must/may alias info in MemorySSA.
Alina Sbirlea [Thu, 8 Mar 2018 18:03:14 +0000 (18:03 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327035 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] fix test to survive the most basic undef constant folding
Sanjay Patel [Thu, 8 Mar 2018 17:34:25 +0000 (17:34 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327034 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r327029
Kuba Mracek [Thu, 8 Mar 2018 17:32:00 +0000 (17:32 +0000)]
Revert r327029

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327033 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] fix test to be independent of FP undef
Sanjay Patel [Thu, 8 Mar 2018 17:24:30 +0000 (17:24 +0000)]
[x86] fix test to be independent of FP undef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327030 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [llvm part]
Kuba Mracek [Thu, 8 Mar 2018 17:24:06 +0000 (17:24 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327029 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[StructurizeCFG] fix test to be independent of FP undef
Sanjay Patel [Thu, 8 Mar 2018 17:13:57 +0000 (17:13 +0000)]
[StructurizeCFG] fix test to be independent of FP undef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327028 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] add override keyword to method ResourcePressureView::printView().
Andrea Di Biagio [Thu, 8 Mar 2018 17:02:28 +0000 (17:02 +0000)]
[llvm-mca] add override keyword to method ResourcePressureView::printView().
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327027 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] regenerate checks; NFC
Sanjay Patel [Thu, 8 Mar 2018 16:56:49 +0000 (16:56 +0000)]
[x86] regenerate checks; NFC

This test will fail if we fix FP undef constant folding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327026 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] HWEventListener is a class, not struct.
Andrea Di Biagio [Thu, 8 Mar 2018 16:34:19 +0000 (16:34 +0000)]
[llvm-mca] HWEventListener is a class, not struct.

This should appease the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327025 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agomerge-request.sh: Update 6.0 metabug for 6.0.1
Tom Stellard [Thu, 8 Mar 2018 16:29:08 +0000 (16:29 +0000)]
merge-request.sh: Update 6.0 metabug for 6.0.1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327024 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[StructurizeCFG] auto-generate full checks; NFC
Sanjay Patel [Thu, 8 Mar 2018 16:25:37 +0000 (16:25 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327022 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Power9] Add more missing instructions to the Power 9 scheduler
Stefan Pintilie [Thu, 8 Mar 2018 16:24:33 +0000 (16:24 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327021 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/GlobalISel: Pass subtarget + TM to LegalizerInfo
Matt Arsenault [Thu, 8 Mar 2018 16:24:16 +0000 (16:24 +0000)]
AMDGPU/GlobalISel: Pass subtarget + TM to LegalizerInfo

These are the parameters x86 already uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327020 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] Unify the API for the various views. NFCI
Andrea Di Biagio [Thu, 8 Mar 2018 16:08:43 +0000 (16:08 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327018 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix unused function warning in StatisticTest.cpp
Daniel Sanders [Thu, 8 Mar 2018 15:52:45 +0000 (15:52 +0000)]
Fix unused function warning in StatisticTest.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327015 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] regenerate checks; NFC
Sanjay Patel [Thu, 8 Mar 2018 15:46:38 +0000 (15:46 +0000)]
[InstCombine] regenerate checks; NFC

We may not need any of these tests after rL327012, but leaving
them here for now until that's confirmed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327014 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstSimplify] add more tests for FP undef; NFC
Sanjay Patel [Thu, 8 Mar 2018 15:39:39 +0000 (15:39 +0000)]
[InstSimplify] add more tests for FP undef; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327012 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDWARFVerifier: Basic verification of .debug_names
Pavel Labath [Thu, 8 Mar 2018 15:34:42 +0000 (15:34 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327011 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] Emit the 'Instruction Info' table before the resource pressure view.
Andrea Di Biagio [Thu, 8 Mar 2018 15:34:38 +0000 (15:34 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327010 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[cmake] Append -Wl,-rpath-link conditionally to GNULD
Michal Gorny [Thu, 8 Mar 2018 15:09:38 +0000 (15:09 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327007 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine, NewGVN] remove FP undef from tests
Sanjay Patel [Thu, 8 Mar 2018 14:57:08 +0000 (14:57 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327004 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CMake] Add missing test dependency
David Zarzycki [Thu, 8 Mar 2018 14:43:24 +0000 (14:43 +0000)]
[CMake] Add missing test dependency

This makes 'ninja clean ; ninja check-all' work again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327002 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUse ellipsis ... to indicate omitted commands
Ed Maste [Thu, 8 Mar 2018 13:52:04 +0000 (13:52 +0000)]
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 .."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327000 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd llvm-mca.rst to the table of contents in docs/CommandGuide.
Andrea Di Biagio [Thu, 8 Mar 2018 13:43:11 +0000 (13:43 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326999 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] LLVM Machine Code Analyzer.
Andrea Di Biagio [Thu, 8 Mar 2018 13:05:02 +0000 (13:05 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326998 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] Don't attempt to parse line tables at invalid offsets
James Henderson [Thu, 8 Mar 2018 10:53:34 +0000 (10:53 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326995 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[dsymutil] Embed toolchain in dSYM bundle
Jonas Devlieghere [Thu, 8 Mar 2018 10:39:12 +0000 (10:39 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326994 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MCSchedule] Always generate processor resource names.
Andrea Di Biagio [Thu, 8 Mar 2018 10:38:45 +0000 (10:38 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326993 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Change X86::PMULDQ/PMULUDQ opcodes to take vXi64 type as input instead of vXi32.
Craig Topper [Thu, 8 Mar 2018 08:02:52 +0000 (08:02 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326991 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Update AMDGOUUsage.rst descriptions
Tony Tye [Thu, 8 Mar 2018 05:46:01 +0000 (05:46 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326989 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Add except_ref as a first-class type
Heejin Ahn [Thu, 8 Mar 2018 04:05:37 +0000 (04:05 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326985 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Add IntrNoReturn property to throw/rethrow intrinsics
Heejin Ahn [Thu, 8 Mar 2018 03:47:52 +0000 (03:47 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326984 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSupport resetting STATISTIC() values using llvm::ResetStatistics()
Daniel Sanders [Thu, 8 Mar 2018 02:36:25 +0000 (02:36 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326981 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd attributes and fix some keywords in llvm-mode.el
Fangrui Song [Thu, 8 Mar 2018 01:28:45 +0000 (01:28 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326978 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[LTO] Support filtering by hotness threshold"
Bob Haarman [Thu, 8 Mar 2018 01:13:10 +0000 (01:13 +0000)]
Revert "[LTO] Support filtering by hotness threshold"

This reverts commit 1f3bd185c53beb6aa68446974b7e80837abd6ef0 (r326107)
because it fails
ThinLTO/X86/diagnostic-handler-remarks-with-hotness.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326975 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoReland "[DebugInfo] Support DWARF expressions in eh_frame"
Rafael Auler [Thu, 8 Mar 2018 00:46:53 +0000 (00:46 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326970 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Fix UB about shift amount exceeds data bit-width
Weiming Zhao [Thu, 8 Mar 2018 00:28:25 +0000 (00:28 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326969 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Fix some isel patterns that used aligned vector load instructions with unaligne...
Craig Topper [Thu, 8 Mar 2018 00:21:17 +0000 (00:21 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326967 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDelete code that is probably dead since r249303.
Rafael Espindola [Thu, 8 Mar 2018 00:17:13 +0000 (00:17 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326966 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix build broken by r326959
Eugene Zemtsov [Thu, 8 Mar 2018 00:07:26 +0000 (00:07 +0000)]
Fix build broken by r326959

Adding Demangle to link time dependencies of Symbolize

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326964 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] LowerBUILD_VECTORAsVariablePermute - reorder permute types. NFCI.
Simon Pilgrim [Wed, 7 Mar 2018 23:56:42 +0000 (23:56 +0000)]
[X86][SSE] LowerBUILD_VECTORAsVariablePermute - reorder permute types. NFCI.

Reorder into 128/256/512 bit vector size groupings.

NFCI commit before some new features.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326963 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUse itaniumDemangle in llvm-symbolizer
Eugene Zemtsov [Wed, 7 Mar 2018 23:07:34 +0000 (23:07 +0000)]
Use itaniumDemangle in llvm-symbolizer

Currently on Windows (_MSC_VER) LLVMSymbolizer supports only Microsoft mangling.
This fix just explicitly uses itaniumDemangle when mangled name starts with _Z.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326959 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TTI] add explanatory comments for getArithmeticInstrCost; NFC
Sanjay Patel [Wed, 7 Mar 2018 22:43:08 +0000 (22:43 +0000)]
[TTI] add explanatory comments for getArithmeticInstrCost; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326956 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Adjust the cost of integer vector division
Evandro Menezes [Wed, 7 Mar 2018 22:35:32 +0000 (22:35 +0000)]
[AArch64] Adjust the cost of integer vector division

Since there is no instruction for integer vector division, factor in the
cost of singling out each element to be used with the scalar division
instruction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326955 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r326932: [DebugInfo] Support DWARF expressions in eh_frame
Rui Ueyama [Wed, 7 Mar 2018 22:29:48 +0000 (22:29 +0000)]
Revert r326932: [DebugInfo] Support DWARF expressions in eh_frame

This reverts commit rr326932 because it broke lld/test/ELF/eh-frame-hdr-augmentation.s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326953 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] add missing pattern for insert_subvector undef
Sebastian Pop [Wed, 7 Mar 2018 22:07:13 +0000 (22:07 +0000)]
[AArch64] add missing pattern for insert_subvector undef

The attached testcase started failing after the patch to define
isExtractSubvectorCheap with the following pattern mismatch:

ISEL: Starting pattern match
  Initial Opcode index to 85068
    Match failed at index 85076
    LLVM ERROR: Cannot select: t47: v8i16 = insert_subvector undef:v8i16, t43, Constant:i64<0>

The code generated from llvm/lib/Target/AArch64/AArch64InstrInfo.td

def : Pat<(insert_subvector undef, (v4i16 FPR64:$src), (i32 0)),
          (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), FPR64:$src, dsub)>;

is in ninja/lib/Target/AArch64/AArch64GenDAGISel.inc
At the location of the error it is:
/* 85076*/    OPC_CheckChild2Type, MVT::i32,

And it failed to match the type of operand 2.
Adding another def-pat for i64 fixes the failed def-pat error:

def : Pat<(insert_subvector undef, (v4i16 FPR64:$src), (i64 0)),
          (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), FPR64:$src, dsub)>;

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326949 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[llvm-objcopy] Add support for large indexes"
Jake Ehrlich [Wed, 7 Mar 2018 20:33:02 +0000 (20:33 +0000)]
Revert "[llvm-objcopy] Add support for large indexes"

Not all build bots have unzip which I used in a test.

This reverts commit 0b1f26d39ea42dd3716b525fbc8c78d8c7bb4479.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326941 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objcopy] Add support for large indexes
Jake Ehrlich [Wed, 7 Mar 2018 19:59:15 +0000 (19:59 +0000)]
[llvm-objcopy] Add support for large indexes

Because of -ffunction-sections (and maybe other use cases I'm not aware of?) it
can occur that we need more than 0xfeff sections but ELF dosn't support that
many sections. To solve this problem SHN_XINDEX exists and with it come a whole
host of changes for section indexes everywhere. This change adds support for
those cases which should allow llvm-objcopy to copy binaries that have an
arbitrary number of sections.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326940 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove unused function argument. NFC
Craig Topper [Wed, 7 Mar 2018 19:45:45 +0000 (19:45 +0000)]
[X86] Remove unused function argument. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326939 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix cmake's multi-config generators after r326738
Daniel Sanders [Wed, 7 Mar 2018 19:32:36 +0000 (19:32 +0000)]
Fix cmake's multi-config generators after r326738

LLVM_ENABLE_STATS isn't known at configure-time in these generators so we must
defer it to build-time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326936 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Support DWARF expressions in eh_frame
Rafael Auler [Wed, 7 Mar 2018 19:19:51 +0000 (19:19 +0000)]
[DebugInfo] Support DWARF expressions in eh_frame

This patch enhances DWARFDebugFrame with the capability of parsing and
printing DWARF expressions in CFI instructions. It also makes FDEs and
CIEs accessible to lib users, so they can process them in client tools
that rely on LLVM. To make it self-contained with a test case, it
teaches llvm-readobj to be able to dump EH frames and checks they are
correct in a unit test. The llvm-readobj code is Maksim Panchenko's work
(maksfb).

Reviewers: JDevlieghere, espindola

Reviewed By: JDevlieghere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326932 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Regenerate float maxnum/minnum tests
Simon Pilgrim [Wed, 7 Mar 2018 19:14:05 +0000 (19:14 +0000)]
[X86][SSE] Regenerate float maxnum/minnum tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326930 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix a bug regarding a mis-identified file type in pdbutil.
Zachary Turner [Wed, 7 Mar 2018 19:12:36 +0000 (19:12 +0000)]
Fix a bug regarding a mis-identified file type in pdbutil.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326929 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate a few switch statements to handle file_magic::pdb.
Zachary Turner [Wed, 7 Mar 2018 18:58:33 +0000 (18:58 +0000)]
Update a few switch statements to handle file_magic::pdb.

This fixes a couple of warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326927 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Pipeliner] Fixed node order issue related to zero latency edges
Roorda, Jan-Willem [Wed, 7 Mar 2018 18:53:36 +0000 (18:53 +0000)]
[Pipeliner] Fixed node order issue related to zero latency edges

Summary:
A desired property of the node order in Swing Modulo Scheduling is
that for nodes outside circuits the following holds: none of them is
scheduled after both a successor and a predecessor. We call
node orders that meet this property valid.

Although invalid node orders do not lead to the generation of incorrect
code, they can cause the pipeliner not being able to find a pipelined schedule
for arbitrary II. The reason is that after scheduling the successor and the
predecessor of a node, no room may be left to schedule the node itself.

For data flow graphs with 0-latency edges, the node ordering algorithm
of Swing Modulo Scheduling can generate such undesired invalid node orders.
This patch fixes that.

In the remainder of this commit message, I will give an example
demonstrating the issue, explain the fix, and explain how the the fix is tested.

Consider, as an example, the following data flow graph with all
edge latencies 0 and all edges pointing downward.

```
   n0
  /  \
n1    n3
  \  /
   n2
    |
   n4
```

Consider the implemented node order algorithm in top-down mode. In that mode,
the algorithm orders the nodes based on greatest Height and in case of equal
Height on lowest Movability. Finally, in case of equal Height and
Movability, given two nodes with an edge between them, the algorithm prefers
the source-node.

In the graph, for every node, the Height and Movability are equal to 0.
As will be explained below, the algorithm can generate the order n0, n1, n2, n3, n4.
So, node n3 is scheduled after its predecessor n0 and after its successor n2.

The reason that the algorithm can put node n2 in the order before node n3,
even though they have an edge between them in which node n3 is the source,
is the following: Suppose the algorithm has constructed the partial node
order n0, n1. Then, the nodes left to be ordered are nodes n2, n3, and n4. Suppose
that the while-loop in the implemented algorithm considers the nodes in
the order n4, n3, n2. The algorithm will start with node n4, and look for
more preferable nodes. First, node n4 will be compared with node n3. As the nodes
have equal Height and Movability and have no edge between them, the algorithm
will stick with node n4. Then node n4 is compared with node n2. Again the
Height and Movability are equal. But, this time, there is an edge between
the two nodes, and the algorithm will prefer the source node n2.
As there are no nodes left to compare, the algorithm will add node n2 to
the node order, yielding the partial node order n0, n1, n2. In this way node n2
arrives in the node-order before node n3.

To solve this, this patch introduces the ZeroLatencyHeight (ZLH) property
for nodes. It is defined as the maximum unweighted length of a path from the
given node to an arbitrary node in which each edge has latency 0.
So, ZLH(n0)=3, ZLH(n1)=ZLH(n3)=2, ZLH(n2)=1, and ZLH(n4)=0

In this patch, the preference for a greater ZeroLatencyHeight
is added in the top-down mode of the node ordering algorithm, after the
preference for a greater Height, and before the preference for a
lower Movability.

Therefore, the two allowed node-orders are n0, n1, n3, n2, n4 and n0, n3, n1, n2, n4.
Both of them are valid node orders.

In the same way, the bottom-up mode of the node ordering algorithm is adapted
by introducing the ZeroLatencyDepth property for nodes.

The patch is tested by adding extra checks to the following existing
lit-tests:
test/CodeGen/Hexagon/SUnit-boundary-prob.ll
test/CodeGen/Hexagon/frame-offset-overflow.ll
test/CodeGen/Hexagon/vect/vect-shuffle.ll

Before this patch, the pipeliner failed to pipeline the loops in these tests
due to invalid node-orders. After the patch, the pipeliner successfully
pipelines all these loops.

Reviewers: bcahoon

Reviewed By: bcahoon

Subscribers: Ayal, mgrang, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326925 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTeach identify_file_magic to identify PDB files.
Zachary Turner [Wed, 7 Mar 2018 18:40:41 +0000 (18:40 +0000)]
Teach identify_file_magic to identify PDB files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326924 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] Move test to correct location.
Stefan Pintilie [Wed, 7 Mar 2018 18:27:10 +0000 (18:27 +0000)]
[PowerPC] Move test to correct location.

Test was added in r326906 to an incorrect location.
Moving the test to PPC CodeGen directory as the test is PPC specific.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326923 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Make the MUL->VPMADDWD work before op legalization on AVX1 targets. Simplify...
Craig Topper [Wed, 7 Mar 2018 17:53:18 +0000 (17:53 +0000)]
[X86] Make the MUL->VPMADDWD work before op legalization on AVX1 targets. Simplify feature checks by using isTypeLegal.

The v8i32 conversion on AVX1 targets was only working after LowerMUL splits 256-bit vectors.

While I was there I've also made it so we don't have to check for AVX2 and BWI directly and instead just ask if the type is legal.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326917 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support] Stop passing StringRefs by const reference in some of the getHostCPUname...
Craig Topper [Wed, 7 Mar 2018 17:53:16 +0000 (17:53 +0000)]
[Support] Stop passing StringRefs by const reference in some of the getHostCPUname implementations. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326916 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Rewrite non-HVX unaligned loads as pairs of aligned ones
Krzysztof Parzyszek [Wed, 7 Mar 2018 17:27:18 +0000 (17:27 +0000)]
[Hexagon] Rewrite non-HVX unaligned loads as pairs of aligned ones

This is a follow-up to r325169, this time for all types, not just HVX
vector types.

Disable this by default, since it's not always safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326915 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LangRef] fix formatting in FP descriptions; NFC
Sanjay Patel [Wed, 7 Mar 2018 17:18:22 +0000 (17:18 +0000)]
[LangRef] fix formatting in FP descriptions; NFC

This is a clean-up step to reduce diffs ahead of real
changes to the FP semantics as discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2018-February/121444.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326913 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Increased vector length for global/constant loads.
Farhana Aleen [Wed, 7 Mar 2018 17:09:18 +0000 (17:09 +0000)]
[AMDGPU] Increased vector length for global/constant loads.

Summary: GCN ISA supports instructions that can read 16 consecutive dwords from memory through the scalar data cache;
         loadstoreVectorizer should take advantage of the wider vector length and pack 16/8 elements of dwords/quadwords.

Author: FarhanaAleen

Reviewed By: rampitec

Subscribers: llvm-commits, AMDGPU

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326910 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-land: Teach CorrelatedValuePropagation to reduce the width of udiv/urem instructions.
Justin Lebar [Wed, 7 Mar 2018 16:56:49 +0000 (16:56 +0000)]
Re-land: Teach CorrelatedValuePropagation to reduce the width of udiv/urem instructions.

Summary:
If the operands of a udiv/urem can be proved to fit within a smaller
power-of-two-sized type, reduce the width of the udiv/urem.

Backed out for failing an assert in clang bootstrap builds.  Re-landing
with a fix for handling non-power-of-two inputs (e.g. udiv i24).

Original Differential Revision: https://reviews.llvm.org/D44102

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326908 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[AMDGPU] Widened vector length for global/constant address space."
Farhana Aleen [Wed, 7 Mar 2018 16:55:27 +0000 (16:55 +0000)]
Revert "[AMDGPU] Widened vector length for global/constant address space."

This reverts commit ce988cc100dc65e7c6c727aff31ceb99231cab03.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326907 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] LSR tunings for PowerPC
Stefan Pintilie [Wed, 7 Mar 2018 16:53:09 +0000 (16:53 +0000)]
[PowerPC] LSR tunings for PowerPC

The purpose of this patch is to have LSR generate better code on Power.
This is done by overriding isLSRCostLess.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326906 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SampleFDO] Extend SampleProfReader to handle demangled names.
Wei Mi [Wed, 7 Mar 2018 16:45:33 +0000 (16:45 +0000)]
[SampleFDO] Extend SampleProfReader to handle demangled names.

SampleProfReader assumes function names in the profile are all mangled names.
However, there are cases that few demangled names are somehow contained in
the profile (usually because of debug info problems), which may trigger parsing
error in SampleProfReader and cause the whole profile to be unusable. The patch
extends SampleProfReader to handle profiles with demangled names, so that those
profiles can still be useful.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326905 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Widened vector length for global/constant address space.
Farhana Aleen [Wed, 7 Mar 2018 16:29:05 +0000 (16:29 +0000)]
[AMDGPU] Widened vector length for global/constant address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326904 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[dwarfdump] Only print CU relative offset in verbose mode
Jonas Devlieghere [Wed, 7 Mar 2018 16:28:53 +0000 (16:28 +0000)]
[dwarfdump] Only print CU relative offset in verbose mode

Instead of only printing the CU-relative offset in non-verbose mode, it
makes more sense to only printed the resolved address. In verbose mode
we still print both.

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

rdar://33525475

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326903 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "Reapply "[DWARFv5] Emit file 0 to the line table.""
Alexander Kornienko [Wed, 7 Mar 2018 16:27:44 +0000 (16:27 +0000)]
Revert "Reapply "[DWARFv5] Emit file 0 to the line table.""

This reverts commit r326839.

r326839 breaks assembly file parsing:

$ cat q.c
void g() {}
$ clang -S q.c -g
$ clang -g -c q.s
q.s:9:2: error: file number already allocated
     .file   1 "/tmp/test" "q.c"
     ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326902 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert rL326898: "Teach CorrelatedValuePropagation to reduce the width of udiv/urem...
Justin Lebar [Wed, 7 Mar 2018 16:05:43 +0000 (16:05 +0000)]
Revert rL326898: "Teach CorrelatedValuePropagation to reduce the width of udiv/urem instructions."

Breaks bootstrap builds: clang built with this patch asserts while
building MCDwarf.cpp: Assertion `castIsValid(op, S, Ty) && "Invalid
cast!"' failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326900 91177308-0d34-0410-b5e6-96231b3b80d8