platform/upstream/llvm.git
9 years agoAdd driver support for Native Client SDK
Derek Schuff [Mon, 30 Mar 2015 20:31:33 +0000 (20:31 +0000)]
Add driver support for Native Client SDK

Add Tool and ToolChain support for clang to target the NaCl OS using the NaCl
SDK for x86-32, x86-64 and ARM.

Includes nacltools::Assemble and Link which are derived from gnutools. They
are similar to Linux but different enought that they warrant their own class.
Also includes a NaCl_TC in ToolChains derived from Generic_ELF with library
and include paths suitable for an SDK and independent of the system tools.

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

llvm-svn: 233594

9 years ago[analyzer] Add test for previous commit.
Jordan Rose [Mon, 30 Mar 2015 20:18:04 +0000 (20:18 +0000)]
[analyzer] Add test for previous commit.

Again, this is being applied in a separate commit so that the previous commit
can be reverted while leaving the test in place.

rdar://problem/20335433

llvm-svn: 233593

9 years ago[analyzer] Disable all retain count diagnostics on values that come from ivars.
Jordan Rose [Mon, 30 Mar 2015 20:18:00 +0000 (20:18 +0000)]
[analyzer] Disable all retain count diagnostics on values that come from ivars.

This is imitating a pre-r228174 state where ivars are not considered tracked by
default, but with the addition that even ivars /with/ retain count information
(e.g. "[_ivar retain]; [ivar _release];") are not being tracked as well. This is
to ensure that we don't regress on values accessed through both properties and
ivars, which is what r228174 was trying to fix.

The issue occurs in code like this:

  [_contentView retain];
  [_contentView removeFromSuperview];
  [self addSubview:_contentView]; // invalidates 'self'
  [_contentView release];

In this case, the call to -addSubview: may change the value of self->_contentView,
and so the analyzer can't be sure that we didn't leak the original _contentView.
This is a correct conservative view of the world, but not a useful one. Until we
have a heuristic that allows us to not consider this a leak, not emitting a
diagnostic is our best bet.

This commit disables all of the ivar-related retain count tests, but does not
remove them to ensure that we don't crash trying to evaluate either valid or
erroneous code. The next commit will add a new test for the example above so
that this commit (and the previous one) can be reverted wholesale when a better
solution is implemented.

Rest of rdar://problem/20335433

llvm-svn: 233592

9 years ago[analyzer] Don't special-case ivars backing +0 properties.
Jordan Rose [Mon, 30 Mar 2015 20:17:47 +0000 (20:17 +0000)]
[analyzer] Don't special-case ivars backing +0 properties.

Give up this checking in order to continue tracking that these values came from
direct ivar access, which will be important in the next commit.

Part of rdar://problem/20335433

llvm-svn: 233591

9 years agollvm-dis: Use the new `DebugLoc` API, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 20:04:06 +0000 (20:04 +0000)]
llvm-dis: Use the new `DebugLoc` API, NFC

Update tools/llvm-dis to use the new `DebugLoc` API.

llvm-svn: 233590

9 years agoDebugInfo: Use new LLVM API for DebugLoc
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 20:01:41 +0000 (20:01 +0000)]
DebugInfo: Use new LLVM API for DebugLoc

Use the new API for `DebugLoc` added in r233573 before the old one
disappears.

llvm-svn: 233589

9 years agoUpdating code owners file per discussion with Doug at the 2014-10 dev meeting.
Richard Smith [Mon, 30 Mar 2015 19:52:53 +0000 (19:52 +0000)]
Updating code owners file per discussion with Doug at the 2014-10 dev meeting.

llvm-svn: 233588

9 years agoTransforms: Use the new DebugLoc API, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 19:49:49 +0000 (19:49 +0000)]
Transforms: Use the new DebugLoc API, NFC

Update lib/Analysis and lib/Transforms to use the new `DebugLoc` API.

llvm-svn: 233587

9 years ago[PPC] Move argument range checks for HTM and crypto builtins to Sema
Kit Barton [Mon, 30 Mar 2015 19:40:59 +0000 (19:40 +0000)]
[PPC] Move argument range checks for HTM and crypto builtins to Sema

The argument range checks for the HTM and Crypto builtins were implemented in
CGBuiltin.cpp, not in Sema. This change moves them to the appropriate location
in SemaChecking.cpp. It requires the creation of a new method in the Sema class
to do checks for PPC-specific builtins.

http://reviews.llvm.org/D8672

llvm-svn: 233586

9 years agoIR: Use the new DebugLoc API, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 19:40:05 +0000 (19:40 +0000)]
IR: Use the new DebugLoc API, NFC

Update lib/IR and lib/Bitcode to use the new `DebugLoc` API.  Added an
explicit conversion to `bool` (avoiding a conversion to `MDLocation`),
since a couple of these use cases need to handle broken code.

llvm-svn: 233585

9 years agoVerify 'optnone' can run DAG combiner when appropriate.
Paul Robinson [Mon, 30 Mar 2015 19:37:44 +0000 (19:37 +0000)]
Verify 'optnone' can run DAG combiner when appropriate.

Adds a test to verify the behavior that r233153 restored: 'optnone'
does not spuriously disable the DAG combiner, and in fact there are
cases where the DAG combiner must run (even at -O0 or 'optnone') in
order for codegen to succeed.

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

