platform/upstream/llvm.git
9 years ago[GMR] Continue my quest to remove linked datastructures from GMR, NFC.
Chandler Carruth [Wed, 22 Jul 2015 22:32:34 +0000 (22:32 +0000)]
[GMR] Continue my quest to remove linked datastructures from GMR, NFC.

This replaces the next-to-last std::map with a DenseMap. While DenseMap
doesn't yet make tons of sense (there are 32 bytes or so in the value
type), my next change will reduce the value type to a single pointer --
we only need a pointer and 3 bits, and that is exactly what we can have.

llvm-svn: 242956

9 years ago[ConstantFolding] Support folding loads from a GlobalAlias
David Majnemer [Wed, 22 Jul 2015 22:29:30 +0000 (22:29 +0000)]
[ConstantFolding] Support folding loads from a GlobalAlias

The MSVC ABI requires that we generate an alias for the vtable which
means looking through a GlobalAlias which cannot be overridden improves
our ability to devirtualize.

Found while investigating PR20801.

Patch by Andrew Zhogin!

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

llvm-svn: 242955

9 years agoRevert "Improve merging of stores from static constructors in GlobalOpt"
Anthony Pesch [Wed, 22 Jul 2015 22:26:54 +0000 (22:26 +0000)]
Revert "Improve merging of stores from static constructors in GlobalOpt"

This reverts commit 0a9dee959a30b81b9e7df64c9a58ff9898c24024.

llvm-svn: 242954

9 years agoRevert "IPO: Avoid brace initialization of a map, some versions of libc++ don't like it"
Anthony Pesch [Wed, 22 Jul 2015 22:26:52 +0000 (22:26 +0000)]
Revert "IPO: Avoid brace initialization of a map, some versions of libc++ don't like it"

This reverts commit fc2dad0c68f8d32273d3c2d790ed496961f829af.

llvm-svn: 242953

9 years ago[asan] Disable ctrl+c test until I figure out how to make it portable
Reid Kleckner [Wed, 22 Jul 2015 22:25:07 +0000 (22:25 +0000)]
[asan] Disable ctrl+c test until I figure out how to make it portable

llvm-svn: 242952

9 years agoRemove almost everything in <__functional_base_03>
Eric Fiselier [Wed, 22 Jul 2015 22:23:49 +0000 (22:23 +0000)]
Remove almost everything in <__functional_base_03>

This patch removes a large amount of duplicate code found in both
<__functional_base> and <__functional_base_03>. The only code that remains
in <__functional_base_03> is the C++03 implementation of __invoke and
__invoke_return.

llvm-svn: 242951

9 years ago[GMR] Make the collection of readers and writers of globals much more
Chandler Carruth [Wed, 22 Jul 2015 22:10:05 +0000 (22:10 +0000)]
[GMR] Make the collection of readers and writers of globals much more
efficient, NFC.

Previously, we built up vectors of function pointers to track readers
and writers. The primary problem here is that we would add the same
function to this vector every time we found an instruction that reads or
writes to the pointer. This could be a *lot* of redudant function
pointers. Instead of doing that, we can use a SmallPtrSet.

This does more than just reduce the size of the list of readers or
writers. We walk the entire lists of each and do a map lookup for each
one. By having sets, we will only do one map lookup per reader or writer
function.

But only one user of the pointer analyzer actually needs this
information, so we can also skip accumulating it (and doing a lot of
heap allocations) for all the other pointer analysis. This is
particularly useful because there are very many more pointers in some of
the other cases.

llvm-svn: 242950

9 years agoForce the gnu archive format to fix the test on darwin.
Rafael Espindola [Wed, 22 Jul 2015 22:09:44 +0000 (22:09 +0000)]
Force the gnu archive format to fix the test on darwin.

llvm-svn: 242949

9 years ago[asan] Make __asan_handle_no_return tolerate unregistered threads
Reid Kleckner [Wed, 22 Jul 2015 21:58:31 +0000 (21:58 +0000)]
[asan] Make __asan_handle_no_return tolerate unregistered threads

Summary:
On Windows, thread injection by the kernel or other running processes is
a fairly common occurrence, so ASan should be resilient to it.  The
comments on GetCurrentThread() say that it can return null, so we
shouldn't be CHECK failing if it does.

Sending control-C is one way to get the kernel to inject a thread into
your process, so I wrote a test around it.

Reviewers: llvm-commits

Subscribers: samsonov

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

llvm-svn: 242948

9 years agofix typo; NFC
Sanjay Patel [Wed, 22 Jul 2015 21:56:41 +0000 (21:56 +0000)]
fix typo; NFC

llvm-svn: 242947

9 years agofix indent; NFC
Sanjay Patel [Wed, 22 Jul 2015 21:47:13 +0000 (21:47 +0000)]
fix indent; NFC

llvm-svn: 242946

9 years agoIPO: Avoid brace initialization of a map, some versions of libc++ don't like it
Justin Bogner [Wed, 22 Jul 2015 21:41:12 +0000 (21:41 +0000)]
IPO: Avoid brace initialization of a map, some versions of libc++ don't like it

Should fix the build failure on these darwin bots:

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/12427/
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/10389/

llvm-svn: 242945

9 years agoSet the live address on child const results in a way that is more maintainable for...
Enrico Granata [Wed, 22 Jul 2015 21:39:15 +0000 (21:39 +0000)]
Set the live address on child const results in a way that is more maintainable for sustained merges with our internal branches

llvm-svn: 242944

