132380 Commits

Author SHA1 Message Date
Quentin Colombet
0a2adaeedd [RegBankSelect] Use frequency and probability information to compute
more precise cost in Greedy mode.

In Fast mode the cost is irrelevant so do not bother requiring that
those passes get scheduled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 17:54:09 +00:00
Quentin Colombet
8ffc17cd96 [RegBankSelect] Use the Fast mode for functions with the optnone attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270242 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 17:36:54 +00:00
Chris Bieneman
54530096e5 [obj2yaml][yaml2obj] Adding enumFallback for MachO load commands
This adds support for handling unknown load commands, and a bogus_load_command tests.

Unknown or unsupported load commands can be specified in YAML by their hex value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 17:20:42 +00:00
Sanjay Patel
2c98ad1c24 fix comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 17:07:19 +00:00
Sanjay Patel
6d605e9529 use range-loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 17:00:10 +00:00
Quentin Colombet
8dd49fb28f [RegBankSelect] Specify different optimization mode for the pass.
The mode should be choose by the target when instantiating the pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270235 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 16:55:35 +00:00
Sanjay Patel
040e77cee7 fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270234 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 16:46:01 +00:00
Krzysztof Parzyszek
4e5eef13a1 Fix error reporting in register scavenger (lack of emergency spill slot)
- Do not store Twine objects.
- Remove report_fatal_error, since llvm_unreachable does terminate the
  program in release mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 16:38:34 +00:00
Quentin Colombet
4c3d76947c [RegBankSelect] Add a method to avoid splitting while repairing.
The previous choice of the insertion points for repairing was
straightfoward but may introduce some basic block or edge splitting. In
some situation this is something we can avoid.
For instance, when repairing a phi argument, instead of placing the
repairing on the related incoming edge, we may move it to the previous
block, before the terminators. This is only possible when the argument
is not defined by one of the terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 16:36:12 +00:00
Davide Italiano
2bd5cc36e7 [PM/PartiallyInlineLibCalls] Fix pass dependencies.
Inline getAnalysisUsage() while I'm here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 16:23:14 +00:00
Simon Pilgrim
11c52a1f5a [X86][AVX] Generalized matching for target shuffle combines
This patch is a first step towards a more extendible method of matching combined target shuffle masks.

Initially this just pulls out the existing basic mask matches and adds support for some 256/512 bit equivalents. Future patterns will require a number of features to be added but I wanted to keep this patch simple.

I hope we can avoid duplication between shuffle lowering and combining and share more complex pattern match functions in future commits.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 16:19:30 +00:00
Simon Pilgrim
a7f9ea74d5 [X86][AVX] Sync with clang/test/CodeGen/avx-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270229 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 16:05:55 +00:00
Davide Italiano
fbaa1ba049 [PartiallyInlineLibCalls] Remove dead includes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 15:52:23 +00:00
Davide Italiano
9d466b3f70 [PM/PartiallyInlineLibCalls] Convert to static function in preparation for porting this pass to the new PM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 15:43:39 +00:00
Sanjay Patel
f5a8ebbd97 [SimplifyCFG] eliminate switch cases based on known range of switch condition
This was noted in PR24766:
https://llvm.org/bugs/show_bug.cgi?id=24766#c2

We may not know whether the sign bit(s) are zero or one, but we can still
optimize based on knowing that the sign bit is repeated.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 14:53:09 +00:00
Krzysztof Parzyszek
a3d21bd41c Correction to r270219: fix detection of invalid frame index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270220 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 14:34:03 +00:00
Krzysztof Parzyszek
64552eff55 Skip entries with invalid indexes in the search loop in register scavenger
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270219 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 14:18:54 +00:00
Sanjay Patel
760078b188 [MCExpr] avoid UB via negation of INT_MIN
I accidentally exposed a bug in MCExpr::evaluateAsRelocatableImpl() with the test file added in:
http://reviews.llvm.org/rL269977

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270218 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 14:09:41 +00:00
Krzysztof Parzyszek
9798d4211d [Hexagon] Use pipe instead of temporary files in tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 14:01:34 +00:00
Rafael Espindola
dddfc0bb56 Refactor X86 symbol access classification.
This refactors the logic in X86 to avoid code duplication. It also
splits it in two steps: it first decides if a symbol is local to the DSO
and then uses that information to decide how to access it.

