Commit Graph

125771 Commits

Author SHA1 Message Date
Simon Pilgrim
0dd2ca765d [X86][SSE] Added tests for insertion of zero elements into vectors
Many of these could be much better if we just lowered them all as shuffles - especially for the 256-bit vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 17:33:32 +00:00
Dimitry Andric
ac6a87b06e Fix several accidental DOS line endings in source files
Summary:
There are a number of files in the tree which have been accidentally checked in with DOS line endings.  Convert these to native line endings.

There are also a few files which have DOS line endings on purpose, and I have set the svn:eol-style property to 'CRLF' on those.

Reviewers: joerg, aaron.ballman

Subscribers: aaron.ballman, sanjoy, dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 17:22:03 +00:00
Simon Pilgrim
c88a575ea5 [X86][SSE41] Added test cases for improving insertps shuffles
As mentioned on D14261, an upcoming patch will improve combines of insertps instructions. 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 17:14:15 +00:00
Simon Pilgrim
85b6d5e1dd [X86][SSE] Added v4f32 shuffle with zero tests
This is mainly test cases for improvements to insertps matching, but pre-SSE41 shuffles could be improved as well

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 17:02:56 +00:00
Craig Topper
07466510a7 [TableGen] Simplify some code slightly. No need to check if the arrays are empty before printing. The loop can be made to print the same thing if the loop is empty. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 08:57:41 +00:00
Craig Topper
2e085133b3 Use an ArrayRef to simplify repeated calculation of the array end. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 08:45:36 +00:00
Craig Topper
4d0731f505 Use std::is_sorted instead of manual loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256701 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:45 +00:00
Craig Topper
2e0fe4b9e9 Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:42 +00:00
Craig Topper
4d34e548af [TableGen] Replace a logically negated xor of bools with just an equality comparison for readability. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256699 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:39 +00:00
Craig Topper
9bb66bd6f5 [TableGen] Use std::find_if and a lambda instead of manual loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:36 +00:00
Craig Topper
8dd99ee81d [TableGen] Fix a bug introduced in r256627. If the switch was not emitted we still emitted a closing curly brace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:34 +00:00
Craig Topper
4d0e40564f [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:30 +00:00
Xinliang David Li
0620569576 [PGO] simple refactoring (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256695 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 04:38:13 +00:00
NAKAMURA Takumi
baea3c8692 WinEHPrepare.cpp: Suppress a warning for -Asserts. [-Wunused-variable]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 01:41:00 +00:00
Joseph Tremoulet
a035c6c7c2 [Verifier] Add braces to satisfy buildbots. NFC
Fix build break introduced by r256691.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-02 15:50:34 +00:00
Joseph Tremoulet
4505d54875 [WinEH] Verify catchswitch handlers
Summary:
The handler list must be nonempty and consist solely of CatchPads.


Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256691 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-02 15:25:25 +00:00
Joseph Tremoulet
3c6a15b1cc [WinEH] Tighten parentPad verifier checks
Summary: A catchswitch cannot be a parent of a cleanuppad or another catchswitch.

Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-02 15:24:24 +00:00
Joseph Tremoulet
d5ab13d966 [WinEH] Update catchrets with cloned successors
Summary:
Add a pass to update catchrets when their successors get cloned; the
existing pass doesn't catch these because it walks the funclet whose
blocks are being cloned but the catchret is in a child funclet.

Also update the test for removing incoming PHI values; when the
predecessor is a catchret, the relevant color is the catchret's parentPad,
not its block's color.


Reviewers: andrew.w.kaylor, rnk, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256689 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-02 15:22:36 +00:00
Yaron Keren
8e6708e246 Correct misleading formatting of several ifs followed by two statements without braces.
While the original code would work with or without braces, it makes sense to
set HaveSemi to true only if (!HaveSemi), otherwise it's already true, so I
put the assignment inside the if block. This addresses PR25998.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-02 13:40:36 +00:00
David Majnemer
71d29c18dc [WinEH] Add additional verification
Recolor the IR to make sure our computed colors are not hiding any bugs.
Also, verifyFunction if we are running some post-preparation operations;
some of these operations can hide latent bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-02 09:26:36 +00:00
David Majnemer
19d1ebc725 [X86] Add intrinsics for reading and writing to the flags register
LLVM's targets need to know if stack pointer adjustments occur after the
prologue.  This is needed to correctly determine if the red-zone is
appropriate to use or if a frame pointer is required.

Normally, LLVM can figure this out very precisely by reasoning about the
contents of the MachineFunction.  There is an interesting corner case:
inline assembly.

The vast majority of inline assembly which will perform a push or pop is
done so to pair up with pushf or popf as appropriate.  Unfortunately,
this inline assembly doesn't mark the stack pointer as clobbered
because, well, it isn't.  The stack pointer is decremented and then
immediately incremented.  Because of this, LLVM was changed in r256456
to conservatively assume that inline assembly contain a sequence of
stack operations.  This is unfortunate because the vast majority of
inline assembly will not end up manipulating the stack pointer in any
way at all.

Instead, let's provide a more principled solution: an intrinsic.
FWIW, other compilers (MSVC and GCC among them) also provide this
functionality as an intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-01 06:50:01 +00:00
Sanjay Patel
e193ff319c [LibCallSimplifier] propagate FMF when shrinking binary calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256682 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 23:40:59 +00:00
Craig Topper
31e470b254 [X86] Remove a return after llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256681 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 22:40:48 +00:00
Craig Topper
8cb3fe2069 [X86] Move shuffle decoding for constant pool into the X86CodeGen library to remove a layering violation in the Util library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256680 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 22:40:45 +00:00
Sanjay Patel
2e3f468f86 [LibCallSimplifier] propagate FMF when shrinking unary calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 21:52:31 +00:00
Sanjay Patel
36bfd300cd change function names to avoid accidentally matching the substring
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256678 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 21:25:25 +00:00
Sanjay Patel
f6e2baf532 add 'fast' attribute to calls to show that the flag isn't being propagated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256677 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 21:12:19 +00:00
Sanjay Patel
6622d8b812 Variable names start with an upper case letter; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256676 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 16:16:58 +00:00
Sanjay Patel
ad8bf7ce34 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256675 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 16:10:49 +00:00
Sanjay Patel
3f79d59152 add FMF for CreateCall variant
The version with OpBundles was missed in:
http://reviews.llvm.org/rL255555



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256674 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 15:39:34 +00:00
Michael Zuckerman
6edca6938a [AVX512] add PSRLQ and PSRLD Intrinsic
Differential Revision: http://reviews.llvm.org/D15770


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256673 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 15:22:04 +00:00
Michael Kuperstein
4f73c42797 [X86] Avoid folding scalar loads into unary sse intrinsics
Not folding these cases tends to avoid partial register updates:
sqrtss (%eax), %xmm0
Has a partial update of %xmm0, while
movss (%eax), %xmm0
sqrtss %xmm0, %xmm0
Has a clobber of the high lanes immediately before the partial update,
avoiding a potential stall.

Given this, we only want to fold when optimizing for size.
This is consistent with the patterns we already have for some of
the fp/int converts, and in X86InstrInfo::foldMemoryOperandImpl()

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256671 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 09:45:16 +00:00
Asaf Badouh
7b8bd88d45 [X86][PKU] Add {RD,WR}PKRU intrinsics
Differential Revision: http://reviews.llvm.org/D15808

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256670 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 08:31:13 +00:00
Craig Topper
5ef134945b [TableGen] Modify the AsmMatcherEmitter to only apply the table growth from r252440 to the Hexagon target.
This restores the previous behavior of not including the mnemonic in the classes table for every target that starts instruction lines with the mnemonic. Not only did the table size increase by 1 entry, but the class enum increased in size which caused every class in the array to increase in size. It also grew the size of the function that parsers tokens into classes by a substantial amount.

This adds a new HasMnemonicFirst flag to all AsmParsers. It's set to 1 by default and Hexagon target overrides it to 0.

For the X86 target alone this recovers 324KB of size on the llvm-mc executable.

I believe the current state is still a bad design choice for the Hexagon target as it causes most of the parsing to do a linear search through the entire match table to comparing operands against every instruction until it finds one that works. At least for the other targets we do a binary search based on mnemonic over which to do the linear scan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 08:18:23 +00:00
Craig Topper
1159059a91 [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256668 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 08:18:20 +00:00
Xinliang David Li
f2f39d6f7b [PGO]: Implement Func PGO name string compression
This is part of the effort/prepration to reduce the size
instr-pgo (object, binary, memory footprint, and raw data).

The functionality is currently off by default and not yet
used by any clients.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256667 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 07:57:16 +00:00
Craig Topper
ee721e9867 [TableGen] Move determination of IsIsolatedToken into the tokenizer instead of trying to search characters around the token. No functional change intended. Verified for in-tree targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256660 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 05:01:45 +00:00
Chandler Carruth
3c4b3a5458 Revert "Revert "[ptr-traits] Implement the base pointer traits using the actual""
This reverts commit r256642 and restores r256620 now that Tobias has
updated Polly.

There are still some potential problems with the code in Polly that I've
sent post-commit review about, but they're unlikely to break anything in
practice, and I'd like to avoid the rest of LLVM and Clang regressing
here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256656 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 23:37:25 +00:00
Sanjay Patel
08e3bf995e [ValueTracking] fix bug computing isKnownToBeAPowerOfTwo() with arithmetic shift right (PR25900)
This is a fix for:
https://llvm.org/bugs/show_bug.cgi?id=25900

If we think that an arithmetic right shift of a power of two is always a power of two, 
an sdiv gets wrongly converted to udiv.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256655 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 22:40:52 +00:00
Teresa Johnson
04e678255f [ThinLTO] Rename variables used in metadata linking (NFC)
As suggested in review for r255909, rename MDMaterialized to AllowTemps,
and identify the name of the boolean flag being set in calls to
saveMetadataList.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256653 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 21:13:55 +00:00
Teresa Johnson
ba0fc20463 Ensure MDNode used as key in metadata linking map cannot be RAUWed
As suggested in review for r255909, add a way to ensure that temporary
MD used as keys in the MetadataToID map during ThinLTO importing are not
RAUWed.

Add support for marking an MDNode as not replaceable. Clear the new
CanReplace flag when adding a temporary MD node to the MetadataToID map
and clear it when destroying the map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256648 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 19:32:24 +00:00
Teresa Johnson
6e198168f8 [ThinLTO] Check MDNode values saved for metadata linking (NFC)
Add an assert suggested in review for r255909 to ensure that MDNodes
saved in the map used for metadata linking are either temporary or
resolved.

Also add a comment clarifying why we may need to save off non-MDNode
metadata.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 19:13:57 +00:00
Sanjay Patel
8a487cdf19 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256645 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 18:31:30 +00:00
Tobias Grosser
eec5b82c6f Revert "[ptr-traits] Implement the base pointer traits using the actual"
The commit we revert is rather small, but it enables a larger piece of new
infrastructure that allows to detected misuses of pointer-traits at compile
time. Unfortunately, this change breaks with the use of incomplete types (e.g.
in Polly). As I am not aware of a simple fix on the Polly side, I temporarely
revert this commit to clean the bots and sync-up with Chandler how to best
adapt to these recent changes.

This reverts commit https://llvm.org/svn/llvm-project/llvm/trunk@256620.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 14:02:58 +00:00
Craig Topper
db4180cc21 [TableGen] Remove unnecessary conversion from StringRef to std::string when outputting to a raw_ostream. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256628 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:24 +00:00
Craig Topper
e18e2bb916 [TableGen] Remove raw_string_ostream by just emitting the header for the switch the first time we emit a case. If the header was never emitted just print the default at the end. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:22 +00:00
Craig Topper
65438a7a79 [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256626 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:20 +00:00
Craig Topper
e6b50232bc [TableGen] Move more things that come from variant into the AsmVariantInfo class so we can reduce some parameters. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256625 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:18 +00:00
Craig Topper
a1a9b68880 [TableGen] Use 'size_t' instead of 'unsigned' to better match the argument types of addAsmOperand. Simplify some code by using StringRef::find instead of std::find. These were previously done in r247527 and r247528, but another commit seems to have erased them. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:15 +00:00
Chandler Carruth
13e79a46af [ptr-traits] Implement the base pointer traits using the actual
alignment of the pointee type!

This is the culmination of the ptr-traits work. Now the compiler will
catch me if I try to use a pointer to an empty struct as a key in
a dense map or inside a PointerIntPair or PointerUnion! This is much,
much better than sometimes corrupting data (and other times working
fine) due to insufficient alignment.

It also means that we will be much more diligent about rejecting other
uses of these constructs that aren't safe.

It also means that we can now be more aggressive with the constructs
when we actually have guaranteed higher alignment without specializing
stuff. I'll be going through and cleaning up all the current overrides
of these traits which are no longer necessary.

Many thanks to Richard, David, and others who helped me get all of this
together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256620 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 04:00:24 +00:00