platform/upstream/llvm.git
9 years agoWorkaround a performance issue with modules + PCH
Ben Langmuir [Fri, 10 Apr 2015 22:25:42 +0000 (22:25 +0000)]
Workaround a performance issue with modules + PCH

More fallout from r228234; when looking up an identifier in a PCH that
imports the Cocoa module on Darwin, it was taking 2 to 5 seconds
because we were hammering the MapVector::erase() function, which is
O(n).  For now, just clear() the contained SmallVector to get back to
0.25 - 0.5 seconds.  This is probably not the long-term fix, because
without modules or without PCH the performance is more like 0.02
seconds.

llvm-svn: 234655

9 years ago[CodeGenPrepare] Report all changes made during instruction sinking
Benjamin Kramer [Fri, 10 Apr 2015 22:25:36 +0000 (22:25 +0000)]
[CodeGenPrepare] Report all changes made during instruction sinking

r234638 chained another transform below which was tripping over the
deleted instruction. Use after free found by asan in many regression
tests.

llvm-svn: 234654

9 years ago[RewriteStatepointsForGC] Missed review comment from 234651 & build fix
Philip Reames [Fri, 10 Apr 2015 22:16:58 +0000 (22:16 +0000)]
[RewriteStatepointsForGC] Missed review comment from 234651 & build fix

After submitting 234651, I noticed I hadn't responded to a review comment by mjacob.  This patch addresses that comment and fixes a Release only build problem due to an unused variable.

llvm-svn: 234653

9 years ago[Objective-C Sema] Fixes a typo which did not allow
Fariborz Jahanian [Fri, 10 Apr 2015 22:07:47 +0000 (22:07 +0000)]
[Objective-C Sema] Fixes a typo which did not allow
bridge casting to super class of object's bridge type.
rdar://18311183

llvm-svn: 234652

9 years ago[RewriteStatepointsForGC] Preprocess the IR to remove unreachable blocks and single...
Philip Reames [Fri, 10 Apr 2015 22:07:04 +0000 (22:07 +0000)]
[RewriteStatepointsForGC] Preprocess the IR to remove unreachable blocks and single entry phis

Two related small changes:

    Various dominance based queries about liveness can get confused if we're talking about unreachable blocks. To avoid reasoning about such cases, just remove them before rewriting statepoints.
    Remove single entry phis (likely left behind by LCSSA) to reduce the number of live values.

Both of these are motivated by http://reviews.llvm.org/D8674 which will be submitted shortly.

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

llvm-svn: 234651

9 years agoReplace a macro with an inline function.
Rui Ueyama [Fri, 10 Apr 2015 22:05:11 +0000 (22:05 +0000)]
Replace a macro with an inline function.

llvm-svn: 234650

9 years agoPECOFF: Use C++11 braced init list to make Version objects.
Rui Ueyama [Fri, 10 Apr 2015 21:57:06 +0000 (21:57 +0000)]
PECOFF: Use C++11 braced init list to make Version objects.

llvm-svn: 234649

9 years agoUse C++11 non-static member initialization.
Rui Ueyama [Fri, 10 Apr 2015 21:49:28 +0000 (21:49 +0000)]
Use C++11 non-static member initialization.

llvm-svn: 234648

9 years ago[RewriteStatepointsForGC] Limited support for vectors of pointers
Philip Reames [Fri, 10 Apr 2015 21:48:25 +0000 (21:48 +0000)]
[RewriteStatepointsForGC] Limited support for vectors of pointers

This patch adds limited support for inserting explicit relocations when there's a vector of pointers live over the statepoint. This doesn't handle the case where the vector contains a mix of base and non-base pointers; that's future work.

The current implementation just scalarizes the vector over the gc.statepoint before doing the explicit rewrite. An alternate approach would be to plumb the vector all the way though the backend lowering, but doing that appears challenging. In particular, the size of the indirect spill slot is currently assumed to be sizeof(pointer) throughout the backend.

In practice, this is enough to allow running the SLP and Loop vectorizers before RewriteStatepointsForGC.

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

llvm-svn: 234647

9 years agoAttempt to fix buildbots.
Rui Ueyama [Fri, 10 Apr 2015 21:42:16 +0000 (21:42 +0000)]
Attempt to fix buildbots.

lldNative was removed in r234641.

llvm-svn: 234646

9 years agoDo s/_context/_ctx/g globally.
Rui Ueyama [Fri, 10 Apr 2015 21:40:59 +0000 (21:40 +0000)]
Do s/_context/_ctx/g globally.

I believe this patch eliminates all remaining uses of _context
or _linkingContext variable names. Consistent naming improves
readability.

