oota-llvm.git
9 years agoAdding profile and version parsers to ARMTargetParser
Renato Golin [Fri, 22 May 2015 18:17:55 +0000 (18:17 +0000)]
Adding profile and version parsers to ARMTargetParser

This allows us to match armv6m to default to thumb, but will also be used by
Clang's driver and remove the current incomplete copy in it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238036 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReapply r238011 with a fix for the trap instruction.
Quentin Colombet [Fri, 22 May 2015 18:10:47 +0000 (18:10 +0000)]
Reapply r238011 with a fix for the trap instruction.
The problem was that I slipped a change required for shrink-wrapping, namely I
used getFirstTerminator instead of the getLastNonDebugInstr that was here before
the refactoring, whereas the surrounding code is not yet patched for that.

Original message:
[X86] Refactor the prologue emission to prepare for shrink-wrapping.

- Add a late pass to expand pseudo instructions (tail call and EH returns).
 Instead of doing it in the prologue emission.
- Factor some static methods in X86FrameLowering to ease code sharing.

NFC.

Related to <rdar://problem/20821487>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238035 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Unroll] Separate the logic for testing each iteration of the loop,
Chandler Carruth [Fri, 22 May 2015 17:41:35 +0000 (17:41 +0000)]
[Unroll] Separate the logic for testing each iteration of the loop,
accumulating estimated cost, and other loop-centric logic from the logic
used to analyze instructions in a particular iteration.

This makes the visitor very narrow in scope -- all it does is visit
instructions, update a map of simplified values, and return whether it
is able to optimize away a particular instruction.

The two cost metrics are now returned as an optional struct. When the
optional is left unengaged, there is no information about the unrolled
cost of the loop, when it is engaged the cost metrics are available to
run against the thresholds.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238033 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PPC64] Add support for clrbhrb, mfbhrbe, rfebb.
Bill Schmidt [Fri, 22 May 2015 16:44:10 +0000 (16:44 +0000)]
[PPC64] Add support for clrbhrb, mfbhrbe, rfebb.

This patch adds support for the ISA 2.07 additions involving the
branch history rolling buffer and event-based branching.  These will
not be used by typical applications, so built-in support is not
required.  They will only be available via inline assembly.

Assembly/disassembly tests are included in the patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238032 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoStop inventing symbol sizes.
Rafael Espindola [Fri, 22 May 2015 15:43:00 +0000 (15:43 +0000)]
Stop inventing symbol sizes.

MachO and COFF quite reasonably only define the size for common symbols.

We used to try to figure out the "size" by computing the gap from one symbol to
the next.

This would not be correct in general, since a part of a section can belong to no
visible symbol (padding, private globals).

It was also really expensive, since we would walk every symbol to find the size
of one.

If a caller really wants this, it can sort all the symbols once and get all the
gaps ("size") in O(n log n) instead of O(n^2).

On MachO this also has the advantage of centralizing all the checks for an
invalid n_sect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238028 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoremove names from comments, fix typos; NFC
Sanjay Patel [Fri, 22 May 2015 15:38:24 +0000 (15:38 +0000)]
remove names from comments, fix typos; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238027 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agofix typo, 80-col; NFC
Sanjay Patel [Fri, 22 May 2015 15:32:33 +0000 (15:32 +0000)]
fix typo, 80-col; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238026 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agofix typo in comment; NFC
Sanjay Patel [Fri, 22 May 2015 15:31:47 +0000 (15:31 +0000)]
fix typo in comment; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238025 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDetect invalid section indexes when we first read them.
Rafael Espindola [Fri, 22 May 2015 14:59:27 +0000 (14:59 +0000)]
Detect invalid section indexes when we first read them.

We still detect the same errors, but now we do it earlier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238024 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] Fix typo in subtarget feature list for 7em triple
John Brawn [Fri, 22 May 2015 14:16:22 +0000 (14:16 +0000)]
[ARM] Fix typo in subtarget feature list for 7em triple

The list of subtarget features for the 7em triple contains 't2xtpk',
which actually disables that subtarget feature. Correct that to
'+t2xtpk' and test that the instructions enabled by that feature do
actually work.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238022 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix llvm-nm -S option.
Rafael Espindola [Fri, 22 May 2015 13:28:35 +0000 (13:28 +0000)]
Fix llvm-nm -S option.

It is explicitly documented to have no effect on object formats where symbols
don't have sizes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238019 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake this test stricter. NFC.
Rafael Espindola [Fri, 22 May 2015 13:17:31 +0000 (13:17 +0000)]
Make this test stricter. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238018 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReapply part of r237975, "Fix Clang -Wmissing-override warning", except for DIContext...
NAKAMURA Takumi [Fri, 22 May 2015 10:11:07 +0000 (10:11 +0000)]
Reapply part of r237975, "Fix Clang -Wmissing-override warning", except for DIContext.h, to apease g++-4.7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238012 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "[X86] Fix a variable name for r237977 so that it works with every compilers."
Tamas Berghammer [Fri, 22 May 2015 10:01:56 +0000 (10:01 +0000)]
Revert "[X86] Fix a variable name for r237977 so that it works with every compilers."
Revert "[X86] Refactor the prologue emission to prepare for shrink-wrapping."

