150488 Commits

Author SHA1 Message Date
Simon Pilgrim
c8690fe7c3 Strip UTF8 BOM that got added in rL305091
Seems my recent move to VS2017 has resulted in a few text editor issues.....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305285 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 10:17:57 +00:00
Simon Pilgrim
0c871133a0 [X86][SSE] Refactor getTargetConstantBitsFromNode to avoid large APInts (PR32037)
Much of PR32037's compile time regression is due to getTargetConstantBitsFromNode always creating large (>64bit) APInts during the bitcasting from the source data to the destination bitwidth.

This commit avoids this bitcast stage if the data is already the correct bitwidth.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 10:13:48 +00:00
Simon Pilgrim
58e5b1642d Strip UTF8 BOM that got added for some reason in rL305163
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305282 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 09:58:27 +00:00
NAKAMURA Takumi
9dab15d6d6 PPCISelLowering.cpp: Fix warnings in r305214. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305277 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 07:34:32 +00:00
Craig Topper
b260ed93ae [AVX-512] Mark masked VPCMP instructions as commutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305276 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 07:13:50 +00:00
Craig Topper
23a0d7597f [AVX-512] Mark masked version of vpcmpeq as being commutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305275 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 07:13:47 +00:00
Craig Topper
f494ed9fe0 [X86] Add masked integer compare instructions to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305274 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 07:13:44 +00:00
Daniel Jasper
efb1f17b70 Read /out:%t which was (accidentally?) removed in r305258.
Without it, the source directory gets polluted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305271 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 07:00:05 +00:00
Brian Gesiak
a468462b6a [Lexicon] Add GVN
Summary: Add a lexicon entry for global value numbering.

Reviewers: davide, majnemer

Reviewed By: davide

Subscribers: llvm-commits, inouehrs

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305270 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 03:06:16 +00:00
David Blaikie
b890993f2f Inliner: Avoid calling shouldInline until it's absolutely necessary
This restores the order of evaluation (& conditionalized evaluation) of
isTriviallyDeadInstruction, InlineHistoryIncludes, and shouldInline
(with the addition of a shouldInline call after
isTriviallyDeadInstruction) from before r305245.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305267 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 02:24:09 +00:00
Sam Clegg
cbf4a3dfad [WebAssembly] Fix symbol type for addresses of external functions
These symbols were previously not being marked as functions
so were appearing as globals instead, and with the incorrect
relocation type.

Without this fix, objects that take address of external
functions include them as global imports rather than function
imports which then fails at link time.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305263 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 01:42:21 +00:00
George Burgess IV
cff96a9836 Fix signed/unsigned comparison warning; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305262 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 01:28:49 +00:00
Wolfgang Pieb
50aa7684a9 Adding one test that I forgot to include with the commit for https://reviews.llvm.org/D32779.
NFC



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305261 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 00:42:03 +00:00
Eric Beckmann
5727acd43e Revert "Revert "Fix alignment bug in COFF emission.""
This revert was done so that my other patch to add test framework could
land separately.  Now the revert can be reverted and this patch can
reland.

This reverts commit 18b3c75b2b0d32601fb60a06b9672c33d6f0dff9.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 00:19:43 +00:00
Eric Beckmann
414fa87d30 Update the test framework for llvm-cvtres to be more comprehensive.
Summary: Added test cases for multiple machine types, file merging, multiple languages, and more resource types.  Also fixed new bugs these tests exposed.

Subscribers: javed.absar, llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 00:16:32 +00:00
Eric Beckmann
78c60c1d48 Revert "Fix alignment bug in COFF emission."
I accidentally combined this patch with one for adding more tests, they
should be separated.

This reverts commit 3da218a523be78df32e637d3446ecf97c9ea0465.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 00:15:47 +00:00
Eric Beckmann
7190629e5b Fix alignment bug in COFF emission.
Summary: Fix alignment issue in D34020, by aligning all sections to 8 bytes.

Reviewers: zturner

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 00:06:10 +00:00
Craig Topper
490f2e0bf7 [IR] Remove override of operator new from PHINode.
This just forwarded to the same signature in User. The version in User is protected so there's no danger of anyone outside of PHINode constructing with the wrong operator new. All PHINodes are created by a static Create function in PHINode.

I believe at one point in history this called User::operator new(s, 0) so it was useful then.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305255 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 00:00:19 +00:00
Adrian Prantl
3f23964a39 Update LangRef for PR27284.
And reverse the ownership between DICompileUnit and DISubprogram.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 23:59:43 +00:00
Sam Clegg
d291c78308 [WebAssembly] MC: Fix value of R_WEBASSEMBLY_TABLE_INDEX relocations
Previously we were writing the value function index space
value but for these types of relocations we want to be
writing the table element index space value.

