Commit Graph

130999 Commits

Author SHA1 Message Date
Matthias Braun
3b74a145c8 TableGen: Support lanemasks for classes without subregisters
Previously using lanemasks on registers without any subregisters was not
well defined. This commit extends TargetRegisterInfo/tablegen to:
- Report a lanemask of 1 for regclasses without subregisters
- Do the right thing when mapping a 0/1 lanemask from a class without
  subregisters into a class with subregisters in
  TargetRegisterInfo::composeSubRegIndexLaneMasks().

This will be used in the upcoming "DetectDeadLanes" patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:04 +00:00
Matthias Braun
289718f19c LiveIntervalAnalysis: Fix handleMove() using wrong value numbers
handleMove() was incorrectly swapping two value numbers. This was missed
before because the problem only occured when moving subregister definitions
and needed -verify-machineinstrs to be detected.

I cannot add a testcase as long as I cannot reapply r260905/r260806.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 02:11:49 +00:00
Craig Topper
701c5797e3 [AArch64] Expand CTTZ for all vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 01:58:21 +00:00
Richard Smith
b012212af7 Fix bogus documentation for StringRef::slice in the End < Start case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 00:57:14 +00:00
Chaoren Lin
b75c7f8193 Use llvm:Twine instead of std::to_string.
std::to_string is not available from the Android NDK.

Reviewers: lhames, ovyalov, chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19638

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 00:49:37 +00:00
Sanjay Patel
cfb23d433e Update test to use FileCheck
Also, add some metadata to show what that currently looks like.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 00:29:27 +00:00
Bryan Chan
2c448a07a4 [SystemZ] Support Swift Calling Convention
Summary:
Port rL265480, rL264754, rL265997 and rL266252 to SystemZ, in order to enable the Swift port on the architecture. SwiftSelf and SwiftError are assigned to R10 and R9, respectively, which are normally callee-saved registers. For more information, see:

RFC: Implementing the Swift calling convention in LLVM and Clang
https://groups.google.com/forum/#!topic/llvm-dev/epDd2w93kZ0

Reviewers: kbarton, manmanren, rjmccall, uweigand

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19414

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 00:17:23 +00:00
Peter Collingbourne
628f22d543 LTO: Don't bother trying to mangle unnamed globals, as they can't be preserved with MustPreserveSymbols.
Summary: Should fix sanitizer-windows bot.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D19635

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:48:11 +00:00
Kevin Enderby
05e0103959 Fix bugs in llvm-objdump printing the last word for -section in non i386 and x86 files.
Two problems, 1) for the last 4 bytes it would print them as separate bytes not a word
and 2) it would print the same last byte for those bytes less than a word.

rdar://25938224


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267819 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:43:00 +00:00
Zachary Turner
4a4743c8af Parse module information from DBI stream.
This gets more data out of the DBI strema of the PDB.  In
particular it extracts the metadata for the list of modules
(compilands) that this PDB contains info about, and adds support
for dumping these fields to llvm-pdbdump.

Differential Revision: http://reviews.llvm.org/D19570
Reviewed By: ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:41:42 +00:00
Quentin Colombet
9473ad8388 [ImplicitNullChecks] Properly update the live-in of the block of the memory operation.
We basically replace:
HoistBB:
cond_br NullBB, NotNullBB

NullBB:
  ...

NotNullBB:
  <reg> = load

into
HoistBB
<reg> = load_faulting_op NullBB
uncond_br NotNullBB

NullBB:
  ...

NotNullBB: ## <reg> is now live-in of NotNullBB
  ...

This partially fixes the machine verifier error for
test/CodeGen/X86/implicit-null-check.ll, but it still fails because
of the implicit CFG structure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267817 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:26:40 +00:00
Rong Xu
0174eda0bc more buildbot failure fix to r267792
__llvm_prf_nm length is embedded in llvm_used. Relax llvm_used check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:23:53 +00:00
Rong Xu
1564d12c82 [PGO] Promote indirect calls to conditional direct calls with value-profile
This patch implements the transformation that promotes indirect calls to
conditional direct calls when the indirect-call value profile meta-data is
available.

Differential Revision: http://reviews.llvm.org/D17864


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267815 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:20:27 +00:00
Sanjay Patel
0d170a8dbc [SimplifyCFG] propagate branch metadata when creating select
There's no existing test for this path, and I don't know how to expose
it in a regression test, but I'm assuming there's some reason this
path exists. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:14:12 +00:00
Lang Hames
def5c175e7 [RuntimeDyld] Propagate another dropped error in RuntimeDyldELF.
This should fix the PPC64 bots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 22:54:03 +00:00
Mitch Bodart
3fdd252bbd [X86] Enable the post-RA-scheduler for clang's default 32-bit cpu.
For compilations with no explicit cpu specified, this exhibits
nice gains on Silvermont, with neutral performance on big cores.