llvm-svn: 234645

9 years agoFix docs-lld-html build.
Rui Ueyama [Fri, 10 Apr 2015 21:37:42 +0000 (21:37 +0000)]
Fix docs-lld-html build.

llvm-svn: 234644

9 years ago[tblgen] Use StringRef::trim
Benjamin Kramer [Fri, 10 Apr 2015 21:37:21 +0000 (21:37 +0000)]
[tblgen] Use StringRef::trim

llvm-svn: 234643

9 years agoAllow the variable view to get synthetic values if they are available in "gui" mode.
Greg Clayton [Fri, 10 Apr 2015 21:34:10 +0000 (21:34 +0000)]
Allow the variable view to get synthetic values if they are available in "gui" mode.

llvm-svn: 234642

9 years agoRemove the Native file format.
Rui Ueyama [Fri, 10 Apr 2015 21:23:51 +0000 (21:23 +0000)]
Remove the Native file format.

The Native file format was designed to be the fastest on-memory or
on-disk file format for object files. The problem is that no one
is working on that. No LLVM tools can produce object files in
the Native, thus the feature of supporting the format is useless
in the linker.

This patch removes the Native file support. We can add it back
if we really want it in future.

llvm-svn: 234641

9 years agoCleanup virtual methods and mark them as "override" and remove "virtual".
Greg Clayton [Fri, 10 Apr 2015 21:21:09 +0000 (21:21 +0000)]
Cleanup virtual methods and mark them as "override" and remove "virtual".

Also fixed an issue with the GUI mode where tree items wouldn't be notified that they were selected. Now selecting a thread or stack frame in the Threads view will update all windows (source, variables, registers).

llvm-svn: 234640

9 years ago[Mips] Fix broken test case
Simon Atanasyan [Fri, 10 Apr 2015 21:19:01 +0000 (21:19 +0000)]
[Mips] Fix broken test case

llvm-svn: 234639

9 years ago[InstCombine][CodeGenPrep] Create llvm.uadd.with.overflow in CGP.
Sanjoy Das [Fri, 10 Apr 2015 21:07:09 +0000 (21:07 +0000)]
[InstCombine][CodeGenPrep] Create llvm.uadd.with.overflow in CGP.

Summary:
This change moves creating calls to `llvm.uadd.with.overflow` from
InstCombine to CodeGenPrep.  Combining overflow check patterns into
calls to the said intrinsic in InstCombine inhibits optimization because
it introduces an intrinsic call that not all other transforms and
analyses understand.

Depends on D8888.

Reviewers: majnemer, atrick

Subscribers: llvm-commits

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

llvm-svn: 234638

9 years agoELF: Simplify assignments to "result"
Rui Ueyama [Fri, 10 Apr 2015 21:03:20 +0000 (21:03 +0000)]
ELF: Simplify assignments to "result"

This file is not -Wconversion-clean, and seems like we don't care
about that except these lines. Fix these lines for simplicity.

llvm-svn: 234637

9 years agoCreate the correct profiling symbol on NetBSD.
Joerg Sonnenberger [Fri, 10 Apr 2015 21:02:53 +0000 (21:02 +0000)]
Create the correct profiling symbol on NetBSD.

llvm-svn: 234636

9 years ago[Mips] Add -pcrel-eh-reloc command line option
Simon Atanasyan [Fri, 10 Apr 2015 21:00:41 +0000 (21:00 +0000)]
[Mips] Add -pcrel-eh-reloc command line option

This MIPS specific option controls R_MIPS_EH relocation handling.
If -pcrel-eh-reloc is specified R_MIPS_EH relocation should be handled
like R_MIPS_PC32 relocation.

llvm-svn: 234635

9 years ago[Mips] Support R_MIPS_EH relocation handling
Simon Atanasyan [Fri, 10 Apr 2015 21:00:29 +0000 (21:00 +0000)]
[Mips] Support R_MIPS_EH relocation handling

The patch supports just the R_MIPS_EH relocation handling and does not
implement full specification of compact exception tables for MIPS ABIs.

llvm-svn: 234634

9 years agoExtend s{,n}printf custom wrappers to support '*' in the format specifiers
Lorenzo Martignoni [Fri, 10 Apr 2015 20:58:28 +0000 (20:58 +0000)]
Extend s{,n}printf custom wrappers to support '*' in the format specifiers

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

llvm-svn: 234633

9 years ago[Mips] Replace MipsTargetHandler member function getGP() by getGPAddr()
Simon Atanasyan [Fri, 10 Apr 2015 20:55:10 +0000 (20:55 +0000)]
[Mips] Replace MipsTargetHandler member function getGP() by getGPAddr()

