Commit Graph

118773 Commits

Author SHA1 Message Date
Rafael Espindola
2faef9ccb0 Add the testcase from pr23900.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240253 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 01:29:24 +00:00
Simon Pilgrim
da5f3d8f76 [X86] Code tidyup - Use SDValue bool operator. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240249 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 21:34:32 +00:00
Duncan P. N. Exon Smith
f1c527b5c1 AsmPrinter: Don't emit empty .debug_loc entries
If we don't know how to represent a .debug_loc entry, skip the entry
entirely rather than emitting an empty one.  Similarly, if a .debug_loc
list has no entries, don't create the list.

We still want to create the variables, just in an optimized-out form
that doesn't have a DW_AT_location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 16:54:56 +00:00
Duncan P. N. Exon Smith
01a8dc8ca6 AsmPrinter: Rewrite initialization of DbgVariable, NFC
There are three types of `DbgVariable`:
  - alloca variables, created based on the MMI table,
  - register variables, created based on DBG_VALUE instructions, and
  - optimized-out variables.

This commit reconfigures `DbgVariable` to make it easier to tell which
kind we have, and make initialization a little clearer.

For MMI/alloca variables, `FrameIndex.size()` must always equal
`Expr.size()`, and there shouldn't be an `MInsn`.  For register
variables (with a `MInsn`), `FrameIndex` must be empty, and `Expr`
should have 0 or 1 element depending on whether it has a complex
expression (registers with multiple locations use `DebugLocListIndex`).
Optimized-out variables shouldn't have any of these fields.

Moreover, this separates DBG_VALUE initialization until after the
variable is created, simplifying logic in a future commit that changes
`collectVariableInfo()` to stop creating empty .debug_loc entries/lists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240243 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 16:50:43 +00:00
Simon Pilgrim
87f860c737 [X86][SSE] Added missing stack folding test for CVTSD2SS instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240241 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 16:07:47 +00:00
NAKAMURA Takumi
b87f6217b3 OptTable.h: Prune a couple of \param(s), since Arg has been ArrayRef-ized. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240240 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 13:44:46 +00:00
David Blaikie
caca524562 Devirtualize ArgList's dtor now that -Wvirtual-dtor and C++11 allow a better way to describe this situation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 06:51:35 +00:00
David Blaikie
fa6a5de95b ArrayRef-ify libDriverMain
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240234 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 06:31:56 +00:00
David Blaikie
006bce7764 ArrayRef-ify ParseArgs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240233 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 06:31:53 +00:00
Rui Ueyama
87ae2e8ab0 Object: Add load configuration structure for 64 bit PE/COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240230 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 01:12:32 +00:00
Hans Wennborg
ee16995e3d Switch lowering: add heuristic for filling leaf nodes in the weight-balanced binary search tree
Sparse switches with profile info are lowered as weight-balanced BSTs. For
example, if the node weights are {1,1,1,1,1,1000}, the right-most node would
end up in a tree by itself, bringing it closer to the top.

However, a leaf in this BST can contain up to 3 cases, and having a single
case in a leaf node as in the example means the tree might become
unnecessarily high.

This patch adds a heauristic to the pivot selection algorithm that moves more
cases into leaf nodes unless that would lower their rank. It still doesn't
yield the optimal tree in every case, but I believe it's conservatibely correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240224 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 17:14:07 +00:00
Simon Pilgrim
1eabc9fb9d [X86][SSE] Fix PerformSExtCombine bug that accessed the wrong return value of an aggregate type.
Fix to rL237885 to ensure that it accesses the correct return value of an aggregate type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240223 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 16:19:24 +00:00
Benjamin Kramer
793ca75174 [PPC] Factor vector removal into a function and remove O(n^2) behavior.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240222 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 15:59:41 +00:00
Benjamin Kramer
35d21618cb [SwitchLowering] Remove quadratic vector removal.
This can be triggered with giant switches. No functionality change
intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240221 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 15:59:34 +00:00
Simon Pilgrim
1e71d7421a [X86][SSE][CostModel] Added full set of sitofp/uitofp costings for SSE2/AVX/AVX2/AVX512F.
Merged separate (but equivalent) SSE2/AVX512F tests.