Add a test case for these relocation types that fails
without this change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305253 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 23:52:44 +00:00
Adrian Prantl
011dd83cbf Use a fixed target triple to s to appease windows bots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305252 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 23:47:27 +00:00
Craig Topper
33617b05dd [IR] Stop deleting other signatures of User::operator new when we override one signature in a class derived from User
User has 3 signatures for operator new today. They take a single size, a size and a number of users, and a size, number of users, and descriptor size.

Historically there used to only be one signature that took size and a number of uses. Long ago derived classes implemented their own versions that took just a size and would call the size and use count version. Then they left an unimplemented signature for the size and use count signature from User. As we moved to C++11 this unimplemented signature because = delete.

Since then operator new has picked up two new signatures for operator new. But when the 3 argument version was added it was never added to the delete list in all of the derived classes where the 2 argument version is deleted. This makes things inconsistent.

I believe once one version of operator new is created in a derived class name hiding will take care of making all of the base class signatures unavailable. So I don't think the deleted lines are needed at all.

This patch removes all of the deletes in cases where there is an override or there is already a delete of another signature (that should trigger name hiding too).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 23:25:15 +00:00
Zachary Turner
5d1e5bdd1b Fix line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305249 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 23:15:47 +00:00
Zachary Turner
ab44768b23 [pdb] Don't choke on unknown symbol types.
When we get an unknown symbol type, we might as well at least
dump it.  Same goes for round-tripping through YAML, we can
dump the record contents as raw bytes even if we don't know
how to interpret it semantically.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 23:10:31 +00:00
David Blaikie
2ed087d093 Inliner: Don't remove calls to readnone+nounwind (but not always_inline) functions in the AlwaysInliner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305245 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 23:01:17 +00:00
Adrian Prantl
9cdced8874 Fix an assertion failure when duplicate dbg.declares are present.
This fixes PR33157.
https://bugs.llvm.org//show_bug.cgi?id=33157

We might also think about disallowing duplicate dbg.declare intrinsics
entirely, but this may complicate some passes needlessly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305244 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 22:41:06 +00:00
Sanjay Patel
44863cb6b5 fix typos/formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305243 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 22:34:37 +00:00
David Blaikie
a17d9bc6ed Support: Don't set RLIMIT_AS on child processes when applying a memory limit
It doesn't seem relevant to set an address space limit - this isn't
important in any sense that I'm aware & it gets in the way of things
that use a lot of address space, like llvm-symbolizer.

This came up when I realized that bugpoint regression tests were much
slower with -gsplit-dwarf than plain -g. Turned out that bugpoint
subprocesses (opt, etc) were crashing and doing symbolization - but
bugpoint runs those subprocesses with a 400MB memory limit. So with
plain -g, mmaping the opt binary would exceed the memory limit, fail,
and thus be really fast - no symbolization occurred. Whereas with
-gsplit-dwarf, comically, having less to map in, it would succeed and
then spend lots of time symbolizing.

I've fixed at least the critical part of bugpoint's perf problem there
by adding an option to allow bugpoint to disable symbolization. Thus
improving the perfromance for -gsplit-dwarf and making the -g-esque
speed available without this quirk/accidental benefit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305242 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 22:16:49 +00:00
George Burgess IV
b94805cb8a [ADT] Add type-safe methods to FoldingSetImpl; NFC.
Thankfully, this hasn't uncovered any new bugs. With this, issues like
the one fixed in r305207 (hopefully) shouldn't happen again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305241 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 22:08:08 +00:00
Zachary Turner
b99d5dc7a5 Fix printing error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305240 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 22:08:03 +00:00
Zachary Turner
6848156130 [llvm-pdbutil] Fix one more issue with no-id-stream PDBs.
This one occurred when we were dumping symbols, we have code
that is prepared to dump many different types of symbols,
including symbols which reference an ID stream.  So when creating
the dumper object, we assume that there is an ID stream.  Fix
this assumption.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305237 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 21:57:41 +00:00
Zachary Turner
3985d97184 Slightly better fix for dealing with no-id-stream PDBs.
The last fix required the user to manually add the required
feature.  This caused an LLD test to fail because I failed to
update LLD.  In practice we can hide this logic so it can just
be transparently added when we write the PDB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 21:46:51 +00:00
Zachary Turner
aaa081a200 [llvm-pdbdump] Don't fail on PDBs with no ID stream.
Older PDBs don't have this.  Its presence is detected by using
the various "feature" flags that come at the end of the PDB
Stream.  Detect this, and don't try to dump the ID stream if the
features tells us it's not present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305235 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 21:34:53 +00:00
Anna Thomas
8cedcc7579 [RS4GC] Drop invalid metadata after pointers are relocated
Summary:
After RS4GC, we should drop metadata that is no longer valid. These metadata
is used by optimizations scheduled after RS4GC, and can cause a miscompile.
One such metadata is invariant.load which is used by LICM sinking transform.
After rewriting statepoints, the address of a load maybe relocated. With
invariant.load metadata on a load instruction, LICM sinking assumes the
loaded value (from a dererenceable address) to be invariant, and
rematerializes the load operand and the load at the exit block.
This transforms the IR to have an unrelocated use of the
address after a statepoint, which is incorrect.
Other metadata we conservatively remove are related to
dereferenceability and noalias metadata.