When we call getGP() we need in fact _gp symbol address. Let's cache its
value and return it directly from the new getGPAddr() function.

llvm-svn: 234632

9 years ago[Mips] Use std::call_once for thread safe initialization
Simon Atanasyan [Fri, 10 Apr 2015 20:55:04 +0000 (20:55 +0000)]
[Mips] Use std::call_once for thread safe initialization

The commit is inspired by r234628. Thanks Rui for the idea.

llvm-svn: 234631

9 years ago[Mips] Fix typo in the comment
Simon Atanasyan [Fri, 10 Apr 2015 20:54:58 +0000 (20:54 +0000)]
[Mips] Fix typo in the comment

llvm-svn: 234630

9 years agoCreate correct platform-specific target for NetBSD PPC64LE.
Joerg Sonnenberger [Fri, 10 Apr 2015 20:53:48 +0000 (20:53 +0000)]
Create correct platform-specific target for NetBSD PPC64LE.

llvm-svn: 234629

9 years agoFix minor threading issue.
Rui Ueyama [Fri, 10 Apr 2015 19:55:35 +0000 (19:55 +0000)]
Fix minor threading issue.

Because calls of applyRelocation is parallelized, all functions
called from that need to be thread-safe. This piece of code
didn't use any synchronization mechanism, so it was not safe.

llvm-svn: 234628

9 years agoAvoid spewing binary to stdout in some filetype=obj tests
Reid Kleckner [Fri, 10 Apr 2015 19:36:55 +0000 (19:36 +0000)]
Avoid spewing binary to stdout in some filetype=obj tests

llvm-svn: 234627

9 years ago[clang-tidy] Add readability-simplify-boolean-expr check to clang-tidy
Alexander Kornienko [Fri, 10 Apr 2015 19:26:43 +0000 (19:26 +0000)]
[clang-tidy] Add readability-simplify-boolean-expr check to clang-tidy

This check looks for comparisons between boolean expressions and boolean
constants and simplifies them to just use the appropriate boolean expression
directly.

if (b == true) becomes if (b)
if (b == false) becomes if (!b)
if (b && true) becomes if (b)
if (b && false) becomes if (false)
if (b || true) becomes if (true)
if (b || false) becomes if (b)
e ? true : false becomes e
e ? false : true becomes !e
if (true) t(); else f(); becomes t();
if (false) t(); else f(); becomes f();
if (e) return true; else return false; becomes return (e);
if (e) return false; else return true; becomes return !(e);
if (e) b = true; else b = false; becomes b = e;
if (e) b = false; else b = true; becomes b = !(e);

http://reviews.llvm.org/D7648

Patch by Richard Thomson!

llvm-svn: 234626

9 years ago[TestFormatters, TestDataFormatterSynthVal] Mark as xfail.
Siva Chandra [Fri, 10 Apr 2015 19:25:50 +0000 (19:25 +0000)]
[TestFormatters, TestDataFormatterSynthVal] Mark as xfail.

Summary:
This is to get the bots to go green while a robust solution to fix these
tests is worked out.

Reviewers: chaoren, tberghammer, clayborg

Reviewed By: tberghammer, clayborg

Subscribers: lldb-commits

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

llvm-svn: 234625

9 years ago[TestAnonymous] Enable all tests for GCC
Siva Chandra [Fri, 10 Apr 2015 19:24:48 +0000 (19:24 +0000)]
[TestAnonymous] Enable all tests for GCC

Summary:
Also added "_with_dsym" prefix to the dsym tests, and "_with_dwarf" to the dwarf tests.

Test Plan: dotest.py -C gcc -p TestAnonymous

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 234624

9 years agoDon't eagerly typo-correct to a keyword if the next token is a right paren.
Kaelyn Takata [Fri, 10 Apr 2015 19:16:46 +0000 (19:16 +0000)]
Don't eagerly typo-correct to a keyword if the next token is a right paren.

Take advantage of the delayed typo no longer being eagerly corrected to
a keyword to filter out keyword corrections (and other things like
unresolved & overloaded expressions, which have placeholder types) when
correcting typos inside of a decltype().

llvm-svn: 234623

9 years agouse update_llc_test_checks.py to tighten checking
Sanjay Patel [Fri, 10 Apr 2015 18:31:42 +0000 (18:31 +0000)]
use update_llc_test_checks.py to tighten checking

test features, not CPUs

remove unnecessary cruft

llvm-svn: 234622

9 years agoTestcase for the previous commit.
Rafael Espindola [Fri, 10 Apr 2015 18:18:17 +0000 (18:18 +0000)]
Testcase for the previous commit.

