Commit Graph

24879 Commits

Author SHA1 Message Date
Mehdi Amini
a8544fbcdb Bitcode Writer: EmitRecordWith* takes an ArrayRef instead of a SmallVector (NFC)
This reapply commit r247178 after post-commit review from D.Blaikie
in a way that makes it compatible with the existing API.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 00:05:09 +00:00
Mehdi Amini
4806ac4a7e Add makeArrayRef() overload for ArrayRef input (no-op/identity) NFC
The purpose is to allow templated wrapper to work with either
ArrayRef or any convertible operation:

template<typename Container>
void wrapper(const Container &Arr) {
  impl(makeArrayRef(Arr));
}

with Container being a std::vector, a SmallVector, or an ArrayRef.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247214 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 00:05:04 +00:00
Reid Kleckner
69d051c87d [SEH] Emit 32-bit SEH tables for the new EH IR
The 32-bit tables don't actually contain PC range data, so emitting them
is incredibly simple.

The 64-bit tables, on the other hand, use the same table for state
numbering as well as label ranges. This makes things more difficult, so
it will be implemented later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 21:10:03 +00:00
Teresa Johnson
d08fb26a14 Change EmitRecordWithAbbrevImpl to take Optional record code. NFC.
This change enables EmitRecord to pass the supplied record Code to
EmitRecordWithAbbrevImpl, rather than insert it into the Vals array.
It is an enabler for changing EmitRecord to take an ArrayRef<uintty> instead
of a SmallVectorImpl<uintty>&