9 years agoUpdate version to 3.8.0svn
Hans Wennborg [Wed, 22 Jul 2015 21:36:42 +0000 (21:36 +0000)]
Update version to 3.8.0svn

llvm-svn: 242942

9 years ago[lit] Fix launching executables relative to the cwd after 'cd'
Reid Kleckner [Wed, 22 Jul 2015 21:35:27 +0000 (21:35 +0000)]
[lit] Fix launching executables relative to the cwd after 'cd'

This was affecting test/asan/TestCases/Windows/coverage-basic.cc in
compiler-rt. It does something like:

  cd %T/mydir
  %clang %s -o t.exe
  ./t.exe

Previously, we'd end up looking for t.exe relative to the cwd of the lit
process, not the cwd of the test.

llvm-svn: 242941

9 years ago[PeepholeOptimizer] Refactor optimizeUncoalescable logic
Bruno Cardoso Lopes [Wed, 22 Jul 2015 21:30:16 +0000 (21:30 +0000)]
[PeepholeOptimizer] Refactor optimizeUncoalescable logic

Reapply r242294.

- Create a new CopyRewriter for Uncoalescable copy-like instructions
- Change the ValueTracker to return a ValueTrackerResult

This makes optimizeUncoalescable looks more like optimizeCoalescable and
use the CopyRewritter infrastructure.

This is also the preparation for looking up into PHI nodes in the
ValueTracker.

rdar://problem/20404526

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

llvm-svn: 242940

9 years agoWebAssembly: basic bitcode → assembly CodeGen test
JF Bastien [Wed, 22 Jul 2015 21:28:15 +0000 (21:28 +0000)]
WebAssembly: basic bitcode → assembly CodeGen test