Removed codegen tests since these are already done better in test/CodeGen/X86.

The actual cost values still need to be updated to match recent codegen improvements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240219 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 14:58:01 +00:00
Yaron Keren
34fb635521 Update ELFObjectWriter::reset() following r238073.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240218 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 11:54:32 +00:00
Yaron Keren
642cc4efd3 Rangify for loops in Inliner::runOnSCC(), NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 07:12:33 +00:00
Justin Bogner
40f8babe9a IndVarSimplify: Avoid UB from binding a reference to a null pointer
Calling operator* on a WeakVH whose Value is null hits undefined
behaviour, since we bind the value to a reference. Instead, go through
`operator Value*` so that we work with the pointer itself.

Found by ubsan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240214 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 06:24:05 +00:00
NAKAMURA Takumi
ac5e008dfd Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240213 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 06:22:04 +00:00
NAKAMURA Takumi
3d378e625c Revert r240040, "[BranchFolding] Replace custom MachineInstr with MachineInstrExpressionTrait"
It caused different emission between stage2 and stage3. Investigating.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240212 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 06:21:48 +00:00
NAKAMURA Takumi
41144b12f0 TargetInstrInfo.h: Fix r240192. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 03:53:18 +00:00
Justin Bogner
9cbe7b76e6 Revert "InstrProf: When reading, copy the data instead of taking a reference. NFC"
Seems like MSVC doesn't like this:

  InstrProf.h(49) : error C2614: 'llvm::InstrProfRecord' : illegal member initialization: 'Hash' is not a base or member

This reverts r240206.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 01:37:56 +00:00
Peter Collingbourne
d1bbb25afe Use correct escaping for semicolon on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240207 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 01:28:20 +00:00
Justin Bogner
9edccc8b40 InstrProf: When reading, copy the data instead of taking a reference. NFC
This consolidates the logic to read instrprof records into the on disk
hash table's lookup trait and makes us copy the counter data instead
of taking references to it as we read. This will simplify further
changes to the format.

Patch by Betul Buyukkurt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 01:26:04 +00:00
Peter Collingbourne
cdc126d293 LibDriver tests require x86 target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240205 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 01:14:37 +00:00
Peter Collingbourne
8c2385dd35 LibDriver: implement /libpath and $LIB; ignore /ignore and /machine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 00:57:12 +00:00
Keno Fischer
bea6fb975e [MCJIT] Add a FindGlobalVariableNamed utility
Summary: This adds FindGlobalVariableNamed to ExecutionEngine
(plus implementation in MCJIT), which is an analog of
FindFunctionNamed for GlobalVariables.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240202 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 00:55:58 +00:00
Justin Bogner
4029c5944b LowerSwitch: Avoid some undefined behaviour
When a case of INT64_MIN was followed by a case that was greater than
zero, we were overflowing a signed integer here. Since we've sorted
the cases here anyway (and thus currentValue must be greater than
nextValue) it's simple enough to avoid this by using addition rather
than subtraction.

Found by UBSAN on existing tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 00:28:25 +00:00
Sanjoy Das
ac9af6c151 [Statepoint] Remove unnecessary argument from Statepoint::getRelocates
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240198 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 00:01:03 +00:00
Sanjoy Das
62d9678d09 [Statepoint][NFC] Fix include guard style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240197 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 00:00:58 +00:00
Nico Weber
7081f6fc99 Revert 240130, it caused crashes (repro in PR23900).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240193 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 23:43:47 +00:00
Sanjay Patel
30c3b2a4c2 name change: hasPattern() -> getMachineCombinerPatterns() ; NFC
This was suggested as part of D10460, but it's independent of
any functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 23:21:42 +00:00
Sanjoy Das
152f3b5997 [CallGraph] Given -print-callgraph a stable printing order.
Summary:
Since FunctionMap has llvm::Function pointers as keys, the order in
which the traversal happens can differ from run to run, causing spurious
FileCheck failures.  Have CallGraph::print sort the CallGraphNodes by
name before printing them.

