Commit Graph

2494 Commits

Author SHA1 Message Date
George Burgess IV
3772549656 Make some LLVM_CONSTEXPR variables const. NFC.
This patch changes LLVM_CONSTEXPR variable declarations to const
variable declarations, since LLVM_CONSTEXPR expands to nothing if the
current compiler doesn't support constexpr. In all of the changed
cases, it looks like the code intended the variable to be const instead
of sometimes-constexpr sometimes-not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 01:05:08 +00:00
David Blaikie
bf471b7adc DebugInfo: Add flag to CU to disable emission of inline debug info into the skeleton CU
In cases where .dwo/.dwp files are guaranteed to be available, skipping
the extra online (in the .o file) inline info can save a substantial
amount of space - see the original r221306 for more details there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279650 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 18:29:49 +00:00
Nico Weber
96d3445a5f fix typo 'varaible' in assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 16:34:54 +00:00
Eugene Zelenko
9feaa97ada Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes.
Differential revision: https://reviews.llvm.org/D23789


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 17:14:32 +00:00
Xinliang David Li
ee836b9f52 [Profile] refactor meta data copying/swapping code
Differential Revision: http://reviews.llvm.org/D23619



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 15:39:03 +00:00
Pete Cooper
75494aa604 Add comments and an assert to follow-up on r279113. NFC.
Philip commented on r279113 to ask for better comments as to
when to use the different versions of getName.  Its also possible
to assert in the simple case that we aren't an overloaded intrinsic
as those have to use the more capable version of getName.

Thanks for the comments Philip.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279466 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 20:18:28 +00:00
Chandler Carruth
65b92679f5 [PM] Introduce an abstraction for all the analyses over a particular IR
unit for use in the PreservedAnalyses set.

This doesn't have any important functional change yet but it cleans
things up and makes the analysis substantially more efficient by
avoiding querying through the type erasure for every analysis.

I also think it makes it much easier to reason about how analyses are
preserved when walking across pass managers and across IR unit
abstractions.

Thanks to Sean and Mehdi both for the comments and suggestions.

Differential Revision: https://reviews.llvm.org/D23691

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-20 04:57:28 +00:00
Pete Cooper
a13b2e5313 Add a version of Intrinsic::getName which is more efficient when there are no overloads.
When running 'opt -O2 verify-uselistorder-nodbg.lto.bc', there are 33m allocations.  8.2m
come from std::string allocations in Intrinsic::getName().  Turns out this method only
returns a std::string because it needs to handle overloads, but that is not the common case.

This adds an overload of getName which just returns a StringRef when there are no overloads
and so saves on the allocations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279113 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 18:30:54 +00:00
Justin Bogner
7d7a23e700 Replace a few more "fall through" comments with LLVM_FALLTHROUGH
Follow up to r278902. I had missed "fall through", with a space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 20:30:52 +00:00
Tim Northover
3ed44cd787 GlobalISel: support irtranslation of icmp instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278969 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 20:25:25 +00:00
Tim Shen
1dca602a37 [GenericDomTree] Change GenericDomTree to use NodeRef in GraphTraits. NFC.
Summary:
Looking at the implementation, GenericDomTree has more specific
requirements on NodeRef, e.g. NodeRefObject->getParent() should compile,
and NodeRef should be a pointer. We can remove the pointer requirement,
but it seems to have little gain, given the limited use cases.

Also changed GraphTraits<Inverse<Inverse<T>> to be more accurate.

Reviewers: dblaikie, chandlerc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23593

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 20:01:58 +00:00
Justin Bogner
6673ea81f6 Replace "fallthrough" comments with LLVM_FALLTHROUGH
This is a mechanical change of comments in switches like fallthrough,
fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 05:10:15 +00:00
Duncan P. N. Exon Smith
3b3dd8847f Scalar: Avoid dereferencing end() in IndVarSimplify
IndVarSimplify::sinkUnusedInvariants calls
BasicBlock::getFirstInsertionPt on the ExitBlock and moves instructions
before it.  This can return end(), so it's not safe to dereference.  Add
an iterator-based overload to Instruction::moveBefore to avoid the UB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 01:54:41 +00:00
David Majnemer
662809578e Make MDNode::intersect faster than O(n * m)
It is pretty easy to get it down to O(nlogn + mlogm).  This
implementation has the added benefit of automatically deduplicating
entries between the two sets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 18:48:37 +00:00
David Majnemer
9c509583cc Don't passively concatenate MDNodes
I have audited all the callers of concatenate and none require duplicate
entries to service concatenation.
These duplicates serve no purpose but to needlessly embiggen the IR.