Sorry, fogot to "git add" the previous time.

llvm-svn: 234621

9 years agoActually check if lseek works instead of using a filename based heuristic.
Rafael Espindola [Fri, 10 Apr 2015 18:16:30 +0000 (18:16 +0000)]
Actually check if lseek works instead of using a filename based heuristic.

llvm-svn: 234620

9 years agoRemember if lseek works in this FD.
Rafael Espindola [Fri, 10 Apr 2015 18:15:51 +0000 (18:15 +0000)]
Remember if lseek works in this FD.

It will be used in clang in a sec.

llvm-svn: 234619

9 years ago[SEH] Add test for inline functions using SEH helpers
Reid Kleckner [Fri, 10 Apr 2015 18:07:38 +0000 (18:07 +0000)]
[SEH] Add test for inline functions using SEH helpers

Such helpers should always be comdat with the parent function and have
internal linkage.

llvm-svn: 234618

9 years agoDebugInfo: Stop leaking temporaries in DIBuilder::createCompileUnit()
Duncan P. N. Exon Smith [Fri, 10 Apr 2015 18:01:58 +0000 (18:01 +0000)]
DebugInfo: Stop leaking temporaries in DIBuilder::createCompileUnit()

Stop leaking temporary nodes from `DIBuilder::createCompileUnit()`.
`replaceAllUsesWith()` doesn't delete the nodes, so we need to delete
them "manually" (well, `TempMDTuple` does that for us).

Similarly, stop leaking the temporary nodes used for variables of
subprograms.

llvm-svn: 234617

9 years agoReally fix exceptions-seh-finally.c
Reid Kleckner [Fri, 10 Apr 2015 17:53:39 +0000 (17:53 +0000)]
Really fix exceptions-seh-finally.c

llvm-svn: 234616

9 years agoHave one raw_fd_ostream constructor forward to the other.
Rafael Espindola [Fri, 10 Apr 2015 17:52:22 +0000 (17:52 +0000)]
Have one raw_fd_ostream constructor forward to the other.

This fixes some odd behavior differences between the two. In particular,
the version that takes a FD no longer unconditionally sets stdout to binary.

llvm-svn: 234615

9 years agoTry to fix exceptions-seh-finally.c
Reid Kleckner [Fri, 10 Apr 2015 17:45:23 +0000 (17:45 +0000)]
Try to fix exceptions-seh-finally.c

llvm-svn: 234614

9 years ago[SEH] Re-land r234532, but use internal linkage for all SEH helpers
Reid Kleckner [Fri, 10 Apr 2015 17:34:52 +0000 (17:34 +0000)]
[SEH] Re-land r234532, but use internal linkage for all SEH helpers

Even though these symbols are in a comdat group, the Microsoft linker
really wants them to have internal linkage.

I'm planning to tweak the mangling in a follow-up change. This is a
straight revert with a 1-line fix.

llvm-svn: 234613

9 years ago[Frontend] Close open file handles before renaming output files
Reid Kleckner [Fri, 10 Apr 2015 17:27:58 +0000 (17:27 +0000)]
[Frontend] Close open file handles before renaming output files

The placement of the 'delete' call that was removed in the unique_ptr
migration in r234597 was not an accident. The raw_ostream has to be
destroyed before you do the rename on Windows, otherwise you get
ERROR_ACCESS_DENIED. We can still use unique_ptr, we just need to do a
manual reset().

Also, range-for-loop-ify this code.

llvm-svn: 234612

9 years ago[FS] Report errors from llvm::sys::fs::rename on Windows
Reid Kleckner [Fri, 10 Apr 2015 17:20:45 +0000 (17:20 +0000)]
[FS] Report errors from llvm::sys::fs::rename on Windows

Previously we would always report success, which is pretty bogus.

I'm too lazy to write a test where rename will portably fail on all
platforms. I'm just trying to fix breakage introduced by r234597, which
happened to tickle this.

llvm-svn: 234611

9 years agoUse llvm::sys::fs::create_directories to create new directory on Windows.
Oleksiy Vyalov [Fri, 10 Apr 2015 17:02:26 +0000 (17:02 +0000)]
Use llvm::sys::fs::create_directories to create new directory on Windows.

http://reviews.llvm.org/D8977

llvm-svn: 234610

9 years agoCheck in missing file.
Greg Clayton [Fri, 10 Apr 2015 16:48:37 +0000 (16:48 +0000)]
Check in missing file.

llvm-svn: 234609

9 years ago[WinEH] Try to make outlining invokes work a little better
Reid Kleckner [Fri, 10 Apr 2015 16:26:42 +0000 (16:26 +0000)]
[WinEH] Try to make outlining invokes work a little better

