OSDN Git Service

android-x86/external-llvm.git
5 years ago[Hexagon] Foundation of support for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 20:18:09 +0000 (20:18 +0000)]
[Hexagon] Foundation of support for Hexagon V66

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

5 years ago[GISel]: Provide standard interface to observe changes in GISel passes
Aditya Nandakumar [Wed, 5 Dec 2018 20:14:52 +0000 (20:14 +0000)]
[GISel]: Provide standard interface to observe changes in GISel passes

https://reviews.llvm.org/D54980

This provides a standard API across GISel passes to observe and notify
passes about changes (insertions/deletions/mutations) to MachineInstrs.
This patch also removes the recordInsertion method in MachineIRBuilder
and instead provides method to setObserver.

Reviewed by: vkeles.

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

5 years ago[CodeExtractor] Do not marked outlined calls which may resume EH as noreturn
Vedant Kumar [Wed, 5 Dec 2018 19:35:37 +0000 (19:35 +0000)]
[CodeExtractor] Do not marked outlined calls which may resume EH as noreturn

Treat terminators which resume exception propagation as returning instructions
(at least, for the purposes of marking outlined functions `noreturn`). This is
to avoid inserting traps after calls to outlined functions which unwind.

rdar://46129950

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

5 years ago[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors
Simon Pilgrim [Wed, 5 Dec 2018 19:32:19 +0000 (19:32 +0000)]
[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors

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

5 years ago[AArch64] Reword description of feature (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:42:57 +0000 (18:42 +0000)]
[AArch64] Reword description of feature (NFC)

Reword the description of the feature that enables custom handling of cheap
instructions.

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

5 years ago[llvm-mca] Simplify test (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:34:51 +0000 (18:34 +0000)]
[llvm-mca] Simplify test (NFC)

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

5 years ago[llvm-mca] Sort test run lines (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:30:06 +0000 (18:30 +0000)]
[llvm-mca] Sort test run lines (NFC)

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

5 years ago[MachineOutliner][NFC] Use getOccurrenceCount() in getNotOutlinedCost()
Jessica Paquette [Wed, 5 Dec 2018 18:17:40 +0000 (18:17 +0000)]
[MachineOutliner][NFC] Use getOccurrenceCount() in getNotOutlinedCost()

Some more gardening.

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

5 years ago[MachineOutliner][NFC] Make getters in MachineOutliner.h const
Jessica Paquette [Wed, 5 Dec 2018 18:12:52 +0000 (18:12 +0000)]
[MachineOutliner][NFC] Make getters in MachineOutliner.h const

Just some refactoring. A few of the getters in OutlinedFunction weren't const.

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

5 years ago[MachineOutliner][NFC] Don't create outlined sequence from integer mapping
Jessica Paquette [Wed, 5 Dec 2018 17:57:33 +0000 (17:57 +0000)]
[MachineOutliner][NFC] Don't create outlined sequence from integer mapping

Some gardening/refactoring.

It's cleaner to copy the instructions into the MachineFunction using the first
candidate instead of going to the mapper.

Also, by doing this we can remove the Seq member from OutlinedFunction entirely.

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

5 years ago[gold-plugin] allow function/data sections to be toggleable
Nick Desaulniers [Wed, 5 Dec 2018 17:46:24 +0000 (17:46 +0000)]
[gold-plugin] allow function/data sections to be toggleable

Summary:
r336838 allowed these to be toggleable.
r336858 reverted r336838.
r336943 made the generation of these sections conditional on LDPO_REL.

This commit brings back the toggle-ability.  You can specify:
-plugin-opt=-function-sections
-plugin-opt=-data-sections
For your linker flags to disable the changes made in r336943.

Without toggling r336943 off, arm64 linux kernels linked with gold-plugin
see significant boot time regressions, but with r336943 outright reverted
x86_64 linux kernels linked with gold-plugin fail to boot.

Reviewers: pcc, void

Reviewed By: pcc

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

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

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

5 years agoAMDGPU: Fix using old address spaces in some tests
Matt Arsenault [Wed, 5 Dec 2018 17:34:59 +0000 (17:34 +0000)]
AMDGPU: Fix using old address spaces in some tests

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

5 years ago[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)
Sanjay Patel [Wed, 5 Dec 2018 17:10:30 +0000 (17:10 +0000)]
[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)

Because we're potentially peeking through a bitcast in this transform,
we need to use overall bitwidths rather than number of elements to
determine when it's safe to proceed.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=39893

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

5 years agoAllow norecurse attribute on functions that have debug infos.
Christian Bruel [Wed, 5 Dec 2018 16:48:00 +0000 (16:48 +0000)]
Allow norecurse attribute on functions that have debug infos.

Summary: debug intrinsics might be marked norecurse to enable the caller function to be norecurse and optimized if needed. This avoids code gen optimisation differences when -g is used, as in globalOpt.cpp:processInternalGlobal checks.

Reviewers: chandlerc, jmolloy, aprantl

Reviewed By: aprantl

Subscribers: aprantl, llvm-commits

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

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

5 years ago[X86] Add test case to show missed opportunity to combine a concat_vector into a...
Andrea Di Biagio [Wed, 5 Dec 2018 16:23:27 +0000 (16:23 +0000)]
[X86] Add test case to show missed opportunity to combine a concat_vector into a scalar_to_vector. NFC

This is a test for D55274.

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

5 years agoRevert "[IR] Add NODISCARD to attribute functions"
Brian Gesiak [Wed, 5 Dec 2018 15:56:09 +0000 (15:56 +0000)]
Revert "[IR] Add NODISCARD to attribute functions"

Revert https://reviews.llvm.org/D55217 due to warnings-turned-into-errors in
AMGPU targets. I'll fix the warnings first, then re-commit this patch.

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

5 years ago[SLH] Fix a nasty bug in SLH.
Chandler Carruth [Wed, 5 Dec 2018 15:42:11 +0000 (15:42 +0000)]
[SLH] Fix a nasty bug in SLH.

Whenever we effectively take the address of a basic block we need to
manually update that basic block to reflect that fact or later passes
such as tail duplication and tail merging can break the invariants of
the code. =/ Sadly, there doesn't appear to be any good way of
automating this or even writing a reasonable assert to catch it early.

The change seems trivially and obviously correct, but sadly the only
really good test case I have is 1000s of basic blocks. I've tried
directly writing a test case that happens to make tail duplication do
something that crashes later on, but this appears to require an
*amazingly* complex set of conditions that I've not yet reproduced.

The change is technically covered by the tests because we mark the
blocks as having their address taken, but that doesn't really count as
properly testing the functionality.

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

5 years ago[SLH] Regenerate tests with --no_x86_scrub_rip to restore the higher
Chandler Carruth [Wed, 5 Dec 2018 15:41:13 +0000 (15:41 +0000)]
[SLH] Regenerate tests with --no_x86_scrub_rip to restore the higher
fidelity checking of RIP-based references to basic blocks and other
labels.

These labels are super important for SLH tests so we should keep them
readable in the test cases.

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

5 years ago[IR] Add NODISCARD to attribute functions
Brian Gesiak [Wed, 5 Dec 2018 15:33:55 +0000 (15:33 +0000)]
[IR] Add NODISCARD to attribute functions

Summary:
Many functions on `llvm::AttributeList` and `llvm::AttributeSet` are
documented with "returns a new {list,set} because attribute
{lists,sets} are immutable." This documentation can be aided by the
addition of an attribute, `LLVM_NODISCARD`. Adding this prevents
unsuspecting users of the API from expecting
`AttributeList::setAttributes` from modifying the underlying list.

At the very least, it would have saved me a few hours of debugging, since I
had been doing just that! I had a bug in my program where I was calling
`setAttributes` but then passing in the unmutated `AttributeList`.
I tried adding LLVM_NODISCARD and confirmed that it would have made my bug
immediately obvious.

Reviewers: rnk, javed.absar

Reviewed By: rnk

Subscribers: llvm-commits

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

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

5 years ago[AMDGPU]: Turn on the DPP combiner by default
Valery Pykhtin [Wed, 5 Dec 2018 15:21:17 +0000 (15:21 +0000)]
[AMDGPU]: Turn on the DPP combiner by default

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

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

5 years ago[InstCombine] simplify icmps with same operands based on dominating cmp
Sanjay Patel [Wed, 5 Dec 2018 15:04:00 +0000 (15:04 +0000)]
[InstCombine] simplify icmps with same operands based on dominating cmp

The tests here are based on the motivating cases from D54827.

More background:
1. We don't get these cases in general with SimplifyCFG because the root
   of the pattern match is an icmp, not a branch. I'm not sure how often
   we encounter this pattern vs. the seemingly more likely case with
   branches, but I don't see evidence to leave the minimal pattern
   unoptimized.

2. This has a chance of increasing compile-time because we're using a
   ValueTracking call to handle the match. The motivating cases could be
   handled with a simpler pair of calls to isImpliedTrueByMatchingCmp/
   isImpliedFalseByMatchingCmp, but I saw that we have a more
   comprehensive wrapper around those, so we might as well use it here
   unless there's evidence that it's significantly slower.

3. Ideally, we'd handle the fold to constants in InstSimplify, but as
   with the existing code here, we could extend this to handle cases
   where the result is not a constant, but a new combined predicate.
   That would mean splitting the logic across the 2 passes and possibly
   duplicating the pattern-matching cost.

4. As mentioned in D54827, this seems like the kind of thing that should
   be handled in Correlated Value Propagation, but that pass is currently
   limited to dealing with instructions with constant operands, so extending
   this bit of InstCombine is the smallest/easiest way to get these patterns
   optimized.

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

5 years ago[X86][SSE] Begun adding modulo rotate support to LowerRotate
Simon Pilgrim [Wed, 5 Dec 2018 14:46:37 +0000 (14:46 +0000)]
[X86][SSE] Begun adding modulo rotate support to LowerRotate

Prep work for PR38243 - mainly adding comments on where we need to add modulo support (doing so at the moment causes massive codegen regressions).

I've also consistently added support for modulo folding for uniform constants (although at the moment we have no way to trigger this) and removed the old assertions.

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

5 years ago[llvm-rc] Support not expressions.
Martin Storsjo [Wed, 5 Dec 2018 13:22:56 +0000 (13:22 +0000)]
[llvm-rc] Support not expressions.

Patch by Jacek Caban!

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

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

5 years ago[TargetLowering] Remove ISD::ANY_EXTEND/ANY_EXTEND_VECTOR_INREG opcodes from Simplify...
Simon Pilgrim [Wed, 5 Dec 2018 12:20:05 +0000 (12:20 +0000)]
[TargetLowering] Remove ISD::ANY_EXTEND/ANY_EXTEND_VECTOR_INREG opcodes from SimplifyDemandedVectorElts

These have no test coverage and the KnownZero flags can't be guaranteed unlike SIGN/ZERO_EXTEND cases.

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

5 years ago[DAG] Add fshl/fshr tblgen opcodes
Simon Pilgrim [Wed, 5 Dec 2018 11:55:33 +0000 (11:55 +0000)]
[DAG] Add fshl/fshr tblgen opcodes

Missed off from https://reviews.llvm.org/D54698

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

5 years ago[test] Skip ThinLTO cache tests requiring atime setting on NetBSD
Michal Gorny [Wed, 5 Dec 2018 11:15:50 +0000 (11:15 +0000)]
[test] Skip ThinLTO cache tests requiring atime setting on NetBSD

Skip the ThinLTO cache tests on NetBSD.  They require 'touch' being
able to alter atime of files, while NetBSD inhibits atime updates
when filesystem is mounted noatime.

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

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

5 years ago[test] Split strip-preserve-time.test, and skip atime test on NetBSD
Michal Gorny [Wed, 5 Dec 2018 11:15:46 +0000 (11:15 +0000)]
[test] Split strip-preserve-time.test, and skip atime test on NetBSD

Split timestamp preservation tests into atime and mtime test, and skip
the former on NetBSD.  When the filesystem is mounted noatime, NetBSD
not only inhibits implicit atime updates but also prevents setting atime
via utime(), causing the test to fail.

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

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

5 years ago[SelectionDAG] Initial support for FSHL/FSHR funnel shift opcodes (PR39467)
Simon Pilgrim [Wed, 5 Dec 2018 11:12:12 +0000 (11:12 +0000)]
[SelectionDAG] Initial support for FSHL/FSHR funnel shift opcodes (PR39467)

This is an initial patch to add a minimum level of support for funnel shifts to the SelectionDAG and to begin wiring it up to the X86 SHLD/SHRD instructions.

Some partial legalization code has been added to handle the case for 'SlowSHLD' where we want to expand instead and I've added a few DAG combines so we don't get regressions from the existing DAG builder expansion code.

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

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

5 years ago[MC] - Fix build bot.
George Rimar [Wed, 5 Dec 2018 11:06:29 +0000 (11:06 +0000)]
[MC] - Fix build bot.

Error was:
/home/buildslave/slave_as-bldslv8/lld-perf-testsuite/llvm/lib/MC/MCFragment.cpp:241:22: error: field 'Offset' will be initialized after field 'LayoutOrder' [-Werror,-Wreorder]
      Atom(nullptr), Offset(~UINT64_C(0)), LayoutOrder(0) {

http://lab.llvm.org:8011/builders/lld-perf-testsuite/builds/9628/steps/build-bin%2Flld/logs/stdio

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

5 years agoRemove superfluous comments. NFCI.
Simon Pilgrim [Wed, 5 Dec 2018 10:45:44 +0000 (10:45 +0000)]
Remove superfluous comments. NFCI.

As requested in D54698.

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

5 years agoRecommit r348243 - "[llvm-mc] - Do not crash when referencing undefined debug sections."
George Rimar [Wed, 5 Dec 2018 10:43:58 +0000 (10:43 +0000)]
Recommit r348243 - "[llvm-mc] - Do not crash when referencing undefined debug sections."

The patch triggered an unrelated msan issue: LayoutOrder variable was not initialized.
(http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/26794/steps/check-llvm%20msan/logs/stdio)
It was fixed.

Original commit message:
MC has code that pre-creates few debug sections:
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L396

If users code has a reference to such section but does not redefine it,
MC code currently asserts, because still thinks they are normally defined.

The patch fixes the issue.

Differential revision: https://reviews.llvm.org/D55173
----
Modified : /llvm/trunk/lib/MC/ELFObjectWriter.cpp
Added : /llvm/trunk/test/MC/ELF/undefined-debug.s

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

5 years ago[TargetLowering] SimplifyDemandedVectorElts - don't alter DemandedElts mask
Simon Pilgrim [Wed, 5 Dec 2018 10:37:45 +0000 (10:37 +0000)]
[TargetLowering] SimplifyDemandedVectorElts - don't alter DemandedElts mask

Fix potential issue with the ISD::INSERT_VECTOR_ELT case tweaking the DemandedElts mask instead of using a local copy - so later uses of the mask use the tweaked version.....

Noticed while investigating adding zero/undef folding to SimplifyDemandedVectorElts and the altered DemandedElts mask was causing mismatches.

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

5 years ago[ARM GlobalISel] Implement call lowering for Thumb2
Diana Picus [Wed, 5 Dec 2018 10:35:28 +0000 (10:35 +0000)]
[ARM GlobalISel] Implement call lowering for Thumb2

The only things that are different from arm are:
* different opcodes for calls and returns
* Thumb calls take predicate operands

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

5 years ago[LICM] *Actually* disable ControlFlowHoisting.
Alina Sbirlea [Wed, 5 Dec 2018 10:16:21 +0000 (10:16 +0000)]
[LICM] *Actually* disable ControlFlowHoisting.

Summary:
The remaining code paths that ControlFlowHoisting introduced that were
not disabled, increased compile time by 3x for some benchmarks.
The time is spent in DominatorTree updates.

Reviewers: john.brawn, mkazantsev

Subscribers: sanjoy, jlebar, llvm-commits

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

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

5 years agoHowToBuildWithPGO.rst: Fix a few details in the manual steps
Hans Wennborg [Wed, 5 Dec 2018 08:35:30 +0000 (08:35 +0000)]
HowToBuildWithPGO.rst: Fix a few details in the manual steps

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

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

5 years ago[X86] Remove -costmodel-reduxcost=true from the experimental vector reduction intrins...
Craig Topper [Wed, 5 Dec 2018 07:56:50 +0000 (07:56 +0000)]
[X86] Remove -costmodel-reduxcost=true from the experimental vector reduction intrinsic tests as it appears to be unnecessary. NFC

I think this has something to do with matching reductions from extractelement, binops, and shuffles. But we're not matching here.

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

5 years ago[X86] Add more cost model tests for vector reductions with narrow vector types. NFC
Craig Topper [Wed, 5 Dec 2018 07:26:57 +0000 (07:26 +0000)]
[X86] Add more cost model tests for vector reductions with narrow vector types. NFC

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

5 years agoAArch64: support funclets in fastcall and swift_call
Saleem Abdulrasool [Wed, 5 Dec 2018 07:09:20 +0000 (07:09 +0000)]
AArch64: support funclets in fastcall and swift_call

Functions annotated with `__fastcall` or `__attribute__((__fastcall__))`
or `__attribute__((__swiftcall__))` may contain SEH handlers even on
Win64.  This matches the behaviour of cl which allows for
`__try`/`__except` inside a `__fastcall` function.  This was detected
while trying to self-host clang on Windows ARM64.

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

5 years ago[X86] Add narrow vector test cases to vector-reduce* tests. Add copies of the tests...
Craig Topper [Wed, 5 Dec 2018 06:29:44 +0000 (06:29 +0000)]
[X86] Add narrow vector test cases to vector-reduce* tests. Add copies of the tests with -x86-experimental-vector-widening-legalization

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

5 years ago[NFC] Verify memoryssa in test for PR39783
Max Kazantsev [Wed, 5 Dec 2018 05:20:08 +0000 (05:20 +0000)]
[NFC] Verify memoryssa in test for PR39783

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

5 years ago[MachineLICM][X86][AMDGPU] Fix subtle bug in the updating of PhysRegClobbers in post...
Craig Topper [Wed, 5 Dec 2018 03:41:26 +0000 (03:41 +0000)]
[MachineLICM][X86][AMDGPU] Fix subtle bug in the updating of PhysRegClobbers in post-RA LICM

It looks like MCRegAliasIterator can visit the same physical register twice. When this happens in this code in LICM we end up setting the PhysRegDef and then later in the same loop visit the register again. Now we see that PhysRegDef is set from the earlier iteration so now set PhysRegClobber.

This patch splits the loop so we have one that uses the previous value of PhysRegDef to update PhysRegClobber and second loop that updates PhysRegDef.

The X86 atomic test is an improvement. I had to add sideeffect to the two shrink wrapping tests to prevent hoisting from occurring. I'm not sure about the AMDGPU tests. It looks like the branch instruction changed at end the of the loops. And in the branch-relaxation test I think there is now "and vcc, exec, -1" instruction that wasn't there before.

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

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

5 years ago[asan] Add clang flag -fsanitize-address-use-odr-indicator
Vitaly Buka [Wed, 5 Dec 2018 01:44:31 +0000 (01:44 +0000)]
[asan] Add clang flag -fsanitize-address-use-odr-indicator

Reviewers: eugenis, m.ostapenko, ygribov

Subscribers: hiraditya, llvm-commits

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

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

5 years ago[TableGen] Preserve order of output operands in DAGISelMatcherGen
Craig Topper [Wed, 5 Dec 2018 00:47:59 +0000 (00:47 +0000)]
[TableGen] Preserve order of output operands in DAGISelMatcherGen

Summary:
This fixes support in DAGISelMatcher backend for DAG nodes with multiple
result values. Previously the order of results in selected DAG nodes always
matched the order of results in ISel patterns. After the change the order of
results matches the order of operands in OutOperandList instead.

For example, given this definition from the attached test case:

  def INSTR : Instruction {
    let OutOperandList = (outs GPR:$r1, GPR:$r0);
    let InOperandList = (ins GPR:$t0, GPR:$t1);
    let Pattern = [(set i32:$r0, i32:$r1, (udivrem i32:$t0, i32:$t1))];
  }

the DAGISelMatcher backend currently produces a matcher that creates INSTR
nodes with the first result `$r0` and the second result `$r1`, contrary to the
order in the OutOperandList. The order of operands in OutOperandList does not
matter at all, which is unexpected (and unfortunate) because the order of
results of a DAG node does matters, perhaps a lot.

With this change, if the order in OutOperandList does not match the order in
Pattern, DAGISelMatcherGen emits CompleteMatch opcodes with the order of
results taken from OutOperandList. Backend writers can use it to express
result reorderings in TableGen.

If the order in OutOperandList matches the order in Pattern, the result of
DAGISelMatcherGen is unaffected.

Patch by Eugene Sharygin

Reviewers: andreadb, bjope, hfinkel, RKSimon, craig.topper

Reviewed By: craig.topper

Subscribers: nhaehnle, craig.topper, llvm-commits

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

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

5 years ago[SelectionDAG] Split very large token factors for loads into 64k chunks.
Amara Emerson [Wed, 5 Dec 2018 00:41:30 +0000 (00:41 +0000)]
[SelectionDAG] Split very large token factors for loads into 64k chunks.

There's a 64k limit on the number of SDNode operands, and some very large
functions with 64k or more loads can cause crashes due to this limit being hit
when a TokenFactor with this many operands is created. To fix this, create
sub-tokenfactors if we've exceeded the limit.

No test case as it requires a very large function.

rdar://45196621

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

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

5 years ago[ADT] Add zip_longest iterators.
Michael Kruse [Wed, 5 Dec 2018 00:31:54 +0000 (00:31 +0000)]
[ADT] Add zip_longest iterators.

Like the already existing zip_shortest/zip_first iterators, zip_longest
iterates over multiple iterators at once, but has as many iterations as
the longest sequence.

This means some iterators may reach the end before others do.
zip_longest uses llvm::Optional's None value to mark a
past-the-end value.

zip_longest is not reverse-iteratable because the tuples iterated over
would be different for different length sequences (IMHO for the same
reason neither zip_shortest nor zip_first should be reverse-iteratable;
one can still reverse the ranges individually if that's the expected
behavior).

In contrast to zip_shortest/zip_first, zip_longest tuples contain
rvalues instead of references. This is because llvm::Optional cannot
contain reference types and the value-initialized default does not have
a memory location a reference could point to.

The motivation for these iterators is to use C++ foreach to compare two
lists of ordered attributes in D48100 (SemaOverload.cpp and
ASTReaderDecl.cpp).

Idea by @hfinkel.

This re-commits r348301 which was reverted by r348303.
The compilation error by gcc 5.4 was resolved using make_tuple in the in
the initializer_list.
The compileration error by msvc14 was resolved by splitting
ZipLongestValueType (which already was a workaround for msvc15) into
ZipLongestItemType and ZipLongestTupleType.

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

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

5 years agoLTO: Don't internalize available_externally globals.
Peter Collingbourne [Wed, 5 Dec 2018 00:09:36 +0000 (00:09 +0000)]
LTO: Don't internalize available_externally globals.

This breaks C and C++ semantics because it can cause the address
of the global inside the module to differ from the address outside
of the module.

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

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

5 years ago[AArch64][GlobalISel] Re-enable selection of volatile loads.
Amara Emerson [Wed, 5 Dec 2018 00:03:09 +0000 (00:03 +0000)]
[AArch64][GlobalISel] Re-enable selection of volatile loads.

We previously disabled this in r323371 because of a bug where we selected an
extending load, but didn't delete the old G_LOAD, resulting in two loads being
generated for volatile loads.

Since we now have dedicated G_SEXTLOAD/G_ZEXTLOAD operations, and that the
tablegen patterns should no longer be able to select (ext(load x)) patterns, it
should be safe to re-enable it.

The old test case should still work as expected.

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

5 years agoRemove the hash code from CVRecord.
Zachary Turner [Tue, 4 Dec 2018 23:56:07 +0000 (23:56 +0000)]
Remove the hash code from CVRecord.

This is no longer used and is just taking up space in the structure.
Heap allocation of this structure is on the critical path, so space
actually matters.

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

5 years ago[asan] Split -asan-use-private-alias to -asan-use-odr-indicator
Vitaly Buka [Tue, 4 Dec 2018 23:17:41 +0000 (23:17 +0000)]
[asan] Split -asan-use-private-alias to -asan-use-odr-indicator

Reviewers: eugenis, m.ostapenko, ygribov

Subscribers: mehdi_amini, kubamracek, hiraditya, steven_wu, dexonsmith, llvm-commits

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

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

5 years ago[InstCombine] add tests for implied simplifications; NFC
Sanjay Patel [Tue, 4 Dec 2018 22:25:33 +0000 (22:25 +0000)]
[InstCombine] add tests for implied simplifications; NFC

Ideally, we would fold all of these in InstSimplify in a
similar way to rL347896, but this is a bit awkward when
we're trying to simplify a compare directly because the
ValueTracking API expects the compare as an input, but
in InstSimplify, we just have the operands of the compare.

Given that we can do transforms besides just simplifications,
we might as well just extend the code in InstCombine (which
already does simplifications with constant operands).

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

5 years agoAArch64: clean up some whitespace in Windows CC (NFC)
Saleem Abdulrasool [Tue, 4 Dec 2018 22:19:29 +0000 (22:19 +0000)]
AArch64: clean up some whitespace in Windows CC (NFC)

Drive by clean up for Windows ARM64 variadic CC (NFC).

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

5 years ago[llvm-pdbutil] Remove the analyze subcommand.
Zachary Turner [Tue, 4 Dec 2018 21:49:04 +0000 (21:49 +0000)]
[llvm-pdbutil] Remove the analyze subcommand.

Nobody has used this since it was introduced, and it doesn't have
test coverage.

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

5 years ago[PDB] Emit S_UDT records in LLD.
Zachary Turner [Tue, 4 Dec 2018 21:48:46 +0000 (21:48 +0000)]
[PDB] Emit S_UDT records in LLD.

Previously these were dropped.  We now understand them sufficiently
well to start emitting them.  From the debugger's perspective, this
now enables us to have debug info about typedefs (both global and
function-locally scoped)

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

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

5 years ago[AVR] Silence fallthrough warning. NFC.
Nirav Dave [Tue, 4 Dec 2018 21:41:52 +0000 (21:41 +0000)]
[AVR] Silence fallthrough warning. NFC.

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

5 years agoRevert "[ADT] Add zip_longest iterators"
Michael Kruse [Tue, 4 Dec 2018 21:38:55 +0000 (21:38 +0000)]
Revert "[ADT] Add zip_longest iterators"

This reverts commit r348301.

Compilation fails on buildbots with older versions of gcc and msvc.

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

5 years ago[ADT] Add zip_longest iterators
Michael Kruse [Tue, 4 Dec 2018 21:06:16 +0000 (21:06 +0000)]
[ADT] Add zip_longest iterators

Like the already existing zip_shortest/zip_first iterators, zip_longest
iterates over multiple iterators at once, but has as many iterations as
the longest sequence.

This means some iterators may reach the end before others do.
zip_longest uses llvm::Optional's None value to mark a
past-the-end value.

zip_longest is not reverse-iteratable because the tuples iterated over
would be different for different length sequences (IMHO for the same
reason neither zip_shortest nor zip_first should be reverse-iteratable;
one can still reverse the ranges individually if that's the expected
behavior).

In contrast to zip_shortest/zip_first, zip_longest tuples contain
rvalues instead of references. This is because llvm::Optional cannot
contain reference types and the value-initialized default does not have
a memory location a reference could point to.

The motivation for these iterators is to use C++ foreach to compare two
lists of ordered attributes in D48100 (SemaOverload.cpp and
ASTReaderDecl.cpp).

Idea by @hfinkel.

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

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

5 years ago[PowerPC] Make no-PIC default to match GCC - LLVM
Stefan Pintilie [Tue, 4 Dec 2018 20:14:57 +0000 (20:14 +0000)]
[PowerPC] Make no-PIC default to match GCC - LLVM

Change the default for PowerPC LE to -fno-PIC.

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

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

5 years ago[CmpInstAnalysis] fix function signature for ICmp code to predicate; NFC
Sanjay Patel [Tue, 4 Dec 2018 18:53:27 +0000 (18:53 +0000)]
[CmpInstAnalysis] fix function signature for ICmp code to predicate; NFC

The old function underspecified the return type, took an unused parameter,
and had a misleading name.

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

5 years agoMove llc-start-stop-instance to x86
Matt Arsenault [Tue, 4 Dec 2018 18:19:08 +0000 (18:19 +0000)]
Move llc-start-stop-instance to x86

Avoid bot failures where the host pass
setup might not have 2 dead-mi-elimination runs

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

5 years ago[SelectionDAG] Redefine isGAPlusOffset in terms of unwrapAddress. NFCI.
Nirav Dave [Tue, 4 Dec 2018 17:59:43 +0000 (17:59 +0000)]
[SelectionDAG] Redefine isGAPlusOffset in terms of unwrapAddress. NFCI.

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

5 years agoAMDGPU: Add f32 vectors to SGPR register classes
Matt Arsenault [Tue, 4 Dec 2018 17:51:36 +0000 (17:51 +0000)]
AMDGPU: Add f32 vectors to SGPR register classes

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

5 years agoMIR: Add method to stop after specific runs of passes
Matt Arsenault [Tue, 4 Dec 2018 17:45:12 +0000 (17:45 +0000)]
MIR: Add method to stop after specific runs of passes

Currently if you use -{start,stop}-{before,after}, it picks
the first instance with the matching pass name. If you run
the same pass multiple times, there's no way to distinguish them.

Allow specifying a run index wih ,N to specify which you mean.

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

5 years ago[InstCombine] rearrange foldICmpWithDominatingICmp; NFC
Sanjay Patel [Tue, 4 Dec 2018 17:44:24 +0000 (17:44 +0000)]
[InstCombine] rearrange foldICmpWithDominatingICmp; NFC

Move it out from under the constant check, reorder
predicates, add comments. This makes it easier to
extend to handle the non-constant case.

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

5 years ago[dsymutil] Ensure we're comparing time stamps with the same precision.
Jonas Devlieghere [Tue, 4 Dec 2018 17:15:23 +0000 (17:15 +0000)]
[dsymutil] Ensure we're comparing time stamps with the same precision.

After TimePoint's precision was increased in LLVM we started seeing
failures because the modification times didn't match. This adds a time
cast to ensure that we're comparing TimePoints with the same amount of
precision.

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

5 years ago[X86][SSE] Add SimplifyDemandedBitsForTargetNode handling for MOVMSK
Simon Pilgrim [Tue, 4 Dec 2018 16:52:32 +0000 (16:52 +0000)]
[X86][SSE] Add SimplifyDemandedBitsForTargetNode handling for MOVMSK

Moves existing SimplifyDemandedBits call out of combineMOVMSK and add SimplifyDemandedVectorElts call based on the sign bits we need.

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

5 years agoRevert "Adapt gcov to changes in CFE."
Ilya Biryukov [Tue, 4 Dec 2018 16:30:31 +0000 (16:30 +0000)]
Revert "Adapt gcov to changes in CFE."

This reverts commit r348203.
Reason: this produces absolute paths in .gcno files, breaking us
internally as we rely on them being consistent with the filenames passed
in the command line.

Also reverts r348157 and r348155 to account for revert of r348154 in
clang repository.

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

5 years ago[X86][SSE] Add MOVMSK demandedbits/elts tests
Simon Pilgrim [Tue, 4 Dec 2018 16:01:25 +0000 (16:01 +0000)]
[X86][SSE] Add MOVMSK demandedbits/elts tests

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

5 years ago[InstCombine] auto-generate full checks for icmp overflow tests; NFC
Sanjay Patel [Tue, 4 Dec 2018 15:41:34 +0000 (15:41 +0000)]
[InstCombine] auto-generate full checks for icmp overflow tests; NFC

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

5 years ago[InstCombine] add helper for icmp with dominator; NFC
Sanjay Patel [Tue, 4 Dec 2018 15:35:17 +0000 (15:35 +0000)]
[InstCombine] add helper for icmp with dominator; NFC

There's a potential small enhancement to this code that could
solve the cases currently under proposal in D54827 via SimplifyCFG.

Whether instcombine should be doing this kind of semi-non-local
analysis in the first place is an open question, but separating
the logic out can only help if/when we decide to move it to a
different pass.

AFAICT, any proposal to do this in SimplifyCFG could also be seen
as an overreach + it would be incomplete to start the fold from a
branch rather than an icmp.

There's another question here about the code for processUGT_ADDCST_ADD().
That part may be completely dead after rL234638 ?

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

5 years ago[InstCombine] auto-generate full checks for icmp dominator tests; NFC
Sanjay Patel [Tue, 4 Dec 2018 15:00:35 +0000 (15:00 +0000)]
[InstCombine] auto-generate full checks for icmp dominator tests; NFC

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

5 years ago[Hexagon] Remove unused checker functions from asm parser
Krzysztof Parzyszek [Tue, 4 Dec 2018 14:58:14 +0000 (14:58 +0000)]
[Hexagon] Remove unused checker functions from asm parser

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

5 years ago[SimpleLoopUnswitch] Remove debug dump.
Alina Sbirlea [Tue, 4 Dec 2018 14:43:24 +0000 (14:43 +0000)]
[SimpleLoopUnswitch] Remove debug dump.

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

5 years agoAdd common check prefix. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 14:32:42 +0000 (14:32 +0000)]
Add common check prefix. NFCI.

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

5 years ago[yaml2obj] Move redundant statements into a separate static function
Xing GUO [Tue, 4 Dec 2018 14:27:51 +0000 (14:27 +0000)]
[yaml2obj] Move redundant statements into a separate static function

Reviewers: jhenderson, grimar

Reviewed By: jhenderson

Subscribers: jakehehrlich, llvm-commits

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

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

5 years agoUpdate MemorySSA in SimpleLoopUnswitch.
Alina Sbirlea [Tue, 4 Dec 2018 14:23:37 +0000 (14:23 +0000)]
Update MemorySSA in SimpleLoopUnswitch.

Summary:
Teach SimpleLoopUnswitch to preserve MemorySSA.

Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits

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

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

5 years ago[GN][NFC] Update readme example to functional command
Martell Malone [Tue, 4 Dec 2018 12:59:22 +0000 (12:59 +0000)]
[GN][NFC] Update readme example to functional command

`ninja -C out/gn check-lld` is not a valid command yet

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

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

5 years ago[X86][NFC] Add more constant-size memcmp tests.
Clement Courbet [Tue, 4 Dec 2018 12:35:51 +0000 (12:35 +0000)]
[X86][NFC] Add more constant-size memcmp tests.

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

5 years agoFix MSVC "unknown pragma" warning. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 12:31:52 +0000 (12:31 +0000)]
Fix MSVC "unknown pragma" warning. NFCI.

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

5 years agoFix -Wparentheses warning. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 12:24:10 +0000 (12:24 +0000)]
Fix -Wparentheses warning. NFCI.

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