This reverts commit 6b3b93fc8b68a2c806aa992ee4bd3d7f61898d4b.
This reverts commit ab0b15dff8539826283a59c2dd700a18a9680e0f.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238011 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCompile time improvements to VirtRegRewriter.
Puyan Lotfi [Fri, 22 May 2015 08:11:26 +0000 (08:11 +0000)]
Compile time improvements to VirtRegRewriter.

This change to VirtRegRewriter::addMBBLiveIns adds live-in registers for each
MachineBasicBlock's LiveIns set without isLiveIn checks as they are being added
because doing so is expensive. After all live-in registers are added, the LiveIn
vectors are sorted and uniqued.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238008 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r237954, "Resubmit r237708 (MIR Serialization: print and parse LLVM IR using...
NAKAMURA Takumi [Fri, 22 May 2015 07:17:07 +0000 (07:17 +0000)]
Revert r237954, "Resubmit r237708 (MIR Serialization: print and parse LLVM IR using MIR format)."

It brought cyclic dependencies between LLVMCodeGen and LLVMMIR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238007 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMC: Shave a pointer off of MCSymbol::Name
Duncan P. N. Exon Smith [Fri, 22 May 2015 06:04:42 +0000 (06:04 +0000)]
MC: Shave a pointer off of MCSymbol::Name

Shave a pointer off of `MCSymbolName` by storing `StringMapEntry<bool>*`
instead of `StringRef`.  This brings `sizeof(MCSymbol)` down to 64 on
64-bit platforms, a nice round number.  My profile showed memory
dropping from 914 MB down to 908 MB, roughly 0.7%.  Other than memory
usage, no functionality change here.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238005 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Fix Clang -Wmissing-override warning"
Tobias Grosser [Fri, 22 May 2015 06:01:04 +0000 (06:01 +0000)]
Revert "Fix Clang -Wmissing-override warning"

This reverts commit r237975. This seems also to break with gcc 4.7

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238004 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMC: Pack MCSymbol::Index in with the bitfield in MCSymbol
Duncan P. N. Exon Smith [Fri, 22 May 2015 05:59:05 +0000 (05:59 +0000)]
MC: Pack MCSymbol::Index in with the bitfield in MCSymbol

Save a pointer for each `MCSymbol`, bringing `llc` memory usage down
from 920 MB to 914 MB, around ~0.6%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238003 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMC: Lift MCSymbolData::Index up to MCSymbol::Index, NFC
Duncan P. N. Exon Smith [Fri, 22 May 2015 05:54:01 +0000 (05:54 +0000)]
MC: Lift MCSymbolData::Index up to MCSymbol::Index, NFC

Lift `MCSymbolData::Index` up a level to `MCSymbol`, as preparation for
packing it into the bitfield in `MCSymbol`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238001 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert part of r237975, "Fix Clang -Wmissing-override warning" in DIContext.h, to...
NAKAMURA Takumi [Fri, 22 May 2015 05:52:50 +0000 (05:52 +0000)]
Revert part of r237975, "Fix Clang -Wmissing-override warning" in DIContext.h, to appease g++-4.7.

  llvm/include/llvm/DebugInfo/DIContext.h:144:11: error:   overriding ‘virtual llvm::LoadedObjectInfo::~LoadedObjectInfo() noexcept (true)’

It seems the destructor in the base class may not be "default".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238000 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSDAG: Give SDDbgValues their own allocator (and reset it)
Duncan P. N. Exon Smith [Fri, 22 May 2015 05:45:19 +0000 (05:45 +0000)]
SDAG: Give SDDbgValues their own allocator (and reset it)

Previously `SDDbgValue`s used the general allocator that lives for all
of `SelectionDAG`.  Instead, give them their own allocator, and reset it
whenever `SDDbgInfo::clear()` is called, plugging a spiritual leak.

This drops `SelectionDAGBuilder::visitIntrinsicCall()` off of my heap
profile (was at around 2% of `llc` for codegen of `-flto -g`).  Thanks
to Pete Cooper for spotting the problem and suggesting the fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237998 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSDAG: Cleanup initialization of SDDbgValue, NFC
Duncan P. N. Exon Smith [Fri, 22 May 2015 05:35:53 +0000 (05:35 +0000)]
SDAG: Cleanup initialization of SDDbgValue, NFC

Cleanup how `SDDbgValue` is initialized, and rearrange the fields to
save two pointers in the struct layout.  No real functionality change
though (and I doubt the memory savings would show up in a profile).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237997 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "unique_ptrify LoadedObjectInfo::clone"
Tobias Grosser [Fri, 22 May 2015 05:33:54 +0000 (05:33 +0000)]
Revert "unique_ptrify LoadedObjectInfo::clone"

This reverts commit r237976, which seems to break existing gcc 4.7 buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237996 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[InstSimplify] Handle some overflow intrinsics in InstSimplify
David Majnemer [Fri, 22 May 2015 03:56:46 +0000 (03:56 +0000)]
[InstSimplify] Handle some overflow intrinsics in InstSimplify

