platform/upstream/llvm.git
9 years ago[AArch64] Fix poor codegen for add immediate.
Quentin Colombet [Tue, 31 Mar 2015 00:31:13 +0000 (00:31 +0000)]
[AArch64] Fix poor codegen for add immediate.
We used to match the register variant before the immediate when the register
argument could be implicitly zero-extended.

llvm-svn: 233653

9 years agoIncreate backlog of lldb-platform's listener socket
Vince Harron [Tue, 31 Mar 2015 00:27:10 +0000 (00:27 +0000)]
Increate backlog of lldb-platform's listener socket

lldb-platform's listener socket only had a backlog of one connection.
That means that if more than one client connected simultaneously, the
connection would be refused. The test suite can be run remotely with
dozens of threads connecting simultaneously. Raised this limit to 100
to effectively eliminate lost connections.

Test Plan:
run tests against a remote target

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

llvm-svn: 233652

9 years agoFix socket leak in lldb-server platform
Vince Harron [Tue, 31 Mar 2015 00:24:51 +0000 (00:24 +0000)]
Fix socket leak in lldb-server platform

lldb-server server process was holding on to a connection to every
client that connected. This continued until the process hit it's
file limit and exited.

lldb-server p --listen *:5432 --server

run remote tests against that server more than 1000 times

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

llvm-svn: 233651

9 years agoDebugInfo: Remove LexicalBlockFile scope/context distinction
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 00:10:37 +0000 (00:10 +0000)]
DebugInfo: Remove LexicalBlockFile scope/context distinction

Two things here:

 1. I read `getScope()` and `getContext()` backwards in r233640.  There
    was no need for `getScopeOfScope()`.  Obviously not enough test
    coverage here (as I said in that commit, I'm going to come back to
    that), but anyway I'm reverting to the behaviour before r233640.
 2. The callers that use `DILexicalBlockFile::getContext()` don't seem
    to care about the difference.  Just have it redirect to `getScope()`
    so I can't get confused again.

llvm-svn: 233650

9 years agoUpdate for llvm commit r233648.
Eric Christopher [Tue, 31 Mar 2015 00:10:23 +0000 (00:10 +0000)]
Update for llvm commit r233648.

llvm-svn: 233649

9 years agoReplace the MCSubtargetInfo parameter with a Triple when creating
Eric Christopher [Tue, 31 Mar 2015 00:10:04 +0000 (00:10 +0000)]
Replace the MCSubtargetInfo parameter with a Triple when creating
an MCInstPrinter. Update all callers and use where we wanted a Triple
previously.

llvm-svn: 233648

9 years agollvm/examples: Suppress building a few JIT examples.
NAKAMURA Takumi [Tue, 31 Mar 2015 00:03:43 +0000 (00:03 +0000)]
llvm/examples: Suppress building a few JIT examples.

  examples/ExceptionDemo/CMakeFiles/ExceptionDemo.dir/ExceptionDemo.cpp.o:(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x10): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager'

llvm-svn: 233647

9 years agollvm/examples: Add RuntimeDyld as libdeps.
NAKAMURA Takumi [Tue, 31 Mar 2015 00:03:36 +0000 (00:03 +0000)]
llvm/examples: Add RuntimeDyld as libdeps.

llvm-svn: 233646

9 years agoFix .gitignore to ignore symlinks.
Chaoren Lin [Tue, 31 Mar 2015 00:03:00 +0000 (00:03 +0000)]
Fix .gitignore to ignore symlinks.

llvm-svn: 233645

9 years agoLexicalScopes: Cleanup remaining uses of DebugLoc
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 23:58:59 +0000 (23:58 +0000)]
LexicalScopes: Cleanup remaining uses of DebugLoc

llvm-svn: 233644

9 years agoDebugLoc: Remove getFromDILexicalBlock()
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 23:47:26 +0000 (23:47 +0000)]
DebugLoc: Remove getFromDILexicalBlock()

The only user of `DebugLoc::getFromDILexicalBlock()` was creating a new
`MDLocation` as convenient API for passing an `MDScope`.  Stop doing
that, and remove the API.  If in the future we actually *want* to create
new DebugLocs, calling `MDLexicalBlock::get()` makes more sense.

llvm-svn: 233643

9 years ago[Objective-C patch]. Amend TransformObjCMessageExpr to handle call
Fariborz Jahanian [Mon, 30 Mar 2015 23:30:24 +0000 (23:30 +0000)]
[Objective-C patch]. Amend TransformObjCMessageExpr to handle call
to 'super' of instance/class methods and not assert.
rdar://20350364