llvm-svn: 233584

9 years ago[NVPTX] Associate a minimum PTX version for each SM architecture
Justin Holewinski [Mon, 30 Mar 2015 19:30:55 +0000 (19:30 +0000)]
[NVPTX] Associate a minimum PTX version for each SM architecture

When a new SM architecture is introduced, it is only supported by the
current PTX version and later.  Make sure we are using at least the
minimum PTX version for the target architecture.

This also removes support for PTX ISA < 3.2.

llvm-svn: 233583

9 years agoCodeGen: Use the new DebugLoc API, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 19:14:47 +0000 (19:14 +0000)]
CodeGen: Use the new DebugLoc API, NFC

Update lib/CodeGen (and lib/Target) to use the new `DebugLoc` API.

llvm-svn: 233582

9 years ago[PPC] Modify HTM and crypto intrinsics to inherit from GCCBuiltin
Kit Barton [Mon, 30 Mar 2015 18:46:15 +0000 (18:46 +0000)]
[PPC] Modify HTM and crypto intrinsics to inherit from GCCBuiltin

There was a change to the way some of the HTM and crypto builtins are being
handled in Clang. Previously, some of the builtins were dealt with in the
CodeGenFunction::EmitPPCBuiltinExpr method (in order to do range checking on
constant arguments). These check will been moved to Sema
http://reviews.llvm.org/D8672), which means those builtins will not be handled
in the EmitPPCBuiltinExpr method anymore. As a result, the definition of the
intrinsics in IntrinsicsPowerPC.td needs to be modified to inherit from the
GCCBuiltin definition.

http://reviews.llvm.org/D8673

llvm-svn: 233581

9 years agoDebugInfo: Reflow printDebugLoc() to use early returns, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 18:45:11 +0000 (18:45 +0000)]
DebugInfo: Reflow printDebugLoc() to use early returns, NFC

llvm-svn: 233580

9 years ago[Orc] Separate callback manager selection from callback manager construction for
Lang Hames [Mon, 30 Mar 2015 18:37:01 +0000 (18:37 +0000)]
[Orc] Separate callback manager selection from callback manager construction for
OrcLazyJIT in lli.

Separating these concerns enables more natural error handling.

llvm-svn: 233579

9 years agoBitcode: Reflow code to use early continues, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 18:29:18 +0000 (18:29 +0000)]
Bitcode: Reflow code to use early continues, NFC

llvm-svn: 233578

9 years agoSelectionDAG: Reflow code to use early returns, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 18:23:28 +0000 (18:23 +0000)]
SelectionDAG: Reflow code to use early returns, NFC

llvm-svn: 233577

9 years ago[NVPTX] Add options for PTX 4.1/4.2 and SM 3.2/3.7/5.2/5.3
Justin Holewinski [Mon, 30 Mar 2015 18:12:50 +0000 (18:12 +0000)]
[NVPTX] Add options for PTX 4.1/4.2 and SM 3.2/3.7/5.2/5.3

llvm-svn: 233575

9 years ago[SystemZ] Fix fallout from r233543 on no-assert builds
Ulrich Weigand [Mon, 30 Mar 2015 18:08:50 +0000 (18:08 +0000)]
[SystemZ] Fix fallout from r233543 on no-assert builds

Test cases must not check for symbolic variable names that are not
present in IR generated by no-assert builds.

Fixed by testing a more complete subset of the va_arg dataflow,
without relying on variable names.

llvm-svn: 233574

9 years agoDebugInfo: Write new DebugLoc API
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 18:07:40 +0000 (18:07 +0000)]
DebugInfo: Write new DebugLoc API

Rewrite `DebugLoc` with a cleaner API that reflects its current status
as a wrapper around an `MDLocation` pointer.

  - Add accessors/constructors to/from `MDLocation`.
  - Simplify construction from `MDNode`.
  - Remove unnecessary `LLVMContext` from APIs.
  - Drop some API that isn't useful any more.
  - Rewrite documentation.

Actually, I've left the old API behind temporarily at the bottom of the
class so that I can update callers in separate commits.  I'll remove it
once the callers are updated.

llvm-svn: 233573

9 years agoDrop some CLooG leftovers
Tobias Grosser [Mon, 30 Mar 2015 17:56:50 +0000 (17:56 +0000)]
Drop some CLooG leftovers

llvm-svn: 233572

9 years agoDelete some leftovers from scoplib
Tobias Grosser [Mon, 30 Mar 2015 17:55:40 +0000 (17:55 +0000)]
Delete some leftovers from scoplib

llvm-svn: 233571

9 years agoDrop libpluto support
Tobias Grosser [Mon, 30 Mar 2015 17:54:01 +0000 (17:54 +0000)]
Drop libpluto support

We do not have buildbots or anything that tests this functionality, hence it
most likely bitrots. People interested to use this functionality can always
recover it from svn history.

llvm-svn: 233570

9 years agoWork around lack of %zd printf format specifier in MSVC libs.
Adrian McCarthy [Mon, 30 Mar 2015 17:46:36 +0000 (17:46 +0000)]
Work around lack of %zd printf format specifier in MSVC libs.

llvm-svn: 233569

9 years agoDebugInfo: Implement MDLocation::getInlinedAtScope()
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 17:41:24 +0000 (17:41 +0000)]
DebugInfo: Implement MDLocation::getInlinedAtScope()