This change does a few things:
- Move some InstCombine transforms to InstSimplify
- Run SimplifyCall from within InstCombine::visitCallInst
- Teach InstSimplify to fold [us]mul_with_overflow(X, undef) to 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237995 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Unroll] Replace a hand-wavy FIXME with a FIXME that explains the actual
Chandler Carruth [Fri, 22 May 2015 03:07:28 +0000 (03:07 +0000)]
[Unroll] Replace a hand-wavy FIXME with a FIXME that explains the actual
problem instead of suggesting doing something that is trivial to do but
incorrect given the current design of the libraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237994 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Unroll] Extract the logic for caching SCEV-modeled GEPs with their
Chandler Carruth [Fri, 22 May 2015 03:02:22 +0000 (03:02 +0000)]
[Unroll] Extract the logic for caching SCEV-modeled GEPs with their
simplified model for use simulating each iteration into a separate
helper function that just returns the cache.

Building this cache had nothing to do with the rest of the unroll
analysis and so this removes an unnecessary coupling, etc. It should
also make it easier to think about the concept of providing fast cached
access to basic SCEV models as an orthogonal concept to the overall
unroll simulation.

I'd really like to see this kind of caching logic folded into SCEV
itself, it seems weird for us to provide it at this layer rather than
making repeated queries into SCEV fast all on their own.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237993 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Unroll] Refactor the accumulation of optimized instruction costs into
Chandler Carruth [Fri, 22 May 2015 02:47:29 +0000 (02:47 +0000)]
[Unroll] Refactor the accumulation of optimized instruction costs into
a single location.

This reduces code duplication a bit and will also pave the way for
a better separation between the visitation algorithm and the unroll
analysis.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237990 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LICM] Sinking doesn't involve the preheader
Philip Reames [Fri, 22 May 2015 02:14:05 +0000 (02:14 +0000)]
[LICM] Sinking doesn't involve the preheader

PR23608 pointed out that using the preheader to gain a context instruction isn't always legal because a loop might not have a preheader.  When looking into that, I realized that using the preheader to determine legality for sinking is questionable at best.  Given no test covers that case and the original commit didn't seem to intend it, I restructured the code to only ask context sensative queries for hoising of loads and stores.  This is effectively a partial revert of 237593.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237985 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r236894 "[BasicAA] Fix zext & sext handling"
Hans Wennborg [Fri, 22 May 2015 01:27:37 +0000 (01:27 +0000)]
Revert r236894 "[BasicAA] Fix zext & sext handling"

This seems to have caused PR23626: Clang miscompiles webkit's base64 decoder

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237984 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Fix a variable name for r237977 so that it works with every compilers.
Quentin Colombet [Fri, 22 May 2015 00:41:03 +0000 (00:41 +0000)]
[X86] Fix a variable name for r237977 so that it works with every compilers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237980 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMergedLoadStoreMotion preserves MemoryDependenceAnalysis, it does not require it.
Daniel Berlin [Fri, 22 May 2015 00:13:05 +0000 (00:13 +0000)]
MergedLoadStoreMotion preserves MemoryDependenceAnalysis, it does not require it.
(It already was coded assuming it can sometimes be null, so no other changes are necessary)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237978 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Refactor the prologue emission to prepare for shrink-wrapping.
Quentin Colombet [Fri, 22 May 2015 00:12:31 +0000 (00:12 +0000)]
[X86] Refactor the prologue emission to prepare for shrink-wrapping.

- Add a late pass to expand pseudo instructions (tail call and EH returns).
  Instead of doing it in the prologue emission.
- Factor some static methods in X86FrameLowering to ease code sharing.

NFC.

Related to <rdar://problem/20821487>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237977 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agounique_ptrify LoadedObjectInfo::clone
David Blaikie [Fri, 22 May 2015 00:05:05 +0000 (00:05 +0000)]
unique_ptrify LoadedObjectInfo::clone

As noted in the original review, this is unused in tree & is used by
Julia... that's problematic. This API coudl easily be deleted/modified
by accident without any validation that it remains correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237976 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix Clang -Wmissing-override warning
David Blaikie [Fri, 22 May 2015 00:00:00 +0000 (00:00 +0000)]
Fix Clang -Wmissing-override warning

& remove the duplication by introducing a CRTP base to implement the
clone behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237975 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PPC] Correct iterator bug in PPCTLSDynamicCall
Hal Finkel [Thu, 21 May 2015 23:45:49 +0000 (23:45 +0000)]
[PPC] Correct iterator bug in PPCTLSDynamicCall