Summary:
Add a basic CodeGen bitcode test which (for now) only prints out the function name and nothing else. The current code merely implements the basic needed for the test run to not crash / assert. Getting to that point required:

 - Basic InstPrinter.
 - Basic AsmPrinter.
 - DiagnosticInfoUnsupported (not strictly required, but nice to have, duplicated from AMDGPU/BPF's ISelLowering).
 - Some SP and register setup in WebAssemblyTargetLowering.
 - Basic LowerFormalArguments.
 - GenInstrInfo.
 - Placeholder LowerFormalArguments.
 - Placeholder CanLowerReturn and LowerReturn.
 - Basic DAGToDAGISel::Select, which requiresGenDAGISel.inc as well as GET_INSTRINFO_ENUM with GenInstrInfo.inc.
 - Remove WebAssemblyFrameLowering::determineCalleeSaves and rely on default.
 - Implement WebAssemblyFrameLowering::hasFP, same as AArch64's implementation.

Follow-up patches will implement a real AsmPrinter, which will require adding MI opcodes specific to WebAssembly.

Reviewers: sunfish

Subscribers: aemerson, jfb, llvm-commits

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

llvm-svn: 242939

9 years agoMIR Serialization: Serialize the machine instruction's debug location.
Alex Lorenz [Wed, 22 Jul 2015 21:15:11 +0000 (21:15 +0000)]
MIR Serialization: Serialize the machine instruction's debug location.

llvm-svn: 242938

9 years agoRename RunCallBacksToRun to llvm::sys::RunSignalHandlers
Yaron Keren [Wed, 22 Jul 2015 21:11:17 +0000 (21:11 +0000)]
Rename RunCallBacksToRun to llvm::sys::RunSignalHandlers

And expose it in Signals.h, allowing clients to call it directly,
possibly LLVMErrorHandler which currently calls RunInterruptHandlers
but not RunSignalHandlers, thus for example not printing the stack
backtrace on Unixish OSes. On Windows it does happen because
RunInterruptHandlers ends up calling the callbacks as well via
Cleanup(). This difference in behaviour and code structures in
*/Signals.inc should be patched in the future.

llvm-svn: 242936

9 years agoImprove merging of stores from static constructors in GlobalOpt
Anthony Pesch [Wed, 22 Jul 2015 21:10:45 +0000 (21:10 +0000)]
Improve merging of stores from static constructors in GlobalOpt

Summary:
While working on a project I wound up generating a fairly large lookup table (10k entries) of callbacks inside of a static constructor. Clang was taking upwards of ~10 minutes to compile the lookup table. I generated a smaller test case (http://www.inolen.com/static_initializer_test.ll) that, after running with -ftime-report, pointed fingers at GlobalOpt and MemCpyOptimizer.

Running globalopt took around ~9 minutes. The slowdown came from how GlobalOpt merged stores from static constructors individually into the global initializer in EvaluateStaticConstructor. For each store it discovered and wanted to commit, it would copy the existing global initializer and then merge in the individual store. I changed this so that stores are now grouped by global, and sorted from most significant to least significant by their GEP indexes (e.g. a store to GEP 0, 0 comes before GEP 0, 0, 1). With this representation, the existing initializer can be copied and all new stores merged into it in a single pass.

With this patch and http://reviews.llvm.org/D11198, the lookup table that was taking ~10 minutes to compile now compiles in around 5 seconds. I've ran 'make check' and the test-suite, which all passed.

I'm not really sure who to tag as a reviewer, Lang mentioned that Chandler may be appropriate.

Reviewers: chandlerc, nlewycky

Subscribers: nlewycky, llvm-commits

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

llvm-svn: 242935

9 years agoMIR Parser: Extract the MDNode parsing code into a separate method. NFC.
Alex Lorenz [Wed, 22 Jul 2015 21:07:04 +0000 (21:07 +0000)]
MIR Parser: Extract the MDNode parsing code into a separate method. NFC.

This change would allow the machine instruction parser to reuse this method when
parsing the metadata node for the machine instruction's debug location property.

llvm-svn: 242934

9 years ago[asan] Test clang's SEH implementation as well as MSVC's
Reid Kleckner [Wed, 22 Jul 2015 20:54:24 +0000 (20:54 +0000)]
[asan] Test clang's SEH implementation as well as MSVC's

llvm-svn: 242933

9 years agoXtimeout TestProcessAttach for Linux.
Chaoren Lin [Wed, 22 Jul 2015 20:52:17 +0000 (20:52 +0000)]
Xtimeout TestProcessAttach for Linux.

llvm-svn: 242932

9 years agoFix -Wextra-semi warnings.
Hans Wennborg [Wed, 22 Jul 2015 20:46:26 +0000 (20:46 +0000)]
Fix -Wextra-semi warnings.

Patch by Eugene Zelenko!

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

llvm-svn: 242931

9 years agoFix -Wextra-semi warnings.
Hans Wennborg [Wed, 22 Jul 2015 20:46:11 +0000 (20:46 +0000)]
Fix -Wextra-semi warnings.

Patch by Eugene Zelenko!

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

llvm-svn: 242930

9 years agoDon't complete an EnumDecl if it's already complete. We already do this check
Sean Callanan [Wed, 22 Jul 2015 20:20:57 +0000 (20:20 +0000)]
Don't complete an EnumDecl if it's already complete.  We already do this check
for CXXRecordDecl.

<rdar://problem/21696221>

llvm-svn: 242929

9 years agoImproved the packet dumper to escape the response string before sending it to the...
Greg Clayton [Wed, 22 Jul 2015 20:12:58 +0000 (20:12 +0000)]
Improved the packet dumper to escape the response string before sending it to the response functions (find any 0x7d characters and remove it and XOR the next character with 0x20). This allows us to parse the JSON in the reply packet and display it correctly.

llvm-svn: 242928

9 years agoSomething was unbalanced, and it wasn't the parentheses. ;-) Reverts r242915.
Aaron Ballman [Wed, 22 Jul 2015 20:02:00 +0000 (20:02 +0000)]
Something was unbalanced, and it wasn't the parentheses. ;-) Reverts r242915.

llvm-svn: 242927

9 years agoFix fetching the symbol table of a thin archive.
Rafael Espindola [Wed, 22 Jul 2015 19:34:26 +0000 (19:34 +0000)]
Fix fetching the symbol table of a thin archive.

We were trying to read it as an external file.

llvm-svn: 242926

9 years agoDe-duplicate Unix & Windows CallBacksToRun
Yaron Keren [Wed, 22 Jul 2015 19:01:14 +0000 (19:01 +0000)]
De-duplicate Unix & Windows CallBacksToRun

Move CallBacksToRun into the common Signals.cpp, create RunCallBacksToRun()
and use these in both Unix/Signals.inc and Windows/Signals.inc.

Lots of potential code to be merged here.

llvm-svn: 242925

9 years agoTest commit, added blank line
Anthony Pesch [Wed, 22 Jul 2015 18:50:10 +0000 (18:50 +0000)]
Test commit, added blank line

llvm-svn: 242923

9 years agoSimplify switch as all cases other than default return true. NFC.
Chad Rosier [Wed, 22 Jul 2015 18:41:57 +0000 (18:41 +0000)]
Simplify switch as all cases other than default return true. NFC.

llvm-svn: 242922

9 years agoIdentify thin archives as archives.
Rafael Espindola [Wed, 22 Jul 2015 18:29:39 +0000 (18:29 +0000)]
Identify thin archives as archives.

llvm-svn: 242921

9 years agoRemove C++98 workaround in llvm::sys::DontRemoveFileOnSignal()
Yaron Keren [Wed, 22 Jul 2015 18:23:51 +0000 (18:23 +0000)]
Remove C++98 workaround in llvm::sys::DontRemoveFileOnSignal()

llvm-svn: 242920

9 years ago[Release] Allow release testers to disable certain components
Renato Golin [Wed, 22 Jul 2015 18:21:39 +0000 (18:21 +0000)]
[Release] Allow release testers to disable certain components

Not all components build correctly on all targets and the release
script had no way to disable them other than editing the script locally.

This change provides a way to disable the test-suite, compiler-rt and
the libraries, as well as allowing you to re-run on the same directory
without checking out all sources again.

llvm-svn: 242919

9 years agoFix warnings related to virtual functions not being marked as override.
Greg Clayton [Wed, 22 Jul 2015 18:16:05 +0000 (18:16 +0000)]
Fix warnings related to virtual functions not being marked as override.

llvm-svn: 242918

9 years agoDon't water JSONGenerator objects down into ObjectSP's too early so that we can call...
Greg Clayton [Wed, 22 Jul 2015 18:15:30 +0000 (18:15 +0000)]
Don't water JSONGenerator objects down into ObjectSP's too early so that we can call member functions specific to dictionaries and arrays without calling GetAsDictionary() or GetAsArray() on them.

llvm-svn: 242917

9 years agoMIR Serialization: Serialize the metadata machine operands.
Alex Lorenz [Wed, 22 Jul 2015 17:58:46 +0000 (17:58 +0000)]
MIR Serialization: Serialize the metadata machine operands.

llvm-svn: 242916

9 years agoBalancing parenthesis in comments and documentation; NFC.
Aaron Ballman [Wed, 22 Jul 2015 17:51:42 +0000 (17:51 +0000)]
Balancing parenthesis in comments and documentation; NFC.

llvm-svn: 242915

9 years agoAdd cygwin x86_64 target.
Yaron Keren [Wed, 22 Jul 2015 17:38:19 +0000 (17:38 +0000)]
Add cygwin x86_64 target.

Patch by Martell Malone!

http://reviews.llvm.org/D11349

llvm-svn: 242914

9 years agoFix warnings.
Bruce Mitchener [Wed, 22 Jul 2015 17:31:44 +0000 (17:31 +0000)]
Fix warnings.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 242913

9 years agomisc-unused-parameters: Fix handling of parameters in template functions.
Daniel Jasper [Wed, 22 Jul 2015 17:30:35 +0000 (17:30 +0000)]
misc-unused-parameters: Fix handling of parameters in template functions.

The parameters of the function templates were being marked as
incorrectly be marked as unused. Added a test for this and changed the
check to use the same

  isReferenced() || !getDeclName()

logic as Sema::DiagnoseUnusedParameters.
Patch Scott Wallace, thank you!

llvm-svn: 242912

9 years ago[lldb-mi] Remove unused bool results.
Bruce Mitchener [Wed, 22 Jul 2015 17:07:27 +0000 (17:07 +0000)]
[lldb-mi] Remove unused bool results.

Summary:
Many methods, in particular various 'Add' methods didn't have
any actual failure scenarios that were being emitted. This meant
that a lot of surrounding code could be simplified.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 242911

9 years agoXFAIL TestReturnValue on Linux-x86_64 with clang
Tamas Berghammer [Wed, 22 Jul 2015 16:59:18 +0000 (16:59 +0000)]
XFAIL TestReturnValue on Linux-x86_64 with clang

The coverage of the test got increased and it fails because of it.

llvm-svn: 242910

9 years ago[ARM] Make the frame lowering code ready for shrink-wrapping.
Quentin Colombet [Wed, 22 Jul 2015 16:34:37 +0000 (16:34 +0000)]
[ARM] Make the frame lowering code ready for shrink-wrapping.

Shrink-wrapping can now be tested on ARM with -enable-shrink-wrap.

Related to <rdar://problem/20821730>

llvm-svn: 242908

9 years ago[OpenMP] Make target data directive generate unexpected directive diagnostic.
Samuel Antao [Wed, 22 Jul 2015 16:02:46 +0000 (16:02 +0000)]
[OpenMP] Make target data directive generate unexpected directive diagnostic.

llvm-svn: 242906

9 years ago[mingw] Add support for -rtlib option and -stdlib option to the mingw driver
Reid Kleckner [Wed, 22 Jul 2015 16:01:38 +0000 (16:01 +0000)]
[mingw] Add support for -rtlib option and -stdlib option to the mingw driver

Now clang should be able to use compiler-rt and libc++ on mingw.

Based on a patch by Martell Malone.

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

llvm-svn: 242905

9 years agoPass -I options to integrates and external assemblers
Renato Golin [Wed, 22 Jul 2015 15:32:36 +0000 (15:32 +0000)]
Pass -I options to integrates and external assemblers

Fixes PR21000.

Patch by Artem Belevich.

llvm-svn: 242904

9 years agoImprove SysV ABI for ARM to handle return values with vector return type
Tamas Berghammer [Wed, 22 Jul 2015 14:53:37 +0000 (14:53 +0000)]
Improve SysV ABI for ARM to handle return values with vector return type

This is required to print out the rerun value of funcions returning
types with the following attributes:
__attribute__((__vector_size__(8)));
__attribute__((ext_vector_type(2)));

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

llvm-svn: 242903

9 years ago[asan] Display ASan history threads in reverse chronological order
Kuba Brecka [Wed, 22 Jul 2015 14:30:56 +0000 (14:30 +0000)]
[asan] Display ASan history threads in reverse chronological order

For use-after-free bugs caught by ASan, we show an allocation and a deallocation stack trace. Let's display them in a "most recent event first" order, this patch does that.

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

llvm-svn: 242902

9 years agoDelete ELFEntityIterator. NFC.
Rafael Espindola [Wed, 22 Jul 2015 14:09:20 +0000 (14:09 +0000)]
Delete ELFEntityIterator. NFC.

llvm-svn: 242901

9 years ago[lldb-mi tests] Fix typo of sensitive.
Bruce Mitchener [Wed, 22 Jul 2015 13:46:32 +0000 (13:46 +0000)]
[lldb-mi tests] Fix typo of sensitive.

llvm-svn: 242900

9 years ago[CONCEPTS] Add diagnostics: non-defining function; non-namespace scope
Hubert Tong [Wed, 22 Jul 2015 13:32:36 +0000 (13:32 +0000)]
[CONCEPTS] Add diagnostics: non-defining function; non-namespace scope

Summary:
Create diagnostic for function concept declaration which is not a
definition.

Create diagnostic for concept declaration which isn't in namespace
scope.

Create associated tests.

Reviewers: rsmith, faisalv, fraggamuffin, hubert.reinterpretcast

Subscribers: cfe-commits

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

Patch by Nathan Wilson!

llvm-svn: 242899

9 years agoStmtOpenMP.h: Fix a couple of \param(s) in r242785. [-Wdocumentation]
NAKAMURA Takumi [Wed, 22 Jul 2015 12:38:10 +0000 (12:38 +0000)]
StmtOpenMP.h: Fix a couple of \param(s) in r242785. [-Wdocumentation]

llvm-svn: 242898

9 years ago[PM/AA] Update to reflect the new LLVM API which no longer requires an
Chandler Carruth [Wed, 22 Jul 2015 12:15:33 +0000 (12:15 +0000)]
[PM/AA] Update to reflect the new LLVM API which no longer requires an
AliasAnalysis pointer.

llvm-svn: 242897

9 years ago[X86][AVX512] add reduce/range/scalef/rndScale
Asaf Badouh [Wed, 22 Jul 2015 12:00:43 +0000 (12:00 +0000)]
[X86][AVX512] add reduce/range/scalef/rndScale
include encoding and intrinsics

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

llvm-svn: 242896

9 years ago[GMR] Add a flag to enable GlobalsModRef in the normal compilation
Chandler Carruth [Wed, 22 Jul 2015 11:57:28 +0000 (11:57 +0000)]
[GMR] Add a flag to enable GlobalsModRef in the normal compilation
pipeline.

Even before I started improving its runtime, it was already crazy fast
once the call graph exists, and if we can get it to be conservatively
correct, will still likely catch a lot of interesting and useful cases.
So it may well be useful to enable by default.

But more importantly for me, this should make it easier for me to test
that changes aren't breaking it in fundamental ways by enabling it for
normal builds.

llvm-svn: 242895

9 years ago[dsymutil] Remove extra semicolon. NFC.
Benjamin Kramer [Wed, 22 Jul 2015 11:54:19 +0000 (11:54 +0000)]
[dsymutil] Remove extra semicolon. NFC.

llvm-svn: 242894

9 years ago[GMR] Switch from std::set to SmallPtrSet. NFC.
Chandler Carruth [Wed, 22 Jul 2015 11:47:54 +0000 (11:47 +0000)]
[GMR] Switch from std::set to SmallPtrSet. NFC.

This almost certainly doesn't matter in some deep sense, but std::set is
essentially always going to be slower here. Now the alias query should
be essentially constant time instead of having to chase the set tree
each time.

llvm-svn: 242893

9 years ago[GMR] Only look in the associated allocs map for an underlying value if
Chandler Carruth [Wed, 22 Jul 2015 11:43:24 +0000 (11:43 +0000)]
[GMR] Only look in the associated allocs map for an underlying value if
it wasn't one of the indirect globals (which clearly cannot be an
allocation function call). Also only do a single lookup into this map
instead of two. NFC.

llvm-svn: 242892

9 years ago[GMR] Switch to a DenseMap and clean up the iteration loop. NFC.
Chandler Carruth [Wed, 22 Jul 2015 11:36:09 +0000 (11:36 +0000)]
[GMR] Switch to a DenseMap and clean up the iteration loop. NFC.

Since we have to iterate this map not that infrequently, we should use
a map that is efficient for iteration. It is also almost certainly much
faster for lookups as well. There is more to do in terms of reducing the
wasted overhead of GMR's runtime though. Not sure how much is worthwhile
though.

The loop improvements should hopefully address the code review that
Duncan gave when he saw this code as I moved it around.

llvm-svn: 242891

9 years agoFix a -Winconsistent-missing-override failure in the .intel_syntax
Chandler Carruth [Wed, 22 Jul 2015 11:22:29 +0000 (11:22 +0000)]
Fix a -Winconsistent-missing-override failure in the .intel_syntax
patch.

llvm-svn: 242890

9 years agoFix test from r242886 to use the right triple.
Michael Kuperstein [Wed, 22 Jul 2015 11:19:22 +0000 (11:19 +0000)]
Fix test from r242886 to use the right triple.

llvm-svn: 242889

9 years ago[PM/AA] Try to fix libc++ build bots which require the type used in
Chandler Carruth [Wed, 22 Jul 2015 11:10:41 +0000 (11:10 +0000)]
[PM/AA] Try to fix libc++ build bots which require the type used in
std::list to be complete by hoisting the entire definition into the
class. Ugly, but hopefully works.

llvm-svn: 242888

9 years agoXFAIL watchpoint tests on Android arm/aarch64
Tamas Berghammer [Wed, 22 Jul 2015 11:00:06 +0000 (11:00 +0000)]
XFAIL watchpoint tests on Android arm/aarch64

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

llvm-svn: 242887

9 years ago[X86] Add .intel_syntax noprefix directive to intel-syntax x86 asm output
Michael Kuperstein [Wed, 22 Jul 2015 10:49:44 +0000 (10:49 +0000)]
[X86] Add .intel_syntax noprefix directive to intel-syntax x86 asm output

Patch by: michael.zuckerman@intel.com
Differential Revision: http://reviews.llvm.org/D11223

llvm-svn: 242886

9 years ago[ELF] Protect write access to the ELFLinkingContext::_cidentSections by a mutex
Simon Atanasyan [Wed, 22 Jul 2015 10:32:19 +0000 (10:32 +0000)]
[ELF] Protect write access to the ELFLinkingContext::_cidentSections by a mutex

The _cidentSections container is filled during files parsing so we need to
serialize a concurrent access to it.

llvm-svn: 242885

9 years agoFix mem2reg to correctly handle allocas only used in a single block
Michael Kuperstein [Wed, 22 Jul 2015 10:29:29 +0000 (10:29 +0000)]
Fix mem2reg to correctly handle allocas only used in a single block

Currently, a load from an alloca that is used in as single block and is not preceded
by a store is replaced by undef. This is not always correct if the single block is
inside a loop.
Fix the logic so that:
1) If there are no stores in the block, replace the load with an undef, as before.
2) If there is a store (regardless of where it is in the block w.r.t the load), bail
out, and let the rest of mem2reg handle this alloca.