Patch suggested by Duncan P. N. Exon Smith, modified by myself a bit to get
correct assertion checking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 20:53:31 +00:00
Mehdi Amini
70e074663d Revert "Bitcode Writer: EmitRecordWith* takes an ArrayRef instead of a SmallVector (NFC)"
This reverts commit r247178.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247182 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 20:35:15 +00:00
Mehdi Amini
9e472a1800 Bitcode Writer: EmitRecordWith* takes an ArrayRef instead of a SmallVector (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247178 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 20:08:39 +00:00
Renato Golin
792b67e240 Revert "AVX512: Implemented encoding and intrinsics for vextracti64x4 ,vextracti64x2, vextracti32x8, vextracti32x4, vextractf64x4, vextractf64x2, vextractf32x8, vextractf32x4 Added tests for intrinsics and encoding."
This reverts commit r247149, as it was breaking numerous buildbots of varied architectures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247177 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 19:44:40 +00:00
Sanjay Patel
97878fcf7d allow unpredictable metadata on switch statements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247174 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 18:38:30 +00:00
Matthias Braun
af5ff60200 Save LaneMask with livein registers
With subregister liveness enabled we can detect the case where only
parts of a register are live in, this is expressed as a 32bit lanemask.
The current code only keeps registers in the live-in list and therefore
enumerated all subregisters affected by the lanemask. This turned out to
be too conservative as the subregister may also cover additional parts
of the lanemask which are not live. Expressing a given lanemask by
enumerating a minimum set of subregisters is computationally expensive
so the best solution is to simply change the live-in list to store the
lanemasks as well. This will reduce memory usage for targets using
subregister liveness and slightly increase it for other targets

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 18:08:03 +00:00
Matthias Braun
6111cd8660 VirtRegMap: Improve addMBBLiveIns() using SlotIndex::MBBIndexIterator; NFC
Now that we have an explicit iterator over the idx2MBBMap in SlotIndices
we can use the fact that segments and the idx2MBBMap is sorted by
SlotIndex position so can advance both simultaneously instead of
starting from the beginning for each segment.

This complicates the code for the subregister case somewhat but should
be more efficient and has the advantage that we get the final lanemask
for each block immediately which will be important for a subsequent
change.

Removes the now unused SlotIndexes::findMBBLiveIns function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 18:07:54 +00:00
Chandler Carruth
9146833fa3 [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible
with the new pass manager, and no longer relying on analysis groups.

This builds essentially a ground-up new AA infrastructure stack for
LLVM. The core ideas are the same that are used throughout the new pass
manager: type erased polymorphism and direct composition. The design is
as follows:

- FunctionAAResults is a type-erasing alias analysis results aggregation
  interface to walk a single query across a range of results from
  different alias analyses. Currently this is function-specific as we
  always assume that aliasing queries are *within* a function.

- AAResultBase is a CRTP utility providing stub implementations of
  various parts of the alias analysis result concept, notably in several
  cases in terms of other more general parts of the interface. This can
  be used to implement only a narrow part of the interface rather than
  the entire interface. This isn't really ideal, this logic should be
  hoisted into FunctionAAResults as currently it will cause
  a significant amount of redundant work, but it faithfully models the
  behavior of the prior infrastructure.

- All the alias analysis passes are ported to be wrapper passes for the
  legacy PM and new-style analysis passes for the new PM with a shared
  result object. In some cases (most notably CFL), this is an extremely
  naive approach that we should revisit when we can specialize for the
  new pass manager.

- BasicAA has been restructured to reflect that it is much more
  fundamentally a function analysis because it uses dominator trees and
  loop info that need to be constructed for each function.

All of the references to getting alias analysis results have been
updated to use the new aggregation interface. All the preservation and
other pass management code has been updated accordingly.

The way the FunctionAAResultsWrapperPass works is to detect the
available alias analyses when run, and add them to the results object.
This means that we should be able to continue to respect when various
passes are added to the pipeline, for example adding CFL or adding TBAA
passes should just cause their results to be available and to get folded
into this. The exception to this rule is BasicAA which really needs to
be a function pass due to using dominator trees and loop info. As
a consequence, the FunctionAAResultsWrapperPass directly depends on
BasicAA and always includes it in the aggregation.

This has significant implications for preserving analyses. Generally,
most passes shouldn't bother preserving FunctionAAResultsWrapperPass
because rebuilding the results just updates the set of known AA passes.
The exception to this rule are LoopPass instances which need to preserve
all the function analyses that the loop pass manager will end up
needing. This means preserving both BasicAAWrapperPass and the
aggregating FunctionAAResultsWrapperPass.

Now, when preserving an alias analysis, you do so by directly preserving
that analysis. This is only necessary for non-immutable-pass-provided
alias analyses though, and there are only three of interest: BasicAA,
GlobalsAA (formerly GlobalsModRef), and SCEVAA. Usually BasicAA is
preserved when needed because it (like DominatorTree and LoopInfo) is
marked as a CFG-only pass. I've expanded GlobalsAA into the preserved
set everywhere we previously were preserving all of AliasAnalysis, and
I've added SCEVAA in the intersection of that with where we preserve
SCEV itself.

One significant challenge to all of this is that the CGSCC passes were
actually using the alias analysis implementations by taking advantage of
a pretty amazing set of loop holes in the old pass manager's analysis
management code which allowed analysis groups to slide through in many
cases. Moving away from analysis groups makes this problem much more
obvious. To fix it, I've leveraged the flexibility the design of the new
PM components provides to just directly construct the relevant alias
analyses for the relevant functions in the IPO passes that need them.
This is a bit hacky, but should go away with the new pass manager, and
is already in many ways cleaner than the prior state.

Another significant challenge is that various facilities of the old
alias analysis infrastructure just don't fit any more. The most
significant of these is the alias analysis 'counter' pass. That pass
relied on the ability to snoop on AA queries at different points in the
analysis group chain. Instead, I'm planning to build printing
functionality directly into the aggregation layer. I've not included
that in this patch merely to keep it smaller.

Note that all of this needs a nearly complete rewrite of the AA
documentation. I'm planning to do that, but I'd like to make sure the
new design settles, and to flesh out a bit more of what it looks like in
the new pass manager first.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247167 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 17:55:00 +00:00
Igor Breger
1676f595b1 AVX512: Implemented encoding and intrinsics for
vextracti64x4 ,vextracti64x2, vextracti32x8, vextracti32x4, vextractf64x4, vextractf64x2, vextractf32x8, vextractf32x4
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 14:35:09 +00:00
Alexandros Lamprineas
a800215d54 LLVM does not distinguish Cortex-M4 from Cortex-M4F neither Cortex-R5 from R5F.
Removed "cortex-r5f" and "cortex-m4f" from Target Parser, sinced they are
unknown cpu names for llvm and clang. Also updated default FPUs for R5 and M4
accordingly.

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

Change-Id: Ib81c7216521a361d8ee1296e4b6a2aa00bd479c5

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 11:20:48 +00:00
Matt Arsenault
7e657c85c6 SelectionDAG: Support Expand of f16 extloads
Currently this hits an assert that extload should
always be supported, which assumes integer extloads.

This moves a hack out of SI's argument lowering and
is covered by existing tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 01:12:27 +00:00
Matt Arsenault
5b5093b7a1 Fix typos / grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247109 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 00:38:33 +00:00
Duncan P. N. Exon Smith
9f4d77fcd0 Revert "Bitcode: ArrayRef-ize EmitRecordWithAbbrev(), NFC"
This reverts commit r247107.  Turns out clang calls these functions
directly, and `ArrayRef<T>` doesn't have a working implicit conversion
from `SmallVector<T>`.

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/14247

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247108 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 00:37:52 +00:00
Duncan P. N. Exon Smith
3db59a76ef Bitcode: ArrayRef-ize EmitRecordWithAbbrev(), NFC
Change `EmitRecordWithAbbrev()` and friends to take an `ArrayRef<T>`
instead of requiring a `SmallVectorImpl<T>`.  No functionality change
intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247107 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-09 00:34:25 +00:00
Peter Collingbourne
9e5511adf8 Re-apply r247080 with order of evaluation fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247095 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 22:49:35 +00:00
Reid Kleckner
dff75493e8 [WinEH] Emit prologues and epilogues for funclets
Summary:
32-bit funclets have short prologues that allocate enough stack for the
largest call in the whole function. The runtime saves CSRs for the
funclet. It doesn't restore CSRs after we finally transfer control back
to the parent funciton via a CATCHRET, but that's a separate issue.
32-bit funclets also have to adjust the incoming EBP value, which is
what llvm.x86.seh.recoverframe does in the old model.

64-bit funclets need to spill CSRs as normal. For simplicity, this just
spills the same set of CSRs as the parent function, rather than trying
to compute different CSR sets for the parent function and each funclet.
64-bit funclets also allocate enough stack space for the largest
outgoing call frame, like 32-bit.

Reviewers: majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247092 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 22:44:41 +00:00
Peter Collingbourne
938e129fc2 Revert r247080, "LowerBitSets: Extend pass to support functions as bitset
members." as it causes test failures on a number of bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247088 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 22:33:23 +00:00
Peter Collingbourne
ad699c862c LowerBitSets: Extend pass to support functions as bitset members.
This change extends the bitset lowering pass to support bitsets that may
contain either functions or global variables. A function bitset is lowered to
a jump table that is laid out before one of the functions in the bitset.

Also add support for non-string bitset identifier names. This allows for
distinct metadata nodes to stand in for names with internal linkage,
as done in D11857.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247080 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 21:57:45 +00:00
Matt Arsenault
55478a8b79 Add const overload of findRegisterUseOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247063 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 20:21:29 +00:00
Evgeniy Stepanov
242f547927 Fix isDiscardableIfUnused to include available_externally linkage.
AvailableExternally functions are discardable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247044 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 18:25:20 +00:00
Alexandros Lamprineas
1955b207be Added arch extensions and default target features in TargetParser.
Differential: http://reviews.llvm.org/D11590

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-05 17:05:33 +00:00
Chad Rosier
7ab65d6098 Typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246851 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-04 12:34:55 +00:00
Richard Smith
c8dacf406f Fix APInt value initialization to give a zero value as any sane integer type
should, rather than giving a broken value that doesn't even zero/sign-extend
properly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246836 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-04 04:08:36 +00:00
Reid Kleckner
412db355b3 Sink COFF.h MC include into .cpp files
This prevents MC clients from getting COFF.h, which conflicts with
winnt.h macros. Also a minor IWYU cleanup. Now the only public headers
including COFF.h are in Object, and they actually need it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-03 16:41:50 +00:00
Silviu Baranga
deae4ec251 Fix IRBuilder CreateBitOrPointerCast for vector types
Summary:
This function was not taking into account that the
input type could be a vector, and wasn't properly
working for vector types.

This caused an assert when building spec2k6 perlbmk for armv8.

Reviewers: rengolin, mzolotukhin

Subscribers: silviu.baranga, mzolotukhin, rengolin, eugenis, jmolloy, aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246759 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-03 11:36:39 +00:00
Joseph Tremoulet
8f3f5c300e [WinEH] Add llvm.eh.exceptionpointer intrinsic
Summary:
This intrinsic can be used to extract a pointer to the exception caught by
a given catchpad.  Its argument has token type and must be a `catchpad`.

Also clarify ExtendingLLVM documentation regarding overloaded intrinsics.


Reviewers: majnemer, andrew.w.kaylor, sanjoy, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246752 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-03 09:15:32 +00:00
Joseph Tremoulet
226889eb73 [WinEH] Add cleanupendpad instruction
Summary:
Add a `cleanupendpad` instruction, used to mark exceptional exits out of
cleanups (for languages/targets that can abort a cleanup with another
exception).  The `cleanupendpad` instruction is similar to the `catchendpad`
instruction in that it is an EH pad which is the target of unwind edges in
the handler and which itself has an unwind edge to the next EH action.
The `cleanupendpad` instruction, similar to `cleanupret` has a `cleanuppad`
argument indicating which cleanup it exits.  The unwind successors of a
`cleanuppad`'s `cleanupendpad`s must agree with each other and with its
`cleanupret`s.

Update WinEHPrepare (and docs/tests) to accomodate `cleanupendpad`.

Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-03 09:09:43 +00:00
Igor Breger
d951d3c8df AVX512: Implemented encoding and intrinsics for vplzcntq, vplzcntd, vpconflictq, vpconflictd
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246750 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-03 09:05:31 +00:00
Douglas Katzman
aa603526a1 Add Myriad into enum VendorType
Differential Revision: http://reviews.llvm.org/D12540

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246732 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 23:11:25 +00:00
Justin Bogner
d034925a34 IR: Remove a redundant function. NFC
Function::print isn't interestingly different from Value::print. Just
let the only caller (in PrintCallGraphPass) call the Value version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246720 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 22:28:47 +00:00
Douglas Katzman
3d7575d7e2 Move twice-repeated clang path operation into a new function.
And make it more robust in the edge case of exactly "./" as input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246711 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 21:02:10 +00:00
Piotr Padlewski
782ac282c5 Constant propagation after hitting assume(cmp) bugfix
Last time code run into assertion `BBE.isSingleEdge()` in
lib/IR/Dominators.cpp:200.

http://reviews.llvm.org/D12170

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246696 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 19:59:59 +00:00
Sanjay Patel
1cded9afe4 add unpredictable metadata type for control flow
This patch defines 'unpredictable' metadata. This metadata can be used to signal to the optimizer
or backend that a branch or switch is unpredictable, and therefore, it's probably better to not
split a compound predicate into multiple branches such as in CodeGenPrepare::splitBranchCondition().

This was discussed in:
https://llvm.org/bugs/show_bug.cgi?id=23827

Dependent patches to alter codegen and expose this in clang to follow.

Differential Revision; http://reviews.llvm.org/D12341


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246688 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 19:06:43 +00:00
NAKAMURA Takumi
074eea0532 MCAssembler.h: Prune unused \param since r246604. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246664 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 16:21:27 +00:00
Rafael Espindola
3c4c9334b2 Pass a symbol table to getRelocationSymbol instead of returning one.
This removes a report_fatal_error from library and avoids checking a
section property for every section entry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246656 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 15:07:39 +00:00
Asaf Badouh
05859c7cbb [X86][AVX512VLBW] add support in byte shift and SAD
add byte shift left/right
add SAD - compute sum of absolute differences

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246654 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 14:21:54 +00:00
Joseph Tremoulet
16c6479624 [TableGen] Allow TokenTy in intrinsic signatures
Summary:
Add the necessary plumbing so that llvm_token_ty can be used as an
argument/return type in intrinsic definitions and correspondingly require
TokenTy in function types.  TokenTy is an opaque type that has no target
lowering, but can be used in machine-independent intrinsics.  It is
required for the upcoming llvm.eh.padparam intrinsic.

Reviewers: majnemer, rnk

Subscribers: stoklund, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246651 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 13:36:25 +00:00
Igor Breger
1b50f7132b AVX512: Implemented encoding and intrinsics for VGETMANTPD/S , VGETMANTSD/S instructions
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 11:18:55 +00:00
Igor Breger
191108c6b8 AVX512: Implemented encoding and intrinsics for vshufps/d.
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246640 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 10:50:58 +00:00
David Majnemer
dc2d216543 [MC] Remove MCAssembler's copy of OS
We can just ask the ObjectWriter for it's stream instead of caching
around our own reference to it.  No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246604 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 23:19:38 +00:00
David Majnemer
3d58bd6369 [MC] Add support for generating COFF CRCs
COFF sections are accompanied with an auxiliary symbol which includes a
checksum.  This checksum used to be filled with just zero but this seems
to upset LINK.exe when it is processing a /INCREMENTAL link job.
Instead, fill the CheckSum field with the JamCRC of the section
contents.  This matches MSVC's behavior.

This fixes PR19666.

N.B.  A rather simple implementation of JamCRC is given.  It implements
a byte-wise calculation using the method given by Sarwate.  There are
implementations with higher throughput like slice-by-eight and making
use of PCLMULQDQ.  We can switch to one of those techniques if it turns
out to be a significant use of time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246590 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 21:23:58 +00:00
Benjamin Kramer
374ff4e100 Remove OutputBuffer.
This was last used by the pre-MC object emitter and has been dead for
quite a while. We have better ways to emit endian-dependent stuff now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 18:25:34 +00:00
Artem Belevich
20264d6c67 New bitcode linker flags:
-only-needed -- link in only symbols needed by destination module
-internalize -- internalize linked symbols

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246561 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 17:55:55 +00:00
David Majnemer
919f1f47e4 [MC] Allow MCObjectWriter's output stream to be swapped out
There are occasions where it is useful to consider the entirety of the
contents of a section.  For example, compressed debug info needs the
entire section available before it can compress it and write it out.
The compressed debug info scenario was previously implemented by
mirroring the implementation of writeSectionData in the ELFObjectWriter.

Instead, allow the output stream to be swapped on demand.  This lets
callers redirect the output stream to a more convenient location before
it hits the object file.

No functionality change is intended.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246554 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 16:19:03 +00:00
Igor Breger
c02bfc6060 AVX512: Implemented intrinsics for valign.
Differential Revision: http://reviews.llvm.org/D12526

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246551 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 15:27:18 +00:00
Rui Ueyama
5c1fa7fc49 Object: Fix COFF import file's symbols.
If a symbol is marked as "data", the symbol should be exported
with __imp_ prefix. Previously, the symbol was exported as-is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246532 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 06:01:53 +00:00
Duncan P. N. Exon Smith
680ff33b17 LTO: Cleanup parameter names and header docs, NFC
Follow LLVM style for the parameter names (`CamelCase` not `camelCase`),
and surface the header docs in doxygen.  No functionality change
intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-31 23:44:06 +00:00