Unfortunately, I can't reduce a small test case for this (although compiling
mpfr-3.1.2 with -O2 -mcpu=a2 would fairly reliably trigger a crash), but the
problem is fairly clear (at least once you know you're looking for one). If the
TLS instruction being replaced was at the end of the block, we'd increment the
iterator past it (so it would then point to MBB.end()), and then we'd increment
it again as part of the for statement, thus overrunning the end of the list.
Don't do that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237974 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r237590, "ARM: allow jump tables to be placed as constant islands."
Peter Collingbourne [Thu, 21 May 2015 23:20:55 +0000 (23:20 +0000)]
Revert r237590, "ARM: allow jump tables to be placed as constant islands."

Caused a miscompile of the Android port of Chromium, details
forthcoming.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237972 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[NaryReassoc] reassociate GEP for CSE
Jingyue Wu [Thu, 21 May 2015 23:17:30 +0000 (23:17 +0000)]
[NaryReassoc] reassociate GEP for CSE

Summary:
x = &a[i];
y = &a[i + j];

=>

y = x + j;

along with some refactoring work such as extracting method
findClosestMatchingDominator.

Depends on D9786 which provides the ScalarEvolution::getGEPExpr interface.

Test Plan: nary-gep.ll

Reviewers: meheff, broune

Reviewed By: broune

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237971 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Support] Fix ErrorOr equality operator.
Michael J. Spencer [Thu, 21 May 2015 23:15:00 +0000 (23:15 +0000)]
[Support] Fix ErrorOr equality operator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237970 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agofix typos, remove function names from comments, NFC
Sanjay Patel [Thu, 21 May 2015 23:04:44 +0000 (23:04 +0000)]
fix typos, remove function names from comments, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237969 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[InstCombine] X - 0 is equal to X, not undef
David Majnemer [Thu, 21 May 2015 23:04:21 +0000 (23:04 +0000)]
[InstCombine] X - 0 is equal to X, not undef

A refactoring made @llvm.ssub.with.overflow.i32(i32 %X, i32 0) transform
into undef instead of %X.

This fixes PR23624.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237968 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse Op<0> accessor instead of OperandList for Instructions. NFC
Pete Cooper [Thu, 21 May 2015 22:48:54 +0000 (22:48 +0000)]
Use Op<0> accessor instead of OperandList for Instructions.  NFC

This is consistent with other uses of the operand list.  I'm planning a future commit where this will actually matter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237967 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse new MachineInstr mayLoadOrStore() API.
Chad Rosier [Thu, 21 May 2015 21:59:57 +0000 (21:59 +0000)]
Use new MachineInstr mayLoadOrStore() API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237965 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[InlineSpiller] Fix rematerialization for bundles.
Quentin Colombet [Thu, 21 May 2015 21:41:55 +0000 (21:41 +0000)]
[InlineSpiller] Fix rematerialization for bundles.

Prior to this patch, we could update the operand of another MI in the same
bundle.

Longer version:
Before InlineSpiller rematerializes a vreg, it iterates over operands of each MI
in a bundle, collecting all (MI, OpNo) pairs that reference that vreg.

Then if it does rematerialize, it goes through the pair list and replaces the
operands with the new (rematerialized) vreg.  The problem is, it tries to
replace all of these operands in the main MI ! This works fine for single MIs.
However, if we are processing a bundle of MIs and the list contains multiple
pairs - the rematerialization will either crash trying to access a non-existing
operand of the main MI, or silently corrupt one of the existing ones. It will
also ignore other MIs in the bundle.

The obvious fix is to use the MI pointers saved in collected (MI, OpNo) pairs.
This must have been the original intent of the pair list but somehow these
pointers got lost.

Patch by Dmitri Shtilman <dshtilman@icloud.com>!

Differential revision: http://reviews.llvm.org/D9904

<rdar://problem/21002163>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237964 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AArch64] Enhance the load/store optimizer with target-specific alias analysis.
Chad Rosier [Thu, 21 May 2015 21:36:46 +0000 (21:36 +0000)]
[AArch64] Enhance the load/store optimizer with target-specific alias analysis.

Phabricator: http://reviews.llvm.org/D9863

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237963 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agofix typo in comment; NFC
Sanjay Patel [Thu, 21 May 2015 21:29:13 +0000 (21:29 +0000)]
fix typo in comment; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237962 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake it easier to use DwarfContext with MCJIT
Keno Fischer [Thu, 21 May 2015 21:24:32 +0000 (21:24 +0000)]
Make it easier to use DwarfContext with MCJIT

Summary:
This supersedes http://reviews.llvm.org/D4010, hopefully properly
dealing with the JIT case and also adds an actual test case.
DwarfContext was basically already usable for the JIT (and back when
we were overwriting ELF files it actually worked out of the box by
accident), but in order to resolve relocations correctly it needs
to know the load address of the section.
Rather than trying to get this out of the ObjectFile or requiring
the user to create a new ObjectFile just to get some debug info,
this adds the capability to pass in that info directly.
As part of this I separated out part of the LoadedObjectInfo struct
from RuntimeDyld, since it is now required at a higher layer.

Reviewers: lhames, echristo

Reviewed By: echristo

Subscribers: vtjnash, friss, rafael, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237961 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPut GEPOperator member function definition in the appropriate .cpp file
David Blaikie [Thu, 21 May 2015 21:17:12 +0000 (21:17 +0000)]
Put GEPOperator member function definition in the appropriate .cpp file

Last commit put it in Constants.cpp instead of Operator.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237960 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Allow gep_type_iterator to work with the pointee type from...
David Blaikie [Thu, 21 May 2015 21:12:43 +0000 (21:12 +0000)]
[opaque pointer type] Allow gep_type_iterator to work with the pointee type from the GEP instruction