Patch by: gil.rapaport@intel.com
Differential Revision: http://reviews.llvm.org/D11355

llvm-svn: 242884

9 years ago[asan] Improve moving of non-instrumented allocas
Kuba Brecka [Wed, 22 Jul 2015 10:25:38 +0000 (10:25 +0000)]
[asan] Improve moving of non-instrumented allocas

In r242510, non-instrumented allocas are now moved into the first basic block.  This patch limits that to only move allocas that are present *after* the first instrumented one (i.e. only move allocas up).  A testcase was updated to show behavior in these two cases.  Without the patch, an alloca could be moved down, and could cause an invalid IR.

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

llvm-svn: 242883

9 years ago[PM/AA] Remove all of the dead AliasAnalysis pointers being threaded
Chandler Carruth [Wed, 22 Jul 2015 09:52:54 +0000 (09:52 +0000)]
[PM/AA] Remove all of the dead AliasAnalysis pointers being threaded
through APIs that are no longer necessary now that the update API has
been removed.

This will make changes to the AA interfaces significantly less
disruptive (I hope). Either way, it seems like a really nice cleanup.

llvm-svn: 242882

9 years ago[PM/AA] Remove the last of the legacy update API from AliasAnalysis as
Chandler Carruth [Wed, 22 Jul 2015 09:49:59 +0000 (09:49 +0000)]
[PM/AA] Remove the last of the legacy update API from AliasAnalysis as
part of simplifying its interface and usage in preparation for porting
to work with the new pass manager.