Reviewers: bogner, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240191 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 23:20:31 +00:00
Dan Liew
9b3369eafc Try to fix generation of LLVMExports.cmake under Visual Studio.
If LLVMDebugInfoPDB links against the DIA SDK then the exports file
would contain an INTERFACE_LINK_LIBRARIES property that contained an
absolute path to ``diaguids.lib`` which used a native windows path (interpreted
as escape sequences when LLVMExports.cmake is imported causing
``find_package(LLVM)`` to fail) rather than the correct CMake style path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 21:50:27 +00:00
Rafael Espindola
7edd010739 Improve error handling of getRelocationAddend.
This patch changes getRelocationAddend to use ErrorOr and considers it an error
to try to get the addend of a REL section.

If, for example, a x86_64 file has a REL section, that file is corrupted and
we should reject it.

Using ErrorOr is not ideal since we check the section type once per relocation
instead of once per section.

Checking once per section would involve getRelocationAddend just asserting and
callers checking the section before iterating over the relocations.

In any case, this is an improvement and includes a test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 20:58:43 +00:00
Pete Cooper
ec43535766 Fix header path in CMake. NFC.
The ADDITIONAL_HEADER_DIRS command can be used to tell UIs that a given library
owns certain headers.  The path for MCParser was missing MC/ in it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240175 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 20:49:02 +00:00
Alex Lorenz
dc6d65201d MIR Parser: report an error when a basic block isn't found.
This commit reports an error when the MIR parser can't find
a basic block with the machine basic block's name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240174 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 20:12:03 +00:00
Adam Nemet
d8c98f16bb [LoopDist] Rename RuntimeCheckEmitter to LoopVersioning, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 19:32:48 +00:00
Adam Nemet
5af96d3a49 [LoopDist] Move pointer-to-partition computation out of RuntimeCheckEmitter, NFC
This starts preparing the class to become a (more) general
LoopVersioning utility class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240164 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 19:32:41 +00:00
Rafael Espindola
6c3277aea4 Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 19:07:59 +00:00
Matt Arsenault
5452b3ddbd AMDGPU: Fix filename in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:56:51 +00:00
Rafael Espindola
776f86420e Make getRelocationSection MachO only.
There are 3 types of relocations on MachO
* Scattered
* Section based
* Symbol based

On ELF and COFF relocations are symbol based.

We were in the strange situation that we abstracted over two of them. This makes
section based relocations MachO only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:54:28 +00:00
Alex Lorenz
260366437c MIR Serialization: Serialize the list of machine basic blocks with simple attributes.
This commit implements the initial serialization of machine basic blocks in a
machine function. Only the simple, scalar MBB attributes are serialized. The 
reference to LLVM IR's basic block is preserved when that basic block has a name.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:43:07 +00:00
Michael Zolotukhin
ad85d7a042 [SLP] Vectorize for all-constant entries.
Differential Revision: http://reviews.llvm.org/D10531

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240144 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:40:15 +00:00
Matt Arsenault
826539160c AMDGPU: Fix some places missed in rename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:39:03 +00:00
Alex Lorenz
75708d8749 MIR Serialization: use default member initializers to initialize yaml::MachineFunction. NFC.
Default member initializers are permitted since r236244.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:36:02 +00:00
Chad Rosier
41c88491da Typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240141 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:32:57 +00:00
Douglas Katzman
ae7a59fa3e Avoid warning about inability to cast from ptr-to-obj to ptr-to-fun.
Use POSIX.1-2003 Technical Corrigendum 1 suggested workaround.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240140 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:21:02 +00:00
Alexander Kornienko
cf0db29df2 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
  -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
  llvm/lib/


Thanks to Eugene Kosov for the original patch!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 15:57:42 +00:00
Rafael Espindola
883d498abf Fix the build.
Sorry, I have no idea how grep failed to find this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240133 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 14:34:12 +00:00