Commit Graph

195758 Commits

Author SHA1 Message Date
Nico Weber eb0cfb5ab0 Warn when jumping out of a __finally block via goto.
This only warns on direct gotos and indirect gotos with a unique label
(`goto *&&label;`).  Jumping out ith a true indirect goto is already an error.

This isn't O(1), but goto statements are less common than continue, break, and
return.  Also, the GetDeepestCommonScope() call in the same function does the
same amount of work, so this isn't worse than what's there in a complexity
sense, and it should be pretty fast in practice.

This is the last piece that was missing in r231623.   

llvm-svn: 231628
2015-03-09 04:27:56 +00:00
Rui Ueyama 5768e9fde9 Test: Use layout-after instead of layout-before.
Update the tests so that they use layout-after instead of layout-before.
In all other places, we use layout-afters as primary edges.

llvm-svn: 231627
2015-03-09 04:00:29 +00:00
Mehdi Amini eb242a5041 InstCombine: fix fold "fcmp x, undef" to account for NaN
Summary:
See the two test cases.

; Can fold fcmp with undef on one side by choosing NaN for the undef

; Can fold fcmp with undef on both side
;   fcmp u_pred undef, undef -> true
;   fcmp o_pred undef, undef -> false
; because whatever you choose for the first undef
; you can choose NaN for the other undef

Reviewers: hfinkel, chandlerc, majnemer

Reviewed By: majnemer

Subscribers: majnemer, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231626
2015-03-09 03:20:25 +00:00
Nico Weber ce90329824 Fix a theoretical bug when ParseCompoundStatement() returns StmtError.
ParseCompoundStatement() currently never returns StmtError, but if it did,
Sema would keep the __finally scope on its stack indefinitely.  Explicitly
add an error callback that clears it.

llvm-svn: 231625
2015-03-09 03:17:15 +00:00
Mehdi Amini 75eda5e913 DCE: isArrayMalloc() is not used neither in LLVM nor Clang
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231624
2015-03-09 02:57:32 +00:00
Nico Weber d64657f298 Warn when jumping out of a __finally block via continue, break, return, __leave.
Since continue, break, return are much more common than __finally, this tries
to keep the work for continue, break, return O(1).  Sema keeps a stack of active
__finally scopes (to do this, ActOnSEHFinally() is split into
ActOnStartSEHFinally() and ActOnFinishSEHFinally()), and the various jump
statements then check if the current __finally scope (if present) is deeper
than then destination scope of the jump.

The same warning for goto statements is still missing.

This is the moral equivalent of MSVC's C4532.

llvm-svn: 231623
2015-03-09 02:47:59 +00:00
Nico Weber 9af63b22a5 Fix typo in comment.
llvm-svn: 231622
2015-03-09 02:34:29 +00:00
Nico Weber 620660cfde Wrap to 80 columns. No behavior change.
llvm-svn: 231621
2015-03-09 02:33:32 +00:00
Alexander Kornienko b2ddb8ac4d [clang-tidy] Fix assertion when a dependent expression is used in an assert.
llvm-svn: 231620
2015-03-09 02:27:57 +00:00
David Blaikie 7a3cbb2997 Simplify boolean expressions in clang with clang-tidy
Patch by Richard (legalize at xmission dot com).

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

llvm-svn: 231619
2015-03-09 02:02:07 +00:00
Rui Ueyama 4cefbd8b72 Resolver: Fix incorrect DenseMap mapping info.
Previously, getEmptyKey and getTombstoneKey return the same value
in the sense of isEqual defined by the same class, although they
need to be distinct values. This could confuse DenseMap.

We didn't see any issue by this wrong code because we don't delete
elements from the symbol table. We only add or replace elements.
But this is a bug and needs to be fixed anyway.

llvm-svn: 231618
2015-03-09 02:00:54 +00:00
David Blaikie dc3f01e9cf Simplify expressions involving boolean constants with clang-tidy
Patch by Richard (legalize at xmission dot com).

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

llvm-svn: 231617
2015-03-09 01:57:13 +00:00
Rui Ueyama 2a08dca3f7 Remove unused function.
llvm-svn: 231616
2015-03-09 01:05:04 +00:00
Rui Ueyama d18a97cb7a PECOFF: Create layout-afters instead of layout-befores.
All readers except PE/COFF reader create layout-after edges to preserve
the original symbol order. PE/COFF uses layout-before edges as primary
edges for no reason.

This patch makes PE/COFF reader to create layout-after edges.
Resolver is updated to recognize reverse edges of layout-after edges
in the garbage collection pass.

Now we can retire layout-before edges. I don't do that in this patch
because if I do, I would have updated many tests to replace all
occurrrences of "layout-before" with "layout-after". So that's a TODO.