llvm-svn: 233642

9 years agoMake the new tests better; make sure that we're testing the case where no reallocatio...
Marshall Clow [Mon, 30 Mar 2015 23:26:16 +0000 (23:26 +0000)]
Make the new tests better; make sure that we're testing the case where no reallocation has to happen

llvm-svn: 233641

9 years agoLexicalScopes: Use debug info hierarchy pervasively
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 23:21:21 +0000 (23:21 +0000)]
LexicalScopes: Use debug info hierarchy pervasively

Pervasively use the types provided by the debug info hierarchy rather
than `MDNode` in `LexicalScopes`.

I noticed (again, I guess, based on comments in the implementation?)
that `DILexicalBlockFile::getScope()` returns something different from
`DILexicalBlockFile::getContext()`.  I created a local helper for
getting the same logic from `MDLexicalBlockFile` called
`getScopeOfScope()`.  I still don't really understand it, but I've added
some FIXMEs and I'll come back to it (I suspect the way we encode these
objects isn't really ideal).

Note that my previous commit r233610 accidentally changed behaviour in
`findLexicalScope()` -- it transitioned from a call to
`DILexicalBlockFile::getScope()` to `MDLexicalBlockFile::getScope()`
(sounds right, doesn't it?) -- so I've fixed that as a drive-by.  No
tests failed with my error, so it looks like we're missing some coverage
here... when I come back to understand the logic, I'll see if I can add
some.

Other than the fix to `findLexicalScope()`, no functionality change.

llvm-svn: 233640

9 years agoSilence an unused variable warning.
David Majnemer [Mon, 30 Mar 2015 23:14:45 +0000 (23:14 +0000)]
Silence an unused variable warning.

No functional change intended.

llvm-svn: 233639

9 years agoMove lib/Fuzzer docs from a README.txt to a proper .rst file.
Kostya Serebryany [Mon, 30 Mar 2015 23:05:30 +0000 (23:05 +0000)]
Move lib/Fuzzer docs from a README.txt to a proper .rst file.

Summary:
Move lib/Fuzzer docs from a README.txt to a proper .rst file.
This change does not add any content, just formatting.

Test Plan: n/a

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 233638

9 years ago[fuzzer] when a single unit takes over 1 second to run and it is the slowest one...
Kostya Serebryany [Mon, 30 Mar 2015 23:04:35 +0000 (23:04 +0000)]
[fuzzer] when a single unit takes over 1 second to run and it is the slowest one so far, print it.

llvm-svn: 233637

9 years ago[WinEH] Run cleanup handlers when an exception is thrown
David Majnemer [Mon, 30 Mar 2015 22:58:10 +0000 (22:58 +0000)]
[WinEH] Run cleanup handlers when an exception is thrown

Generate tables in the .xdata section representing what actions to take
when an exception is thrown.  This currently fills in state for
cleanups, catch handlers are still unfinished.

llvm-svn: 233636

9 years agoTransfer implicit operands when expanding the RET_ReallyLR pseudo instruction.
Juergen Ributzka [Mon, 30 Mar 2015 22:45:56 +0000 (22:45 +0000)]
Transfer implicit operands when expanding the RET_ReallyLR pseudo instruction.

When we expand the RET_ReallyLR pseudo instruction we also need to transfer the
implicit operands.

The return register is an implicit operand and without it the liveness
calculation generates an incorrect live-out set for the patchpoint.

This fixes rdar://problem/19068476.

llvm-svn: 233635

9 years ago[fuzzer] print various stats in a unified way
Kostya Serebryany [Mon, 30 Mar 2015 22:44:03 +0000 (22:44 +0000)]
[fuzzer] print various stats in a unified way

llvm-svn: 233624

9 years ago[bpf] add support for bswap instructions
Alexei Starovoitov [Mon, 30 Mar 2015 22:40:40 +0000 (22:40 +0000)]
[bpf] add support for bswap instructions

BPF has cpu_to_be and cpu_to_le instructions.
For now assume little endian and generate cpu_to_be for ISD::BSWAP.

llvm-svn: 233620

9 years ago[bpf] fix build
Alexei Starovoitov [Mon, 30 Mar 2015 22:40:35 +0000 (22:40 +0000)]
[bpf] fix build

fix build broken due to r233599.
Would still need to switch to MDLocation long term.

llvm-svn: 233619

9 years ago[Mips] Move the `Elf_RegInfo` structure declaration to the separate file
Simon Atanasyan [Mon, 30 Mar 2015 22:36:07 +0000 (22:36 +0000)]
[Mips] Move the `Elf_RegInfo` structure declaration to the separate file

No functional changes.

llvm-svn: 233618

9 years ago[ELF] Change type of `OutputSection::setType()` argument to int64_t
Simon Atanasyan [Mon, 30 Mar 2015 22:36:01 +0000 (22:36 +0000)]
[ELF] Change type of `OutputSection::setType()` argument to int64_t

Type of `OutputSection::_type` field is int64_t. This change makes
the field's and the argument's types consistent and allows to assign
full range of values to the `OutputSection::_type` field.

llvm-svn: 233617

9 years ago[Mips] clang-format the code
Simon Atanasyan [Mon, 30 Mar 2015 22:35:56 +0000 (22:35 +0000)]
[Mips] clang-format the code

No functional changes.

llvm-svn: 233616

9 years agoRename const char *Triple argument to TT to avoid shadowing llvm::Triple.
Eric Christopher [Mon, 30 Mar 2015 22:31:14 +0000 (22:31 +0000)]
Rename const char *Triple argument to TT to avoid shadowing llvm::Triple.

llvm-svn: 233615

9 years agoRemove unused MCSubtargetInfo argument from the X86 MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 22:16:37 +0000 (22:16 +0000)]
Remove unused MCSubtargetInfo argument from the X86 MCInstPrinter ctors.