Write `MDLocation::getInlinedAtScope()` and use it to re-implement
`DebugLoc::getScopeNode()` (and simplify `DISubprogram::Verify()`).
This follows the inlined-at linked list and returns the scope of the
deepest/last location.

llvm-svn: 233568

9 years agoUpdate isl to 285e92aea
Tobias Grosser [Mon, 30 Mar 2015 17:28:57 +0000 (17:28 +0000)]
Update isl to 285e92aea

This is mostly a set of schedule tree enhancements which are not yet directly
useful to Polly.

llvm-svn: 233567

9 years agoDelinearization of expressions that contain array size parameters
Tobias Grosser [Mon, 30 Mar 2015 17:22:28 +0000 (17:22 +0000)]
Delinearization of expressions that contain array size parameters

This allows us to delinerize code such as:

  A[][n]

  for (i
    for (j
      A[i][n-j-1] = ...

which would previously have been delinearize to an access A[i+1][-j-1].

To recover the correct access we apply the piecewise expression:

  { A[i][j] -> A[i-1][i+N]: i < 0; A[i][j] -> A[i][i]: i >= 0}

This approach generalizes to higher dimensions.

llvm-svn: 233566

9 years agoVerifier: Add operand checks for remaining debug info
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 17:21:38 +0000 (17:21 +0000)]
Verifier: Add operand checks for remaining debug info

llvm-svn: 233565

9 years agoDebugInfo: Simplify logic in DISubprogram::Verify(), NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 17:06:38 +0000 (17:06 +0000)]
DebugInfo: Simplify logic in DISubprogram::Verify(), NFC

Simplify the logic in `DISubprogram::Verify()` by using the new debug
info hierarchy directly instead of the `DebugLoc` wrapper.

llvm-svn: 233563

9 years agoVerifier: Loosen r233559 check for 'function:' field in MDSubprogram
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 17:04:06 +0000 (17:04 +0000)]
Verifier: Loosen r233559 check for 'function:' field in MDSubprogram

Stop worrying about what the `function:` field is in `MDSubprogram`,
since it could be a bitcast [1].  Just check its type and leave it at
that.

[1]: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/3540/

llvm-svn: 233562

9 years agoVerifier: Add operand checks for MDLexicalBlock
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 16:37:48 +0000 (16:37 +0000)]
Verifier: Add operand checks for MDLexicalBlock

Add operand checks for `MDLexicalBlock` and `MDLexicalBlockFile`.  Like
`MDLocalVariable` and `MDLocation`, these nodes always require a scope.

There was no test bitrot to fix here (just updated the serialization
tests in test/Assembler/mdlexicalblock.ll).

llvm-svn: 233561

9 years agoDebugInfo: Rename some testcases
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 16:21:28 +0000 (16:21 +0000)]
DebugInfo: Rename some testcases

Momentarily (but never in tree), the `scope:` field was called
`parent:`.  Apparently a few testcases were left behind with "parent" in
the name, so rename them.

llvm-svn: 233560

9 years agoVerifier: Check operands of MDSubprogram nodes
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 16:19:15 +0000 (16:19 +0000)]
Verifier: Check operands of MDSubprogram nodes

Check operands of `MDSubprogram`s in the verifier, and update the
accessors and factory functions to use more specific types.

There were a lot of broken testcases, which I fixed in r233466.  If you
have out-of-tree tests for debug info, you probably need similar changes
to the ones I made there.

llvm-svn: 233559

9 years agoTrying to fix the Hexagon and debian-fast bots arm32_neon_vcnt_upgrade.ll test.
Yaron Keren [Mon, 30 Mar 2015 16:10:39 +0000 (16:10 +0000)]
Trying to fix the Hexagon and debian-fast bots arm32_neon_vcnt_upgrade.ll test.

llvm-svn: 233558

9 years agoWhile testing Erik's code coverage scripts, I found a hole in the test suite - vector...
Marshall Clow [Mon, 30 Mar 2015 16:07:11 +0000 (16:07 +0000)]
While testing Erik's code coverage scripts, I found a hole in the test suite - vector::assign where a reallocation was not required had no tests. Add some

llvm-svn: 233557

9 years agoAdd option to only run scop detection
Tobias Grosser [Mon, 30 Mar 2015 16:05:48 +0000 (16:05 +0000)]
Add option to only run scop detection

llvm-svn: 233556

9 years agoRemove more superfluous .str() and replace std::string concatenation with Twine.
Yaron Keren [Mon, 30 Mar 2015 15:42:36 +0000 (15:42 +0000)]
Remove more superfluous .str() and replace std::string concatenation with Twine.

Following r233392, http://llvm.org/viewvc/llvm-project?rev=233392&view=rev.

llvm-svn: 233555

9 years agomore space; NFC
Sanjay Patel [Mon, 30 Mar 2015 15:31:32 +0000 (15:31 +0000)]
more space; NFC

llvm-svn: 233554

9 years ago[X86] Ensure integer domain on scalar i64 load/store stack folding tests. NFC
Simon Pilgrim [Mon, 30 Mar 2015 15:25:51 +0000 (15:25 +0000)]
[X86] Ensure integer domain on scalar i64 load/store stack folding tests. NFC

llvm-svn: 233553

