Commit Graph

119020 Commits

Author SHA1 Message Date
Rafael Espindola
b24bbb73a7 Add an ELFSymbolRef type.
This allows user code to say Sym.getSize() instead of having to manually fetch
the object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 22:10:04 +00:00
Frederic Riss
d26d587fbe IAS: Use the root macro instanciation for location
r224810 fixed the handling of macro debug locations in AsmParser. This patch
fixes the logic to actually do what was intended: it uses the first macro of
the macro stack instead of the last one. The updated testcase shows that the
current scheme doesn't work when macro instanciations are nested and multiple
files are used.

Reviewers: compnerd

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 21:57:33 +00:00
Michael J. Spencer
4cbb2db3ab [Object][ELF] Add support for dumping dynamic relocations when sections are stripped.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240703 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 21:47:32 +00:00
Duncan P. N. Exon Smith
ee46b796c2 dsymutil: Split out patchStmtList(), NFC
Split out code to patch up the `DW_AT_stmt_list` for the cloned DIE, and
reorganize it so that it doesn't depend on `DIE::values_begin()` and
`DIE::values_end()` (which I'm trying to kill off).

David Blaikie and I talked about adding a range-algorithm version of
`std::find_if()`, but the assertion *still* required getting at the end
iterator.  IMO, a separate helper function with an early return is
easier to reason about here.

A follow-up commit that removes `DIE::setValue()` and mutates the
`DIEValue` directly is coming shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240701 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 21:42:46 +00:00
Sanjay Patel
7db079305c fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240699 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 21:11:08 +00:00
Rafael Espindola
0999c2c69c llvm-nm: Don't print mapping symbols.
This matches the behavior of gnu nm. Fixes pr23930.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240695 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 21:00:51 +00:00
Pete Cooper
5c09803aee Use foreach loop over constant operands. NFC.
A number of places had explicit loops over Constant::operands().
Just use foreach loops where possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240694 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 20:51:38 +00:00
Rafael Espindola
d3704298c2 We don't need the targets to read objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240684 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 20:20:19 +00:00
Jingyue Wu
529f49db93 [InstCombine] call SimplifyICmpInst with correct context
Summary:
Fixes PR23809. Without passing the context to SimplifyICmpInst, we would
use the assume to prove that the condition feeding the assume is
trivially true (see isValidAssumeForContext in ValueTracking.cpp),
causing the removal of the assume which may be useful for later
optimizations.

Test Plan: pr23800.ll

Reviewers: hfinkel, majnemer

Reviewed By: hfinkel

Subscribers: henryhu, llvm-commits, wengxt, broune, meheff, eliben

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 20:14:47 +00:00
Rafael Espindola
1de6f369b3 Diagnose undefined temporary symbols.
We already disallowed

.global .Lfoo

so this is reasonable.

This is a small cherry pick from r240130.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240681 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 20:10:45 +00:00
Paul Robinson
f2c0530fca Make this test verify .debug_pubnames is actually missing.
It was matching at EOF regardless of whether the section was present.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 19:37:13 +00:00
Yaron Keren
9d1dc09759 Rangify for loop in Inliner.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240678 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 19:28:24 +00:00
Douglas Katzman
40db269af5 Add Arg::getValues method with const 'this' and const result
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240673 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 18:48:26 +00:00
Matt Arsenault
a59b0561c8 DAGCombiner: Remove redundant check
MemIntrinsicSDNode is already a subclass of MemSDNode,
so the MemSDNode check is sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240672 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 18:47:02 +00:00
Peter Collingbourne
8d5e4e48bc GVN: If a branch has two identical successors, we cannot declare either dead.
This previously caused miscompilations as a result of phi nodes receiving
undef incoming values from blocks dominated by such successors.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240670 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 18:32:02 +00:00
Rafael Espindola
b12380a76d Add a test for a recent regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240656 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 16:16:08 +00:00
Rafael Espindola
bfb732def0 llvm-nm: print 'n' instead of '?'
This matches gnu nm and has the advantage that there is a upper case N.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240655 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 16:01:53 +00:00
Kit Barton
1ebbc68719 [PPC] Implement vmrgew and vmrgow instructions
This patch adds support for the vector merge even word and vector merge odd word
instructions introduced in POWER8.

Phabricator review: http://reviews.llvm.org/D10704


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240650 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 15:17:40 +00:00
Bruno Cardoso Lopes
39b2e22f00 [AsmPrinter] Fix crash in handleIndirectSymViaGOTPCRel
Check for symbols in MCValue before using them. Bail out early in case
they are null. This fixes PR23779.

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

rdar://problem/21532830

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240649 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 15:17:23 +00:00
Jonathan Roelofs
8eb93196be Doxygen-ify a few comments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240647 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 15:06:47 +00:00
Rafael Espindola
8bf1076cf9 Use computeSymbolSizes in llvm-symbolize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 15:06:38 +00:00
Rafael Espindola
7a0f58b7f0 Use range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240645 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 15:00:38 +00:00
Rafael Espindola
ca30411d98 Modernize getELFDynamicSymbolIterators.
* Have it return a iterator_range.
* Remove the global function.
* Rename to getDynamicSymbolIterators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240644 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 14:39:35 +00:00
Benjamin Kramer
b81740d146 Don't use std::make_unique.
We still have to support C++11 standard libraries, make_unique is a C++14
feature.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 13:47:36 +00:00
Benjamin Kramer
6f5a75de5e [PPC] Replace debug value skipping with getLastNonDebugInstr.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240641 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 13:39:03 +00:00
Joseph Tremoulet
fb51095c4b [ORC] Add ObjectTransformLayer
Summary:
This is a utility for clients that want to insert a layer that modifies
each ObjectFile and then passes it along to the next layer.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240640 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 13:35:22 +00:00
Benjamin Kramer
2f6d58ae0d Replace copy-pasted debug value skipping with MBB::getLastNonDebugInstr
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240639 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 13:28:24 +00:00
Toma Tabacu
3b503894c2 [mips] [IAS] Refactor the emitDirectiveModuleFP() functions. NFC.
Summary:
Simplify emitDirectiveModuleFP() by having it just print the current information
from MipsABIFlagsSection and doing an updateABIInfo() before such calls.

This prevents us from forgetting to update the STI.FeatureBits,
because updateABIInfo() uses those to update the MipsABIFlagsSection object,
and also makes sure we use the update mechanism from MipsABIFlagsSection.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits, mpf

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240637 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 12:44:38 +00:00
Artur Pilipenko
f2e7bb5d2f Take alignment into account in isSafeToLoadUnconditionally
Reviewed By: hfinkel

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240636 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 12:18:43 +00:00
Ulrich Weigand
01381b0e95 [SystemZ] Only attempt RxSBG optimization for integer types
As pointed out by Justin Bogner (see r240520), SystemZDAGToDAGISel::Select
currently attempts to convert boolean operations into RxSBG even on some
non-integer types (in particular, vector types).  This would not work in
any case, and it happened to trigger undefined behaviour in allOnes.

This patch verifies that we have a (<= 64-bit) integer type before
attempting to perform this optimization.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240634 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 11:52:36 +00:00
Toma Tabacu
f03400827b [mips] [IAS] Refactor the emitDirectiveModuleOddSPReg() functions. NFC.
Summary:
We can simplify emitDirectiveModuleOddSPReg() by having it print the current OddSPReg information
from MipsABIFlagsSection and doing an updateABIInfo() before such calls.

This prevents us from forgetting to update the STI.FeatureBits, because updateABIInfo() uses those to update the MipsABIFlagsSection object,
and also makes sure we use the update mechanism from MipsABIFlagsSection.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits, mpf

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240630 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 10:56:57 +00:00
Pawel Bylica
b4a6282e4b Add missing <array> include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240629 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 10:47:08 +00:00
Jay Foad
0ee17729e5 Teach LLVM about the PPC64 memory sanitizer implementation.
Summary:
This is the LLVM part of the PPC memory sanitizer implementation in
D10648.

Reviewers: kcc, samsonov, willschm, wschmidt, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 10:34:29 +00:00
Pawel Bylica
780a0c9266 Express APInt::{s,u}{l,g}e(uint64_t) in terms of APInt::{s,u}{l,g}t(uint64_t). NFC.
This is preparation for http://reviews.llvm.org/D10655: Change APInt comparison with uint64_t.
Some unit tests added also.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240626 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 10:23:52 +00:00
Toma Tabacu
e39f000353 [mips] [IAS] Fix parsing of memory offset expressions with parenthesis depth >1.
Summary:
In an expression such as "(((a+b)+c)+d)", parseParenExpression() would only parse the "a+b)+c", which would result in an error later on in the parser.
This means that we can only parse one level of inner parentheses.

In order to fix this, I added a new function called parseParenExprOfDepth(), which parses a specified number of trailing parenthesis expressions
(except for the outermost parenthesis), and changed MipsAsmParser to use it in parseMemOffset instead of parseParenExpression().

Reviewers: dsanders, rafael

Reviewed By: dsanders, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240625 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 09:52:02 +00:00
Ahmed Bougacha
eb78c2fbdf [X86] Accept hasAVX512() as well as hasFMA() when generating FMA.
We don't always have FMA, for example when using 'clang -mavx512f'
without an explicit CPU.

Also check for an explicit +avx512f instead of CPUs in a couple
related tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240616 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 00:44:46 +00:00
Ahmed Bougacha
cd07f777e6 [X86] Cleanup fma tests a little bit. NFC.
Reformat, isolate 213->231 xform, actually --check-prefix CHECK,
and deduplicate the FMA intrinsic tests (FMA3 in AMD-land).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240615 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 00:40:25 +00:00
Swaroop Sridhar
983b80cf02 Enable StackMap Serialization for COFF
Summary

This change turns on the emission of 
__LLVM_Stackmaps section when generating COFF binaries.

Test Plan

Added a scenario to the test case: 
test\CodeGen\X86\statepoint-stackmap-format.ll.

Code Review:

http://reviews.llvm.org/D10680



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240613 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 00:28:42 +00:00
Rui Ueyama
7d6e44bde8 libObject/COFF: Add a function to get pointers to relocation entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240610 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25 00:07:39 +00:00
Duncan P. N. Exon Smith
a0b4ef1f70 Add simplify_type<const WeakVH>; simplify IndVarSimplify
r240214 fixed some UB in IndVarSimplify, and it needed a temporary
`WeakVH` to do it.  Add `simplify_type<const WeakVH>` so that this
temporary isn't necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240599 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 22:23:21 +00:00
Douglas Katzman
72260ba601 [X86] Simplify some stuff in X86DisassemblerDecoder. NFC
- Deciding that insn->sibIndex is SIB_INDEX_NONE does not require another
check beyond the fully decoded bits being equal to 0x4.
The expression insn->sibIndex == SIB_INDEX_sib could not have been true unless
index were 0x4, because SIB_INDEX_sib is merely the range base (SIB_INDEX_EAX)
plus 4. Respectively SIB_INDEX_sib64.

- Don't use a switch statement to perform left-shift.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240598 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 22:04:55 +00:00
David Majnemer
12bb40b2ab [GVN] Intersect the IR flags when CSE'ing two instructions
We performed a simple, but incomplete, intersection when it came time to
CSE instructions.  It didn't handle, for example, the 'exact' flag.

This fixes PR23922.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240595 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 21:52:25 +00:00
Douglas Katzman
e40e848767 Spelling fixes in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240594 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 21:46:53 +00:00
David Majnemer
95a741163f [Reassociate] Don't propogate flags when creating negations
Reassociate mutated existing instructions in order to form negations
which would create additional reassociate opportunities.

This fixes PR23926.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240593 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 21:27:36 +00:00
Sanjay Patel
613afa1372 fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240592 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 20:42:33 +00:00
Sanjay Patel
473e5d658e don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240591 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 20:40:57 +00:00
Akira Hatanaka
45dc32257e [If Converter] Convert recursion to iteration.
This commit makes changes to IfConverter::AnalyzeBlock to use iteration instead
of recursion. Previously, this function would get called recursively a large
number of times and eventually segfault when a function with the following CFG
was compiled:

BB0:
 if (condition0)
  goto BB1
 goto BB2
BB1:
 goto BB2
BB2:
 if (condition1)
  goto BB3
 goto BB4
BB3:
...
(repeat until BB7488)

rdar://problem/21386145

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240589 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 20:34:35 +00:00
Pete Cooper
f79d253a3e Devirtualize Instruction::clone_impl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240588 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 20:22:23 +00:00
Jingyue Wu
58f8a138a9 Add NVPTXPeephole pass to reduce unnecessary address cast
Summary:
This patch first change the register that holds local address for stack
frame to %SPL. Then the new NVPTXPeephole pass will try to scan the
following pattern

   %vreg0<def> = LEA_ADDRi64 <fi#0>, 4
   %vreg1<def> = cvta_to_local %vreg0

and transform it into

   %vreg1<def> = LEA_ADDRi64 %VRFrameLocal, 4

Patched by Xuetian Weng

Test Plan: test/CodeGen/NVPTX/local-stack-frame.ll

Reviewers: jholewinski, jingyue

Reviewed By: jingyue

Subscribers: eliben, jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240587 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 20:20:16 +00:00
Sanjay Patel
8e5b874f17 fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240585 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 20:07:50 +00:00