Differential Revision: http://reviews.llvm.org/D19138


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 22:52:35 +00:00
Kevin Enderby
0d974f894f Fix a bug in llvm-objdump printing of 32-bit addresses for -section in non i386 and x86 files.
rdar://25896202


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267807 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 22:36:18 +00:00
Quentin Colombet
6c76c8948d [X86][FastISel] Make sure we use the right register class when we select stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 22:33:42 +00:00
Rong Xu
d0d678f8fe Fix buildbot failure due to r267792
Relax the test check as some targets do not have name compression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 22:06:35 +00:00
Colin LeMahieu
1baab3bf65 [Hexagon] Merging nops in to previous packet rather than always creating a new one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 21:37:44 +00:00
Quentin Colombet
42b983d1a7 [X86] Fix the lowering of TLS calls.
The callseq_end node must be glued with the TLS calls, otherwise,
the generic code will miss the uses of the returned value and will
mark it dead.
Moreover, TLSCall 64-bit pseudo must not set an implicit-use on RDI,
the pseudo uses the symbol address at this point not RDI and the
lowering will do the right thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 21:37:37 +00:00
Colin LeMahieu
a6e18c129a [MCAssembler] Allow backend to finalize layout post-relaxation.
Differential revision: http://reviews.llvm.org/D19429

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 21:26:13 +00:00
Rong Xu
66f1b7d0e9 [PGO] Prohibit address recording if the function is both internal and COMDAT
Differential Revision: http://reviews.llvm.org/D19515


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 21:17:30 +00:00
Matt Arsenault
38099e5394 AMDGPU: Account for globals in AMDGPUPromoteAlloca pass
Patch by Bas Nieuwenhuizen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 21:05:08 +00:00
Lang Hames
a5c5d80d6f [RuntimeDyld] Add missing include - <string> is requried for std::to_string.
This should fix the compile error that showed up in build:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/6754/



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:54:49 +00:00
Lang Hames
5089efd04e [RuntimeDyld] Propagate Errors from findPPC64TOCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:51:58 +00:00
Kevin Enderby
9390186529 Add a test case for the crash fixed with r267037. David Blaikie said it would be nice to have!
This was crashing llvm-objdump with -macho -objc-meta-data when trying dump a non-existent section.
So the test binary is simply created from an empty .s file compiled with: clang -arch armv7 empty.s -c


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:37:06 +00:00
Ahmed Bougacha
5678798442 [ARM] Set AddPristinesAndCSRs to expandCMP_SWAP LivePhysRegs.
We run after PEI.
Found via inspection; no obvious testcase.

Follow-up to r266679.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:33:07 +00:00
Ahmed Bougacha
67e6d9a989 [AArch64] Set AddPristinesAndCSRs to expandCMP_SWAP LivePhysRegs.
We run after PEI.
Found via inspection; no obvious testcase.

Follow-up to r266339.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:33:05 +00:00
Ahmed Bougacha
920e60d5d4 [AArch64] Set correct successors in CMPXCHG pseudo expansion.
transferSuccessors() would LoadCmpBB a successor of DoneBB,
whereas it should be a successor of the original MBB.

Follow-up to r266339.

Unfortunately, it's tricky to catch this in the verifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:33:02 +00:00
Ahmed Bougacha
2076e882ca [ARM] Set correct successors in CMPXCHG pseudo expansion.
transferSuccessors() would LoadCmpBB a successor of DoneBB, whereas
it should be a successor of the original MBB.

The testcase changes are caused by Thumb2SizeReduction, which
was previously confused by the broken CFG.

Follow-up to r266679.

Unfortunately, it's tricky to catch this in the verifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:32:54 +00:00
Simon Pilgrim
4ede31dcd2 [InstCombine][AVX2] Add AVX2 per-element vector shift tests
At the moment we don't simplify PSRAV/PSRLV/PSLLV intrinsics to generic IR for constant shift amounts, but we could.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:25:34 +00:00
Lang Hames
54b806a776 [RuntimeDyld] Plumb Error/Expected through the internals of RuntimeDyld.
Also replaces a number of calls to report_fatal_error with Error returns.

The plumbing will make it easier to return errors originating in libObject.