N.B. Layering getMostGenericAliasScope on top of concatenate makes it
O(nlogn + mlogm) instead of O(n*m).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 18:48:34 +00:00
Mehdi Amini
804c815e77 Revert "Revert "Invariant start/end intrinsics overloaded for address space""
This reverts commit 32fc6488e48eafc0ca1bac1bd9cbf0008224d530.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:31:24 +00:00
Mehdi Amini
2eb84a568a Revert "Invariant start/end intrinsics overloaded for address space"
This reverts commit r276447.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:27:32 +00:00
Eugene Zelenko
82d16ec877 Fix some Clang-tidy modernize-use-using and Include What You Use warnings.
Differential revision: https://reviews.llvm.org/D23478


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278583 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 00:50:41 +00:00
Gor Nishanov
b6ae34d909 [Coroutines]: Part6b: Add coro.id intrinsic.
Summary:
1. Make coroutine representation more robust against optimization that may duplicate instruction by introducing coro.id intrinsics that returns a token that will get fed into coro.alloc and coro.begin. Due to coro.id returning a token, it won't get duplicated and can be used as reliable indicator of coroutine identify when a particular coroutine call gets inlined.
2. Move last three arguments of coro.begin into coro.id as they will be shared if coro.begin will get duplicated.
3. doc + test + code updated to support the new intrinsic.

Reviewers: mehdi_amini, majnemer

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D23412

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 05:45:49 +00:00
David Majnemer
ac0eb3d821 Use the range variant of transform instead of unpacking begin/end
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278476 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 04:32:42 +00:00
David Majnemer
5d08e375ab Use the range variant of remove_if instead of unpacking begin/end
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 04:32:37 +00:00
David Majnemer
2d62ce6ee8 Use the range variant of find/find_if instead of unpacking begin/end
If the result of the find is only used to compare against end(), just
use is_contained instead.

No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 03:55:06 +00:00
David Majnemer
975248e4fb Use the range variant of find instead of unpacking begin/end
If the result of the find is only used to compare against end(), just
use is_contained instead.

No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278433 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 22:21:41 +00:00
David Majnemer
dc9c737666 Use range algorithms instead of unpacking begin/end
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 21:15:00 +00:00
Duncan P. N. Exon Smith
9040acb5e3 IR: Don't cast the end iterator to Instruction*
End iterators are usually sentinels, not actually Instruction* at all.
Stop casting to it just to get an iterator back.

There is likely no observable functionality change here right now
(although this is relying on UB, I doubt it was triggering anything),
but I'll be removing the cast soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 15:45:04 +00:00
Sanjoy Das
497124346e [Statepoints] Minor cosmetic change; NFC
The verification failure message was missing a space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 00:56:46 +00:00
Chandler Carruth
430591fd27 [x86] Fix a bug in the auto-upgrade from r276416 where we failed to give
a sufficiently low alignment for the IR load created.

There is no test case because we don't have any test cases for the *IR*
produced by the autoupgrade, only the x86 assembly, and it happens that
the x86 assembly for this intrinsic as it is tested in the autoupgrade
path just happens to not produce a separate load instruction where we
might have observed the alignment.

I'm going to follow up on the original commit to suggest getting
IR-level testing in addition to the asm level testing here so that we
can see and test these kinds of issues. We might never get an x86
instruction out with an alignment constraint, but we could stil
miscompile code by folding against the alignment marked on (or inferred
for in this case) the load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 07:41:26 +00:00
Vedant Kumar
5987faf07f [IR] Remove some unused #includes (NFC)
I needed a reader-writer lock for a downstream project and noticed that
llvm has one. Function.cpp is the only file in-tree that refers to it.
To anyone reading this: are you using RWMutex in out-of-tree code? Maybe
it's not worth keeping around any more...

Since we're not actually using RWMutex *here*, remove the #include (and
a few other stale headers while we're at it).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 23:14:37 +00:00
Sean Silva
2fb9a98752 Consistently use ModuleAnalysisManager
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.

Thanks to David for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:28:38 +00:00
Sean Silva
20b343c051 Consistently use FunctionAnalysisManager
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.

Thanks to David for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278077 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:28:15 +00:00
Benjamin Kramer
284030ab2c Move helpers into anonymous namespaces. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 11:13:10 +00:00
Gor Nishanov
fa2883261f Part 4c: Coroutine Devirtualization: Devirtualize coro.resume and coro.destroy.
Summary:
This is the 4c patch of the coroutine series. CoroElide pass now checks if PostSplit coro.begin
is referenced by coro.subfn.addr intrinsics. If so replace coro.subfn.addrs with an appropriate coroutine
subfunction associated with that coro.begin.

Documentation and overview is here: http://llvm.org/docs/Coroutines.html.