The first part is implemented by shouldAssumeDSOLocal. It is not in any
way specific to X86. In a followup patch I intend to move it to
somewhere common and reused it in other backends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 12:20:10 +00:00
Rafael Espindola
f5a1debd28 Simplify handling of hidden stubs on PowerPC.
We now handle them just like non hidden ones. This was already the case
on x86 (r207518) and arm (r207517).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270205 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 12:00:52 +00:00
NAKAMURA Takumi
e3282d30d8 SparcISelLowering.cpp: Add missing StringSwitch.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 10:53:56 +00:00
Chris Dewhurst
8393870560 [Sparc] Implement getRegisterByName.
Allows Sparc registers to be specifically referred to in inline assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 10:21:01 +00:00
Benjamin Kramer
e3bf66476f [ProfileData] Thread unique_ptr through the summary builder to avoid leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 09:18:37 +00:00
Igor Kudrin
88a127497f [Coverage] Fix an issue where improper coverage mapping data could be loaded for an inline function.
If an inline function is observed but unused in a translation unit, dummy
coverage mapping data with zero hash is stored for this function.
If such a coverage mapping section came earlier than real one, the latter
was ignored. As a result, llvm-cov was unable to show coverage information
for those functions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 09:14:24 +00:00
Chris Dewhurst
564e8812da [Sparc] Enable more inline assembly constraints.
Note: This is specifically to allow GCC's test pr44707 to pass.

Trivial change, not put for differential revision. Test included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 09:03:01 +00:00
Diana Picus
5930164242 Fix some comment typos in SelectionDAGBuilder. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 08:06:31 +00:00
Saleem Abdulrasool
e7579a0096 Target: move enum back into MC
Move the enumeration back to avoid the layering violation.  Should repair the
modules build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 05:13:35 +00:00
Craig Topper
2f6808a785 [X86] Run the AVX/AVX2 intrinsic tests in AVX512VL mode too just to make sure we don't break any older intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 05:10:32 +00:00
Craig Topper
9c173669ce [X86] Fix another AVX pattern to only be disable if VLX and BWI are supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 05:10:27 +00:00
Saleem Abdulrasool
0266e3802a Target: move the EH enumeration and add option
Move the ExceptionHandling enumeration into TargetOptions and introduce a field
to track the desired exception model.  This will allow us to set the exception
model from the frontend (needed to optionally use SjLj EH on other targets where
zero-cost is available and preferred).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 03:39:28 +00:00
Jacques Pienaar
1c820cfeb9 [lanai] Use Optional<Reloc> in LanaiTargetMachine.
Follow r269988 and use Optional<Reloc>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 03:21:37 +00:00
Craig Topper
264bca366b Revert accidental commit of a test command line addition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 02:01:51 +00:00
Craig Topper
af1ca0f2aa [X86] Fix some AVX patterns to only be disabled if VLX and BWI are supported. Without this we get isel failures on the avx-intrinsics-x86.ll test in AVX512VL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 02:00:08 +00:00
Dan Liew
036e9cc7c7 [LibFuzzer] Fix implementation of `GetPeakRSSMb()` on Mac OSX.
On Linux ``rusage.ru_maxrss`` is in KiB but on Mac OSX it is in bytes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 01:37:54 +00:00
Dan Liew
adef8786dd [LibFuzzer] Fix `NumberOfCpuCores()` on Mac OSX.
The ``nprocs`` command does not exist under Mac OSX so use
``sysctl`` instead on that platform.

Whilst I'm here

* Use ``pclose()`` instead of ``fclose()`` which the ``popen()``
  documentation says should be used.