5 years ago[X86] Remove unnecessary peekThroughEXTRACT_SUBVECTORs call.
Simon Pilgrim [Tue, 4 Dec 2018 12:21:43 +0000 (12:21 +0000)]
[X86] Remove unnecessary peekThroughEXTRACT_SUBVECTORs call.

The GetSplatValue/IsSplatVector call will call this anyhow and the later code is just for a v2i64 type so doesn't need it.

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

5 years ago[TargetLowering] expandFP_TO_UINT - avoid FPE due to out of range conversion (PR17686)
Simon Pilgrim [Tue, 4 Dec 2018 11:21:30 +0000 (11:21 +0000)]
[TargetLowering] expandFP_TO_UINT - avoid FPE due to out of range conversion (PR17686)

PR17686 demonstrates that for some targets FP exceptions can fire in cases where the FP_TO_UINT is expanded using a FP_TO_SINT instruction.

The existing code converts both the inrange and outofrange cases using FP_TO_SINT and then selects the result, this patch changes this for 'strict' cases to pre-select the FP_TO_SINT input and the offset adjustment.

The X87 cases don't need the strict flag but generates much nicer code with it....

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

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

5 years agoRevert rL348121 from llvm/trunk: [NFC][AArch64] Split out backend features
Simon Pilgrim [Tue, 4 Dec 2018 10:55:48 +0000 (10:55 +0000)]
Revert rL348121 from llvm/trunk: [NFC][AArch64] Split out backend features