9 years ago[libcxx] Fix PR22771 - Support access control SFINAE in the library version of is_con...
Eric Fiselier [Mon, 30 Mar 2015 15:22:20 +0000 (15:22 +0000)]
[libcxx] Fix PR22771 - Support access control SFINAE in the library version of is_convertible.

Summary:
Currently the conversion check does not take place in a context where access control SFINAE is applied. This patch changes the context of the test expression so that SFINAE occurs if access control does not permit the conversion.

Related bug: https://llvm.org/bugs/show_bug.cgi?id=22771

Reviewers: mclow.lists, rsmith, dim

Reviewed By: dim

Subscribers: dim, rodrigc, emaste, cfe-commits

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

llvm-svn: 233552

9 years agoFix Sphinx warning " Title underline too short.".
Rafael Espindola [Mon, 30 Mar 2015 15:16:30 +0000 (15:16 +0000)]
Fix Sphinx warning " Title underline too short.".

llvm-svn: 233551

9 years ago[ELF] Use override keyword instead of virtual
Simon Atanasyan [Mon, 30 Mar 2015 15:07:16 +0000 (15:07 +0000)]
[ELF] Use override keyword instead of virtual

No functional changes.

llvm-svn: 233550

9 years ago[Mips] Do not use llvm::Optional for GP0 value and TLS section address
Simon Atanasyan [Mon, 30 Mar 2015 15:07:11 +0000 (15:07 +0000)]
[Mips] Do not use llvm::Optional for GP0 value and TLS section address

Use of llvm::Optional is redundant here. Initializing by default value 0
is enough.

No functional changes.

llvm-svn: 233549

9 years ago[Mips] Rename class method merge => mergeHeaderFlags
Simon Atanasyan [Mon, 30 Mar 2015 15:07:05 +0000 (15:07 +0000)]
[Mips] Rename class method merge => mergeHeaderFlags

No functional changes.

llvm-svn: 233548

9 years agoReplace sys.platform skips in tests with @skip decorators which check against remote...
Robert Flack [Mon, 30 Mar 2015 14:12:17 +0000 (14:12 +0000)]
Replace sys.platform skips in tests with @skip decorators which check against remote platform.

Adds @skipIfPlatform and @skipUnlessPlatform decorators which will skip if /
unless the target platform is in the provided platform list.

Test Plan:
ninja check-lldb shows no regressions.
When running cross platform, tests which cannot run on the target platform are
skipped.

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

llvm-svn: 233547

9 years agoFix check in TestNoreturnUnwind
Tamas Berghammer [Mon, 30 Mar 2015 14:05:37 +0000 (14:05 +0000)]
Fix check in TestNoreturnUnwind

llvm-svn: 233546

9 years agoSave a std::string.
Rafael Espindola [Mon, 30 Mar 2015 13:59:06 +0000 (13:59 +0000)]
Save a std::string.

The group names are always symbol names, so we can use a StringRef.

llvm-svn: 233545

9 years ago[SystemZ] Fix definition of IntMaxType / Int64Type
Ulrich Weigand [Mon, 30 Mar 2015 13:50:21 +0000 (13:50 +0000)]
[SystemZ] Fix definition of IntMaxType / Int64Type

Like on other 64-bit platforms, Int64Type should be SignedLong
on SystemZ, not SignedLongLong as per default.  This could cause
ABI incompatibilities in certain cases (e.g. name mangling).

llvm-svn: 233544

9 years ago[SystemZ] Fix some ABI corner cases
Ulrich Weigand [Mon, 30 Mar 2015 13:49:01 +0000 (13:49 +0000)]
[SystemZ] Fix some ABI corner cases

Running the GCC's inter-compiler ABI compatibility test suite uncovered
a couple of errors in clang's SystemZ ABI implementation.  These all
affect only rare corner cases:

- Short vector types

GCC synthetic vector types defined with __attribute__ ((vector_size ...))
are always passed and returned by reference.  (This is not documented in
the official ABI document, but is the de-facto ABI implemented by GCC.)
clang would do that only for vector sizes >= 16 bytes, but not for shorter
vector types.

- Float-like aggregates and empty bitfields

clang would consider any aggregate containing an empty bitfield as
first element to be a float-like aggregate.  That's obviously wrong.
According to the ABI doc, the presence of an empty bitfield makes
an aggregate to be *not* float-like.  However, due to a bug in GCC,
empty bitfields are ignored in C++; this patch changes clang to be
compatible with this "feature" of GCC.

- Float-like aggregates and va_arg

The va_arg implementation would mis-detect some aggregates as float-like
that aren't actually passed as such.  This applies to aggregates that
have only a single element of type float or double, but using an aligned
attribute that increases the total struct size to more than 8 bytes.

This error occurred because the va_arg implement used to have an copy
of the float-like aggregate detection logic (i.e. it would call the
isFPArgumentType routine, but not perform the size check).

To simplify the logic, this patch removes the duplicated logic and
instead simply checks the (possibly coerced) LLVM argument type as
already determined by classifyArgumentType.

llvm-svn: 233543

9 years ago[mips] Add support for 'ZC' inline assembly memory constraint.
Daniel Sanders [Mon, 30 Mar 2015 13:47:23 +0000 (13:47 +0000)]
[mips] Add support for 'ZC' inline assembly memory constraint.

Summary: Also add tests for 'R' and 'm'.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: cfe-commits

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