llvm-svn: 233614

9 years agoDFSan-based fuzzer (proof of concept).
Kostya Serebryany [Mon, 30 Mar 2015 22:09:51 +0000 (22:09 +0000)]
DFSan-based fuzzer (proof of concept).

Summary:
This adds a simple DFSan-based (i.e. taint-guided) fuzzer mutator,
see the comments for details.

Test Plan: a test added

Reviewers: samsonov, pcc

Reviewed By: samsonov, pcc

Subscribers: llvm-commits

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

llvm-svn: 233613

9 years agoRemove unused MCSubtargetInfo argument from the Sparc MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 22:09:43 +0000 (22:09 +0000)]
Remove unused MCSubtargetInfo argument from the Sparc MCInstPrinter ctors.

llvm-svn: 233612

9 years agoRemove unused MCSubtargetInfo argument from the NVPTX MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 22:03:16 +0000 (22:03 +0000)]
Remove unused MCSubtargetInfo argument from the NVPTX MCInstPrinter ctors.

llvm-svn: 233611

9 years agoLexicalScopes: Use MDLocation directly instead of DebugLoc
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:54:46 +0000 (21:54 +0000)]
LexicalScopes: Use MDLocation directly instead of DebugLoc

There's no benefit to using `DebugLoc` here.  Moreover, this will let a
follow-up commit work with `MDScope` directly instead of `DebugLoc`.

llvm-svn: 233610

9 years agoRemove unused MCSubtargetInfo argument from the ARM MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 21:52:28 +0000 (21:52 +0000)]
Remove unused MCSubtargetInfo argument from the ARM MCInstPrinter ctors.

llvm-svn: 233609

9 years agoRemove unused MCSubtargetInfo argument from the AArch64 MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 21:52:26 +0000 (21:52 +0000)]
Remove unused MCSubtargetInfo argument from the AArch64 MCInstPrinter ctors.

llvm-svn: 233608

9 years agoRemove unused Target argument from MCInstPrinter ctor functions.
Eric Christopher [Mon, 30 Mar 2015 21:52:21 +0000 (21:52 +0000)]
Remove unused Target argument from MCInstPrinter ctor functions.

llvm-svn: 233607

9 years ago[RegisterCoalescer] Fix a potential misuse of direct operand index in the
Quentin Colombet [Mon, 30 Mar 2015 21:50:44 +0000 (21:50 +0000)]
[RegisterCoalescer] Fix a potential misuse of direct operand index in the
terminal rule.
Spot by code inspection.

llvm-svn: 233606

9 years agoDebugInfo: Use the new DebugLoc API from r233573
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:47:17 +0000 (21:47 +0000)]
DebugInfo: Use the new DebugLoc API from r233573

This should fix the build [1] after r233599 removed the old API.

[1]: http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-parallel-fast/builds/5265

llvm-svn: 233605

