Adrian Prantl [Thu, 25 Jun 2015 23:19:19 +0000 (23:19 +0000)]
Debug Info: Add basic test coverage for the DWARF encoding of bitfields.
While looking at a couple of bugs in the debug info output for bitfields
I noticed that there wasn't a single regression test to test my changes
against, so here's a start.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240717
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 25 Jun 2015 22:15:05 +0000 (22:15 +0000)]
DAGCombiner: Use pop_back_val()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240709
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 22:10:04 +0000 (22:10 +0000)]
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
Frederic Riss [Thu, 25 Jun 2015 21:57:33 +0000 (21:57 +0000)]
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
Michael J. Spencer [Thu, 25 Jun 2015 21:47:32 +0000 (21:47 +0000)]
[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
Duncan P. N. Exon Smith [Thu, 25 Jun 2015 21:42:46 +0000 (21:42 +0000)]
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
Sanjay Patel [Thu, 25 Jun 2015 21:11:08 +0000 (21:11 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240699
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 21:00:51 +0000 (21:00 +0000)]
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
Pete Cooper [Thu, 25 Jun 2015 20:51:38 +0000 (20:51 +0000)]
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
Rafael Espindola [Thu, 25 Jun 2015 20:20:19 +0000 (20:20 +0000)]
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
Jingyue Wu [Thu, 25 Jun 2015 20:14:47 +0000 (20:14 +0000)]
[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
Rafael Espindola [Thu, 25 Jun 2015 20:10:45 +0000 (20:10 +0000)]
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
Paul Robinson [Thu, 25 Jun 2015 19:37:13 +0000 (19:37 +0000)]
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
Yaron Keren [Thu, 25 Jun 2015 19:28:24 +0000 (19:28 +0000)]
Rangify for loop in Inliner.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240678
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Thu, 25 Jun 2015 18:48:26 +0000 (18:48 +0000)]
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
Matt Arsenault [Thu, 25 Jun 2015 18:47:02 +0000 (18:47 +0000)]
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
Peter Collingbourne [Thu, 25 Jun 2015 18:32:02 +0000 (18:32 +0000)]
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
Rafael Espindola [Thu, 25 Jun 2015 16:16:08 +0000 (16:16 +0000)]
Add a test for a recent regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240656
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 16:01:53 +0000 (16:01 +0000)]
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
Kit Barton [Thu, 25 Jun 2015 15:17:40 +0000 (15:17 +0000)]
[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
Bruno Cardoso Lopes [Thu, 25 Jun 2015 15:17:23 +0000 (15:17 +0000)]
[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
Jonathan Roelofs [Thu, 25 Jun 2015 15:06:47 +0000 (15:06 +0000)]
Doxygen-ify a few comments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240647
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 15:06:38 +0000 (15:06 +0000)]
Use computeSymbolSizes in llvm-symbolize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240646
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 15:00:38 +0000 (15:00 +0000)]
Use range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240645
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 14:39:35 +0000 (14:39 +0000)]
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
Benjamin Kramer [Thu, 25 Jun 2015 13:47:36 +0000 (13:47 +0000)]
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
Benjamin Kramer [Thu, 25 Jun 2015 13:39:03 +0000 (13:39 +0000)]
[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
Joseph Tremoulet [Thu, 25 Jun 2015 13:35:22 +0000 (13:35 +0000)]
[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
Benjamin Kramer [Thu, 25 Jun 2015 13:28:24 +0000 (13:28 +0000)]
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
Toma Tabacu [Thu, 25 Jun 2015 12:44:38 +0000 (12:44 +0000)]
[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
Artur Pilipenko [Thu, 25 Jun 2015 12:18:43 +0000 (12:18 +0000)]
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
Ulrich Weigand [Thu, 25 Jun 2015 11:52:36 +0000 (11:52 +0000)]
[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
Toma Tabacu [Thu, 25 Jun 2015 10:56:57 +0000 (10:56 +0000)]
[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
Pawel Bylica [Thu, 25 Jun 2015 10:47:08 +0000 (10:47 +0000)]
Add missing <array> include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240629
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Thu, 25 Jun 2015 10:34:29 +0000 (10:34 +0000)]
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
Pawel Bylica [Thu, 25 Jun 2015 10:23:52 +0000 (10:23 +0000)]
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
Toma Tabacu [Thu, 25 Jun 2015 09:52:02 +0000 (09:52 +0000)]
[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
Ahmed Bougacha [Thu, 25 Jun 2015 00:44:46 +0000 (00:44 +0000)]
[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
Ahmed Bougacha [Thu, 25 Jun 2015 00:40:25 +0000 (00:40 +0000)]
[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
Swaroop Sridhar [Thu, 25 Jun 2015 00:28:42 +0000 (00:28 +0000)]
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
Rui Ueyama [Thu, 25 Jun 2015 00:07:39 +0000 (00:07 +0000)]
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
Duncan P. N. Exon Smith [Wed, 24 Jun 2015 22:23:21 +0000 (22:23 +0000)]
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
Douglas Katzman [Wed, 24 Jun 2015 22:04:55 +0000 (22:04 +0000)]
[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
David Majnemer [Wed, 24 Jun 2015 21:52:25 +0000 (21:52 +0000)]
[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
Douglas Katzman [Wed, 24 Jun 2015 21:46:53 +0000 (21:46 +0000)]
Spelling fixes in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240594
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 24 Jun 2015 21:27:36 +0000 (21:27 +0000)]
[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
Sanjay Patel [Wed, 24 Jun 2015 20:42:33 +0000 (20:42 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240592
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 24 Jun 2015 20:40:57 +0000 (20:40 +0000)]
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
Akira Hatanaka [Wed, 24 Jun 2015 20:34:35 +0000 (20:34 +0000)]
[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
Pete Cooper [Wed, 24 Jun 2015 20:22:23 +0000 (20:22 +0000)]
Devirtualize Instruction::clone_impl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240588
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Wed, 24 Jun 2015 20:20:16 +0000 (20:20 +0000)]
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
Sanjay Patel [Wed, 24 Jun 2015 20:07:50 +0000 (20:07 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240585
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 24 Jun 2015 20:04:26 +0000 (20:04 +0000)]
Revert "(HEAD -> master, origin/master, origin/HEAD) opt: Add option to strip or add llvm value names"
Accidental commit
This reverts commit r240583.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240584
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 24 Jun 2015 20:03:33 +0000 (20:03 +0000)]
opt: Add option to strip or add llvm value names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240583
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 24 Jun 2015 20:03:27 +0000 (20:03 +0000)]
ARMLoadStoreOptimizer: Fix errata 602117 handling and make testcase actually test for it
This fixes PR23912
Differential Revision: http://reviews.llvm.org/D10620
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240582
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 24 Jun 2015 19:57:32 +0000 (19:57 +0000)]
Make computeSymbolSizes never fail.
On ELF that was already the case since getting the size of a symbol
never fails.
On MachO and COFF we could fail trying to get the section of a symbol. But
we don't really need the section, just the section number to know if two
symbols are in the same section or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240580
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 24 Jun 2015 19:56:10 +0000 (19:56 +0000)]
MIR Serialization: Serialize simple MachineRegisterInfo attributes.
This commit serializes the 3 scalar boolean attributes from the
MachineRegisterInfo class: IsSSA, TracksRegLiveness, and
TracksSubRegLiveness. These attributes are serialized as part
of the machine function YAML mapping.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10618
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240579
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 24 Jun 2015 19:32:52 +0000 (19:32 +0000)]
Use Symbol::getValue to simplify object::computeSymbolSizes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240575
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Wed, 24 Jun 2015 19:28:40 +0000 (19:28 +0000)]
[LSR] canonicalize Prod*(1<<C) to Prod<<C
Summary:
Because LSR happens at a late stage where mul of a power of 2 is
typically canonicalized to shl, this canonicalization emits code that
can be better CSE'ed.
Test Plan:
Transforms/LoopStrengthReduce/shl.ll shows how this change makes GVN more
powerful. Fixes some existing tests due to this change.
Reviewers: sanjoy, majnemer, atrick
Reviewed By: majnemer, atrick
Subscribers: majnemer, llvm-commits
Differential Revision: http://reviews.llvm.org/D10448
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240573
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 24 Jun 2015 19:27:53 +0000 (19:27 +0000)]
Use Symbol.getValue to simplify RuntimeDyldCOFF::getSymbolOffset. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240572
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 24 Jun 2015 19:11:10 +0000 (19:11 +0000)]
Add a SymbolRef::getValue.
This returns either the symbol offset or address. Since it is not defined which
one, it never has to lookup the section and so never fails.
I will add users in the next commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240569
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Wed, 24 Jun 2015 18:55:24 +0000 (18:55 +0000)]
Devirtualize Constant::replaceUsesOfWithOnConstant.
This is part of the work to devirtualize Value.
The old pattern was to call replaceUsesOfWithOnConstant which was overridden by
subclasses. Those could then call replaceUsesOfWithOnConstantImpl on Constant
to handle deleting the current value.
To be consistent with other parts of the code, this has been changed so that we
call the method on Constant, and that dispatches to an Impl on subclasses.
As part of this, it made sense to rename the methods to be more descriptive. The
new name is Constant::handleOperandChange, and it requires that all subclasses of
Constant implement handleOperandChangeImpl, even if they just throw an error if
they shouldn't be called.
Reviewed by Duncan Exon Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240567
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 24 Jun 2015 18:48:11 +0000 (18:48 +0000)]
AsmPrinter: Cleanup DIEValue::EmitValue() API, NFC
Stop taking a `dwarf::Form` in `DIEValue::EmitValue()` and
`DIEValue::SizeOf()`, since they're always passed `DIEValue::getForm()`
anyway. This is just left over from when `DIEValue` didn't know its own
form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240566
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 24 Jun 2015 18:14:41 +0000 (18:14 +0000)]
Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240563
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 24 Jun 2015 18:03:39 +0000 (18:03 +0000)]
Object: Add XFAILed test case for r239560.
We ought to also emit unmangled references to dllimported functions,
but no existing linker needs this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240562
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Wed, 24 Jun 2015 17:53:17 +0000 (17:53 +0000)]
[CaptureTracking] Avoid long compilation time on large basic blocks
CaptureTracking becomes very expensive in large basic blocks while
calling PointerMayBeCaptured. PointerMayBeCaptured scans the BB the
number of times equal to the number of uses of 'BeforeHere', which is
currently capped at 20 and bails out with Tracker->tooManyUses().
The bottleneck here is the number of calls to PointerMayBeCaptured * the
basic block scan. In a testcase with a 82k instruction BB,
PointerMayBeCaptured is called 130k times, leading to 'shouldExplore'
taking 527k runs, this currently takes ~12min.
To fix this we locally (within PointerMayBeCaptured) number the
instructions in the basic block using a DenseMap to cache instruction
positions/numbers. We build the cache incrementally every time we need
to scan an unexplored part of the BB, improving compile time to only
take ~2min.
This triggers in the flow: DeadStoreElimination -> MepDepAnalysis ->
CaptureTracking.
Side note: after multiple runs in the test-suite I've seen no
performance nor compile time regressions, but could note a couple of
compile time improvements:
Performance Improvements - Compile Time Delta Previous Current StdDev
SingleSource/Benchmarks/Misc-C++/bigfib -4.48% 0.8547 0.8164 0.0022
MultiSource/Benchmarks/TSVC/LoopRerolling-dbl/LoopRerolling-dbl -1.47% 1.3912 1.3707 0.0056
Differential Revision: http://reviews.llvm.org/D7010
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240560
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 24 Jun 2015 17:34:58 +0000 (17:34 +0000)]
MIR Serialization: Serialize the null register operands.
This commit serializes the null register machine operands.
It uses the '_' keyword to represent them, but the parser
also allows the '%noreg' named register syntax.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10580
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240558
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Wed, 24 Jun 2015 17:26:24 +0000 (17:26 +0000)]
[LoopVectorizer] Fix bailing-out condition for OptForSize case.
With option OptForSize enabled, the Loop Vectorizer is not supposed to
create tail loop. The condition checking that was invalid and was not
matching to the comment above.
Patch by Marianne Mailhot-Sarrasin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240556
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 24 Jun 2015 17:08:44 +0000 (17:08 +0000)]
Simplify the logic, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240554
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 24 Jun 2015 17:05:04 +0000 (17:05 +0000)]
ADTTests: merge #ifdef checks from r240436.
This commit merges the #ifdef and #ifndef checks into one #if, as
suggested by Duncan P. N. Exon Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240553
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 24 Jun 2015 14:48:54 +0000 (14:48 +0000)]
Don't get confused with sections whose section number is reserved.
It is perfectly possible for SHNDX to contain indexes that have the same value
as reserved st_shndx values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240544
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 24 Jun 2015 13:52:25 +0000 (13:52 +0000)]
[X86][AVX] Added full set of 256-bit vector shift tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240542
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 24 Jun 2015 13:25:57 +0000 (13:25 +0000)]
Eliminate additional redundant copies of Triple objects. NFC.
Subscribers: rafael, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D10654
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240540
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Wed, 24 Jun 2015 12:49:42 +0000 (12:49 +0000)]
Fix instruction scheduling live register tracking
Summary:
This patch fixes PR23405 (https://llvm.org/bugs/show_bug.cgi?id=23405).
During a node unscheduling an entry in LiveRegGens can be replaced with a new value. That corrupts the live reg tracking and LiveReg* structure is not cleared as should be during unscheduling. Problematic condition that enforces Gen replacement is `I->getSUnit()->getHeight() < LiveRegGens[I->getReg()]->getHeight()`. This condition should be checked only if LiveRegGen was set in current node unscheduling.
Test Plan: Regression test included.
Reviewers: hfinkel, atrick
Reviewed By: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9993
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240538
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Wed, 24 Jun 2015 11:49:44 +0000 (11:49 +0000)]
[llvm-stress] Simple refactoring and better style. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240534
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Wed, 24 Jun 2015 10:32:16 +0000 (10:32 +0000)]
[mips][microMIPS] Implement BREAK, EHB and EI instructions
http://reviews.llvm.org/D10090
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240531
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 24 Jun 2015 10:20:30 +0000 (10:20 +0000)]
Change how symbol sizes are handled in lib/Object.
COFF and MachO only define symbol sizes for common symbols. Reflect that
in the class hierarchy by having a method for common symbols only in the base
and a general one in ELF.
This avoids the need of using a magic value for the size, which had a few
problems
* Most callers didn't check for it.
* The ones that did could not tell the magic value from a file actually having
that value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240529
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 24 Jun 2015 10:06:29 +0000 (10:06 +0000)]
[ADT] Teach DenseMap to support StringRef keys.
While often you want to use something specialized like StringMap, when
the strings already have persistent storage a normal densemap over them
can be more efficient.
This can't go into StringRef.h because of really obnoxious header chains
from the hashing code to the endian detection code to CPU feature
detection code to StringMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240528
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 24 Jun 2015 07:03:07 +0000 (07:03 +0000)]
Hexagon: Paper over the undefined behaviour introduced by r238692
This stops shifting a 32-bit value by such absurd amounts as 96 and
120. We do this by dropping a call to the function that was doing this
entirely, which rather surprisingly doesn't break *any* tests.
I've also added an assert in the misbehaving function to prove that
it's no longer being called with completely invalid arguments.
This change looks pretty bogus and we should probably be reverting
r238692 instead, but this is hard to do with the number of follow ups
that have happened since. It can't be any worse than the undefined
behaviour that was happening before though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240526
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 24 Jun 2015 06:40:09 +0000 (06:40 +0000)]
MILexer.cpp: Try to fix a warning. [-Wsign-compare]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240525
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 24 Jun 2015 06:19:19 +0000 (06:19 +0000)]
[TableGen] Restore the use of the TheInit field in Record to cache the Record's DefInit. I broke this when I fixed memory leaks recently. Remove the DenseMap that mapped Record's to DefInit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240524
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Wed, 24 Jun 2015 06:07:41 +0000 (06:07 +0000)]
Do not treat ARM _MoveToCoprocessor* intrinsics as MSBuiltins.
Those builtins are now handled via ad-hoc code in clang with r240522 to
deal with reordering the arguments to fix PR22560.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240523
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 24 Jun 2015 06:00:53 +0000 (06:00 +0000)]
Hexagon: Avoid left shifting negative values (it's UB)
Found by ubsan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240521
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 24 Jun 2015 05:59:19 +0000 (05:59 +0000)]
SystemZ: Rephrase this allOnes calculation to avoid UB
This allOnes function hits undefined behaviour if Count is greater
than 64, but we can avoid that and simplify the calculation by just
saturating if such a value is passed in.
This comes up under ubsan becauseRxSBGOperands is sometimes created
with values that are 128 bits wide. Somebody more familiar with this
code should probably look into whether that's expected, as a 64 bit
mask may or may not be appropriate for such types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240520
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 24 Jun 2015 03:19:35 +0000 (03:19 +0000)]
Don't repeat name in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240516
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Wed, 24 Jun 2015 00:07:16 +0000 (00:07 +0000)]
[X86] Don't generate vbroadcasti128 for v4i64 splats from memory.
We used to erroneously match:
(v4i64 shuffle (v2i64 load), <0,0,0,0>)
Whereas vbroadcasti128 is more like:
(v4i64 shuffle (v2i64 load), <0,1,0,1>)
This problem doesn't exist for vbroadcastf128, which kept matching
the intrinsic after r231182. We should perhaps re-introduce the
intrinsic here as well, but that's a separate issue still being
discussed.
While there, add some proper vbroadcastf128 tests. We don't currently
match those, like for loading vbroadcastsd/ss on AVX (the reg-reg
broadcasts where added in AVX2).
Fixes PR23886.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240488
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Wed, 24 Jun 2015 00:05:07 +0000 (00:05 +0000)]
Remove unused GlobalVariable::replaceUsesOfWithOnConstant. NFC.
The only caller of this method is Value::replaceAllUsesWith which
explicitly checks that we are not a GlobalValue. So replace the
body with an unreachable to ensure that we never call it.
The unreachable itself is moved to GlobalValue not GlobalVariable
as that is the base class of all the globals we don't want to call
this method on.
Note, this patch is short lived as i'll soon refactor all callers
of this method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240486
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Wed, 24 Jun 2015 00:03:48 +0000 (00:03 +0000)]
[X86] update_llc_test_checks vector-shuffle-*. NFC.
Some of them had gone stale.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240485
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 Jun 2015 23:42:28 +0000 (23:42 +0000)]
MIR Serialization: Serialize immediate machine operands.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10573
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240481
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 23 Jun 2015 23:26:22 +0000 (23:26 +0000)]
fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240480
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 23 Jun 2015 23:05:08 +0000 (23:05 +0000)]
don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240478
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Tue, 23 Jun 2015 22:52:19 +0000 (22:52 +0000)]
Add "-mcpu=" option to llvm-rtdyld
This patch adds the -mcpu= option to llvm-rtdyld. With this option, one
can test relocations for different types of CPUs (e.g. Mips64r6).
Patch by Vladimir Radosavljevic.
Differential Revision: http://reviews.llvm.org/D10503
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240477
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 Jun 2015 22:39:23 +0000 (22:39 +0000)]
MIR Parser: Use correct source locations for machine instruction diagnostics.
This commit translates the source locations for MIParser diagnostics from
the locations in the machine instruction string to the locations in the
MIR file.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10574
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240474
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Tue, 23 Jun 2015 21:55:11 +0000 (21:55 +0000)]
Devirtualize Constant::destroyConstant.
This reorganizes destroyConstant and destroyConstantImpl.
Now there is only destroyConstant in Constant itself, while
subclasses are required to implement destroyConstantImpl.
destroyConstantImpl no longer calls delete but is instead only
responsible for removing the constant from any maps in which it
is contained.
Reviewed by Duncan Exon Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240471
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 23 Jun 2015 21:18:15 +0000 (21:18 +0000)]
[X86][SSE] Added full set of 128-bit vector shift tests.
Removed some old duplicate tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240465
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Tue, 23 Jun 2015 21:00:08 +0000 (21:00 +0000)]
Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.
Currently some users of this function do this explicitly, and all the
rest forget to do this.
ThreadSanitizer was one of such users, and had missing debug
locations for calls into TSan runtime handling atomic operations,
eventually leading to poorly symbolized stack traces and malfunctioning
suppressions.
This is another change relevant to PR23837.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240460
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 23 Jun 2015 20:57:26 +0000 (20:57 +0000)]
Pass 2 more variables to lit tests.
Pass ADB and ADB_SERIAL environment variables to lit tests.
This would allow running Android tests in compiler-rt when
there is more than one device attached to the host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240459
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 23 Jun 2015 20:09:03 +0000 (20:09 +0000)]
Revert "[FaultMaps] Move FaultMapParser to Object/"
This reverts commit r240364 (git
c49542e5bb186). The issue r240364 was
trying to fix was fixed independently in r240362.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240448
91177308-0d34-0410-b5e6-
96231b3b80d8
Steven Wu [Tue, 23 Jun 2015 18:56:48 +0000 (18:56 +0000)]
Adding the missing LTO API to lto.exports
Summary:
lto_codegen_set_should_embed_uselists is introduced in r235943 but not
added to lto.exports. Add to export list to expose the API.
Reviewers: dexonsmith
Subscribers: rafael, llvm-commits
Differential Revision: http://reviews.llvm.org/D10658
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240442
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 23 Jun 2015 18:34:25 +0000 (18:34 +0000)]
Don't pass a 32 bit value to "%08" PRIx64.
Should fix the arm bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240439
91177308-0d34-0410-b5e6-
96231b3b80d8