WinEH currently turns invokes into calls. Long term, we will reconsider
this, but for now, make sure we remap the operands and clone the
successors of the new terminator.

llvm-svn: 234608

9 years agoAdd logging plugin for Windows
Adrian McCarthy [Fri, 10 Apr 2015 16:18:08 +0000 (16:18 +0000)]
Add logging plugin for Windows

llvm-svn: 234607

9 years ago[CallSite] Use the injected base class name. NFC.
Benjamin Kramer [Fri, 10 Apr 2015 16:02:34 +0000 (16:02 +0000)]
[CallSite] Use the injected base class name. NFC.

llvm-svn: 234606

9 years agoDrop ISL_INSTALL path
Tobias Grosser [Fri, 10 Apr 2015 15:41:14 +0000 (15:41 +0000)]
Drop ISL_INSTALL path

There is no need for an isl install path anymore. isl is now part of Polly.

llvm-svn: 234605

9 years ago[ASan] Use a better name for a function parameter
Timur Iskhodzhanov [Fri, 10 Apr 2015 15:31:16 +0000 (15:31 +0000)]
[ASan] Use a better name for a function parameter

llvm-svn: 234604

9 years ago[PowerPC] Prefetching should also consider depth > 1 loops
Hal Finkel [Fri, 10 Apr 2015 15:05:02 +0000 (15:05 +0000)]
[PowerPC] Prefetching should also consider depth > 1 loops

Iterating over loops from the LoopInfo instance only provides top-level loops.
We need to search the whole tree of loops to find the inner ones.

llvm-svn: 234603

9 years agoSplit Mprotect into MmapNoAccess and MprotectNoAccess to be more portable
Timur Iskhodzhanov [Fri, 10 Apr 2015 15:02:19 +0000 (15:02 +0000)]
Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portable

On Windows, we have to know if a memory to be protected is mapped or not.
On POSIX, Mprotect was semantically different from mprotect most people know.

llvm-svn: 234602

9 years ago[CallSite] Make construction from Value* (or Instruction*) explicit.
Benjamin Kramer [Fri, 10 Apr 2015 14:50:08 +0000 (14:50 +0000)]
[CallSite] Make construction from Value* (or Instruction*) explicit.

CallSite roughly behaves as a common base CallInst and InvokeInst. Bring
the behavior closer to that model by making upcasts explicit. Downcasts
remain implicit and work as before.

Following dyn_cast as a mental model checking whether a Value *V isa
CallSite now looks like this:
  if (auto CS = CallSite(V)) // think dyn_cast
instead of:
  if (CallSite CS = V)

This is an extra token but I think it is slightly clearer. Making the
ctor explicit has the advantage of not accidentally creating nullptr
CallSites, e.g. when you pass a Value * to a function taking a CallSite
argument.

llvm-svn: 234601

9 years agoDon't rely on implicit CallSite construction.
Benjamin Kramer [Fri, 10 Apr 2015 14:49:31 +0000 (14:49 +0000)]
Don't rely on implicit CallSite construction.

llvm-svn: 234600

9 years agoTry to make MSVC happy.
Rafael Espindola [Fri, 10 Apr 2015 14:37:39 +0000 (14:37 +0000)]
Try to make MSVC happy.

llvm-svn: 234599

9 years agoReturn std::unique_ptr to avoid a release and recreate.
Rafael Espindola [Fri, 10 Apr 2015 14:30:43 +0000 (14:30 +0000)]
Return std::unique_ptr to avoid a release and recreate.

llvm-svn: 234598

9 years agoUse a std::unique_ptr to make it easier to see who owns the stream.
Rafael Espindola [Fri, 10 Apr 2015 14:11:52 +0000 (14:11 +0000)]
Use a std::unique_ptr to make it easier to see who owns the stream.

llvm-svn: 234597

9 years ago[clang-tidy] Fix for llvm.org/PR23161
Szabolcs Sipos [Fri, 10 Apr 2015 13:55:39 +0000 (13:55 +0000)]
[clang-tidy] Fix for llvm.org/PR23161

The misc-static-assert check will not warn on the followings:
  assert("Some message" == NULL);
  assert(NULL == "Some message");

llvm-svn: 234596

9 years ago[mips] [IAS] Improve comments in MipsAsmParser::expandLoadImm. NFC.
Toma Tabacu [Fri, 10 Apr 2015 13:28:16 +0000 (13:28 +0000)]
[mips] [IAS] Improve comments in MipsAsmParser::expandLoadImm. NFC.

llvm-svn: 234595