9 years ago[opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee...
David Blaikie [Mon, 30 Mar 2015 21:41:43 +0000 (21:41 +0000)]
[opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee type

This pushes the use of PointerType::getElementType up into several
callers - I'll essentially just have to keep pushing that up the stack
until I can eliminate every call to it...

llvm-svn: 233604

9 years agoFix PR23045.
Rafael Espindola [Mon, 30 Mar 2015 21:36:43 +0000 (21:36 +0000)]
Fix PR23045.

Keep a note in the materializer that we are stripping debug info so that
user doing a lazy read of the module don't hit outdated formats.

Thanks to Duncan for suggesting the fix.

llvm-svn: 233603

9 years agoTransforms: Update unit tests to use verifyModule()
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:35:14 +0000 (21:35 +0000)]
Transforms: Update unit tests to use verifyModule()

Since I'm slowly gutting `DISubprogram` and `DICompileUnit`, update the
`CloneFunc` unit tests to call `verifyModule()` (where the checks are
moving to).

llvm-svn: 233602

9 years agoDwarfDebug: Avoid creating new DebugLocs in the backend
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:32:28 +0000 (21:32 +0000)]
DwarfDebug: Avoid creating new DebugLocs in the backend

Don't use `DebugLoc::getFnDebugLoc()`, which creates new `MDLocation`s,
in the backend.  We just want to grab the subprogram here anyway.

llvm-svn: 233601

9 years agoExplain how to abandon a review.
Paul Robinson [Mon, 30 Mar 2015 21:27:28 +0000 (21:27 +0000)]
Explain how to abandon a review.

llvm-svn: 233600

9 years agoDebugInfo: Remove dead code from old DebugLoc API
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:19:50 +0000 (21:19 +0000)]
DebugInfo: Remove dead code from old DebugLoc API

Remove old API for `DebugLoc` now that all the callers have been
updated.  If this broke your out-of-tree build, here's a quick map from
the old API to the new one:

    DebugLoc DebugLoc::getFromMDLocation(MDNode *)
      => DebugLoc::DebugLoc(MDLocation *)
      => explicit DebugLoc::DebugLoc(MDNode *) // works with broken code

    MDNode *DebugLoc::getAsMDNode(LLVMContext &)
      => MDLocation *DebugLoc::get()
      => DebugLoc::operator MDLocation *()
      => MDNode *DebugLoc::getAsMDNode() // works with broken code

    bool DebugLoc::isUnknown()
      => DebugLoc::operator MDLocation *()
          i.e.: if (MDLocation *DL = ...)
      => DebugLoc::operator bool() // works with broken code
          i.e.: if (DebugLoc DL = ...)

    void DebugLoc::getScopeAndInlinedAt(MDNode *&, MDNode *&)
      => use: MDNode *DebugLoc::getScope()
         and: MDLocation *DebugLoc::getInlinedAt()

    MDNode *DebugLoc::getScopeNode(LLVMContext &)
      => MDNode *DebugLoc::getInlinedAtScope()

    void DebugLoc::dump(LLVMContext &)
      => void DebugLoc::dump()

    void DebugLoc::getFnDebugLoc(LLVMContext &)
      => void DebugLoc::getFnDebugLoc()

    MDNode *DebugLoc::getScope(LLVMContext &)
      => MDNode *DebugLoc::getScope()

    MDNode *DebugLoc::getInlinedAt(LLVMContext &)
      => MDLocation *DebugLoc::getInlinedAt()

I've noted above the only functions that won't crash on broken code (due
to downcasting to `MDLocation`).  If your code could be dealing with
broken IR (i.e., you haven't run the verifier yet, or you've used a
temporary node that will eventually (but not yet) get RAUW'ed to an
`MDLocation`), you need to restrict yourself to those.

llvm-svn: 233599

9 years agoUse range loops and add missing braces.
Rafael Espindola [Mon, 30 Mar 2015 21:18:36 +0000 (21:18 +0000)]
Use range loops and add missing braces.

llvm-svn: 233598

9 years agoTransforms: Fix a use of the old DebugLoc in unittests
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:05:29 +0000 (21:05 +0000)]
Transforms: Fix a use of the old DebugLoc in unittests

Missed this one before.

llvm-svn: 233597

9 years ago[opaque pointer type] More IRBuilder::createGEP (non-inbounds) migrations: CodeGenPre...
David Blaikie [Mon, 30 Mar 2015 20:42:56 +0000 (20:42 +0000)]
[opaque pointer type] More IRBuilder::createGEP (non-inbounds) migrations: CodeGenPrepare and SimplifyLibCalls

llvm-svn: 233596

9 years agoMC: For variable symbols, maintain MCSymbol::Section as a cache.
Peter Collingbourne [Mon, 30 Mar 2015 20:41:21 +0000 (20:41 +0000)]
MC: For variable symbols, maintain MCSymbol::Section as a cache.

This fixes the visibility of symbols in certain edge cases involving aliases
with multiple levels of indirection.

Fixes PR19582.

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

llvm-svn: 233595

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