llvm-svn: 233542

9 years ago[SystemZ] Fix LLVM crash on unoptimized code
Ulrich Weigand [Mon, 30 Mar 2015 13:46:59 +0000 (13:46 +0000)]
[SystemZ] Fix LLVM crash on unoptimized code

Compiling the following function with -O0 would crash, since LLVM would
hit an assertion in getTestUnderMaskCond:

  int test(unsigned long x)
  {
    return x >= 0 && x <= 15;
  }

Fixed by detecting the case in the caller of getTestUnderMaskCond.

llvm-svn: 233541

9 years ago[SystemZ] Remove TargetMachine CPU auto-detection
Ulrich Weigand [Mon, 30 Mar 2015 13:46:25 +0000 (13:46 +0000)]
[SystemZ] Remove TargetMachine CPU auto-detection

As was done for X86 in r206094.

llvm-svn: 233540

9 years agoSpecial case the creation of relocation sections.
Rafael Espindola [Mon, 30 Mar 2015 13:39:16 +0000 (13:39 +0000)]
Special case the creation of relocation sections.

These sections are never looked up and we know when have to create them. Use
that to save adding them to the regular map and avoid a symbol->string->symbol
conversion for the group symbol.

This also makes the implementation independent of the details of how unique
sections are implemented.

llvm-svn: 233539

9 years ago[ARM] Remove whitespace in rel-ifunc test
Denis Protivensky [Mon, 30 Mar 2015 13:31:05 +0000 (13:31 +0000)]
[ARM] Remove whitespace in rel-ifunc test

llvm-svn: 233538

9 years ago[mips] Support 9-bit offsets for the 'R' inline assembly memory constraint.
Daniel Sanders [Mon, 30 Mar 2015 13:27:25 +0000 (13:27 +0000)]
[mips] Support 9-bit offsets for the 'R' inline assembly memory constraint.

Summary:
The 'R' constraint is actually supposed to be much more complicated than
this and is defined in terms of whether it will cause macro expansion in
the assembler. 'R' is getting less useful due to architecture changes and
ought to be replaced by other constraints. We therefore implement 9-bit
offsets which will work for all subtargets and all instructions.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits

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

llvm-svn: 233537

9 years agoRevert test commit at revision 233535.
Russell Gallop [Mon, 30 Mar 2015 12:39:03 +0000 (12:39 +0000)]
Revert test commit at revision 233535.

llvm-svn: 233536

9 years agoTest commit
Russell Gallop [Mon, 30 Mar 2015 12:37:55 +0000 (12:37 +0000)]
Test commit

llvm-svn: 233535

9 years agoAdd forgotten underscore
Tobias Grosser [Mon, 30 Mar 2015 12:22:39 +0000 (12:22 +0000)]
Add forgotten underscore

llvm-svn: 233534

9 years agoAdd some missing isl prefixes
Tobias Grosser [Mon, 30 Mar 2015 11:52:59 +0000 (11:52 +0000)]
Add some missing isl prefixes

llvm-svn: 233533

9 years ago[Mips] Fix writing R_MIPS_REL32 relocation addendum
Simon Atanasyan [Mon, 30 Mar 2015 11:39:02 +0000 (11:39 +0000)]
[Mips] Fix writing R_MIPS_REL32 relocation addendum

If input relocation records have RELA format while output dynamic
relocations have REL format the only way to transfer a dynamic
relocation addendum is to save it into the location modified by
the dynamic relocation.

llvm-svn: 233532

9 years agoFix TestGdbRemote* on remote linux
Tamas Berghammer [Mon, 30 Mar 2015 10:52:32 +0000 (10:52 +0000)]
Fix TestGdbRemote* on remote linux

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

llvm-svn: 233531

9 years agoclang-format: [JS] Fix comment formatting in goog.scopes.
Daniel Jasper [Mon, 30 Mar 2015 09:56:50 +0000 (09:56 +0000)]
clang-format: [JS] Fix comment formatting in goog.scopes.

Before:
  goog.scope(function() {
  // test
  var x = 0;
  // test
  });

After:
  goog.scope(function() {
  // test
  var x = 0;
    // test
  });

llvm-svn: 233530

9 years agoRevert "[SCEV] Look at backedge dominating conditions."
Daniel Jasper [Mon, 30 Mar 2015 09:30:02 +0000 (09:30 +0000)]
Revert "[SCEV] Look at backedge dominating conditions."

This leads to terribly slow compile times under MSAN. More discussion
on the commit thread of r233447.

llvm-svn: 233529

9 years agoAVX-512: blank lines, duplicated tests, no functional changes
Elena Demikhovsky [Mon, 30 Mar 2015 09:29:28 +0000 (09:29 +0000)]
AVX-512: blank lines, duplicated tests, no functional changes

see comments http://reviews.llvm.org/D6835

llvm-svn: 233528

9 years agoAVX-512: added intrinsics for VPAND, VPOR and VPXOR
Elena Demikhovsky [Mon, 30 Mar 2015 08:30:34 +0000 (08:30 +0000)]
AVX-512: added intrinsics for VPAND, VPOR and VPXOR
by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 233525

9 years ago[X86] In getHostCPUFeatures, disable xop, f16c, fma, and fma4 if OS does not support...
Craig Topper [Mon, 30 Mar 2015 06:31:14 +0000 (06:31 +0000)]
[X86] In getHostCPUFeatures, disable xop, f16c, fma, and fma4 if OS does not support saving ymm state.