The raw non-instruction/constant form of this is still relying on being
able to access the pointee type from a pointer type - those will be
cleaned up later. For now, just focus on the cases where the pointee
type is easily accessible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237958 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoStop forwarding (get|set)Aligment from MCSectionData to MCSection.
Rafael Espindola [Thu, 21 May 2015 21:02:35 +0000 (21:02 +0000)]
Stop forwarding (get|set)Aligment from MCSectionData to MCSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237956 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MachineInstr] Add mayLoadOrStore API. NFC.
Chad Rosier [Thu, 21 May 2015 21:00:30 +0000 (21:00 +0000)]
[MachineInstr] Add mayLoadOrStore API. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237955 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoResubmit r237708 (MIR Serialization: print and parse LLVM IR using MIR format).
Alex Lorenz [Thu, 21 May 2015 20:54:45 +0000 (20:54 +0000)]
Resubmit r237708 (MIR Serialization: print and parse LLVM IR using MIR format).

This commit is a 2nd attempt at committing the initial MIR serialization patch.
The first commit (r237708) made the incremental buildbots unstable and was
reverted in r237730. The original commit didn't add a terminating null
character to the LLVM IR source which was passed to LLParser, and this
sometimes caused the test 'llvmIR.mir' to fail with a parsing error because
the LLVM IR source didn't have a null character immediately after the end
and thus LLLexer encountered some garbage characters that ultimately caused
the error.

This commit also includes the other test fixes I committed in
r237712 (llc path fix) and r237723 (remove target triple) which
also got reverted in r237730.

--Original Commit Message--

MIR Serialization: print and parse LLVM IR using MIR format.

This commit is the initial commit for the MIR serialization project.
It creates a new library under CodeGen called 'MIR'. This new
library adds a new machine function pass that prints out the LLVM IR
using the MIR format. This pass is then added as a last pass when a
'stop-after' option is used in llc. The new library adds the initial
functionality for parsing of MIR files as well. This commit also
extends the llc tool so that it can recognize and parse MIR input files.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun, Philip Reames

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237954 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PPC64] Handle vpkudum mask pattern correctly when vpkudum isn't available
Bill Schmidt [Thu, 21 May 2015 20:48:49 +0000 (20:48 +0000)]
[PPC64] Handle vpkudum mask pattern correctly when vpkudum isn't available

My recent patch to add support for ISA 2.07 vector pack/unpack
instructions didn't properly check for availability of the vpkudum
instruction when recognizing it as a special vector shuffle case.
This causes us to leave the vector shuffle in place (rather than
converting it to a vector permute) so that it can be recognized later
as a vpkudum, but that pattern is invalid for processors prior to
POWER8.  Thus LLVM crashes with an "unable to select" message.  We
observed this since one of our buildbots is configured to generate
code for a POWER7.

This patch fixes the problem by checking for availability of the
vpkudum instruction during custom lowering of vector shuffles.

I've added a test case variant for the vpkudum pattern when the
instruction isn't available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237952 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoStop creating MCSectionData is the ELF writer.
Rafael Espindola [Thu, 21 May 2015 20:43:13 +0000 (20:43 +0000)]
Stop creating MCSectionData is the ELF writer.

Now is is just its use of MCSymbolData that requires it to take a non const
MCAssembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237951 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[lib/Fuzzer] ignore flags that start with --; use git pull --rebase instead of just...
Kostya Serebryany [Thu, 21 May 2015 20:39:13 +0000 (20:39 +0000)]
[lib/Fuzzer] ignore flags that start with --; use git pull --rebase instead of just git pull

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237950 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR / debug info: Add a DWOId field to DICompileUnit,
Adrian Prantl [Thu, 21 May 2015 20:37:30 +0000 (20:37 +0000)]
IR / debug info: Add a DWOId field to DICompileUnit,
so DWARF skeleton CUs can be expression in IR. A skeleton CU is a
(typically empty) DW_TAG_compile_unit that has a DW_AT_(GNU)_dwo_name and
a DW_AT_(GNU)_dwo_id attribute. It is used to refer to external debug info.

This is a prerequisite for clang module debugging as discussed in
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/040076.html.
In order to refer to external types stored in split DWARF (dwo) objects,
such as clang modules, we need to emit skeleton CUs, which identify the
dwarf object (i.e., the clang module) by filename (the SplitDebugFilename)
and a hash value, the dwo_id.

This patch only contains the IR changes. The idea is that a CUs with a
non-zero dwo_id field will be emitted together with a DW_AT_GNU_dwo_name
and DW_AT_GNU_dwo_id attribute.

http://reviews.llvm.org/D9488
rdar://problem/20091852

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237949 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PPC/LoopUnrollRuntime] Don't avoid high-cost trip count computation on the PPC/A2
Hal Finkel [Thu, 21 May 2015 20:30:23 +0000 (20:30 +0000)]
[PPC/LoopUnrollRuntime] Don't avoid high-cost trip count computation on the PPC/A2

On X86 (and similar OOO cores) unrolling is very limited, and even if the
runtime unrolling is otherwise profitable, the expense of a division to compute
the trip count could greatly outweigh the benefits. On the A2, we unroll a lot,
and the benefits of unrolling are more significant (seeing a 5x or 6x speedup
is not uncommon), so we're more able to tolerate the expense, on average, of a
division to compute the trip count.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237947 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agowriteSymbolTable now only needs a MCContext.
Rafael Espindola [Thu, 21 May 2015 19:54:44 +0000 (19:54 +0000)]
writeSymbolTable now only needs a MCContext.