This patch drops such metadata on store and load instructions after
rewriting statepoints.

Reviewers: reames, sanjoy, apilipenko

Reviewed by: reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 21:26:53 +00:00
Tom Stellard
c746f23920 AMDGPU/GlobalISel: Mark 32-bit G_ADD as legal
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, llvm-commits, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:54:56 +00:00
George Burgess IV
4d6bb2d890 [ADT] Reduce duplication between {Contextual,}FoldingSet; NFC
This is a precursor to another change (coming soon) that aims to make
FoldingSet's API more type-safe. Without this, the type-safety change
would just duplicate 4 more public methods between the already very
similar classes.

This renames FoldingSetImpl to FoldingSetBase so it's consistent with
the FooBase -> FooImpl<T> -> Foo<T> convention we seem to have with
other containers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305231 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:52:53 +00:00
Tim Northover
4f4997576f AArch64: don't try to emit an add (shifted reg) for SP.
The "Add/sub (shifted reg)" instructions use the 31 encoding for xzr and wzr
rather than the SP, so we need to use different variants.

Situations where this actually comes up are rare enough (see test-case) that I
think falling back to DAG is fine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305230 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:49:53 +00:00
Zachary Turner
bd6d1e94a1 Fix a null pointer dereference in llvm-pdbutil pretty.
Static data members were causing a problem because I mistakenly
assumed all members would affect a class's layout and so the
Layout member would be non-null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305229 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:46:35 +00:00
Matthias Braun
c37ab5f805 SplitKit: Fix partially live subreg splitting
Fix thinko/typo in subreg aware liverange splitting logic. I'm not sure
how to write a proper testcase for this. The original problem only
happens on an out-of-tree target. Forcing subreg enabled targets to
spill and split in a predictable way is near impossible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305228 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:30:52 +00:00
Peter Collingbourne
9283a09c18 IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata.
The new metadata is easier to manipulate than module flags.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:10:48 +00:00
David Blaikie
fd2310ef5b Remove unneeded conditionals - the code is already conditional on the same condition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:09:53 +00:00
Tim Hammerquist
ce1a1091e2 Add EOL at EOF to appease source utils like unifdef
<rdar://problem/32511256>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:08:55 +00:00
Reid Kleckner
0e34c3597c [llvm-ar] Make llvm-lib behave more like the MSVC archiver
Summary:
Use the filepath used to open the archive member as the archive member
name instead of the file basename. This path might be absolute or
relative.  This is important because the archive member name will show
up in the PDB, and we want our PDBs to look as much like MSVC's as
possible.

This also helps avoid an issue in our PDB module descriptor writing
code, which assumes that all module names are unique. Relative paths
still aren't guaranteed to be unique, but they're much better than
basenames, which definitely aren't unique.

Reviewers: ruiu, zturner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 19:45:35 +00:00
Galina Kistanova
b31b7dcdb5 Addressed Takumi's comment about redundancy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 19:17:55 +00:00
Spyridoula Gravani
ef10827246 [DWARF] Added a blank line in llvm-dwarfdump to test commit access.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305220 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 19:04:28 +00:00
Sylvestre Ledru
b12244c42f Same expressions on both sides of the return
Summary:
I guess we want PointerToMemberFunction & PointerToDataMember


Fix coverity cid 1376038 


Reviewers: zturner

Reviewed By: zturner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305219 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 18:53:46 +00:00
Tony Jiang
759cec2ab3 [PowerPC] Match vec_revb builtins to P9 instructions.
Power9 has instructions that will reverse the bytes within an element for all
sizes (half-word, word, double-word and quad-word). These can be used for the
vec_revb builtins in altivec.h. However, we implement these to match vector
shuffle nodes as that will cover both the builtins and vector shuffles that
occur in the SDAG through other means.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 18:24:36 +00:00
Tony Jiang
e3ae196e24 [Power9] Added support for the modsw, moduw, modsd, modud hardware instructions.
Note that if we need the result of both the divide and the modulo then we
compute the modulo based on the result of the divide and not using the new
hardware instruction.

Commit on behalf of STEFAN PINTILIE.
Differential Revision: https://reviews.llvm.org/D33940

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305210 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:58:42 +00:00
Reid Kleckner
20e04578a8 [llvm-ar] Fix AddNewMember typo in enum
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:44:42 +00:00
Sanjay Patel
59e73620b8 [utils] remove ability to generate llc check lines from update_test_checks.py
The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing just causes confusion. Now, this script will only work with 
opt to produce check lines for IR transforms.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305208 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:44:30 +00:00