9 years ago[AArch64] Changes some SchedAlias to WriteRes for Cortex-A57.
Chad Rosier [Fri, 10 Apr 2015 13:19:27 +0000 (13:19 +0000)]
[AArch64] Changes some SchedAlias to WriteRes for Cortex-A57.

Using SchedAliases is convenient and works well for latency and resource
lookup for instructions.  However, this creates an entry in
AArch64WriteLatencyTable with a WriteResourceID of 0, breaking any
SchedReadAdvance since the lookup will fail.

http://reviews.llvm.org/D8043
Patch by Dave Estes <cestes@codeaurora.org>!

llvm-svn: 234594

9 years ago[AArch64] Adjusts Cortex-A57 machine model to handle zero shift.
Chad Rosier [Fri, 10 Apr 2015 13:19:21 +0000 (13:19 +0000)]
[AArch64] Adjusts Cortex-A57 machine model to handle zero shift.

http://reviews.llvm.org/D8043
Patch by Dave Estes <cestes@codeaurora.org>!

llvm-svn: 234593

9 years agoReturn a pointer instead of having a pointer outparam and a bool return.
Rafael Espindola [Fri, 10 Apr 2015 13:14:31 +0000 (13:14 +0000)]
Return a pointer instead of having a pointer outparam and a bool return.

llvm-svn: 234592

9 years agoInitializing an uninitialized data member; should be NFC.
Aaron Ballman [Fri, 10 Apr 2015 13:05:04 +0000 (13:05 +0000)]
Initializing an uninitialized data member; should be NFC.

llvm-svn: 234591

9 years agoReturn a pointer instead of having a pointer outparam and a bool return.
Rafael Espindola [Fri, 10 Apr 2015 12:54:53 +0000 (12:54 +0000)]
Return a pointer instead of having a pointer outparam and a bool return.

llvm-svn: 234590

9 years agoMicrooptimize DenseMap::clear.
Benjamin Kramer [Fri, 10 Apr 2015 12:46:44 +0000 (12:46 +0000)]
Microoptimize DenseMap::clear.

Cache NumEntries locally, it's only used in an assert and using the member
variable prevents the compiler from eliminating the tombstone check for types
with trivial destructors. No functionality change intended.

llvm-svn: 234589

9 years ago[ARM] Implement PLT for dynamic pass
Denis Protivensky [Fri, 10 Apr 2015 11:41:27 +0000 (11:41 +0000)]
[ARM] Implement PLT for dynamic pass

This includes implementation of PLT0 entry.

For testing, libfn.so binary is added since
there's no way to link shared objects with lld yet.

llvm-svn: 234588

9 years agoReduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.
Benjamin Kramer [Fri, 10 Apr 2015 11:37:55 +0000 (11:37 +0000)]
Reduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.

No functional change intended.

llvm-svn: 234587

9 years agoReduce dyn_cast<> to isa<> or cast<> where possible.
Benjamin Kramer [Fri, 10 Apr 2015 11:24:51 +0000 (11:24 +0000)]
Reduce dyn_cast<> to isa<> or cast<> where possible.

No functional change intended.

llvm-svn: 234586

9 years ago[ARM] Rework GOT/PLT entry generation
Denis Protivensky [Fri, 10 Apr 2015 11:05:11 +0000 (11:05 +0000)]
[ARM] Rework GOT/PLT entry generation

Use consistent naming: commonly used generator methods
don't have 'Entry' suffices.

llvm-svn: 234585

9 years ago[mips] [IAS] Make the mips-expansions-bad.s test more readable. NFC.
Toma Tabacu [Fri, 10 Apr 2015 10:46:59 +0000 (10:46 +0000)]
[mips] [IAS] Make the mips-expansions-bad.s test more readable. NFC.

Move the check lines below the code lines and change the indentation from 8
spaces to 2 spaces.

llvm-svn: 234584

9 years ago[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.
Alexey Bataev [Fri, 10 Apr 2015 10:43:45 +0000 (10:43 +0000)]
[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.

Emit a code for reduction clause. Next code should be emitted for reductions:

static kmp_critical_name lock = { 0 };

void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
  ...
  *(Type<i> *)lhs[i] = RedOp<i>(*(Type<i> *)lhs[i], *(Type<i> *)rhs[i]);
  ...
}

... void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n> - 1]};
switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
case 1:
  ...
  <LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]);
  ...
  __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
  break;
case 2:
  ...
  Atomic(<LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]));
  ...
  break;
default:
  ;
}
Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.

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

llvm-svn: 234583