This patch splits backend features currently
hidden behind architecture versions.

For example, currently the only way to activate
complex numbers extension is targeting an v8.3
architecture, where after the patch this extension
can be added separately.

This refactoring is required by the new command lines proposal:
http://lists.llvm.org/pipermail/llvm-dev/2018-September/126346.html

Reviewers: DavidSpickett, olista01, t.p.northover

Subscribers: kristof.beyls, bryanpkc, javed.absar, pbarrio

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

........

This has been causing buildbots failures for the past 24 hours: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/14386

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

5 years agoRevert r348243 "[llvm-mc] - Do not crash when referencing undefined debug sections."
George Rimar [Tue, 4 Dec 2018 10:55:03 +0000 (10:55 +0000)]
Revert r348243 "[llvm-mc] - Do not crash when referencing undefined debug sections."

It broke msan and asan bots it seems:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/26794/steps/check-llvm%20msan/logs/stdio
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/20993/steps/ninja%20check%201/logs/stdio

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

5 years ago[TargetLowering] Add SimplifyDemandedVectorElts support to EXTEND opcodes
Simon Pilgrim [Tue, 4 Dec 2018 10:41:06 +0000 (10:41 +0000)]
[TargetLowering] Add SimplifyDemandedVectorElts support to EXTEND opcodes