llvm-svn: 233518

9 years ago[X86] Remove FeatureAES for 'corei7' CPU. 'corei7' should match 'nehalem' which doesn...
Craig Topper [Mon, 30 Mar 2015 06:31:11 +0000 (06:31 +0000)]
[X86] Remove FeatureAES for 'corei7' CPU. 'corei7' should match 'nehalem' which doesn't have AES. Having AES and not PCLMUL makes 'corei7' halfway between Nehalem and Westmere.

llvm-svn: 233517

9 years ago[X86] Use the more specific CPU names like 'nehalem', 'westmere', 'haswell', etc...
Craig Topper [Mon, 30 Mar 2015 06:31:09 +0000 (06:31 +0000)]
[X86] Use the more specific CPU names like 'nehalem', 'westmere', 'haswell', etc. Split Nehalem and Westmere CPUs.

llvm-svn: 233516

9 years ago[X86] Move family 6 model 21 to 'pentium-m'. Near as I can tell this is a Dothan...
Craig Topper [Mon, 30 Mar 2015 06:31:06 +0000 (06:31 +0000)]
[X86] Move family 6 model 21 to 'pentium-m'. Near as I can tell this is a Dothan based SOC.

llvm-svn: 233515

9 years ago[X86] Family 6 model 29 is a Penryn based processor not a Nehalem based processor.
Craig Topper [Mon, 30 Mar 2015 06:31:03 +0000 (06:31 +0000)]
[X86] Family 6 model 29 is a Penryn based processor not a Nehalem based processor.

llvm-svn: 233514

9 years ago[OPENMP] Codegen for 'atomic update' construct.
Alexey Bataev [Mon, 30 Mar 2015 05:20:59 +0000 (05:20 +0000)]
[OPENMP] Codegen for 'atomic update' construct.

Adds atomic update codegen for the following forms of expressions:

x binop= expr;
x++;
++x;
x--;
--x;
x = x binop expr;
x = expr binop x;
If x and expr are integer and binop is associative or x is a LHS in a RHS of the assignment expression, and atomics are allowed for type of x on the target platform atomicrmw instruction is emitted.
Otherwise compare-and-swap sequence is emitted:

bb:
...
atomic load <x>
cont:
<expected> = phi [ <x>, label %bb ], [ <new_failed>, %cont ]
<desired> = <expected> binop <expr>
<res> = cmpxchg atomic &<x>, desired, expected
<new_failed> = <res>.field1;
br <res>field2, label %exit, label %cont
exit:
...

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

llvm-svn: 233513

9 years ago[MCJIT] In debug memory dump output, don't truncate 64 bit addresses
Alexei Starovoitov [Mon, 30 Mar 2015 05:15:57 +0000 (05:15 +0000)]
[MCJIT] In debug memory dump output, don't truncate 64 bit addresses

Summary: In dumpMemorySections a cast was too short, and in resolveRelocations a format string was too short.

Test Plan:
Enable debug build and run a program which invokes MCJIT::finalizeObject(). Saw valid input as below (highlighted addresses were previously truncated):

```
Parse relocations:
Resolving relocations Section #0 **0x7f4c1337b000**
----- Contents of section socket1 before relocations -----
**0x00007f4c1337b000**: 18 01 00 00 01 01 01 0a 00 00 00 00 04 03 02 01
0x00007f4c1337b010: 7b 1a f8 ff 00 00 00 00 18 11 00 00 05 00 00 00

```

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits, ast

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

llvm-svn: 233512

9 years ago[OPENMP] Improved codegen for implicit/explicit 'barrier' constructs.
Alexey Bataev [Mon, 30 Mar 2015 04:30:22 +0000 (04:30 +0000)]
[OPENMP] Improved codegen for implicit/explicit 'barrier' constructs.

Replace boolean IsExplicit parameter of OpenMPRuntime::emitBarrierCall() method by OpenMPDirectiveKind Kind for better compatibility with the runtime library. Also add processing of 'nowait' clause on worksharing directives.
Differential Revision: http://reviews.llvm.org/D8659

llvm-svn: 233511

9 years ago[Orc] Add missing #include. Hopefully this will appease the modules buildbots.
Lang Hames [Mon, 30 Mar 2015 04:02:55 +0000 (04:02 +0000)]
[Orc] Add missing #include. Hopefully this will appease the modules buildbots.

llvm-svn: 233510

9 years ago[MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through
Lang Hames [Mon, 30 Mar 2015 03:37:06 +0000 (03:37 +0000)]
[MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through
MCJIT.

This patch decouples the two responsibilities of the RTDyldMemoryManager class,
memory management and symbol resolution, into two new classes:
RuntimeDyld::MemoryManager and RuntimeDyld::SymbolResolver.

The symbol resolution interface is modified slightly, from:

  uint64_t getSymbolAddress(const std::string &Name);

to:

  RuntimeDyld::SymbolInfo findSymbol(const std::string &Name);

The latter passes symbol flags along with symbol addresses, allowing RuntimeDyld
and others to reason about non-strong/non-exported symbols.

The memory management interface removes the following method:

  void notifyObjectLoaded(ExecutionEngine *EE,
                          const object::ObjectFile &) {}

as it is not related to memory management. (Note: Backwards compatibility *is*
maintained for this method in MCJIT and OrcMCJITReplacement, see below).

The RTDyldMemoryManager class remains in-tree for backwards compatibility.
It inherits directly from RuntimeDyld::SymbolResolver, and indirectly from
RuntimeDyld::MemoryManager via the new MCJITMemoryManager class, which
just subclasses RuntimeDyld::MemoryManager and reintroduces the
notifyObjectLoaded method for backwards compatibility).

The EngineBuilder class retains the existing method:

  EngineBuilder&
  setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager> mcjmm);