It used to use an MCAssembler just to record the alignment of the sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237944 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPass a const MCAssembler to writeSectionHeader.
Rafael Espindola [Thu, 21 May 2015 19:46:39 +0000 (19:46 +0000)]
Pass a const MCAssembler to writeSectionHeader.

It never creates sections, so it can use Asm.getSectionData instead of
Asm.getOrCreateSectionData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237943 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoYAML: Null terminate block scalar's value.
Alex Lorenz [Thu, 21 May 2015 19:45:02 +0000 (19:45 +0000)]
YAML: Null terminate block scalar's value.

The commit null terminates the string value in the `yaml::BlockScalarNode`
class.

This change is motivated by the initial MIR serialization commit (r237708)
that I reverted in r237730 because the LLVM IR source from the block
scalar node wasn't terminated by a null character and thus the buildbots
failed on one testcase sometimes. This change enables me to recommit
the reverted commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237942 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r237766, "Support: Introduce LLVM_FALLTHROUGH macro."
Peter Collingbourne [Thu, 21 May 2015 19:44:44 +0000 (19:44 +0000)]
Revert r237766, "Support: Introduce LLVM_FALLTHROUGH macro."

The value of this macro seems to be very low unless we actually start
using it everywhere, and I don't have immediate plans to make that
happen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237941 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unused argument. NFC.
Rafael Espindola [Thu, 21 May 2015 19:42:35 +0000 (19:42 +0000)]
Remove unused argument. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237940 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix StreamingMemoryObject to respect known object size.
Derek Schuff [Thu, 21 May 2015 19:40:19 +0000 (19:40 +0000)]
Fix StreamingMemoryObject to respect known object size.

The existing code for method StreamingMemoryObject.fetchToPos does not respect
the corresonding call to setKnownObjectSize(). As a result, it allows the
StreamingMemoryObject to read bytes past the object size.

This patch provides a test case, and code to fix the problem.

Patch by Karl Schimpf
Differential Revision: http://reviews.llvm.org/D8931

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237939 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFetch alignment directly out of MCSection. NFC.
Rafael Espindola [Thu, 21 May 2015 19:36:43 +0000 (19:36 +0000)]
Fetch alignment directly out of MCSection. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237938 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd support for VSX scalar single-precision arithmetic in the PPC target
Nemanja Ivanovic [Thu, 21 May 2015 19:32:49 +0000 (19:32 +0000)]
Add support for VSX scalar single-precision arithmetic in the PPC target

http://reviews.llvm.org/D9891
Following up on the VSX single precision loads and stores added earlier, this
adds support for elementary arithmetic operations on single precision values
in VSX registers. These instructions utilize the new VSSRC register class.
Instructions added:
xsaddsp
xsdivsp
xsmulsp
xsresp
xsrsqrtesp
xssqrtsp
xssubsp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237937 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove alignment from MCSectionData to MCSection.
Rafael Espindola [Thu, 21 May 2015 19:20:38 +0000 (19:20 +0000)]
Move alignment from MCSectionData to MCSection.

This starts merging MCSection and MCSectionData.

There are a few issues with the current split between MCSection and
MCSectionData.

* It optimizes the the not as important case. We want the production
of .o files to be really fast, but the split puts the information used
for .o emission in a separate data structure.

* The ELF/COFF/MachO hierarchy is not represented in MCSectionData,
leading to some ad-hoc ways to represent the various flags.

* It makes it harder to remember where each item is.

The attached patch starts merging the two by moving the alignment from
MCSectionData to MCSection.

Most of the patch is actually just dropping 'const', since
MCSectionData is mutable, but MCSection was not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237936 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopDistribute] Remove a layer of pointer indirection.
Benjamin Kramer [Thu, 21 May 2015 18:32:07 +0000 (18:32 +0000)]
[LoopDistribute] Remove a layer of pointer indirection.

Just store InstPartitions directly into the std::list. No functional change
intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237930 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agouse range-based for-loops; NFCI
Sanjay Patel [Thu, 21 May 2015 17:43:26 +0000 (17:43 +0000)]
use range-based for-loops; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237918 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agouse range-based for-loops; NFCI
Sanjay Patel [Thu, 21 May 2015 17:22:45 +0000 (17:22 +0000)]
use range-based for-loops; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237917 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix warning on builds without asserts.
Rafael Espindola [Thu, 21 May 2015 17:09:22 +0000 (17:09 +0000)]
Fix warning on builds without asserts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237915 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agouse range-based for-loop
Sanjay Patel [Thu, 21 May 2015 17:04:17 +0000 (17:04 +0000)]
use range-based for-loop

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237914 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAvoid unnecessary section switching. NFC.
Rafael Espindola [Thu, 21 May 2015 17:00:40 +0000 (17:00 +0000)]
Avoid unnecessary section switching. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237913 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove yet another method of creating begin and end symbol for sections.
Rafael Espindola [Thu, 21 May 2015 16:52:32 +0000 (16:52 +0000)]
Remove yet another method of creating begin and end symbol for sections.

