Pete Cooper [Tue, 2 Feb 2016 01:52:40 +0000 (01:52 +0000)]
Set ordinals of all File's created in MachO passes.
When we do debug printing of atoms, they expect their parent file
to have an ordinal. Right now we trigger a bunch of asserts.
This doesn't actually manifest in differences in any real tests, but
even if the only thing it does is improve debuggability then its still
useful.
llvm-svn: 259450
Ahmed Bougacha [Tue, 2 Feb 2016 01:44:03 +0000 (01:44 +0000)]
[X86][FastISel] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.
FastISel counterpart to r259448.
llvm-svn: 259449
Ahmed Bougacha [Tue, 2 Feb 2016 01:32:50 +0000 (01:32 +0000)]
[X86] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.
Officially, we don't acknowledge non-default configurations of MXCSR,
as getting there would require usage of the FENV_ACCESS pragma (at
least insofar as rounding mode is concerned).
We don't support the pragma, so we can assume that the default
rounding mode - round to nearest, ties to even - is always used.
However, it's inconsistent with the rest of the instruction set,
where MXCSR is always effective (unless otherwise specified).
Also, it's an unnecessary obstacle to the few brave souls that use
fenv.h with LLVM.
Avoid the hard-coded rounding mode for fp_to_f16; use MXCSR instead.
llvm-svn: 259448
Anna Zaks [Tue, 2 Feb 2016 01:03:11 +0000 (01:03 +0000)]
[safestack] Make sure the unsafe stack pointer is popped in all cases
The unsafe stack pointer is only popped in moveStaticAllocasToUnsafeStack so it won't happen if there are no static allocas.
Fixes https://llvm.org/bugs/show_bug.cgi?id=26122
Differential Revision: http://reviews.llvm.org/D16339
llvm-svn: 259447
Philip Reames [Tue, 2 Feb 2016 00:45:30 +0000 (00:45 +0000)]
[LVI] Fix a latent bug in getValueAt
This routine was returning Undefined for most queries. This was utterly wrong. Amusingly, we do not appear to have any callers of this which are actually trying to exploit unreachable code or this would have broken the world.
A better approach would be to explicit describe the intersection of facts. That's blocked behind http://reviews.llvm.org/D14476 and I wanted to fix the current bug.
llvm-svn: 259446
Richard Trieu [Tue, 2 Feb 2016 00:36:59 +0000 (00:36 +0000)]
Template Type Diffing change
When all the arguments of a template are elided, print "A<...>" instead of
"A<[2 * ...]>". Also remove comment fragment that means nothing.
llvm-svn: 259445
Rui Ueyama [Tue, 2 Feb 2016 00:35:49 +0000 (00:35 +0000)]
Always initialize Out<ELFT> members.
Instead of leave unused fields as is, set them to nullptr.
Currnetly this is NFC, but if you call writeResults more than
once, you should be able to see the difference.
llvm-svn: 259444
Jim Ingham [Tue, 2 Feb 2016 00:21:39 +0000 (00:21 +0000)]
We try to avoid static objects. These are on the error path for unsupported features
in the socket, so just returning freshly constructed objects is fine.
llvm-svn: 259443
Pete Cooper [Tue, 2 Feb 2016 00:05:47 +0000 (00:05 +0000)]
Fixed comment characters. NFC
llvm-svn: 259442
Pete Cooper [Tue, 2 Feb 2016 00:02:50 +0000 (00:02 +0000)]
Add pointerKind() method to the MachO ArchHandler's. NFC.
The ObjCPass is going to need to create pointer sized relocations in
the ObjC sections. This method will be used to give us a target independent
way of getting the correct kind for the refererence.
llvm-svn: 259441
Pete Cooper [Mon, 1 Feb 2016 23:56:27 +0000 (23:56 +0000)]
Add ObjC method list atom type. NFC.
An upcoming patch will use this to create lists of ObjC methods.
Adding it now to reduce the amount of code in that patch.
Test cases will follow in the other patch too.
llvm-svn: 259440
Pete Cooper [Mon, 1 Feb 2016 23:56:23 +0000 (23:56 +0000)]
Add command line option to disable ObjC category merging.
This adds the no_objc_category_merging cmdline option which will
be used in an upcoming commit to disable the category optimizer.
It is on by default in ld64 so we match that here.
Test case will come soon with the patch to make use of this option.
llvm-svn: 259439
Sanjay Patel [Mon, 1 Feb 2016 23:53:35 +0000 (23:53 +0000)]
fix typos; NFC
llvm-svn: 259438
Philip Reames [Mon, 1 Feb 2016 23:44:38 +0000 (23:44 +0000)]
[LVI] Missing test case from 259432
llvm-svn: 259437
Pete Cooper [Mon, 1 Feb 2016 23:42:10 +0000 (23:42 +0000)]
Move SimpleDefinedAtom::addReference to DefinedAtom.
Most of the other methods to access Reference's were on DefinedAtom so
this just keeps them all together.
This will be used in a future patch in ObjCPass which needs to add
new references. The method is virtual because we may add references to
different data structures depending on whether we parsed a macho file or
yaml.
llvm-svn: 259436
Rui Ueyama [Mon, 1 Feb 2016 23:28:21 +0000 (23:28 +0000)]
ELF: Do not call fatal() if relocation contraints are not satisfied.
http://reviews.llvm.org/D16648
llvm-svn: 259435
Teresa Johnson [Mon, 1 Feb 2016 23:26:30 +0000 (23:26 +0000)]
Add test for PR26419 (stable function summary ordering)
Enhance an existing test to also check that the ordering of the function
summary entries is stable.
llvm-svn: 259434
Stephane Sezer [Mon, 1 Feb 2016 23:21:27 +0000 (23:21 +0000)]
Fix getCompiler in unit testing framework on compiler symlinks
Summary:
Checks using the result of getCompiler() will fail to identify the compiler
correctly if CC is a symlink path (ie /usr/bin/cc).
Reviewers: zturner, emaste
Subscribers: llvm-commits, sas
Differential Revision: http://reviews.llvm.org/D16488
Change by Francis Ricci <fjricci@fb.com>
llvm-svn: 259433
Philip Reames [Mon, 1 Feb 2016 23:21:11 +0000 (23:21 +0000)]
[LVI] Remove overly tight assert from 259429
I'll submit a test case shortly which covers this, but it's causing clang self host problems in the builders so I wanted to get it removed.
llvm-svn: 259432
Pete Cooper [Mon, 1 Feb 2016 23:05:20 +0000 (23:05 +0000)]
Add operator== for DefinedAtom::reference_iterator. NFC.
This will be used by a future commit which wanted to compare iterators
for equality.
Also changed operator!= to be in terms of the new operator==
llvm-svn: 259431
Simon Pilgrim [Mon, 1 Feb 2016 23:04:05 +0000 (23:04 +0000)]
[X86][AVX512] Add support for AVX512 VMOVD (load) shuffle decoding
llvm-svn: 259430
Philip Reames [Mon, 1 Feb 2016 22:57:53 +0000 (22:57 +0000)]
[LVI] Add select handling
Teach LVI to handle select instructions in the exact same way it handles PHI nodes. This is useful since various parts of the optimizer convert PHI nodes into selects and we don't want these transformations to cause inferior optimization.
Note that this patch does nothing to exploit the implied constraint on the inputs represented by the select condition itself. That will be a later patch and is blocked on http://reviews.llvm.org/D14476
llvm-svn: 259429
Nico Weber [Mon, 1 Feb 2016 22:31:51 +0000 (22:31 +0000)]
Always build a new TypeSourceInfo for function templates with parameters
RecursiveASTVisitor::TraverseFunctionHelper() traverses a function's
ParmVarDecls by going to the function's getTypeSourceInfo if it exists, and
`DEF_TRAVERSE_TYPELOC(FunctionProtoType` then goes to the function's
ParmVarDecls.
For a function template that doesn't have parameters that explicitly depend on
the template parameter, we used to be clever and not build a new
TypeSourceInfo. That meant that when an instantiation of such a template is
visited, its TypeSourceInfo would point to the ParmVarDecls of the template,
not of the instantiation, which then confused clients of RecursiveASTVisitor.
So don't be clever for function templates that have parameters, even if none of
the parameters depend on the type.
Fixes PR26257.
http://reviews.llvm.org/D16478
llvm-svn: 259428
Simon Pilgrim [Mon, 1 Feb 2016 22:26:28 +0000 (22:26 +0000)]
[X86][AVX512] Add support for AVX512 VMOVSD/VMOVSS shuffle decoding
llvm-svn: 259427
Pete Cooper [Mon, 1 Feb 2016 22:24:44 +0000 (22:24 +0000)]
MachoFile should default to using subsections_via_symbols.
When we parse a MachoFile, we set a number of members from the parsed
file, for example, subsectionsViaSymbols.
However, a number of passes, such as ObjCPass, create local copies of
MachoFile and don't get the benefit of setting flags and other fields in
the parser. Instead we can just give a more sensible default as the parser
will definitely get the correct value from the file anyway.
llvm-svn: 259426
Sanjay Patel [Mon, 1 Feb 2016 22:23:39 +0000 (22:23 +0000)]
function names start with a lowercase letter; NFC
llvm-svn: 259425
Matthias Braun [Mon, 1 Feb 2016 22:18:58 +0000 (22:18 +0000)]
Fix build problem by lower SmallSet<N> to a reasonable value
llvm-svn: 259424
Sanjay Patel [Mon, 1 Feb 2016 22:10:26 +0000 (22:10 +0000)]
[InstCombine] simplify masked scatter/gather intrinsics with zero masks
A masked scatter with a zero mask means there's no store.
A masked gather with a zero mask means the passthru arg is returned.
This is a continuation of:
http://reviews.llvm.org/rL259369
http://reviews.llvm.org/rL259392
llvm-svn: 259421
Simon Pilgrim [Mon, 1 Feb 2016 22:05:50 +0000 (22:05 +0000)]
[X86][AVX512] Add support for AVX512 VINSERTPS shuffle decoding
llvm-svn: 259420
Matthias Braun [Mon, 1 Feb 2016 22:05:16 +0000 (22:05 +0000)]
SmallSet/SmallPtrSet: Refuse huge Small numbers
These sets do linear searching in small mode; It is not a good idea to
use huge numbers as the small value here, save people from themselves by
adding a static_assert.
Differential Revision: http://reviews.llvm.org/D16706
llvm-svn: 259419
Arpith Chacko Jacob [Mon, 1 Feb 2016 22:02:05 +0000 (22:02 +0000)]
Undoing commit r259366 to debug buildbot failure.
> http://reviews.llvm.org/D16758
llvm-svn: 259418
Rafael Espindola [Mon, 1 Feb 2016 21:52:00 +0000 (21:52 +0000)]
Simplify.
Now that we remember the StringRefs when they are first added, we can
write the table in any order.
llvm-svn: 259417
Simon Pilgrim [Mon, 1 Feb 2016 21:46:12 +0000 (21:46 +0000)]
[X86][SSE] Regenerated load vector + element extraction tests.
llvm-svn: 259416
Pete Cooper [Mon, 1 Feb 2016 21:42:17 +0000 (21:42 +0000)]
Use dyn_cast instead of static_cast.
Now that MachoFile has classof(), we can use dyn_cast instead which
is actually the only safe way to handle this.
Turns out this actually manifests as a bug as we were incorrectly
casting instances which weren't MachoFile in to a MachoFile.
Unfortunately, there's no reliable way of checking for this as it
requires that the file we are looking for has a 0 at exactly the byte
we need for the load of subsectionsViaSymbols.
llvm-svn: 259413
Chad Rosier [Mon, 1 Feb 2016 21:38:31 +0000 (21:38 +0000)]
Move comments a bit closer to associated code. NFC.
llvm-svn: 259411
Simon Pilgrim [Mon, 1 Feb 2016 21:30:50 +0000 (21:30 +0000)]
[X86][SSE] Add AVX512 merge consecutive load tests
Add AVX512F/AVX512BW 512-bit tests.
Add AVX512F tests to existing 128/256-bit tests.
llvm-svn: 259410
Aaron Ballman [Mon, 1 Feb 2016 21:28:33 +0000 (21:28 +0000)]
Code clean up; NFC.
Patch by Alexander Riccio.
llvm-svn: 259409
Alexey Samsonov [Mon, 1 Feb 2016 21:08:16 +0000 (21:08 +0000)]
[CMake] Use LLVM_MAIN_SRC_DIR instead of LLVM_SOURCE_DIR.
The former will be properly initialized in standalone CMake build of
compiler-rt.
llvm-svn: 259407
Simon Pilgrim [Mon, 1 Feb 2016 21:06:32 +0000 (21:06 +0000)]
Regenerate vector blend tests.
llvm-svn: 259406
Simon Pilgrim [Mon, 1 Feb 2016 21:01:29 +0000 (21:01 +0000)]
Regenerate vector sext/zext constant folding tests.
llvm-svn: 259405
Rui Ueyama [Mon, 1 Feb 2016 21:00:35 +0000 (21:00 +0000)]
ELF: Teach SymbolBody about how to get its addresses.
Previously, the methods to get symbol addresses were somewhat scattered
in many places. You can use getEntryAddr returns the address of the symbol,
but if you want to get the GOT address for the symbol, you needed to call
Out<ELFT>::Got->getEntryAddr(Sym). This change adds new functions, getVA,
getGotVA, getGotPltVA, and getPltVA to SymbolBody, so that you can use
SymbolBody as the central place to ask about symbols.
http://reviews.llvm.org/D16710
llvm-svn: 259404
Jun Bum Lim [Mon, 1 Feb 2016 20:55:11 +0000 (20:55 +0000)]
Avoid inlining call sites in unreachable-terminated block
Summary:
If the normal destination of the invoke or the parent block of the call site is unreachable-terminated, there is little point in inlining the call site unless there is literally zero cost. Unlike my previous change (D15289), this change specifically handle the call sites followed by unreachable in the same basic block for call or in the normal destination for the invoke. This change could be a reasonable first step to conservatively inline call sites leading to an unreachable-terminated block while BFI / BPI is not yet available in inliner.
Reviewers: manmanren, majnemer, hfinkel, davidxl, mcrosier, dblaikie, eraman
Subscribers: dblaikie, davidxl, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D16616
llvm-svn: 259403
Chad Rosier [Mon, 1 Feb 2016 20:54:36 +0000 (20:54 +0000)]
Remove extra semicolon. NFC.
llvm-svn: 259402
Sanjoy Das [Mon, 1 Feb 2016 20:48:14 +0000 (20:48 +0000)]
[SCEV] Clean up isKnownPredicateViaConstantRanges; NFCI
- ScalarEvolution::isKnownPredicateViaConstantRanges duplicates some
logic already present in ConstantRange, use ConstantRange for those
bits.
- In some cases ScalarEvolution::isKnownPredicateViaConstantRanges
returns `false` to mean "definitely false" (e.g. see the
`LHSRange.getSignedMin().sge(RHSRange.getSignedMax())` case for
`ICmpInst::ICMP_SLT`), but for `isKnownPredicateViaConstantRanges`,
`false` actually means "don't know". Get rid of this extra bit of
code to avoid confusion.
llvm-svn: 259401
Sanjoy Das [Mon, 1 Feb 2016 20:48:10 +0000 (20:48 +0000)]
[SCEV] Rename isKnownPredicateWithRanges; NFC
Make it obvious that it uses constant ranges, and use `Via` instead of
`With`, like other similar functions in SCEV.
llvm-svn: 259400
Rafael Espindola [Mon, 1 Feb 2016 20:36:49 +0000 (20:36 +0000)]
Fix infinite recursion in MCAsmStreamer::EmitValueImpl.
If a target can only emit 8-bits data, we would loop in EmitValueImpl
since it will try to split a 32-bits data in 1 chunk of 32-bits.
No test since all current targets can emit 32bits at a time.
Patch by Alexandru Guduleasa!
llvm-svn: 259399
Teresa Johnson [Mon, 1 Feb 2016 20:16:35 +0000 (20:16 +0000)]
[ThinLTO] Ensure function summary output order is stable
Iterate over the function list instead of a DenseMap of Function pointers
when emitting the function summary into the module.
This fixes PR26419.
llvm-svn: 259398
Jim Ingham [Mon, 1 Feb 2016 20:05:37 +0000 (20:05 +0000)]
Add a note on how to create an empty target and use it to attach to
processes whose executables you don't know up front.
llvm-svn: 259396
Nico Weber [Mon, 1 Feb 2016 20:03:53 +0000 (20:03 +0000)]
Revert r259143, it broke check-lld on Windows (see PR26388).
llvm-svn: 259395
Rafael Espindola [Mon, 1 Feb 2016 19:56:12 +0000 (19:56 +0000)]
Add a test for r258362.
Thanks to Mehdi for finding it.
llvm-svn: 259394
Eugene Zelenko [Mon, 1 Feb 2016 19:47:24 +0000 (19:47 +0000)]
Sort checks alphabetically in ReadabilityTidyModule.cpp.
llvm-svn: 259393
Sanjay Patel [Mon, 1 Feb 2016 19:39:52 +0000 (19:39 +0000)]
[InstCombine] simplify masked store intrinsics with all ones or zeros masks
A masked store with a zero mask means there's no store.
A masked store with an allOnes mask means it's a normal vector store.
This is a continuation of:
http://reviews.llvm.org/rL259369
llvm-svn: 259392
Davide Italiano [Mon, 1 Feb 2016 19:22:16 +0000 (19:22 +0000)]
[llvm-nm] Simplify the code a bit. NFCI.
Fix a style violation while I'm here.
llvm-svn: 259391
Reid Kleckner [Mon, 1 Feb 2016 19:13:28 +0000 (19:13 +0000)]
[ubsan] Stop thinking we can rely on C++ ABI knowledge on Windows
We already disabled various tests relying on C++ ABI knowledge, but we
still tried to build in this configuration on Windows which was a
mistake.
Fixes PR26415.
llvm-svn: 259388
Balaram Makam [Mon, 1 Feb 2016 19:13:07 +0000 (19:13 +0000)]
AArch64: Implement missed conditional compare sequences.
Summary:
This is an extension to the existing implementation of r242436 which
restricts to only select inputs. This version fixes missed opportunities
in pr26084 by attempting to lower conditional compare sequences of
and/or trees with setcc leafs. This will additionaly handle the case
when a tree with select input is not a conjunction-disjunction tree
but some of the sub trees are conjunction-disjunction trees.
Reviewers: jmolloy, t.p.northover, mcrosier, MatzeB
Subscribers: mcrosier, llvm-commits, junbuml, haicheng, mssimpso, gberry
Differential Revision: http://reviews.llvm.org/D16291
llvm-svn: 259387
Pete Cooper [Mon, 1 Feb 2016 19:10:10 +0000 (19:10 +0000)]
Atomize the ObjC category list section.
__DATA, __objc_catlist contains a list of pointers to categories.
We want to atomize it so that the ObjC pass can later optimize and remove
categories. That will be a later patch.
llvm-svn: 259386
Matthew Simpson [Mon, 1 Feb 2016 19:09:24 +0000 (19:09 +0000)]
Add test case missing from r259357 (NFC)
llvm-svn: 259385
Geoff Berry [Mon, 1 Feb 2016 19:07:06 +0000 (19:07 +0000)]
[AArch64] Simplify prolog/epilog callee save/restore. NFC.
Summary:
Factor out common code for callee-save register pair calculation. This
is intended to simplify follow-on changes that reduce the number of
registers saved/restored.
Depends on D16732
Reviewers: mcrosier, jmolloy, t.p.northover
Subscribers: aemerson, rengolin, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D16734
llvm-svn: 259384
Reid Kleckner [Mon, 1 Feb 2016 18:58:24 +0000 (18:58 +0000)]
Fix attribute((mode([word|unwind_word]))) for x32
Patch by H.J. Lu
```
typedef unsigned int gcc_word __attribute__((mode(word)));
```
and
```
typedef unsigned int gcc_unwind_word __attribute__((mode(unwind_word)));
```
define the largest unsigned integer types which can be stored in a
general purpose register, which may not be the pointer type. For x32,
they aren't pointer nor unsigned long. We should
1. Make getUnwindWordWidth and getRegisterWidth virtual,
2. Override them for x32, similar to hasInt128Type.
3. Use getRegisterWidth for __attribute__((mode(word)));
This fixes PR 24706.
Reviewers: rnk
Differential Revision: http://reviews.llvm.org/D16779
llvm-svn: 259383
Peter Collingbourne [Mon, 1 Feb 2016 18:55:50 +0000 (18:55 +0000)]
docs: Clarify that cfi-unrelated-cast is based on lifetime.
Also restore Makefile.sphinx which is needed to build the documentation.
llvm-svn: 259382
Ulrich Weigand [Mon, 1 Feb 2016 18:31:19 +0000 (18:31 +0000)]
[SystemZ] Fix wrong-code generation for certain always-false conditions
We've found another bug in the code generation logic conditions for a
certain class of always-false conditions, those of the form
if ((a & 1) < 0)
These only reach the back end when compiling without optimization.
The bug was introduced by the choice of using TEST UNDER MASK
to implement a check for
if ((a & MASK) < VAL)
as
if ((a & MASK) == 0)
where VAL is less than the the lowest bit of MASK. This is correct
in all cases except for VAL == 0, in which case the original
condition is always false, but the replacement isn't.
Fixed by excluding that particular case.
llvm-svn: 259381
Colin LeMahieu [Mon, 1 Feb 2016 18:15:39 +0000 (18:15 +0000)]
[NFC] Referencing manual for reason why subregbit is checked
llvm-svn: 259380
Zachary Turner [Mon, 1 Feb 2016 18:12:59 +0000 (18:12 +0000)]
Always write the session file in UTF-8.
This patch attempts to solve the Python 2 / Python 3 incompatibilities by
introducing a new `encoded_file` abstraction that we use instead of
`io.open()`. The problem with the builtin implementation of `io.open` is
that `read` and `write` accept and return `unicode` objects, which are not
always convenient to work with in Python 2. We solve this by making
`encoded_file.open()` return the same object returned by `io.open()` but
with hooked `read()` and `write()` methods. These hooked methods will
accept binary or text data, and conditionally convert what it gets to a
`unicode` object using the correct encoding. When calling `read()` it
also does any conversion necessary to convert the output back into the
native `string` type of the running python version.
Differential Revision: http://reviews.llvm.org/D16736
llvm-svn: 259379
Zachary Turner [Mon, 1 Feb 2016 18:12:54 +0000 (18:12 +0000)]
Fix misnamed variable in TestProcessAPI.py
llvm-svn: 259378
Sanjay Patel [Mon, 1 Feb 2016 17:46:18 +0000 (17:46 +0000)]
fix broken check lines
Without the colon, it doesn't mean anything!
llvm-svn: 259377
Benjamin Kramer [Mon, 1 Feb 2016 17:42:01 +0000 (17:42 +0000)]
Move LocInfoType from Sema to AST.
While transient and only used during parsing, LocInfoTypes are still used
from ASTDumper and are part of the AST.
llvm-svn: 259376
David Majnemer [Mon, 1 Feb 2016 17:37:56 +0000 (17:37 +0000)]
[InstCombine] Don't transform (X+INT_MAX)>=(Y+INT_MAX) -> (X<=Y)
This miscompile came about because we tried to use a transform which was
only appropriate for xor operators when addition was present.
This fixes PR26407.
llvm-svn: 259375
Jun Bum Lim [Mon, 1 Feb 2016 17:03:07 +0000 (17:03 +0000)]
[ValueTracking] Improve isKnownNonZero for PHI of non-zero constants
It is clear that a PHI is a non-zero if all incoming values are non-zero constants.
llvm-svn: 259370
Sanjay Patel [Mon, 1 Feb 2016 17:00:10 +0000 (17:00 +0000)]
[InstCombine] simplify masked load intrinsics with all ones or zeros masks
A masked load with a zero mask means there's no load.
A masked load with an allOnes mask means it's a normal vector load.
Differential Revision: http://reviews.llvm.org/D16691
llvm-svn: 259369
Pavel Labath [Mon, 1 Feb 2016 16:50:28 +0000 (16:50 +0000)]
Remove flaky annotation for TestCallWithTimeout on linux
The test has passed last 100 runs of the buildbot.
llvm-svn: 259368
Geoff Berry [Mon, 1 Feb 2016 16:47:51 +0000 (16:47 +0000)]
[PrologEpilogInserter] Add some debug output for callee-save frame object allocation
Reviewers: mcrosier
Subscribers: mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D16733
llvm-svn: 259367
Arpith Chacko Jacob [Mon, 1 Feb 2016 16:32:47 +0000 (16:32 +0000)]
[OpenMP] Prevent nesting of target constructs within target code execution regions.
Summary:
This patch enhances Sema to check for the following restriction:
OpenMP 4.5 [2.17 Nesting of Regions]
If a target, target update, target data, target enter data, or
target exit data construct is encountered during execution of a
target region, the behavior is unspecified.
Reviewers: ABataev
Differential Revision: http://reviews.llvm.org/D16758
llvm-svn: 259366
Geoff Berry [Mon, 1 Feb 2016 16:29:19 +0000 (16:29 +0000)]
[AArch64] Simplify callee-save register save/restore. NFC.
Summary:
Simplify callee-save register save/restore code generation by
remembering the size of the callee-save area when it is computed so we
don't have to scan the prologue/epilogue instructions again later to
reconstruct it.
This is intended to simplify follow-on changes that reduce the number of
registers saved/restored.
Reviewers: mcrosier, jmolloy, t.p.northover
Subscribers: aemerson, rengolin, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D16732
llvm-svn: 259365
Matthew Simpson [Mon, 1 Feb 2016 16:07:01 +0000 (16:07 +0000)]
[LV] Rename RdxPHIsToFix to PHIsToFix (NFC)
In the future, we will vectorize recurrences other than reductions. This patch
renames a few variables and updates their associated comments to enable them to
be reused for non-reduction PHI nodes.
This change was requested in the review for D16197.
llvm-svn: 259364
Asaf Badouh [Mon, 1 Feb 2016 15:48:21 +0000 (15:48 +0000)]
[X86][AVX512VBMI] add encoding and intrinsics for Multishift
Differential Revision: http://reviews.llvm.org/D16399
llvm-svn: 259363
Aaron Ballman [Mon, 1 Feb 2016 15:31:15 +0000 (15:31 +0000)]
Add a new check, readability-redundant-control-flow, that check for some forms of redundant control flow statements. Currently checks for return statements at the end of a function with a void return type and continue statements at the end of looping statements.
Patch by Richard Thomson.
llvm-svn: 259362
Vasileios Kalintiris [Mon, 1 Feb 2016 15:19:35 +0000 (15:19 +0000)]
[mips] Split large test file into 3 smaller ones.
Remove the old select.ll file and use select-int.ll, select-flt.ll,
select-dbl.ll for testing selects on integers, floats & doubles respectivelly.
llvm-svn: 259361
Daniel Sanders [Mon, 1 Feb 2016 15:13:31 +0000 (15:13 +0000)]
[mips] Range check uimm16 and fix several bugs this revealed.
Summary:
The bugs were:
* teq and similar take 4-bit unsigned immediates on microMIPS.
* teqi and similar have side-effects like teq do.
* shll_s.w and shra_r.w take 5-bit unsigned immediates.
* The various DSP ext* instructions take a 5-bit immediate.
* repl.qh takes an 8-bit unsigned immediate.
* repl.ph takes a 10-bit unsigned immediate.
* rddsp/wrdsp take a 10-bit unsigned immediate.
* teqi and similar take signed 16-bit immediates (10-bit for microMIPS).
* Out-of-range immediate macros for or/xor take a simm32/simm64 depending
on architecture. I'll fix the simm64 case properly when I reach simm32.
lui is a bit more lenient than GAS and accepts signed immediates in addition
to unsigned. This is because MipsMCExpr can produce signed values when
constant folding and it currently lacks a way of knowing it should fold to
an unsigned value.
Reviewers: vkalintiris
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D15446
llvm-svn: 259360
Aaron Ballman [Mon, 1 Feb 2016 14:11:47 +0000 (14:11 +0000)]
Reapply r259210 with a fix for RegistryTest.cpp.
Patch by Richard Thomson.
llvm-svn: 259359
Amjad Aboud [Mon, 1 Feb 2016 14:09:41 +0000 (14:09 +0000)]
Improved macro emission in dwarf.
Changed emitting offset of macinfo entry into compiler unit DIE to use "addSectionLabel" method rather than explicitly calculating size/offset of macro entry.
Differential Revision: http://reviews.llvm.org/D16292
llvm-svn: 259358
Matthew Simpson [Mon, 1 Feb 2016 13:38:29 +0000 (13:38 +0000)]
Reapply commit r258404 with fix.
The previous patch caused PR26364. The fix is to ensure that we don't enter a
cycle when iterating over use-def chains.
llvm-svn: 259357
Pavel Labath [Mon, 1 Feb 2016 13:29:41 +0000 (13:29 +0000)]
Remove Timer::Initialize routine
Summary:
I've run into an issue when running unit tests, where the underlying problem turned out to be
that we were creating Timer objects (through several layers of indirection) without calling
Timer::Initialize. Since Timer's thread-local storage was not properly initialized, we were
overwriting gtest's own thread-local storage, causing test failures.
Instead of requiring that every test calls Timer::Initialize(), I remove the function altogether:
The thread-local storage can be initialized on-demand, and the g_file variable initialized to
stdout and never changed, so I have simply removed it.
Reviewers: clayborg, zturner, tberghammer
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D16722
llvm-svn: 259356
Benjamin Kramer [Mon, 1 Feb 2016 13:22:39 +0000 (13:22 +0000)]
Remove the egregious PCHContainer layering hack that doesn't seem to be necessary anymore.
llvm-svn: 259355
Tobias Grosser [Mon, 1 Feb 2016 11:54:13 +0000 (11:54 +0000)]
ScopInfo: Correct schedule construction
For schedule generation we assumed that the reverse post order traversal used by
the domain generation is sufficient, however it is not. Once a loop is
discovered, we have to completely traverse it, before we can generate the
schedule for any block/region that is only reachable through a loop exiting
block.
To this end, we add a "loop stack" that will keep track of loops we
discovered during the traversal but have not yet traversed completely.
We will never visit a basic block (or region) outside the most recent
(thus smallest) loop in the loop stack but instead queue such blocks
(or regions) in a waiting list. If the waiting list is not empty and
(might) contain blocks from the most recent loop in the loop stack the
next block/region to visit is drawn from there, otherwise from the
reverse post order iterator.
We exploit the new property of loops being always completed before additional
loops are processed, by removing the LoopSchedules map and instead keep all
information in LoopStack. This clarifies that we indeed always only keep a
stack of in-process loops, but will never keep incomplete schedules for an
arbitrary set of loops. As a result, we can simplify some of the existing code.
This patch also adds some more documentation about how our schedule construction
works.
This fixes http://llvm.org/PR25879
This patch is an modified version of Johannes Doerfert's initial fix.
Differential Revision: http://reviews.llvm.org/D15679
llvm-svn: 259354
Daniel Jasper [Mon, 1 Feb 2016 11:21:07 +0000 (11:21 +0000)]
clang-format: Fix incorrect pointer detection in lambdas in constructor
initializers.
Before:
Constructor() : member([](A *a, B * b) {}) {}
After:
Constructor() : member([](A *a, B *b) {}) {}
llvm-svn: 259353
Daniel Jasper [Mon, 1 Feb 2016 11:21:02 +0000 (11:21 +0000)]
clang-format: Add option to disable string literal formatting.
llvm-svn: 259352
Daniel Jasper [Mon, 1 Feb 2016 11:20:55 +0000 (11:20 +0000)]
clang-format: Fix alignment of trailing multiline columns.
llvm-svn: 259351
Daniel Jasper [Mon, 1 Feb 2016 11:20:47 +0000 (11:20 +0000)]
clang-format: [JS] Treat "in" as a proper operator.
llvm-svn: 259350
JF Bastien [Mon, 1 Feb 2016 10:46:16 +0000 (10:46 +0000)]
WebAssembly NFC: simplify control flow
This should now be easier to read.
llvm-svn: 259349
Ewan Crawford [Mon, 1 Feb 2016 10:39:24 +0000 (10:39 +0000)]
DWARF RenderScript vendor extension
Patch adds a DWARF language vendor extension for RenderScript.
We are already using this identifier in LLDB with a hard coded value, so it's preferable to use a LLVM generated enum instead.
The language is intended to be added to the next version of the standard.
See http://www.dwarfstd.org/ShowIssue.php?issue=150331.1
Reviewers: dexonsmith, echristo
Subscribers: probinson domipheus, srhines, llvm-commits
Differential Revision: http://reviews.llvm.org/D16409
llvm-svn: 259348
Tobias Grosser [Mon, 1 Feb 2016 10:07:43 +0000 (10:07 +0000)]
ScopInfo: Drop dead code in schedule description
In https://llvm.org/svn/llvm-project/polly/trunk@251870 code was committed to
avoid a failure in the presence of infinite loops, but the test case committed
along with this change passes without the actual change. I looked back into the
code and also checked with the original committer (Johannes), but could not find
the reason why the code is needed. The introduction of LoopStacks for
buildSchedule in one of the next commits will make it even more clear that this
code is not needed, but I remove this ahead of time to facilitate bisecting in
case I missed something.
llvm-svn: 259347
Igor Breger [Mon, 1 Feb 2016 09:57:15 +0000 (09:57 +0000)]
AVX512: fix mask handling for gather/scatter/prefetch intrinsics.
Differential Revision: http://reviews.llvm.org/D16755
llvm-svn: 259346
Artem Dergachev [Mon, 1 Feb 2016 09:29:17 +0000 (09:29 +0000)]
[analyzer] Use a wider integer type for an array index.
Avoids unexpected overflows while performing pointer arithmetics in 64-bit code.
Moreover, neither PointerDiffType nor 'int' can be used as a common array index
type because arrays may have size (and indexes) more than PTRDIFF_MAX but less
than SIZE_MAX.
Patch by Aleksei Sidorin!
Differential Revision: http://reviews.llvm.org/D16063
llvm-svn: 259345
Abhishek Aggarwal [Mon, 1 Feb 2016 09:01:42 +0000 (09:01 +0000)]
Set correct ThreadStopInfo in case of trace event
Summary:
- The patch solves Bug 23478 and Bug 19311. Resolving
Bug 23478 also resolves Bug 23039.
Correct ThreadStopInfo is set for Linux and FreeBSD
platforms.
- Summary:
When a trace event is reported, we need to check
whether the trace event lands at a breakpoint site.
If it lands at a breakpoint site then set the thread's
StopInfo with the reason 'breakpoint'. Else, set the reason
to be 'Trace'.
Change-Id: I0af9765e782fd74bc0cead41548486009f8abb87
Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>
Reviewers: jingham, emaste, lldb-commits, clayborg, ovyalov
Subscribers: emaste
Differential Revision: http://reviews.llvm.org/D16720
llvm-svn: 259344
Simon Pilgrim [Mon, 1 Feb 2016 08:59:30 +0000 (08:59 +0000)]
[X86][SSE] Find source of the inserted element of INSERTPS
Minor patch to trace back through target shuffles to the source of the inserted element in a (V)INSERTPS shuffle.
Differential Revision: http://reviews.llvm.org/D16652
llvm-svn: 259343
Igor Breger [Mon, 1 Feb 2016 07:56:09 +0000 (07:56 +0000)]
AVX512 : Fix SETCCE lowering for KNL 32 bit.
Differential Revision: http://reviews.llvm.org/D16752
llvm-svn: 259342
Frederic Riss [Mon, 1 Feb 2016 04:43:14 +0000 (04:43 +0000)]
[dsymutil] Skip mach-o paired relocations
Noticed while working on scattered relocations.
I do not think these relocs can actually happen in the debug_info section,
but if they happen the code would mishandle them. Explicitely skip them
and warn if we encounter one.
llvm-svn: 259341
David Majnemer [Mon, 1 Feb 2016 04:28:59 +0000 (04:28 +0000)]
[X86] Cleanup the WinEHState pass
Remove unnecessary includes and class state.
No functional change intended.
llvm-svn: 259340
Frederic Riss [Mon, 1 Feb 2016 03:44:22 +0000 (03:44 +0000)]
[dsymutil] Support scattered relocs.
Although it seems like clang will never emit scattered relocations in
the debug information (at least I couldn't find a way), we have too
support them for the benefit of other compilers.
As clang doesn't generate them, the included testcase was produced
from hacked up assembly.
llvm-svn: 259339
David Majnemer [Mon, 1 Feb 2016 03:29:38 +0000 (03:29 +0000)]
Revert r258580 and r258581.
Those commits created an artificial edge from a cleanup to a synthesized
catchswitch in order to get the MSVC personality routine to execute
cleanups which don't cleanupret and are not wrapped by a catchswitch.
This worked well enough but is not a complete solution in situations
where there the cleanup infinite loops.
However, the real deal breaker behind this approach comes about from a
degenerate case where the cleanup is post-dominated by unreachable *and*
throws an exception. This ends poorly because the catchswitch will
inadvertently catch the exception.
Because of this we should go back to our previous behavior of not
executing certain cleanups (identical behavior with the Itanium ABI
implementation in clang, GCC and ICC).
N.B. I think this could be salvaged by making the catchpad rethrow the
exception and properly transforming throwing calls in the cleanup into
invokes.
llvm-svn: 259338