llvm-svn: 231615
2015-03-09 00:06:07 +00:00
Rui Ueyama f46b190465 PECOFF: Define and use BaseReloc type instead of std::pair.
"first" and "second" are not easy to memorize.
Define a type to use meaningful names.

llvm-svn: 231614
2015-03-08 22:49:27 +00:00
Owen Anderson 7e621e9d5e Teach DataLayout to infer a plausible alignment for things even when nothing is specified by the user.
llvm-svn: 231613
2015-03-08 21:53:59 +00:00
Johannes Doerfert f4af99bc6a [Formating] Fix formating
llvm-svn: 231612
2015-03-08 21:38:35 +00:00
Rui Ueyama 803150c9d0 Revert r231552: Resolver: optimize fallback atoms.
This patch broke a buildbot.

llvm-svn: 231611
2015-03-08 21:31:38 +00:00
Rui Ueyama 04597ac258 Re-commit r231545: PECOFF: Do not add extraneous symbols to the dead strip root
That commit was reverted in r231582 as it was a culprit for
buildbot breakage. Turned out it's not.

llvm-svn: 231610
2015-03-08 21:31:36 +00:00
Joerg Sonnenberger 6d7cb4668f Avoid warnings on !PowerPC
llvm-svn: 231609
2015-03-08 21:08:39 +00:00
Joerg Sonnenberger 531cf7f491 Don't produce warnings on !PowerPC.
llvm-svn: 231608
2015-03-08 21:06:58 +00:00
Johannes Doerfert 7384399ddc [FIX] Add and force initialization for Pass * member
r231268 accidently dropped the initialization that is re-introduced
  here. The const will enforce initialization for the future.

llvm-svn: 231607
2015-03-08 20:14:34 +00:00
Johannes Doerfert e4bd53bd0c [FIX] Use the correct functions to extract the LB/UB from a range
The current tests will continue to cover this code and more will be
  added when non-affine loops are supported.

llvm-svn: 231606
2015-03-08 19:49:50 +00:00
Benjamin Kramer 3162f29fcd Properly initialize the parser_crash debug token.
Found by msan.

llvm-svn: 231605
2015-03-08 19:28:24 +00:00
Benjamin Kramer 72b7d3ed4b Fix the MSVC build.
Type traits are hard.

llvm-svn: 231604
2015-03-08 18:20:22 +00:00
Benjamin Kramer d503c1c531 Make Token a real POD type.
We copy them around a lot and skip construction in favor of startToken,
make the default construction trivial to reflect that.

llvm-svn: 231603
2015-03-08 18:11:59 +00:00
Vince Harron 18258687e6 Skip all lldb-mi tests on Linux
lldb-mi tests have been failing for a while on the buildbots.
Disabling until someone has a chance to fix.

llvm-svn: 231602
2015-03-08 17:28:08 +00:00
Andrea Di Biagio 6c7d70469c [X86][AVX] Fix wrong lowering of VPERM2X128 nodes
There were cases where the backend computed a wrong permute mask for a VPERM2X128 node.

Example:
\code
define <8 x float> @foo(<8 x float> %a, <8 x float> %b) {
  %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 undef, i32 undef, i32 6, i32 7, i32 undef, i32 undef, i32 6, i32 7>
  ret <8 x float> %shuffle
}
\code end

Before this patch, llc (with -mattr=+avx) emitted the following vperm2f128:
  vperm2f128 $0, %ymm0, %ymm0, %ymm0  # ymm0 = ymm0[0,1,0,1]

With this patch, llc emits a vperm2f128 with a correct permute mask:
  vperm2f128 $17, %ymm0, %ymm0, %ymm0  # ymm0 = ymm0[2,3,2,3]

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

llvm-svn: 231601
2015-03-08 16:28:47 +00:00
Ed Maste 8f3c0cd1ba Fix whitespace on Python SWIG wrapper
llvm-svn: 231600
2015-03-08 16:24:30 +00:00
Tobias Grosser f3c17e65d1 Drop meaningless test case
This test case was supposed to test the range analysis but it became just
another delinearization test case after enabling delinearization.

Suggested-by: Johannes Doerfert
llvm-svn: 231599
2015-03-08 16:12:47 +00:00
Benjamin Kramer 57a3d084cd Make static variables const if possible. Makes them go into a read-only section.
Or fold them into a initializer list which has the same effect. NFC.

llvm-svn: 231598
2015-03-08 16:07:39 +00:00
Benjamin Kramer 28b45ce151 Make constant static variables const so they can go into a read-only section
NFC.

llvm-svn: 231597
2015-03-08 16:06:46 +00:00
Johannes Doerfert 1e03f5d10d Small change to create_ll.sh [NFC]
llvm-svn: 231596
2015-03-08 15:36:27 +00:00
Tobias Grosser 6973cb6ec7 Enable delinearization by default - second try
After having fixed the LNT bugs in the previous commits, lets reenable the
delinearization.