I missed this one when first unifying how we handle begin and end symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237912 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agodon't repeat function names in comments; NFC
Sanjay Patel [Thu, 21 May 2015 16:42:22 +0000 (16:42 +0000)]
don't repeat function names in comments; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237911 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSize enum so we can store it as 16-bits and avoid casts. NFC
Pete Cooper [Thu, 21 May 2015 16:40:18 +0000 (16:40 +0000)]
Size enum so we can store it as 16-bits and avoid casts.  NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237910 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse existing helper for adding a section. NFC.
Rafael Espindola [Thu, 21 May 2015 16:19:32 +0000 (16:19 +0000)]
Use existing helper for adding a section. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237909 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agouse range-based for-loop; NFCI
Sanjay Patel [Thu, 21 May 2015 16:00:50 +0000 (16:00 +0000)]
use range-based for-loop; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237908 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agostd::sort must be called with a strict weak ordering.
Manuel Klimek [Thu, 21 May 2015 15:38:25 +0000 (15:38 +0000)]
std::sort must be called with a strict weak ordering.

Found by a debug enabled stl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237906 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAVX-512: Enabled SSE intrinsics on AVX-512.
Elena Demikhovsky [Thu, 21 May 2015 14:01:32 +0000 (14:01 +0000)]
AVX-512: Enabled SSE intrinsics on AVX-512.
Predicate UseAVX depricates pattern selection on AVX-512.
This predicate is necessary for DAG selection to select EVEX form.
But mapping SSE intrinsics to AVX-512 instructions is not ready yet.
So I replaced UseAVX with HasAVX for intrinsics patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237903 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake Triple::parseARMArch use ARMTargetParser
Renato Golin [Thu, 21 May 2015 13:52:20 +0000 (13:52 +0000)]
Make Triple::parseARMArch use ARMTargetParser

Simplifying Triple::parseARMArch, leaving all the parsing to ARMTargetParser.

This commit also adds AArch64 detection to ARMTargetParser canonicalization,
and a two RedHat arch names (v{6,7}hl, meaning hard-float / little-endian).

Adding enough unit tests to cover the basics. Clang checks fine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237902 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[RewriteStatepointsForGC] Fix debug assertion during derivable pointer rematerialization
Igor Laevsky [Thu, 21 May 2015 13:02:14 +0000 (13:02 +0000)]
[RewriteStatepointsForGC] Fix debug assertion during derivable pointer rematerialization

Correct assertion would be that there is no other uses from chain we are currently cloning. It is ok to have other uses of values not from this chain.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237899 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix memory-dereferenceable.ll test
Artur Pilipenko [Thu, 21 May 2015 12:51:38 +0000 (12:51 +0000)]
Fix memory-dereferenceable.ll test

One of the testcases introduced by D9365 had incorrect !dereferenceable metadata on load. It must fail but it doesn't due to incorrect order of CHECK/CHECK-NOT commands in test. Fixed both.

Reviewed By: sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237897 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTest commit. Fix typo in MemDerefPrinter.cpp comment.
Artur Pilipenko [Thu, 21 May 2015 11:57:38 +0000 (11:57 +0000)]
Test commit. Fix typo in MemDerefPrinter.cpp comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237893 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unnecessary FIXME comment
Renato Golin [Thu, 21 May 2015 10:47:56 +0000 (10:47 +0000)]
Remove unnecessary FIXME comment

It has been fixed by commit r237797.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237890 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFixed unused variable warning in non-assert builds from rL237885
Simon Pilgrim [Thu, 21 May 2015 10:22:10 +0000 (10:22 +0000)]
Fixed unused variable warning in non-assert builds from rL237885

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237889 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][SSE] Improve support for 128-bit vector sign extension
Simon Pilgrim [Thu, 21 May 2015 10:05:03 +0000 (10:05 +0000)]
[X86][SSE] Improve support for 128-bit vector sign extension

This patch improves support for sign extension of the lower lanes of vectors of integers by making use of the SSE41 pmovsx* sign extension instructions where possible, and optimizing the sign extension by shifts on pre-SSE41 targets (avoiding the use of i64 arithmetic shifts which require scalarization).

It converts SIGN_EXTEND nodes to SIGN_EXTEND_VECTOR_INREG where necessary, that more closely matches the pmovsx* instruction than the default approach of using SIGN_EXTEND_INREG which splits the operation (into an ANY_EXTEND lowered to a shuffle followed by shifts) making instruction matching difficult during lowering. Necessary support for SIGN_EXTEND_VECTOR_INREG has been added to the DAGCombiner.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237885 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] [IAS] Add 2 missing CHECK directives for fixups in mips-expansions.s.
Toma Tabacu [Thu, 21 May 2015 10:04:39 +0000 (10:04 +0000)]
[mips] [IAS] Add 2 missing CHECK directives for fixups in mips-expansions.s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237884 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[TableGen] Resolve complex def names inside multiclasses
Hal Finkel [Thu, 21 May 2015 04:32:56 +0000 (04:32 +0000)]
[TableGen] Resolve complex def names inside multiclasses

We had not been trying hard enough to resolve def names inside multiclasses
that had complex concatenations, etc. Now we'll try harder.

Patch by Amaury Sechet!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237877 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAsmPrinter: Compute absolute label difference directly
Duncan P. N. Exon Smith [Thu, 21 May 2015 02:41:23 +0000 (02:41 +0000)]
AsmPrinter: Compute absolute label difference directly