Add support for ISD::*_EXTEND and ISD::*_EXTEND_VECTOR_INREG opcodes.

The extra broadcast in trunc-subvector.ll will be fixed in an upcoming patch.

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

5 years ago[llvm-mc] - Do not crash when referencing undefined debug sections.
George Rimar [Tue, 4 Dec 2018 10:10:50 +0000 (10:10 +0000)]
[llvm-mc] - Do not crash when referencing undefined debug sections.

MC has code that pre-creates few debug sections:
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L396

If users code has a reference to such section but does not redefine it,
MC code currently asserts, because still thinks they are normally defined.

The patch fixes the issue.

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

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

5 years ago[llvm-dwarfdump] - Dump the older versions of .eh_frame/.debug_frame correctly.
George Rimar [Tue, 4 Dec 2018 10:01:39 +0000 (10:01 +0000)]
[llvm-dwarfdump] - Dump the older versions of .eh_frame/.debug_frame correctly.

The issue is the following.

DWARF 2 used version 1 for .debug_frame.
(Appendix G, p. 416 http://dwarfstd.org/doc/DWARF5.pdf)

lib/MC now always sets version 1 for .eh_frame (and sets 1-4 versions for .debug_frame correctly):
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1530
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1562
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1602

In version 1, return_address_register was defined as ubyte, while other versions
switched to uleb128.
(p 62, http://www.dwarfstd.org/doc/dwarf-2.0.0.pdf)

Patch teaches llvm-dwarfdump about this difference.

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

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

5 years ago[X86] Remove custom DAG combine for SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG.
Craig Topper [Tue, 4 Dec 2018 04:51:07 +0000 (04:51 +0000)]
[X86] Remove custom DAG combine for SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG.

We only needed this because it provided really aggressive constant folding even through constant pool entries created from build_vectors. The main case was for vXi8 MULH legalization which was happening as part of legalize DAG instead of as part of legalize vector ops. Now its part of vector op legalization and we've added special handling for build vectors of all constants there. This has removed the need for this code on the list tests we have.

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

5 years agoReverting r348215
Ranjeet Singh [Tue, 4 Dec 2018 02:03:53 +0000 (02:03 +0000)]
Reverting r348215

Causing failures on ubsan buildbot boxes.

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

5 years ago[TableGen] Improve the formatting of the emitted predicates (NFC)
Evandro Menezes [Tue, 4 Dec 2018 01:43:22 +0000 (01:43 +0000)]
[TableGen] Improve the formatting of the emitted predicates (NFC)

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

5 years ago[TableGen] Fix typo in emitted comment (NFC)
Evandro Menezes [Tue, 4 Dec 2018 01:43:19 +0000 (01:43 +0000)]
[TableGen] Fix typo in emitted comment (NFC)

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

5 years ago[ExecutionEngine] Change NotifyObjectEmitted/NotifyObjectFreed API.
Lang Hames [Tue, 4 Dec 2018 00:55:15 +0000 (00:55 +0000)]
[ExecutionEngine] Change NotifyObjectEmitted/NotifyObjectFreed API.

This patch renames both methods (NotifyObjectEmitted -> notifyObjectLoaded, and
NotifyObjectFreed -> notifyObjectFreed), adds an abstract "ObjectKey" (uint64_t)
parameter to notifyObjectLoaded, and replaces the ObjectFile parameter for
notifyObjectFreed with an ObjectKey. Using an ObjectKey to track identify
events, rather than a reference to the ObjectFile, allows us to free the
ObjectFile after notifyObjectLoaded is called, saving memory.

https://reviews.llvm.org/D53773

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

5 years ago[ARM64][Windows] Fix local stack size for funclets
Sanjin Sijaric [Tue, 4 Dec 2018 00:54:52 +0000 (00:54 +0000)]
[ARM64][Windows] Fix local stack size for funclets

The comment was misplaced, and the code didn't do what the comment indicated,
namely ignoring the varargs portion when computing the local stack size of a
funclet in emitEpilogue.  This results in incorrect offset computations within
funclets that are contained in vararg functions.

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

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

5 years ago[asan] Reduce binary size by using unnamed private aliases
Vitaly Buka [Tue, 4 Dec 2018 00:36:14 +0000 (00:36 +0000)]
[asan] Reduce binary size by using unnamed private aliases

Summary:
--asan-use-private-alias increases binary sizes by 10% or more.
Most of this space was long names of aliases and new symbols.
These symbols are not needed for the ODC check at all.

Reviewers: eugenis

Subscribers: hiraditya, llvm-commits

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

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

5 years ago[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo
Jessica Paquette [Tue, 4 Dec 2018 00:31:55 +0000 (00:31 +0000)]
[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo

This moves the stack check logic into a lambda within getOutliningCandidateInfo.

This allows us to be less conservative with stack checks. Whether or not a
stack instruction is safe to outline is dependent on the frame variant and call
variant of the outlined function; only in cases where we modify the stack can
these be unsafe.

So, if we move that logic later, when we're looking at an individual candidate,
we can make better decisions here.

This gives some code size savings as a result.

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

5 years ago[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic
Jessica Paquette [Tue, 4 Dec 2018 00:31:47 +0000 (00:31 +0000)]
[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic

If we dropped too many candidates to be beneficial when dropping candidates
that modify the stack, there's no reason to check for other cost model
qualities.

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

5 years ago[projects] Use directory name for add_llvm_external_projects
Shoaib Meenai [Tue, 4 Dec 2018 00:12:03 +0000 (00:12 +0000)]
[projects] Use directory name for add_llvm_external_projects

add_llvm_external_projects expects the directory name instead of the
full path, otherwise the check for an in-tree subproject will fail and
the project won't be configured.

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

5 years ago[ThinLTO] Look through aliases when computing hash keys
George Burgess IV [Tue, 4 Dec 2018 00:02:33 +0000 (00:02 +0000)]
[ThinLTO] Look through aliases when computing hash keys

Without this, we don't consider types used by aliasees in our cache key.
This caused issues when using the same cache for thin-linking the same
TU with different sets of virtual call candidates for a virtual call
inside of a constructor. That's sort of a mouthful. :)

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

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

5 years ago[IR] Don't assume all functions are 4 byte aligned
Ranjeet Singh [Tue, 4 Dec 2018 00:01:23 +0000 (00:01 +0000)]
[IR] Don't assume all functions are 4 byte aligned

In some cases different alignments for function might be used to save
space e.g. thumb mode with -Oz will try to use 2 byte function
alignment. Similar patch that fixed this in other areas exists here
https://reviews.llvm.org/D46110

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

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

5 years ago[Hexagon] Switch to auto-generated intrinsic definitions and patterns
Krzysztof Parzyszek [Mon, 3 Dec 2018 22:40:36 +0000 (22:40 +0000)]
[Hexagon] Switch to auto-generated intrinsic definitions and patterns

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

5 years ago[CodeExtractor] Split PHI nodes with incoming values from outlined region (PR39433)
Vedant Kumar [Mon, 3 Dec 2018 22:40:21 +0000 (22:40 +0000)]
[CodeExtractor] Split PHI nodes with incoming values from outlined region (PR39433)

If a PHI node out of extracted region has multiple incoming values from it,
split this PHI on two parts. First PHI has incomings only from region and
extracts with it (they are placed to the separate basic block that added to the
list of outlined), and incoming values in original PHI are replaced by first
PHI. Similar solution is already used in CodeExtractor for PHIs in entry block
(severSplitPHINodes method). It covers PR39433 bug.

Patch by Sergei Kachkov!

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

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