llvm-svn: 231595
2015-03-08 15:21:18 +00:00
Tobias Grosser bf7193ae61 Update test cases to work independently of delinearization default
llvm-svn: 231594
2015-03-08 15:21:15 +00:00
Johannes Doerfert 6a4d81c1f6 Add end user report message for unprofitable regions [NFC]
llvm-svn: 231593
2015-03-08 15:11:50 +00:00
Tobias Grosser 90078c5580 Add sign-extension during codegen of index expressions
When code generating array index expressions the types of the different
components of the index expressions may not always match. We extend the type of
the index expression (if possible) and assert otherwise.

llvm-svn: 231592
2015-03-08 15:08:32 +00:00
Tobias Grosser 9d3c0b655a Revert "Enable delinearization by default"
This reverts commit 231590. Apparantly we have three more issues left
in oggenc, smg2000 and linpack.

llvm-svn: 231591
2015-03-08 12:57:31 +00:00
Tobias Grosser 16c701d0c9 Enable delinearization by default
The performance test case just committed was the last open issue I was aware of.
We enable this by default to increase test coverage and to possibly trigger
reports of issues yet unknown.

llvm-svn: 231590
2015-03-08 12:30:37 +00:00
Tobias Grosser 6e4d597e86 Add delinearization test-case that timed out earlier
llvm-svn: 231589
2015-03-08 12:07:02 +00:00
Argyrios Kyrtzidis 69e6f1f257 [Rewrite] Make RewriteBuffer accessible on its own, and add a unit test for it.
llvm-svn: 231588
2015-03-08 04:00:33 +00:00
Argyrios Kyrtzidis fe0d61d245 [Rewrite] Move RewriteBuffer into its own header.
llvm-svn: 231587
2015-03-08 04:00:28 +00:00
Rui Ueyama 47d101e613 PECOFF: Fix off-by-one error.
We accidentally skipped the last base relocation entry for each block.

llvm-svn: 231586
2015-03-08 03:23:43 +00:00
Rui Ueyama 31777ce9a1 PECOFF: Parallelize base relocation creation.
If an output is large, its base relocation section can be also large.
For example, chrome.dll is almost 300 MB, and it has about 9 million
base relocations. Creating the section took 1.5 seconds on my machine.

This patch changes the way to create the section so that we can use
parallel_sort to group base relocations by high bits. This change
makes the linker almost 4% faster for the above test case on my machine.
If I replace parallel_sort with std::sort, performance remains the same,
so single thread performance should remain the same.

This has no functionality change. The output should be identical as
before.

llvm-svn: 231585
2015-03-08 02:44:53 +00:00
Rui Ueyama 8ade983734 Resolver: Use LLVM StringMap and DenseMap.
All defined symbols from all archive files are inserted to _archiveMap,
so performance of hash table matters here (I'm not trying to convert
all std::maps with DenseMaps). This change seems to make the linker
0.5% - 1% faster for my test case.

llvm-svn: 231584
2015-03-08 02:44:51 +00:00
Rui Ueyama 0536677ad6 Remove sectionPosition attribute.
This code is simply dead. No one is using it.

http://reviews.llvm.org/D8125

llvm-svn: 231583
2015-03-08 01:01:40 +00:00
Rui Ueyama 316d64ea1d Revert r231545 to unbreak buildbot.
This patch reverts r231545 "PECOFF: Do not add extraneous symbols
to the dead strip root." CrWinClangLLD buildbot is currently broken.
Since I can't reproduce the issue locally, I'm reverting the most
relevant change.

llvm-svn: 231582
2015-03-08 00:26:53 +00:00
Simon Pilgrim 8c58c066b7 [DAGCombiner] Add a shuffle mask commutation helper function. NFCI.
We have an increasing number of cases where we are creating commuted shuffle masks - all implementing nearly the same code.

This patch adds a static helper function - ShuffleVectorSDNode::commuteMask() and replaces a number of cases to use it.

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

llvm-svn: 231581
2015-03-07 22:33:11 +00:00
Saleem Abdulrasool a99e152e80 Unwind: remove unnecessary check
Linux/GNU on AArch64 EH ABI Level III is implemented using exception frame
tables as defined in LSB II.11.6.  The exception frame tables use the DWARF
Exception Header Encoding as described in LSB II.11.5.1.  We already defined the
appropriate definition _LIBUNWIND_SUPPORT_DWARF_UNWIND to enable this.

llvm-svn: 231580
2015-03-07 22:21:31 +00:00
David Majnemer 73460f94a2 Fix the autoconf build
lib/ExecutionEngine/Targets has no Makefile, causing the autoconf build
to fail.  Solve this by bringing the COFF implementation of RuntimeDyld
in line like the Mach-O and ELF implementations.

llvm-svn: 231579
2015-03-07 21:47:46 +00:00