9 years ago[ARM] Replace dyn_cast with isa check
Denis Protivensky [Fri, 10 Apr 2015 10:30:04 +0000 (10:30 +0000)]
[ARM] Replace dyn_cast with isa check

llvm-svn: 234582

9 years agoRemove threshold for inserting lifetime markers for named temporaries
Arnaud A. de Grandmaison [Fri, 10 Apr 2015 10:13:52 +0000 (10:13 +0000)]
Remove threshold for inserting lifetime markers for named temporaries

Now that TailRecursionElimination has been fixed with r222354, the
threshold on size for lifetime marker insertion can be removed. This
only affects named temporary though, as the patch for unnamed temporaries
is still in progress.

My previous commit (r222993) was not handling debuginfo correctly, but
this could only be seen with some asan tests. Basically, lifetime markers
are just instrumentation for the compiler's usage and should not affect
debug information; however, the cleanup infrastructure was assuming it
contained only destructors, i.e. actual code to be executed, and was
setting the breakpoint for the end of the function to the closing '}', and
not the return statement, in order to show some destructors have been
called when leaving the function. This is wrong when the cleanups are only
lifetime markers, and this is now fixed.

llvm-svn: 234581

9 years ago[ARM] Improve veneer handling and introduce handlePlain method
Denis Protivensky [Fri, 10 Apr 2015 09:54:10 +0000 (09:54 +0000)]
[ARM] Improve veneer handling and introduce handlePlain method

Handle veneers only for call-like relocations.

llvm-svn: 234580

9 years ago[sanitizer][MIPS] Fix warnings on MIPS
Dmitry Vyukov [Fri, 10 Apr 2015 09:45:22 +0000 (09:45 +0000)]
[sanitizer][MIPS] Fix warnings on MIPS
Fixed:
- stack frame size warning.
- msse3 flag unused warning.
- GoTsanRuntimeCheck dependency warning reported by cmake.

Change by Sagar Thakur
Reviewed in http://reviews.llvm.org/D8963

llvm-svn: 234579

9 years agoReverting test commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:43:58 +0000 (08:43 +0000)]
Reverting test commit.

llvm-svn: 234578

9 years agoTest commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:42:08 +0000 (08:42 +0000)]
Test commit.

llvm-svn: 234577

9 years ago[ARM] Remove unused variable in dynamic pass
Denis Protivensky [Fri, 10 Apr 2015 07:53:18 +0000 (07:53 +0000)]
[ARM] Remove unused variable in dynamic pass

llvm-svn: 234576

9 years ago[OPENMP] Fixed cleanup of OpenMP code.
Alexey Bataev [Fri, 10 Apr 2015 07:48:12 +0000 (07:48 +0000)]
[OPENMP] Fixed cleanup of OpenMP code.

llvm-svn: 234575

9 years agoFix typo in test. There is no %clangcxx, but there is %clangxx.
Nick Lewycky [Fri, 10 Apr 2015 07:43:19 +0000 (07:43 +0000)]
Fix typo in test. There is no %clangcxx, but there is %clangxx.

llvm-svn: 234574

9 years ago[ARM] Add skeleton for dynamic relocation pass
Denis Protivensky [Fri, 10 Apr 2015 07:42:08 +0000 (07:42 +0000)]
[ARM] Add skeleton for dynamic relocation pass

llvm-svn: 234573

9 years ago[OPENMP] Fixing troubles with lambdas in cleanups.
Alexey Bataev [Fri, 10 Apr 2015 06:33:45 +0000 (06:33 +0000)]
[OPENMP] Fixing troubles with lambdas in cleanups.

llvm-svn: 234572

9 years ago[lib/Fuzzer] Section: How good is my fuzzer?
Kostya Serebryany [Fri, 10 Apr 2015 06:32:29 +0000 (06:32 +0000)]
[lib/Fuzzer] Section: How good is my fuzzer?

llvm-svn: 234571

9 years ago[lib/Fuzzer] explain compatibility with AFL
Kostya Serebryany [Fri, 10 Apr 2015 05:44:43 +0000 (05:44 +0000)]
[lib/Fuzzer] explain compatibility with AFL

llvm-svn: 234570

9 years ago[OPENMP] Fixed incompatibility with MSVC, NFC.
Alexey Bataev [Fri, 10 Apr 2015 05:32:31 +0000 (05:32 +0000)]
[OPENMP] Fixed incompatibility with MSVC, NFC.

llvm-svn: 234568

9 years agoDivergence analysis for GPU programs
Jingyue Wu [Fri, 10 Apr 2015 05:03:50 +0000 (05:03 +0000)]
Divergence analysis for GPU programs

