Commit Graph

125771 Commits

Author SHA1 Message Date
Chandler Carruth
c1527e65f8 [ptr-traits] Refactor how PointerIntPair does its pointer manipulation
to isolate it in a dependent helper class.

Without doing this, we end up requiring all of the pointer traits the
moment you even define a PointerIntPair. That makes them *incredibly*
hard to use, for example you can't use them at all inside a class for
pointers to that class!

This change sinks all the logic into a helper template class that only
needs to be fully instantiated when *using* the PointerIntPair. We still
get compile-time checking, but it is deferred long enough to make
tradition out-of-line method definitions (or just the normal deferred
method body parsing) sufficient to handle cycling references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 03:56:19 +00:00
Chandler Carruth
140bb2d40b [ptr-traits] Add one more #include necessary to do strict alignment
checking of pointers used in PointerIntPairs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256617 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 03:56:17 +00:00
Teresa Johnson
8a32dc47d6 Rename MDValue* to Metadata* (NFC)
Renamed MDValue* to Metadata*, and MDValueToValIDMap to MetadataToIDs,
as per review for r255909.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256593 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 23:00:22 +00:00
Manuel Jacob
1ae1fbe339 [RS4GC] Use DenseMap::count() instead of DenseMap::find()/DenseMap::end(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256586 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 22:16:41 +00:00
Sanjay Patel
5ba53aa41d don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256584 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 22:11:50 +00:00
Sanjay Patel
b9a849eeb8 use auto with dyn_casted values; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 22:00:37 +00:00
Manuel Jacob
df4a54ad91 [PlaceSafepoints] Assert that the gc.safepoint_poll function is present in the module.
If running the PlaceSafepoints pass on a module which doesn't have the
gc.safepoint_poll function without disabling entry and backedge safepoints,
previously the pass crashed with an obscure error because of a null pointer.
Now it fails the assert instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256580 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 21:57:55 +00:00
Sanjay Patel
733af2eb65 use auto with dyn_casted values; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256579 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 21:49:08 +00:00
Sanjay Patel
960b34efe0 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256574 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 19:34:53 +00:00
Sanjay Patel
3bb88046da use range-based for-loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256573 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 19:14:23 +00:00
Sanjay Patel
f2dffb31ec use range-based for-loop; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256572 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 18:30:09 +00:00
Chad Rosier
8b2e79cb09 Add command line options to force function/loop alignments.
These are being added for testing purposes.
http://reviews.llvm.org/D15648

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 18:18:07 +00:00
Sanjay Patel
71bc3dca8f don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256569 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 18:14:06 +00:00
Geoff Berry
7a39479674 [JumpThreading] Fix opcode bonus in getJumpThreadDuplicationCost()
The code that was meant to adjust the duplication cost based on the
terminator opcode was not being executed in cases where the initial
threshold was hit inside the loop.

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256568 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 18:10:16 +00:00
Sanjay Patel
c32ece6aee use range-based for-loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256566 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 17:15:22 +00:00
Philip Reames
d70fde56aa [MemoryBuiltins] Delete dead code [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256565 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 17:04:43 +00:00
Michael Zuckerman
982aa42a6e [AVX512] add PSRLW Intrinsic
Fixing tab/space indentation.
Differential Revision: http://reviews.llvm.org/D15751



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256561 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 14:34:58 +00:00
Davide Italiano
ec0fb28be3 [llvm-objdump] Mark noreturn function as such.
Match attribute in the header to make MSVC happy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256560 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 13:41:02 +00:00
Michael Zuckerman
48d1be172b [AVX512] add PSRLW Intrinsic
Differential Revision: http://reviews.llvm.org/D15751


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256558 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 13:04:35 +00:00
Chandler Carruth
df1cf99600 [ADT] Teach alignment helpers to work correctly for abstract classes.
This is necessary to use them as part of pointer traits and is generally
useful. I've added unit test coverage to isolate and ensure this works
correctly.

I'll watch the build bots to try to see if any compilers can't tolerate
this bit of magic (and much credit goes to Richard Smith for coming up
with this magical production!) but give a shout if you see issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256553 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 09:52:41 +00:00
Chandler Carruth
a202d8ec2d [ptr-traits] Provide a real MCFragment address for the sentinel instead
of casting the integer '4' to such a pointer. There is no reason to
expect '4' to be a portable or reliable pointer of this form. The only
reason this ever worked is because the PointerIntPair that this actually
gets used with has an artificially *low* presumed alignment that allowed
it to work. When the alignment of PointerIntPair is derived from the
actual type's alignment, the asserts start firing on this pointer. I'm
amazed we never managed to do anything that triggered the alignment
sanitizer with it, as this is just flat out UB.

If folks dislike this approach to providing a sentinel fragment address,
there are a myriad of other alternatives, suggestions welcome. But this
one has the distinct advantage of not requiring the friend dance of
ilist's sentinel (which I'll point out is *also* in play for
MCFragment!) and seems to be using a nicely provided facility in
MCFragment to establish just such dummy nodes.

This is part of a series of patches to allow LLVM to check for complete
pointee types when computing its pointer traits. This is absolutely
necessary to get correct (or reproducible) results for things like how
many low bits are guaranteed to be zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256552 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 09:32:18 +00:00
Chandler Carruth
5bfe3bbc47 [ptr-traits] Sink several in-body method definitions to be out-of-line
inline definitions after the mutually recursive pair of types have been
defined. The two types mutually recurse specifically through
abstractions that require pointer traits which makes this kind of mutual
recursion especially tricky to get right in terms of ordering.

This is part of a series of patches to allow LLVM to check for complete
pointee types when computing its pointer traits. This is absolutely
necessary to get correct (or reproducible) results for things like how
many low bits are guaranteed to be zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256551 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 09:24:42 +00:00
Chandler Carruth
f79435efbe [ptr-traits] Sink a constructor definition to the .cpp file and add
missing includes so that the pointee types for DenseMap pointer keys and
such are complete prior to us querying the pointer traits for them.

This is part of a series of patches to allow LLVM to check for complete
pointee types when computing its pointer traits. This is absolutely
necessary to get correct (or reproducible) results for things like how
many low bits are guaranteed to be zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256550 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 09:24:39 +00:00
Chandler Carruth
39ec439c79 [ptr-traits] Add a bunch of includes to provide complete types that are
used in pointer dense map key types or in other ways that require
pointer traits.

This is part of a series of patches to allow LLVM to check for complete
pointee types when computing its pointer traits. This is absolutely
necessary to get correct (or reproducible) results for things like how
many low bits are guaranteed to be zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256549 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 09:06:21 +00:00
Chandler Carruth
24cdab76e0 [ptr-traits] Split the MCFragment type hierarchy out of the MCAssembler
header to its own header, allowing users of fragments to have a narrower
header file, and avoid circular header dependencies when getting the
definition of MCSection prior to inspecting traits on MCSection
pointers.

This is part of a series of patches to allow LLVM to check for complete
pointee types when computing its pointer traits. This is absolutely
necessary to get correct (or reproducible) results for things like how
many low bits are guaranteed to be zero.

Note that this doesn't in any way change the design of MC, it is just
moving code around to allow the *header files* to be more fine grained.
Without this, it is impossible to get a complete type for MCSection
where it is needed.

If anyone would prefer a different slicing of the header files, I'm
happy to oblige of course. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256548 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 09:06:16 +00:00
Chandler Carruth
0d55429ae6 [MC] Fix the comment header for this header file. It was just
copy/pasted.

Happy for anyone to suggest a more precise or refined set of boilerplate
here, but the comments on the actual code seem descriptive and accurate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256547 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 09:06:10 +00:00
Craig Topper
cf09bdf62e De-virtualize mnemonicIsValid and remove from the base class. It's not called by any common code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256544 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 07:43:03 +00:00
Craig Topper
3058f6ed44 [TableGen] Remove MnemonicContainsDot from AsmParser. It isn't used. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256542 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 07:03:30 +00:00
Craig Topper
04efc660cc [X86] Remove declaration of ATTAsmParser. Its equivalent to the DefaultAsmParser. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256541 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 07:03:27 +00:00
Craig Topper
98a6307b5a [TableGen] Add missing space to output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256540 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 07:03:25 +00:00
Craig Topper
300c966c18 [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 07:03:23 +00:00
James Y Knight
b905a6b1c4 [TrailingObjects] Dynamically realign under-aligned trailing objects.
Previously, the code enforced non-decreasing alignment of each trailing
type. However, it's easy enough to allow for realignment as needed, and
thus avoid the developer having to think about the possiblilities for
alignment requirements on all architectures.

(E.g. on Linux/x86, a struct with an int64 member is 4-byte aligned,
while on other 32-bit archs -- and even with other OSes on x86 -- it has
8-byte alignment. This sort of thing is irritating to have to manually
deal with.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256533 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 04:00:43 +00:00
James Y Knight
c1b271062b Fix gold test after r256465.
That commit added a new pass, and this test is sensitive to what the
first pass after verify is called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256532 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 03:48:37 +00:00
Chandler Carruth
9bdbabc1b2 [ptr-traits] Merge the MetadataTracking helpers into the Metadata
header.

This is part of a series of patches to allow LLVM to check for complete
pointee types when computing its pointer traits. This is absolutely
necessary to get correct (or reproducible) results for things like how
many low bits are guaranteed to be zero.

The MetadataTracking helpers aren't actually independent. They rely on
constructing a PointerUnion between Metadata and MetadataAsValue
pointers, which requires know the alignment of pointers to those types
which requires them to be complete.

The .cpp file even defined a method declared in Metadata.h! These really
don't seem like something that is separable, and there is no real
layering problem with just placing them together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256531 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 02:14:50 +00:00
Chandler Carruth
5c35f963fb [ADT] Run clang-format over another file before I try to enhance it so
I don't commit the bug in r256518 again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256530 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 02:14:45 +00:00
Chandler Carruth
1093924e45 [ADT] Use a nonce type with at least 4 byte alignment.
We didn't actually statically check this, and so it worked 25% of the
time for me. =/ Really sorry it took so long to fix, I shouldn't leave
the commit log editor window open without saving and landing the commit.
=[

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256528 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 00:03:24 +00:00
Eric Christopher
8d5b76e5d4 Accept dwarf version 5 for CIE versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 23:02:42 +00:00
Artyom Skrobov
1714cbd44c [Thumb] Fix assembler error 'cannot honor width suffix pop {lr}'
Summary:
* avoid generating POP {LR} in Thumb1 epilogues
* combine MOV LR, Rx + BX LR -> BX Rx in a peephole optimization pass
* combine POP {LR} + B + BX LR -> POP {PC} on v5T+

Test cases by Ana Pazos

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256523 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 21:40:45 +00:00
Sanjay Patel
a5063429b2 [x86] lower calls to fmin and llvm.minnum.* using minss/minsd/minps/minpd (PR24475)
This is a follow-on to:
http://reviews.llvm.org/rL255700
http://reviews.llvm.org/rL256454
http://reviews.llvm.org/rL256510



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256522 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 21:16:55 +00:00
Easwaran Raman
0651a407f6 Refactor inline costs analysis by removing the InlineCostAnalysis class
InlineCostAnalysis is an analysis pass without any need for it to be one.
Once it stops being an analysis pass, it doesn't maintain any useful state
and the member functions inside can be made free functions. NFC.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256521 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 20:28:19 +00:00
Manuel Jacob
912373de69 [RS4GC] Fix rematerialization of bitcast of bitcast.
Summary:
Previously, only the outer (last) bitcast was rematerialized, resulting in a
use of the unrelocated inner (first) bitcast after the statepoint.  See the
test case for an example.

Reviewers: igor-laevsky, reames

Subscribers: reames, alex, llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256520 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 20:14:05 +00:00
Elena Demikhovsky
84f6badccc Implemented cost model for masked gather and scatter operations
The cost is calculated for all X86 targets. When gather/scatter instruction
is not supported we calculate the cost of scalar sequence.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256519 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 20:10:59 +00:00
Chandler Carruth
d0dc794073 [ADT] Don't use a fixture just to get a nonce type for this unittest.
Instead, actually produce a nonce type in the test and use that. This
makes the test, IMO, both simpler and more clear.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256518 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 20:03:16 +00:00
Eric Christopher
9baeb40c98 As a prelude to the rest of DWARF5 being supported go ahead and accept
version 5 in llvm-dwarfdump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256515 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 19:58:36 +00:00
Chandler Carruth
0fd19a0c60 [ADT] Run clang-format over more code, fixing numerous formatting
oddities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256514 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 19:54:36 +00:00
Chandler Carruth
63021c496e [ADT] Run clang-format over PointerUnion.h and clean up its comments.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256513 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 19:52:46 +00:00
Manuel Jacob
aa64145119 [vim] Add token type to Vim syntax file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256512 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 19:51:04 +00:00
Sanjay Patel
5fb72b3250 [x86] lower calls to fmax and llvm.maxnum.* using maxps/maxpd (PR24475)
This is a follow-on to:
http://reviews.llvm.org/rL255700
http://reviews.llvm.org/rL256454



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256510 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 19:20:19 +00:00
Sanjay Patel
3e50893e8e Specify triple so 'make check' passes on darwin x86-64
The check lines were added with:
http://reviews.llvm.org/rL256458
http://reviews.llvm.org/rL256460

but on a darwin target, the output looks like:
  ## InlineAsm Start
  rorq  %rdi
  ## InlineAsm End
  ## InlineAsm Start
  rorq  %rsi
  ## InlineAsm End
  leaq  (%rsi,%rdi), %rax
  retq




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256507 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 18:28:44 +00:00
Sanjay Patel
4c32013a9a tidy up; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256506 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 18:18:22 +00:00