Replacing report_fatal_errors with Error returns will give JIT clients the
opportunity to recover gracefully when the JIT is unable to produce/relocate
code, as well as providing meaningful error messages that can be used to file
bug reports.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:24:48 +00:00
Than McIntosh
91e2a20847 Fix build failure under NDEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:07:02 +00:00
Kevin B. Smith
d71b57d3ce [X86]: Quit promoting 16 bit loads to 32 bit.
Differential Revision: http://reviews.llvm.org/D19592


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:58:03 +00:00
Kostya Serebryany
cb249e3b07 [libFuzzer] disable leak detection if we have tried it for 1000 times w/o finding a leak [part 2]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:52:56 +00:00
Kostya Serebryany
30f53168fa [libFuzzer] disable leak detection if we have tried it for 1000 times w/o finding a leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:52:34 +00:00
Andrew Kaylor
7a5448535e Add optimization bisect opt-in calls for PowerPC passes
Differential Revision: http://reviews.llvm.org/D19554



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:39:32 +00:00
David Majnemer
11dea5d5dd [CodeGenPrepare] Don't sink a cast past its user
The sink cast machinery is supposed to sink casts as close to their user
as possible.  However, an EH pad is the first instruction in it's basic
block.  Don't sink if the user is an EH pad.

This fixes PR27536.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:36:38 +00:00
Than McIntosh
ed52756a75 Refactor debugging code, NFC.
Summary:
Refactor debugging routines to reduce code duplication. Remove a couple
of #include's that were not needed. Don't require MachineDominator as a
prereq for this pass (not needed).

These changes split off from http://reviews.llvm.org/D18827.

Reviewers: wmi, gbiv, qcolombet

Subscribers: llvm-commits, davidxl, jevinskie

Differential Revision: http://reviews.llvm.org/D18992

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:26:25 +00:00
Justin Lebar
bd4ea6e77b [NVPTX] Run NVVMReflect at the beginning of IR passes.
Summary:
Currently the NVVMReflect pass is run at the beginning of our backend
passes.  But really, it should be run as early as possible, as it's
simply resolving an "if" statement in code.  So copy it into
TargetMachine::addEarlyAsPossiblePasses.

We still run it at the beginning of the backend passes, since it's
needed for correctness when lowering to nvptx.

(Specifically, NVVMReflect changes each call to the __nvvm_reflect
function or llvm.nvvm.reflect intrinsic into an integer constant, based
on the pass's configuration.  Clearly we miss many optimization
opportunities if we perform this transformation at the beginning of
codegen.)

Reviewers: rnk

Subscribers: tra, llvm-commits, jholewinski

Differential Revision: http://reviews.llvm.org/D18616

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:13:37 +00:00
Justin Lebar
ae889d3672 Add TargetMachine::addEarlyAsPossiblePasses, and call it from opt.
Summary:
This is a hook to allow TargetMachine to install passes at the
EP_EarlyAsPossible PassManagerBuilder extension point.

Reviewers: chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18614

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:08:24 +00:00
Ahmed Bougacha
a1d8280553 [LIR] Set attributes on memset_pattern16.
"inferattrs" will deduce the attribute, but it will be too late for
many optimizations. Set it ourselves when creating the call.

Differential Revision: http://reviews.llvm.org/D17598

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:50 +00:00
Ahmed Bougacha
a08b12b7a1 [LIR] Reuse variable. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:46 +00:00
Ahmed Bougacha
18fc933b03 [InferAttrs] Mark memset_pattern16 params nocapture.
Differential Revision: http://reviews.llvm.org/D19471

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:43 +00:00
Ahmed Bougacha
76739f43a9 [TLI] Unify LibFunc attribute inference. NFCI.
Now the pass is just a tiny wrapper around the util. This lets us reuse
the logic elsewhere (done here for BuildLibCalls) instead of duplicating
it.

The next step is to have something like getOrInsertLibFunc that also
sets the attributes.

Differential Revision: http://reviews.llvm.org/D19470

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:40 +00:00
Ahmed Bougacha
8a8efec992 [TLI] Unify LibFunc signature checking. NFCI.
I tried to be as close as possible to the strongest check that
existed before; cleaning these up properly is left for future work.

Differential Revision: http://reviews.llvm.org/D19469

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:35 +00:00
Ahmed Bougacha
4f8c113e74 [TLI] Fix indentation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:29 +00:00
Sjoerd Meijer
09aedbd06b Clean up to avoid compiler warnings for casting away const qualifiers.
Differential Revision: http://reviews.llvm.org/D19598


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 18:35:02 +00:00
Chad Rosier
8d960539d9 Revert "[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD."
This reverts commit r267733 due to a -Werror,-Wunused-function error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 18:29:11 +00:00