Create a low-overhead path for `EmitLabelDifference()` that emits a
emits an absolute number when (1) the output is an object stream and (2)
the two symbols are in the same data fragment.

This drops memory usage on Mach-O from 975 MB down to 919 MB (5.8%).
The only call is when `!doesDwarfUseRelocationsAcrossSections()` --
i.e., on Mach-O -- since otherwise an absolute offset from the start of
the section needs a relocation.  (`EmitLabelDifference()` is cheaper on
ELF anyway, since it creates 1 fewer temp symbol, and it gets called far
less often.  It's not clear to me if this is even a bottleneck there.)

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237876 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMC: Initialize MCSymbolData::Offset directly
Duncan P. N. Exon Smith [Thu, 21 May 2015 01:59:58 +0000 (01:59 +0000)]
MC: Initialize MCSymbolData::Offset directly

Try to fix miscompile after r237873.  Looks like this union
initialization isn't legal (or at least not supported).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237875 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MemCpyOpt] Do move the memset, but look at its dest's dependencies.
Ahmed Bougacha [Thu, 21 May 2015 01:43:39 +0000 (01:43 +0000)]
[MemCpyOpt] Do move the memset, but look at its dest's dependencies.

In effect a partial revert of r237858, which was a dumb shortcut.
Looking at the dependencies of the destination should be the proper
fix: if the new memset would depend on anything other than itself,
the transformation isn't correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237874 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMC: Simplify MCSymbolData initialization and remove MCSymbol pointer
Duncan P. N. Exon Smith [Thu, 21 May 2015 01:33:03 +0000 (01:33 +0000)]
MC: Simplify MCSymbolData initialization and remove MCSymbol pointer

Finally remove the `MCSymbolData::Symbol` pointer.  It was still being
used to track whether `MCSymbolData` had been initialized, but this is
better tracked by the bitfield in `MCSymbol`.

The only caller of `MCSymbolData::initialize()` was `MCAssembler`, which
(other than `Symbol`) passed in all-0 values.  Replace all that
indirection with a default constructor.

The main point is a cleanup (and there's more cleanup to do), but there
are also some small memory savings.  I measured ~989 MB down to ~975 MB,
cutting a little over 1% off the top of `llc`.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237873 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDocument the CoreCLR GC Strategy
Swaroop Sridhar [Thu, 21 May 2015 00:50:10 +0000 (00:50 +0000)]
Document the CoreCLR GC Strategy

Add notead about the CoreCLR GC Strategy to the
Garbage Collection document.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237869 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMC: Make MCSymbolData::Symbol private
Duncan P. N. Exon Smith [Thu, 21 May 2015 00:49:09 +0000 (00:49 +0000)]
MC: Make MCSymbolData::Symbol private

Make the back-pointer from `MCSymbolData` to `MCSymbol` private,
preparing to remove the back pointer entirely.  I've already updated all
the users, although for now it's still used to indicate whether
`MCSymbol::Data` has been initialized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237868 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMC: Remove last use of MCSymbolData::getSymbol(), NFC
Duncan P. N. Exon Smith [Thu, 21 May 2015 00:39:24 +0000 (00:39 +0000)]
MC: Remove last use of MCSymbolData::getSymbol(), NFC

Remove the last use of `MCSymbolData::getSymbol()`.  There's some
*really* hairy stuff going on in `MachObjectWriter::WriteNList()` that I
want to come back to.  In particular, it updates `Symbol` to point at
its aliasee (if any), but leaves `Data` behind, and it's not clear
whether everything makes sense there.

For now I've left the logic unchanged by adding `OrigSymbol` and moving
the FIXME from r237750 up a bit higher.  I've filed PR23598 to track
looking into this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237867 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MemCpyOpt] Pass Instruction to IRBuilder, no need for NextNode. NFC.
Ahmed Bougacha [Thu, 21 May 2015 00:08:35 +0000 (00:08 +0000)]
[MemCpyOpt] Pass Instruction to IRBuilder, no need for NextNode. NFC.

We're erasing the instructions anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237861 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Pass explicit pointee type in another case of GEP constant...
David Blaikie [Thu, 21 May 2015 00:06:38 +0000 (00:06 +0000)]
[opaque pointer type] Pass explicit pointee type in another case of GEP constant folding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237860 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix build error
Andrew Kaylor [Wed, 20 May 2015 23:58:44 +0000 (23:58 +0000)]
Fix build error

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237859 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MemCpyOpt] Don't move the memset when optimizing memset+memcpy.
Ahmed Bougacha [Wed, 20 May 2015 23:55:16 +0000 (23:55 +0000)]
[MemCpyOpt] Don't move the memset when optimizing memset+memcpy.

Fixes PR23599, another miscompile introduced by r235232: when there is
another dependency on the destination of the created memset (i.e., the
part of the original destination that the memcpy doesn't depend on)
between the memcpy and the original memset, we would insert the created
memset after the memcpy, and thus after the other dependency.

Instead, insert the created memset right after the old one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237858 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix build warning
Andrew Kaylor [Wed, 20 May 2015 23:28:03 +0000 (23:28 +0000)]
Fix build warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237855 91177308-0d34-0410-b5e6-96231b3b80d8