and includes two new methods:

  EngineBuilder&
  setMemoryManager(std::unique_ptr<MCJITMemoryManager> MM);

  EngineBuilder&
  setSymbolResolver(std::unique_ptr<RuntimeDyld::SymbolResolver> SR);

Clients should use EITHER:

A single call to setMCJITMemoryManager with an RTDyldMemoryManager.

OR (exclusive)

One call each to each of setMemoryManager and setSymbolResolver.

This patch should be fully compatible with existing uses of RTDyldMemoryManager.
If it is not it should be considered a bug, and the patch either fixed or
reverted.

If clients find the new API to be an improvement the goal will be to deprecate
and eventually remove the RTDyldMemoryManager class in favor of the new classes.

llvm-svn: 233509

9 years agoAdd check for kind of UnqualifiedId in Declarator::isStaticMember()
Petar Jovanovic [Mon, 30 Mar 2015 00:43:56 +0000 (00:43 +0000)]
Add check for kind of UnqualifiedId in Declarator::isStaticMember()

Method CXXMethodDecl::isStaticOverloadedOperator expects Operator field
from the struct OperatorFunctionId, which is a member of the union in
the class UnqualifiedId. If the kind of UnqualifiedId is not checked,
there is no guarantee that the value that this method receives will be
correct, because it can be the value of another union member and not
OperatorFunctionId.

This bug manifests itself when running make check-all on mips64 BE.

This fix resolves the following regression tests:
Clang :: CXX/special/class.dtor/p9.cpp
Clang :: CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp
Clang :: CodeGenCXX/ctor-dtor-alias.cpp
Clang :: CodeGenCXX/debug-info-windows-dtor.cpp
Clang :: CodeGenCXX/dllexport-members.cpp
Clang :: CodeGenCXX/dllexport.cpp

Patch by Violeta Vukobrat.

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

llvm-svn: 233508

9 years agoGist-simplify access relations in the context of domain constraints
Tobias Grosser [Mon, 30 Mar 2015 00:07:50 +0000 (00:07 +0000)]
Gist-simplify access relations in the context of domain constraints

This simplifies already one test case and is needed for upcoming improvements
to our delinearization.

llvm-svn: 233507

9 years ago[Orc] Add missing inline keyword to the function introduced in r233504.
Lang Hames [Sun, 29 Mar 2015 22:07:07 +0000 (22:07 +0000)]
[Orc] Add missing inline keyword to the function introduced in r233504.

llvm-svn: 233506

9 years agoAvoid nullptr dereference in the ScopGraphPrinter
Tobias Grosser [Sun, 29 Mar 2015 22:00:54 +0000 (22:00 +0000)]
Avoid nullptr dereference in the ScopGraphPrinter

Reported-by: http://buildd-clang.debian.net/scan-build
llvm-svn: 233505

9 years ago[Orc] Use raw TargetAddresses for callback trampoline addresses, rather than IR.
Lang Hames [Sun, 29 Mar 2015 21:55:27 +0000 (21:55 +0000)]
[Orc] Use raw TargetAddresses for callback trampoline addresses, rather than IR.
Add convenience function for building a typed IR Constant from trampoline
addresses.

llvm-svn: 233504

9 years ago[MS ABI] Rework .xdata HandlerType emission
David Majnemer [Sun, 29 Mar 2015 21:55:10 +0000 (21:55 +0000)]
[MS ABI] Rework .xdata HandlerType emission

Utilizing IMAGEREL relocations for synthetic IR constructs isn't
valuable, just clutter.  While we are here, simplify HandlerType names
by making the numeric value for the 'adjective' part of the mangled name
instead of appending '.const', etc.  The old scheme made for very long
global names and leads to wordy things like '.std_bad_alloc'

llvm-svn: 233503

9 years agoSilence sign compare warning. NFC.
Benjamin Kramer [Sun, 29 Mar 2015 20:49:03 +0000 (20:49 +0000)]
Silence sign compare warning. NFC.

llvm-svn: 233502

9 years agoStrip constant factors from SCoP parameters
Johannes Doerfert [Sun, 29 Mar 2015 20:45:09 +0000 (20:45 +0000)]
Strip constant factors from SCoP parameters

  This will strip the constant factor of a parameter befor we add it to
  the SCoP. As a result the access functions are simplified, e.g., for
  the attached test case.

llvm-svn: 233501

9 years ago[inline asm] Don't reject duplicated matching constraints
Benjamin Kramer [Sun, 29 Mar 2015 20:33:07 +0000 (20:33 +0000)]
[inline asm] Don't reject duplicated matching constraints

They're harmless and it's easy to generate them from clang, leading to
a crash in LLVM. Found by afl-fuzz.