* Check for errors that were previously unhandled.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 01:30:36 +00:00
Dylan McKay
c776d19aca Add AVRTargetStreamers
Reviewed by Matt Arsenault in http://reviews.llvm.org/D16311

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 01:17:38 +00:00
Quentin Colombet
9b176c7309 [RegBankSelect] Refactor the code to split the repairing and mapping of
an instruction.

Use the previously introduced RepairingPlacement class to split the code
computing the repairing placement from the code doing the actual
placement. That way, we will be able to consider different placement and
then, only apply the best one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 00:55:51 +00:00
Quentin Colombet
68fddfc32f [RegBankSelect] Add helper class for repairing code placement.
When assigning the register banks we may have to insert repairing code
to move already assigned values accross register banks.

Introduce a few helper classes to keep track of what is involved in the
repairing of an operand:
- InsertPoint and its derived classes record the positions, in the CFG,
  where repairing has to be inserted.
- RepairingPlacement holds all the insert points for the repairing of an
  operand plus the kind of action that is required to do the repairing.

This is going to be used to keep track of how the repairing should be
done, while comparing different solutions for an instruction. Indeed, we
will need the repairing placement to capture the cost of a solution and
we do not want to compute it a second time when we do the actual
repairing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270167 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 00:49:10 +00:00
Quentin Colombet
f1b77e3c65 [RegBankSelect] Refactor assignmentMatch to avoid testing the current
register bank twice.

Prior to this change, we were checking if the assignment for the current
machine operand was matching, then we would check if the mismatch
requires to insert repair code.
We actually already have this information from the first check, so just
pass it along.

NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270166 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 00:42:57 +00:00
Rafael Espindola
e5257f1c4b Fix pr27728.
Sorry for the lack testcase. There is one in the pr, but it depends on
std::sort and the .ll version is 110 lines, so I don't think it is
wort it.

The bug was that we were sorting after adding a terminator, and the
sorting algorithm could end up putting the terminator in the middle of
the List vector.

With that we would create a Spans map entry keyed on nullptr which would
then be added to CUs and fail in that sorting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 00:38:28 +00:00
Quentin Colombet
b90ae9029e [RegBankSelect] Introduce MappingCost helper class.
This helper class will be used to represent the cost of mapping an
instruction to a specific register bank.
The particularity of these costs is that they are mostly local, thus the
frequency of the basic block is irrelevant. However, for few
instructions (e.g., phis and terminators), the cost may be non-local and
then, we need to account for the frequency of the involved basic blocks.

This will be used by the greedy mode I am working on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 00:35:26 +00:00
Richard Smith
92d8cd03a5 Restore ASCIIbetical order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 00:05:55 +00:00
Chris Bieneman
5a8295114e [obj2yaml] [yaml2obj] Adding a test for r270124
This test covers strings after load command structs and zero fill bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270159 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:26:39 +00:00
Chris Bieneman
e90cbf6c44 [yaml2obj] Removing debug code that scribbled 0xDEADBEEF
Now that MachO load command fields are fully covered we can fill unaccounted for bytes with 0. That allows us to sparsely specify YAML to simplify tests.

Simplifying load_commands test accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:26:31 +00:00
Lang Hames
8c34a3f83c [RuntimeDyld][MachO] Add support for SUBTRACTOR relocations between anonymous
symbols on x86-64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:26:05 +00:00
Rafael Espindola
02e249fb8e clang-format. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:17:37 +00:00
Sanjoy Das
069b376c47 Add const qualifiers to appease bots; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:15:59 +00:00
Easwaran Raman
ed8d5eadcc Allow -inline-threshold to override default threshold.
Before r257832, the threshold used by SimpleInliner was explicitly specified or generated from opt levels and passed to the base class Inliner's constructor. There, it was first overridden by explicitly specified -inline-threshold. The refactoring in r257832 did not preserve this behavior for all opt levels. This change brings back the original behavior.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:02:09 +00:00
Richard Smith
7534b79ef9 Forgotten file from r269992.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 22:56:37 +00:00