Summary:
Some optimizations such as jump threading and loop unswitching can negatively
affect performance when applied to divergent branches. The divergence analysis
added in this patch conservatively estimates which branches in a GPU program
can diverge. This information can then help LLVM to run certain optimizations
selectively.

Test Plan: test/Analysis/DivergenceAnalysis/NVPTX/diverge.ll

Reviewers: resistor, hfinkel, eliben, meheff, jholewinski

Subscribers: broune, bjarke.roune, madhur13490, tstellarAMD, dberlin, echristo, jholewinski, llvm-commits

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

llvm-svn: 234567

9 years ago[WinEHPrepare] Don't rely on the order of IR
David Majnemer [Fri, 10 Apr 2015 04:56:17 +0000 (04:56 +0000)]
[WinEHPrepare] Don't rely on the order of IR

The IPToState table must be emitted after we have generated labels for
all functions in the table.  Don't rely on the order of the list of
globals.  Instead, utilize WinEHFuncInfo to tell us how many catch
handlers we expect to outline.  Once we know we've visited all the catch
handlers, emit the cppxdata.

llvm-svn: 234566

9 years ago[Sema] Don't assume that an initializer list has an initializer
David Majnemer [Fri, 10 Apr 2015 04:52:06 +0000 (04:52 +0000)]
[Sema] Don't assume that an initializer list has an initializer

Given something like 'int({}, 1)', we would try to emit a diagnostic
regarding the excess element in the scalar initializer.  However, we
assumed that the initializer list had an element in it.

llvm-svn: 234565

9 years ago[OPENMP] Refactoring of codegen for OpenMP directives.
Alexey Bataev [Fri, 10 Apr 2015 04:50:10 +0000 (04:50 +0000)]
[OPENMP] Refactoring of codegen for OpenMP directives.

Refactored API of OpenMPRuntime for compatibility with combined directives.
Differential Revision: http://reviews.llvm.org/D8859

llvm-svn: 234564

9 years agoRevert r234532 for a bit, it very likely caused http://crbug.com/475768
Nico Weber [Fri, 10 Apr 2015 04:33:03 +0000 (04:33 +0000)]
Revert r234532 for a bit, it very likely caused crbug.com/475768

llvm-svn: 234563

9 years agoRemove 'z' modifier from printf/sscanf operations in AdbClient - the modifier isn...
Oleksiy Vyalov [Fri, 10 Apr 2015 03:59:52 +0000 (03:59 +0000)]
Remove 'z' modifier from printf/sscanf operations in AdbClient  - the modifier isn't supported by MS C++ compiler.

llvm-svn: 234562

9 years ago[PowerPC] Don't crash on PPC32 i64 fp_to_uint on modern cores
Hal Finkel [Fri, 10 Apr 2015 03:39:00 +0000 (03:39 +0000)]
[PowerPC] Don't crash on PPC32 i64 fp_to_uint on modern cores

When we have an instruction for this (and, thus, don't generate a runtime
call), we need to custom type legalize this (in a trivial way, just as we do
for fp_to_sint).

Fixes PR23173.

llvm-svn: 234561

9 years ago_mm256_blend_epi16 is being cast to __m256d instead of __m256i. Fixing this.
Ekaterina Romanova [Fri, 10 Apr 2015 02:39:45 +0000 (02:39 +0000)]
_mm256_blend_epi16 is being cast to __m256d instead of __m256i. Fixing this.

llvm-svn: 234560

9 years agoWrap socket error handling with SetLastError and IsInterrupted internal functions...
Oleksiy Vyalov [Fri, 10 Apr 2015 02:31:37 +0000 (02:31 +0000)]
Wrap socket error handling with SetLastError and IsInterrupted internal functions which can properly treat Windows and POSIX errors.

http://reviews.llvm.org/D8939

llvm-svn: 234559

9 years agoRemove redundant parentheses.
Rui Ueyama [Fri, 10 Apr 2015 02:18:23 +0000 (02:18 +0000)]
Remove redundant parentheses.

llvm-svn: 234558

9 years agoDo not use default arguments for trivial functions.
Rui Ueyama [Fri, 10 Apr 2015 02:15:13 +0000 (02:15 +0000)]
Do not use default arguments for trivial functions.

llvm-svn: 234557

9 years agoRemove unused return values.
Rui Ueyama [Fri, 10 Apr 2015 02:06:28 +0000 (02:06 +0000)]
Remove unused return values.

llvm-svn: 234556

9 years ago[modules] Remove unused MACRO_TABLE record.
Richard Smith [Fri, 10 Apr 2015 02:02:24 +0000 (02:02 +0000)]
[modules] Remove unused MACRO_TABLE record.

llvm-svn: 234555