llvm-svn: 233500

9 years ago[parse] Don't crash on alternative operator spellings from macros in c++11 attributes.
Benjamin Kramer [Sun, 29 Mar 2015 19:25:07 +0000 (19:25 +0000)]
[parse] Don't crash on alternative operator spellings from macros in c++11 attributes.

Found by afl-fuzz.

llvm-svn: 233499

9 years agoUse SDValue bool check to tidyup some possible vector folding ops. NFC.
Simon Pilgrim [Sun, 29 Mar 2015 19:13:40 +0000 (19:13 +0000)]
Use SDValue bool check to tidyup some possible vector folding ops. NFC.

llvm-svn: 233498

9 years ago[lex] Provide a valid token when __has_include is found outside of a pp directive
Benjamin Kramer [Sun, 29 Mar 2015 19:05:27 +0000 (19:05 +0000)]
[lex] Provide a valid token when __has_include is found outside of a pp directive

ExpandBuiltinMacro would strip the identifier and downstream users crash
when they encounter an identifier token with nullptr identifier info.

Found by afl-fuzz.

llvm-svn: 233497

9 years ago[edit] Don't hit an assert when trying to delete a trailing space at EOF
Benjamin Kramer [Sun, 29 Mar 2015 18:07:29 +0000 (18:07 +0000)]
[edit] Don't hit an assert when trying to delete a trailing space at EOF

The buffer is guaranteed to be zero-terminated so we can just
circumvent the check. Found by afl-fuzz.

llvm-svn: 233496

9 years agoUse SDValue bool check to tidyup some possible ReassociateOps. NFC.
Simon Pilgrim [Sun, 29 Mar 2015 16:49:51 +0000 (16:49 +0000)]
Use SDValue bool check to tidyup some possible ReassociateOps. NFC.

llvm-svn: 233495

9 years ago[parser] Push _Atomic locs through DeclaratorChunk.
Benjamin Kramer [Sun, 29 Mar 2015 16:42:06 +0000 (16:42 +0000)]
[parser] Push _Atomic locs through DeclaratorChunk.

Otherwise it stays uninitialized with potentially catastrophic results.
Found by afl-fuzz.

llvm-svn: 233494

9 years ago[lex] Don't create a garbage token if parsing of __has_include fails.
Benjamin Kramer [Sun, 29 Mar 2015 15:33:29 +0000 (15:33 +0000)]
[lex] Don't create a garbage token if parsing of __has_include fails.

It will crash downstream somewhere. Found by afl-fuzz.

llvm-svn: 233493

9 years ago[Parse] Don't crash on ~A::{
Benjamin Kramer [Sun, 29 Mar 2015 14:35:39 +0000 (14:35 +0000)]
[Parse] Don't crash on ~A::{

Found by clang-fuzz.

llvm-svn: 233492

9 years ago[lex] Don't read past the end of the buffer
Benjamin Kramer [Sun, 29 Mar 2015 14:11:37 +0000 (14:11 +0000)]
[lex] Don't read past the end of the buffer

While dereferencing ThisTokEnd is fine and we know that it's not in
[a-zA-Z0-9_.], ThisTokEnd[1] is really past the end.

Found by asan and with a little help from clang-fuzz.

llvm-svn: 233491

9 years ago[lex] Turn range checks into asserts.
Benjamin Kramer [Sun, 29 Mar 2015 14:11:22 +0000 (14:11 +0000)]
[lex] Turn range checks into asserts.

We know that the last accessible char is not in [a-zA-Z0-9_.] so we can
happily scan on as long as it is. No functionality change.

llvm-svn: 233490

9 years agoAVX-512: Fixed the "commutative" property flag in VPANDN instruction
Elena Demikhovsky [Sun, 29 Mar 2015 09:14:29 +0000 (09:14 +0000)]
AVX-512: Fixed the "commutative" property flag in VPANDN instruction
By Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 233489

9 years agoFix a variable name in MSVC specific part of rr233487.
Craig Topper [Sun, 29 Mar 2015 01:07:57 +0000 (01:07 +0000)]
Fix a variable name in MSVC specific part of rr233487.

llvm-svn: 233488

9 years ago[X86] Implement getHostCPUFeatures for X86.
Craig Topper [Sun, 29 Mar 2015 01:00:23 +0000 (01:00 +0000)]
[X86] Implement getHostCPUFeatures for X86.

Plan to use this as part of CPU 'native' support so we can stop picking a different CPU name if CPU doesn't support AVX or AVX2.

llvm-svn: 233487

9 years agoDelete MCInstPrinter::AvailableFeatures.
Akira Hatanaka [Sat, 28 Mar 2015 21:07:24 +0000 (21:07 +0000)]
Delete MCInstPrinter::AvailableFeatures.

All the ports have been fixed to read the feature bits from the subtarget passed
to the print methods. Also, delete the call to setAvailableFeatures in the
constructor of NVPTX's instprinter as the instprinter wasn't using the feature
bits anywhere.

llvm-svn: 233486

9 years ago[X86] Read the feature bits from the subtarget that is passed to printInst
Akira Hatanaka [Sat, 28 Mar 2015 20:56:05 +0000 (20:56 +0000)]
[X86] Read the feature bits from the subtarget that is passed to printInst
instead of from MCInstPrinter::AvailableFeatures.

llvm-svn: 233485