Note that this will likely expose that we have dead arguments, members,
and maybe even pass requirements for AA. I'll be cleaning those up in
seperate patches. This just zaps the actual update API.

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

llvm-svn: 242881

9 years ago[PM/AA] Switch to an early-exit. NFC. This was split out of another
Chandler Carruth [Wed, 22 Jul 2015 09:44:54 +0000 (09:44 +0000)]
[PM/AA] Switch to an early-exit. NFC. This was split out of another
change because the diff is *useless*. I assure you, I just switched to
early-return in this function.

Cleanup in preparation for my next commit, as requested in code review!

llvm-svn: 242880

9 years ago[PM/AA] Put the 'final' keyword in the correct place. And actually
Chandler Carruth [Wed, 22 Jul 2015 09:34:18 +0000 (09:34 +0000)]
[PM/AA] Put the 'final' keyword in the correct place. And actually
succeed at compiling my change before committing it too!

llvm-svn: 242879

9 years ago[PM/AA] Replace the only use of the AliasAnalysis::deleteValue API (in
Chandler Carruth [Wed, 22 Jul 2015 09:27:58 +0000 (09:27 +0000)]
[PM/AA] Replace the only use of the AliasAnalysis::deleteValue API (in
GlobalsModRef) with CallbackVHs that trigger the same behavior.

This is technically more expensive, but in benchmarking some LTO runs,
it seems unlikely to even be above the noise floor. The only way I was
able to measure the performance of GMR at all was to run nothing else
but this one analysis on a linked clang bitcode file. The call graph
analysis still took 5x more time than GMR, and this change at most made
GMR 2% slower (this is well within the noise, so its hard for me to be
sure that this is an actual change). However, in a real LTO run over the
same bitcode, the GMR run takes so little time that the pass timers
don't measure it.

With this, I can remove the last update API from the AliasAnalysis
interface, but I'll actually remove the interface hook point in
a follow-up commit.

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

llvm-svn: 242878

9 years agoAVX-512: Added intrinsics for VCVT* instructions.
Elena Demikhovsky [Wed, 22 Jul 2015 08:56:00 +0000 (08:56 +0000)]
AVX-512: Added intrinsics for VCVT* instructions.
All SKX forms. All VCVT instructions for float/double/int/long types.

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

llvm-svn: 242877

9 years agoTest commit
Ravitheja Addepally [Wed, 22 Jul 2015 08:41:18 +0000 (08:41 +0000)]
Test commit

llvm-svn: 242876

9 years agoFix warnings found by -Wextra-semi
Pavel Labath [Wed, 22 Jul 2015 08:12:01 +0000 (08:12 +0000)]
Fix warnings found by -Wextra-semi

patch by Eugene Zelenko.

llvm-svn: 242875

9 years agoMake stream::operator<< take "const" void *
Pavel Labath [Wed, 22 Jul 2015 07:58:17 +0000 (07:58 +0000)]
Make stream::operator<< take "const" void *

Summary:
This enables us to avoid casts to "void *" in some cases and avoids a couple of "casts off const
qualifiers" warnings.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 242874

9 years ago[LoopUnswitch] Code refactoring to separate trivial loop unswitch and non-trivial...
Chen Li [Wed, 22 Jul 2015 05:26:29 +0000 (05:26 +0000)]
[LoopUnswitch] Code refactoring to separate trivial loop unswitch and non-trivial loop unswitch in processCurrentLoop()

Summary: The current code in LoopUnswtich::processCurrentLoop() mixes trivial loop unswitch and non-trivial loop unswitch together. It goes over all basic blocks in the loop and checks if a condition is trivial or non-trivial unswitch condition. However, trivial unswitch condition can only occur in the loop header basic block (where it controls whether or not the loop does something at all). This refactoring separate trivial loop unswitch and non-trivial loop unswitch. Before going over all basic blocks in the loop, it checks if the loop header contains a trivial unswitch condition. If so, unswitch it. Otherwise, go over all blocks like before but don't check trivial condition any more since they are not possible to be in the other blocks. This code has no functionality change.

Reviewers: meheff, reames, broune

Subscribers: llvm-commits

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

llvm-svn: 242873

9 years agoRemove more commented out code. That is what version control is for.
Eric Fiselier [Wed, 22 Jul 2015 04:37:12 +0000 (04:37 +0000)]
Remove more commented out code. That is what version control is for.

llvm-svn: 242872

9 years ago[BranchFolding] do not iterate the aliases of virtual registers
Jingyue Wu [Wed, 22 Jul 2015 04:16:52 +0000 (04:16 +0000)]
[BranchFolding] do not iterate the aliases of virtual registers

Summary:
MCRegAliasIterator only works for physical registers. So, do not run it
on virtual registers.

With this issue fixed, we can resurrect the BranchFolding pass in NVPTX
backend.

Reviewers: jholewinski, bkramer

Subscribers: henryhu, meheff, llvm-commits, jholewinski

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

llvm-svn: 242871

9 years agoCleanup <__functional_03>
Eric Fiselier [Wed, 22 Jul 2015 04:14:38 +0000 (04:14 +0000)]
Cleanup <__functional_03>

<__functional_03> provides the C++03 definitions for std::memfun and
std::function. However the interaction between <functional> and <__functional_03>
is ugly and duplicates code needlessly. This patch cleans up how the two
headers work together.

The major changes are:

- Provide placeholders, is_bind_expression and is_placeholder in <functional>
  for both C++03 and C++11.

- Provide bad_function_call, function fwd decl,
  __maybe_derive_from_unary_function and __maybe_derive_from_binary_function
  in <functional> for both C++03 and C++11.

- Move the <__functional_03> include to the bottom of <functional>. This makes
  it easier to see how <__functional_03> interacts with <functional>

- Remove a commented out implementation of bind in C++03. It's never going
  to get implemented.

- Mark almost all std::bind tests as unsupported in C++03. std::is_placeholder
  works in C++03 and C++11. std::is_bind_expression is provided in C++03 but
  always returns false.

llvm-svn: 242870

9 years ago[SROA] Fix a nasty pile of bugs to do with big-endian, different alloca
Chandler Carruth [Wed, 22 Jul 2015 03:32:42 +0000 (03:32 +0000)]
[SROA] Fix a nasty pile of bugs to do with big-endian, different alloca
types and loads, loads or stores widened past the size of an alloca,
etc.

This started off with a bug report about big-endian behavior with
bitfields and loads and stores to a { i32, i24 } struct. An initial
attempt to fix this was sent for review in D10357, but that didn't
really get to the root of the problem.

The core issue was that canConvertValue and convertValue in SROA were
handling different bitwidth integers by doing a zext of the integer. It
wouldn't do a trunc though, only a zext! This would in turn lead SROA to
form an i24 load from an i24 alloca, zext it to i32, and then use it.
This would at least produce the wrong value for big-endian systems.

One of my many false starts here was to correct the computation for
big-endian systems by shifting. But this doesn't actually work because
the original code has a 64-bit store to the entire 8 bytes, and a 32-bit
load of the last 4 bytes, and because the alloc size is 8 bytes, we
can't lose that last (least significant if bigendian) byte! The real
problem here is that we're forming an i24 load in SROA which is actually
not sufficiently wide to load all of the necessary bits here. The source
has an i32 load, and SROA needs to form that as well.

The straightforward way to do this is to disable the zext logic in
canConvertValue and convertValue, forcing us to actually load all
32-bits. This seems like a really good change, but it in turn breaks
several other parts of SROA.

First in the chain of knock-on failures, we had places where we were
doing integer-widening promotion even though some of the integer loads
or stores extended *past the end* of the alloca's memory! There was even
a comment about preventing this, but it only prevented the case where
the type had a different bit size from its store size. So I added checks
to handle the cases where we actually have a widened load or store and
to avoid trying to special integer widening promotion in those cases.

Second, we actually rely on the ability to promote in the face of loads
past the end of an alloca! This is important so that we can (for
example) speculate loads around PHI nodes to do more promotion. The bits
loaded are garbage, but as long as they aren't used and the alignment is
suitable high (which it wasn't in the test case!) this is "fine". And we
can't stop promoting here, lots of things stop working well if we do. So
we need to add specific logic to handle the extension (and truncation)
case, but *only* where that extension or truncation are over bytes that
*are outside the alloca's allocated storage* and thus totally bogus to
load or store.

And of course, once we add back this correct handling of extension or
truncation, we need to correctly handle bigendian systems to avoid
re-introducing the exact bug that started us off on this chain of misery
in the first place, but this time even more subtle as it only happens
along speculated loads atop a PHI node.

I've ported an existing test for PHI speculation to the big-endian test
file and checked that we get that part correct, and I've added several
more interesting big-endian test cases that should help check that we're
getting this correct.

Fun times.

llvm-svn: 242869

9 years ago[modules] Stop performing PCM lookups for all identifiers when building with C++...
Richard Smith [Wed, 22 Jul 2015 02:08:40 +0000 (02:08 +0000)]
[modules] Stop performing PCM lookups for all identifiers when building with C++ modules. Instead, serialize a list of interesting identifiers and mark those ones out of date on module import. Avoiding the identifier lookups here gives a 20-30% speedup in builds with large numbers of modules. No functionality change intended.

llvm-svn: 242868

9 years agoAdd an Either<T,U> type to lldb_utility which represents a type-safe payload of eithe...
Enrico Granata [Wed, 22 Jul 2015 02:06:37 +0000 (02:06 +0000)]
Add an Either<T,U> type to lldb_utility which represents a type-safe payload of either one type or another, à la Haskell

llvm-svn: 242867

9 years agoClean up wording in help for breakpoint --language option.
Dawn Perchik [Wed, 22 Jul 2015 02:01:32 +0000 (02:01 +0000)]
Clean up wording in help for breakpoint --language option.

llvm-svn: 242866

9 years agoSetVector: add reverse_iterator support.
Richard Smith [Wed, 22 Jul 2015 01:30:58 +0000 (01:30 +0000)]
SetVector: add reverse_iterator support.

llvm-svn: 242865

9 years agoFix initializer list order in <regex> to be correct
Eric Fiselier [Wed, 22 Jul 2015 01:29:41 +0000 (01:29 +0000)]
Fix initializer list order in <regex> to be correct

llvm-svn: 242864

9 years ago[modules] Change module manager visitation order to be a bit more stable when
Richard Smith [Wed, 22 Jul 2015 01:28:05 +0000 (01:28 +0000)]
[modules] Change module manager visitation order to be a bit more stable when
more modules are added: visit modules depth-first rather than breadth-first.
The visitation is still (approximately) oldest-to-newest, and still guarantees
that a module is visited before anything it imports, so modules that are
imported by others sometimes need to jump to a later position in the visitation
order when more modules are loaded, but independent module trees don't
interfere with each other any more.

llvm-svn: 242863

9 years agoXfail test_dyld_library_path for Android.
Chaoren Lin [Wed, 22 Jul 2015 01:17:51 +0000 (01:17 +0000)]
Xfail test_dyld_library_path for Android.

Originally, the source for the hidden lib_d and the regular lib_d were the same
file, so we always got the "correct" source for each. Splitting them up in
D11367 exposed a bug of showing the incorrect source file for the hidden lib_d.

llvm-svn: 242862

9 years ago[libcxx] Add support for sanitizers on OS X.
Eric Fiselier [Wed, 22 Jul 2015 00:33:36 +0000 (00:33 +0000)]
[libcxx] Add support for sanitizers on OS X.

Summary: This patch adds special configuration logic to find the compiler_rt libraries required by sanitizers on OS X. The supported sanitizers are Address and Undefined.

Reviewers: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 242858

9 years ago[Sema] Diagnose use of declaration correctly.
Davide Italiano [Wed, 22 Jul 2015 00:30:58 +0000 (00:30 +0000)]
[Sema] Diagnose use of declaration correctly.

Before we skipped that for virtual functions not fully qualified (r81507).
This commit basically reverts this to the older behaviour, which seems
more consistent. We now also correctly consider ill-formed calls to deleted
member functions, which were silently passed before in some cases.
The review contains the whole discussion.

PR: 20268
Differential Revision:  http://reviews.llvm.org/D11334

llvm-svn: 242857

9 years agoFix typos.
Bruce Mitchener [Wed, 22 Jul 2015 00:16:02 +0000 (00:16 +0000)]
Fix typos.

Summary: Fix a bunch of typos.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 242856

9 years ago[modules] In C++, stop serializing and deserializing a list of declarations in
Richard Smith [Tue, 21 Jul 2015 23:54:07 +0000 (23:54 +0000)]
[modules] In C++, stop serializing and deserializing a list of declarations in
the identifier table. This is redundant, since the TU-scope lookups are also
serialized as part of the TU DeclContext, and wasteful in a number of ways. We
still emit the decls for PCH / preamble builds, since for those we want
identical results, not merely semantically equivalent ones.

llvm-svn: 242855

9 years agoChange a test to follow the formatting of the rest of the tests in the file.
Richard Trieu [Tue, 21 Jul 2015 23:38:30 +0000 (23:38 +0000)]
Change a test to follow the formatting of the rest of the tests in the file.
No functional change.

llvm-svn: 242854

9 years ago[sanitizer] Implement include_if_exists with process name substitution.
Evgeniy Stepanov [Tue, 21 Jul 2015 23:03:13 +0000 (23:03 +0000)]
[sanitizer] Implement include_if_exists with process name substitution.

include_if_exists=/path/to/sanitizer/options reads flags from the
file if it is present. "%b" in the include file path (for both
variants of the flag) is replaced with the basename of the main
executable.

llvm-svn: 242853

9 years agoImprove the performance of DWARFDebugInfo::GetCompileUnitContainingDIE() by using...
Greg Clayton [Tue, 21 Jul 2015 22:53:51 +0000 (22:53 +0000)]
Improve the performance of DWARFDebugInfo::GetCompileUnitContainingDIE() by using a binary search.

Also switched DWARFDebugInfo::GetCompileUnit() over to using the same kind of binary search instead of using bsearch().

llvm-svn: 242852

9 years ago[Fuzzer] Rely on $PATH expansion instead of hardcoding paths in tests. NFC.
Alexey Samsonov [Tue, 21 Jul 2015 22:51:55 +0000 (22:51 +0000)]
[Fuzzer] Rely on $PATH expansion instead of hardcoding paths in tests. NFC.

llvm-svn: 242851

9 years ago[Fuzzer] Clearly separate regular and DFSan tests. NFC.
Alexey Samsonov [Tue, 21 Jul 2015 22:51:49 +0000 (22:51 +0000)]
[Fuzzer] Clearly separate regular and DFSan tests. NFC.

llvm-svn: 242850

9 years agoclang-format: Fix unary operator detection in for loops.
Daniel Jasper [Tue, 21 Jul 2015 22:51:00 +0000 (22:51 +0000)]
clang-format: Fix unary operator detection in for loops.

Before:
  for (;; * a = b) {}

After:
  for (;; *a = b) {}

llvm-svn: 242849