Upstreaming sequence (rough plan)
1.Add documentation. (https://reviews.llvm.org/D22603)
2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
3.Add empty coroutine passes. (https://reviews.llvm.org/D22847)
4.Add coroutine devirtualization + tests.
ab) Lower coro.resume and coro.destroy (https://reviews.llvm.org/D22998)
c) Do devirtualization <= we are here
5.Add CGSCC restart trigger + tests.
6.Add coroutine heap elision + tests.
7.Add the rest of the logic (split into more patches)

Reviewers: majnemer

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D23229

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 02:16:35 +00:00
David Callahan
fcb7a4a31d [AutoFDO] Fix handling of empty profiles
Summary:
If a profile has no samples for a function, then the function "entry count" is set to the value 0. Several places in the code test that if the Function::getEntryCount is defined at all. Here we change to treat a 0 entry count the same as undefined.

In particular, this fixes a problem in getLayoutSuccessorProbThreshold in MachineBlockPlacement.cpp where we use a different and inferior heuristic for laying out basic blocks.

Reviewers: danielcdh, dnovillo

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23082

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 18:38:19 +00:00
David Majnemer
5964d136e5 [coroutines] Part 4[ab]: Coroutine Devirtualization: Lower coro.resume and coro.destroy.
This is the forth patch in the coroutine series. CoroEaly pass now lowers coro.resume
and coro.destroy intrinsics by replacing them with an indirect call to an address
returned by coro.subfn.addr intrinsic. This is done so that CGPassManager recognizes
devirtualization when CoroElide replaces a call to coro.subfn.addr with an appropriate
function address.

Patch by Gor Nishanov!

Differential Revision: https://reviews.llvm.org/D22998

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 20:30:07 +00:00
Duncan P. N. Exon Smith
8fa25a1082 IR: Drop uniquing when an MDNode Value operand is deleted
This is a fix for PR28697.

An MDNode can indirectly refer to a GlobalValue, through a
ConstantAsMetadata.  When the GlobalValue is deleted, the MDNode operand
is reset to `nullptr`.  If the node is uniqued, this can lead to a
hard-to-detect cache invalidation in a Metadata map that's shared across
an LLVMContext.

Consider:

 1. A map from Metadata* to `T` called RemappedMDs.
 2. A node that references a global variable, `!{i1* @GV}`.
 3. Insert `!{i1* @GV} -> SomeT` in the map.
 4. Delete `@GV`, leaving behind `!{null} -> SomeT`.

Looking up the generic and uninteresting `!{null}` gives you `SomeT`,
which is likely related to `@GV`.  Worse, `SomeT`'s lifetime may be tied
to the deleted `@GV`.

This occurs in practice in the shared ValueMap used since r266579 in the
IRMover.  Other code that handles more than one Module (with different
lifetimes) in the same LLVMContext could hit it too.

The fix here is a partial revert of r225223: in the rare case that an
MDNode operand is a ConstantAsMetadata (i.e., wrapping a node from the
Value hierarchy), drop uniquing if it gets replaced with `nullptr`.
This changes step #4 above to leave behind `distinct !{null} -> SomeT`,
which can't be confused with the generic `!{null}`.

In theory, this can cause some churn in the LLVMContext's MDNode
uniquing map when Values are being deleted.  However:

  - The number of GlobalValues referenced from uniqued MDNodes is
    expected to be quite small.  E.g., the debug info metadata schema
    only references GlobalValues from distinct nodes.

  - Other Constants have the lifetime of the LLVMContext, whose teardown
    is careful to drop references before deleting the constants.

As a result, I don't expect a compile time regression from this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277625 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 18:19:43 +00:00
Sanjoy Das
308cf93891 [Verifier] Disallow illegal ptr<->int casts in ConstantExprs
This should have been a part of rL277085, but I hadn't considered this
case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277413 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 02:55:57 +00:00
Sanjoy Das
81274146ab Tie the Verifier class to a Module; NFCI
Summary:
This commit changes the Verifier class to accept a Module via the
constructor to make it obvious that a specific instance of the class is
only intended to work with a specific module.  The `updateModule` setter
(despite being private) was making this fact less transparent.

There are fields in the `Verifier` class like `DeoptimizeDeclarations`
and `GlobalValueVisited` which are module specific, so a given
Verifier instance will not in fact work across multiple modules today.
This change just makes that more obvious.

The motivation is to make it easy to get to the datalayout of the
module unambiguously.  That is required to verify that `inttoptr` and
`ptrtoint` constant expressions are well typed in the face of
non-integral pointer types.

Reviewers: dexonsmith, bkramer, majnemer, chandlerc

Subscribers: mehdi_amini, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D23040

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 01:34:50 +00:00
David Majnemer
6687e3a1ed [Verifier] Resume instructions can only be in functions w/ a personality
This fixes PR28799.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 18:06:34 +00:00
Amjad Aboud
67b0099873 Fixed "copy-paste" mistake from revision 255245.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-31 14:41:50 +00:00
Tim Northover
9c9955b41f CodeGen: add new "intrinsic" MachineOperand kind.
This will be used during GlobalISel, where we need a more robust and readable
way to write tests than a simple immediate ID.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 20:32:59 +00:00
Justin Lebar
24dbd38b83 Revert "Don't invoke getName() from Function::isIntrinsic().", rL276942.
This broke some out-of-tree AMDGPU tests that relied on the old behavior
wherein isIntrinsic() would return true for any function that starts
with "llvm.".  And in general that change will not play nicely with
out-of-tree backends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 23:58:15 +00:00
Sanjoy Das
1c20b71db8 [IR] Introduce a non-integral pointer type
Summary:
This change adds a `ni` specifier in the `datalayout` string to denote
pointers in some given address spaces as "non-integral", and adds some
typing rules around these special pointers.

Reviewers: majnemer, chandlerc, atrick, dberlin, eli.friedman, tstellarAMD, arsenm

Subscribers: arsenm, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D22488

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277085 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 23:43:38 +00:00
Justin Lebar
6d9563a0bc Don't invoke getName() from Function::isIntrinsic().
Summary:
getName() involves a hashtable lookup, so is expensive given how
frequently isIntrinsic() is called.  (In particular, many users cast to
IntrinsicInstr or one of its subclasses before calling
getIntrinsicID().)

This has an incidental functional change: Before, isIntrinsic() would
return true for any function whose name started with "llvm.", even if it
wasn't properly an intrinsic.  The new behavior seems more correct to
me, because it's strange to say that isIntrinsic() is true, but
getIntrinsicId() returns "not an intrinsic".

Some callers want the old behavior -- they want to know whether the
caller is a recognized intrinsic, or might be one in some other version
of LLVM.  For them, we added Function::hasLLVMReservedName(), which
checks whether the name starts with "llvm.".

This change is good for a 1.5% e2e speedup compiling a large Eigen
benchmark.

Reviewers: bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 23:46:57 +00:00
Anna Thomas
3b6613c9db Add invariant start call creation in IRBuilder.NFC
Differential Revision: https://reviews.llvm.org/D22700

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276471 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 20:57:23 +00:00
Anna Thomas
80ee170cb3 Invariant start/end intrinsics overloaded for address space
Summary:
The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address
space.

With this change, these intrinsics are overloaded for any adddress space
for memory objects
and we can use these llvm invariant intrinsics in non-default address
spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant
memory in managed languages.

Reviewers: apilipenko, reames

Subscribers: llvm-commits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 17:49:40 +00:00
Simon Pilgrim
370589a158 [X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 (reapplied)
As reported on PR26235, we don't currently make use of the VBROADCASTF128/VBROADCASTI128 instructions (or the AVX512 equivalents) to load+splat a 128-bit vector to both lanes of a 256-bit vector.

This patch enables lowering from subvector insertion/concatenation patterns and auto-upgrades the llvm.x86.avx.vbroadcastf128.pd.256 / llvm.x86.avx.vbroadcastf128.ps.256 intrinsics to match.

We could possibly investigate using VBROADCASTF128/VBROADCASTI128 to load repeated constants as well (similar to how we already do for scalar broadcasts).

Reapplied with fix for PR28657 - removed intrinsic definitions (clang companion patch to be be submitted shortly).

Differential Revision: https://reviews.llvm.org/D22460

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 13:58:44 +00:00
Benjamin Kramer
964a86a1f7 Revert "[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128"
It caused PR28657.

This reverts commit r276281.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276405 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 11:03:10 +00:00
Anna Thomas
d89a69b5fd Revert "Invariant start/end intrinsics overloaded for address space"
This reverts commit r276316.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 19:06:28 +00:00
Anna Thomas
4227f92f58 Invariant start/end intrinsics overloaded for address space
Summary:
The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address space.

With this change, these intrinsics are overloaded for any adddress space for memory objects
and we can use these llvm invariant intrinsics in non-default address spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant memory in managed languages.

Reviewers: tstellarAMD, reames, apilipenko

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22519

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 18:41:44 +00:00
Simon Pilgrim
50248af35e [X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128
As reported on PR26235, we don't currently make use of the VBROADCASTF128/VBROADCASTI128 instructions (or the AVX512 equivalents) to load+splat a 128-bit vector to both lanes of a 256-bit vector.

This patch enables lowering from subvector insertion/concatenation patterns and auto-upgrades the llvm.x86.avx.vbroadcastf128.pd.256 / llvm.x86.avx.vbroadcastf128.ps.256 intrinsics to match.

We could possibly investigate using VBROADCASTF128/VBROADCASTI128 to load repeated constants as well (similar to how we already do for scalar broadcasts).

Differential Revision: https://reviews.llvm.org/D22460

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 14:10:54 +00:00