platform/upstream/llvm.git
8 years agoFix SocketAddressTest (again)
Pavel Labath [Wed, 30 Mar 2016 09:43:04 +0000 (09:43 +0000)]
Fix SocketAddressTest (again)

On some versions of Windows, the address is returned as "::1", while on others it's
"0:0:...:0:1". Accept both versions, as they represent the same address.

llvm-svn: 264850

8 years agoFix warning in ThreadSanitizerRuntime
Pavel Labath [Wed, 30 Mar 2016 09:42:59 +0000 (09:42 +0000)]
Fix warning in ThreadSanitizerRuntime

llvm-svn: 264849

8 years agoFix warning in ClangExpressionParser
Pavel Labath [Wed, 30 Mar 2016 08:45:37 +0000 (08:45 +0000)]
Fix warning in ClangExpressionParser

llvm-svn: 264847

8 years agoFix flakyness in TestWatchpointMultipleThreads
Pavel Labath [Wed, 30 Mar 2016 08:43:54 +0000 (08:43 +0000)]
Fix flakyness in TestWatchpointMultipleThreads

Summary:
the inferior in the test deliberately does not lock a mutex when accessing the watched variable.
The reason for that is unclear as, based on the logs, the original intention of the test was to
check whether watchpoints get propagated to newly created threads, which should work fine even
with a mutex. Furthermore, in the unlikely event (which I have still observed happening from time
to time) that two threads do manage the execute the "critical section" simultaneously, the test
will fail, as it is expecting the watchpoint "hit count" to be 1, but in this case it will be 2.

Given this, I have simply chose to lock the mutex always, so that we have more predictible
behavior. Watchpoints being hit simultaneously is still (and correctly!) tested by
TestConcurrentEvents.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 264846

8 years ago[x86] Fix a horrible bug in our lowering of x86 floating point atomic
Chandler Carruth [Wed, 30 Mar 2016 08:41:59 +0000 (08:41 +0000)]
[x86] Fix a horrible bug in our lowering of x86 floating point atomic
operations.

Specifically, we had code that tried to badly approximate reconstructing
all of the possible variations on addressing modes in two x86
instructions based on those in one pseudo instruction. This is not the
first bug uncovered with doing this, so stop doing it altogether.
Instead generically and pedantically copy every operand from the address
over to both new instructions, and strip kill flags from any register
operands.

This fixes a subtle bug seen in the wild where we would mysteriously
drop parts of the addressing mode, causing for example the index
argument in the added test case to just be completely ignored.

Hypothetically, this was an extremely bad miscompile because it actually
caused a predictable and leveragable write of a 64bit quantity to an
unintended offset (the first element of the array intead of whatever
other element was intended). As a consequence, in theory this could even
have introduced security vulnerabilities.

However, this was only something that could happen with an atomic
floating point add. No other operation could trigger this bug, so it
seems extremely unlikely to have occured widely in the wild.

But it did in fact occur, and frequently in scientific applications
which were using relaxed atomic updates of a floating point value after
adding a delta. Those would end up being quite badly miscompiled by
LLVM, which is how we found this. Of course, this often looks like
a race condition in the code, but it was actually a miscompile.

I suspect that this whole RELEASE_FADD thing was a complete mistake.
There is no such operation, and I worry that anything other than add
will get remarkably worse codegeneration. But that's not for this
change....

llvm-svn: 264845

8 years agoFix shared build after r264790
Ismail Donmez [Wed, 30 Mar 2016 08:31:46 +0000 (08:31 +0000)]
Fix shared build after r264790

llvm-svn: 264844

8 years ago[ELF] - Do not keep undefined locals in .symtab
George Rimar [Wed, 30 Mar 2016 08:16:11 +0000 (08:16 +0000)]
[ELF] - Do not keep undefined locals in .symtab

gold and bfd do not include the undefined locals in symtab.
We have no reasons to support that either.

That fixes PR27016

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

llvm-svn: 264843

8 years agoFor MS ABI, emit dllexport friend functions defined inline in class
Stephan Bergmann [Wed, 30 Mar 2016 06:27:31 +0000 (06:27 +0000)]
For MS ABI, emit dllexport friend functions defined inline in class

...as that is apparently what MSVC does.  This is an updated version of r263738,
which had to be reverted in r263740 due to test failures.  The original version
had erroneously emitted functions that are defined in class templates, too (see
the updated "Handle friend functions" code in EmitDeferredDecls,
lib/CodeGen/ModuleBuilder.cpp).  (The updated tests needed to be split out into
their own dllexport-ms-friend.cpp because of the CHECK-NOTs which would have
interfered with subsequent CHECK-DAGs in dllexport.cpp.)

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

llvm-svn: 264841

8 years ago[CodeGen] Mark EVT:getExtendedSizeInBits() as LLVM_READONLY.
Craig Topper [Wed, 30 Mar 2016 05:26:43 +0000 (05:26 +0000)]
[CodeGen] Mark EVT:getExtendedSizeInBits() as LLVM_READONLY.

I think I had tried this a long time back and some bots failed. Hoping that was with an older gcc and maybe now it will work.

llvm-svn: 264840

8 years ago[docs] Add gpucc publication and tutorial.
Jingyue Wu [Wed, 30 Mar 2016 05:05:40 +0000 (05:05 +0000)]
[docs] Add gpucc publication and tutorial.

llvm-svn: 264839

8 years ago[OpenCL] Fix pipe builtin bugs
Xiuli Pan [Wed, 30 Mar 2016 04:46:32 +0000 (04:46 +0000)]
[OpenCL] Fix pipe builtin bugs

Summary:
1. Diag should be output if types are not the same.
2. Should compare using canonical type.
3. Refine the diag to be more clear.

Reviewers: yaxunl, Anastasia

Subscribers: MatsPetersson, pekka.jaaskelainen, cfe-commits

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

llvm-svn: 264825

8 years ago[profile] Remove quotes around env variable, NFC
Vedant Kumar [Wed, 30 Mar 2016 04:36:10 +0000 (04:36 +0000)]
[profile] Remove quotes around env variable, NFC

llvm-svn: 264824

8 years agoIR: Constify LLVMContext::discardValueNames, NFC
Duncan P. N. Exon Smith [Wed, 30 Mar 2016 04:32:29 +0000 (04:32 +0000)]
IR: Constify LLVMContext::discardValueNames, NFC

llvm-svn: 264823

8 years agoBitcodeReader: Fix weird whitespace, NFC
Duncan P. N. Exon Smith [Wed, 30 Mar 2016 04:21:52 +0000 (04:21 +0000)]
BitcodeReader: Fix weird whitespace, NFC

llvm-svn: 264822

8 years agoDon't register the addresses of private symbols from expressions.
Sean Callanan [Wed, 30 Mar 2016 03:44:51 +0000 (03:44 +0000)]
Don't register the addresses of private symbols from expressions.

They're not supposed to go in the symbol table, and in fact the way the JIT
is currently implemented it sometimes crashes when you try to get the
address of such a function.  So we skip them.

llvm-svn: 264821

8 years ago[MemorySSA] Make the visitor more careful with calls.
George Burgess IV [Wed, 30 Mar 2016 03:12:08 +0000 (03:12 +0000)]
[MemorySSA] Make the visitor more careful with calls.

Prior to this patch, the MemorySSA caching visitor would cache all
calls that it visited. When paired with phi optimization, this can be
problematic. Consider:

define void @foo() {
  ; 1 = MemoryDef(liveOnEntry)
  call void @clobberFunction()
  br i1 undef, label %if.end, label %if.then

if.then:
  ; MemoryUse(??)
  call void @readOnlyFunction()
  ; 2 = MemoryDef(1)
  call void @clobberFunction()
  br label %if.end

if.end:
  ; 3 = MemoryPhi(...)
  ; MemoryUse(?)
  call void @readOnlyFunction()
  ret void
}

When optimizing MemoryUse(?), we visit defs 1 and 2, so we note to
cache them later. We ultimately end up not being able to optimize
passed the Phi, so we set MemoryUse(?) to point to the Phi. We then
cache the clobbering call for def 1 to be the Phi.

This commit changes this behavior so that we wipe out any calls
added to VisistedCalls while visiting the defs of a phi we couldn't
optimize.

Aside: With this patch, we now can bootstrap clang/LLVM without a
single MemorySSA verifier failure. Woohoo. :)

llvm-svn: 264820

8 years ago[x86] Extract a helper function to compute the full addressing mode from
Chandler Carruth [Wed, 30 Mar 2016 03:10:24 +0000 (03:10 +0000)]
[x86] Extract a helper function to compute the full addressing mode from
an x86 MachineInstr's operands. This will be super useful to fix some
bad atomics code in my next commit.

No functionality changed.

llvm-svn: 264819

8 years ago[PGO] Handle invoke inst in IR based icall instrumentation
Xinliang David Li [Wed, 30 Mar 2016 02:16:07 +0000 (02:16 +0000)]
[PGO] Handle invoke inst in IR based icall instrumentation

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

llvm-svn: 264818

8 years ago[profile] Test error reporting by writing to a temp directory
Vedant Kumar [Wed, 30 Mar 2016 01:30:47 +0000 (01:30 +0000)]
[profile] Test error reporting by writing to a temp directory

This test case is meant to check whether verbose error logging works. It
does this by _failing_ to write a profile to a path corresponding to a
directory. Make this clearer by writing to a temporary directory.

Patch suggested by Sean Silva!

llvm-svn: 264817

8 years agoFix comments.
Rui Ueyama [Wed, 30 Mar 2016 00:43:49 +0000 (00:43 +0000)]
Fix comments.

The original comments were separated by new code that is irrelevant to
the comment. This patch moves the comment to the right place and update it.

llvm-svn: 264816

8 years ago[llgo] add USES_TERMINAL option to check-libgo
Andrew Wilkins [Wed, 30 Mar 2016 00:29:33 +0000 (00:29 +0000)]
[llgo] add USES_TERMINAL option to check-libgo

Summary:
The check-libgo target runs "make check" in the
libgo package, which can take a long time on
slower machines. To prevent buildbot failures
due to timeout, we can use Ninja's console pool
for this target.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 264815

8 years ago[MemorySSA] Change how the walker views/walks visited phis.
George Burgess IV [Wed, 30 Mar 2016 00:26:26 +0000 (00:26 +0000)]
[MemorySSA] Change how the walker views/walks visited phis.

This patch teaches the caching MemorySSA walker a few things:

1. Not to walk Phis we've walked before. It seems that we tried to do
   this before, but it didn't work so well in cases like:

define void @foo() {
  %1 = alloca i8
  %2 = alloca i8
  br label %begin

begin:
  ; 3 = MemoryPhi({%0,liveOnEntry},{%end,2})
  ; 1 = MemoryDef(3)
  store i8 0, i8* %2
  br label %end

end:
  ; MemoryUse(?)
  load i8, i8* %1
  ; 2 = MemoryDef(1)
  store i8 0, i8* %2
  br label %begin
}

Because we wouldn't put Phis in Q.Visited until we tried to visit them.
So, when trying to optimize MemoryUse(?):
  - We would visit 3 above
    - ...Which would make us put {%0,liveOnEntry} in Q.Visited
    - ...Which would make us visit {%0,liveOnEntry}
    - ...Which would make us put {%end,2} in Q.Visited
    - ...Which would make us visit {%end,2}
      - ...Which would make us visit 3
        - ...Which would realize we've already visited everything in 3
        - ...Which would make us conservatively return 3.

In the added test-case, (@looped_visitedonlyonce) this behavior would
cause us to give incorrect results. Specifically, we'd visit 4 twice
in the same query, but on the second visit, we'd skip while.cond because
it had been visited, visit if.then/if.then2, and cache "1" as the
clobbering def on the way back.

2. If we try to walk the defs of a {Phi,MemLoc} and see it has been
   visited before, just hand back the Phi we're trying to optimize.

I promise this isn't as terrible as it seems. :)

We now insert {Phi,MemLoc} pairs just before walking the Phi's upward
defs. So, we check the cache for the {Phi,MemLoc} pair before checking
if we've already walked the Phi.

The {Phi,MemLoc} pair is (almost?) always guaranteed to have a cache
entry if we've already fully walked it, because we cache as we go.

So, if the {Phi,MemLoc} pair isn't in cache, either:
 (a) we must be in the process of visiting it (in which case, we can't
     give a better answer in a cache-as-we-go DFS walker)

 (b) we visited it, but didn't cache it on the way back (...which seems
     to require `ModifyingAccess` to not dominate `StartingAccess`,
     so I'm 99% sure that would be an error. If it's not an error, I
     haven't been able to get it to happen locally, so I suspect it's
     rare.)

- - - - -

As a consequence of this change, we no longer skip upward defs of phis,
so we can kill the `VisitedOnlyOne` check. This gives us better accuracy
than we had before, at the cost of potentially doing a bit more work
when we have a loop.

llvm-svn: 264814

8 years ago[Driver] Quote clang full version in dwarf producer when invoking cc1as
Bruno Cardoso Lopes [Wed, 30 Mar 2016 00:25:57 +0000 (00:25 +0000)]
[Driver] Quote clang full version in dwarf producer when invoking cc1as

Convenience to allow easy copy-n-paste from clang -v output when
reproducing cc1as comandline.

rdar://problem/23959295

llvm-svn: 264813

8 years ago[libprofile] Make this test express intent a bit better.
Sean Silva [Wed, 30 Mar 2016 00:25:15 +0000 (00:25 +0000)]
[libprofile] Make this test express intent a bit better.

This also makes it work on PS4 a bit better.
For running the libprofile tests on PS4, we are sneaking environment
variables through on the command line, so the extra argument for
LLVM_PROFILE_FILE was messing up the simple `argc < 2` check.

llvm-svn: 264812

8 years ago[Aarch64] Turn on the LoopDataPrefetch pass for Cyclone
Adam Nemet [Wed, 30 Mar 2016 00:21:29 +0000 (00:21 +0000)]
[Aarch64] Turn on the LoopDataPrefetch pass for Cyclone

llvm-svn: 264811

8 years agoFixed the failing test TestCommandScriptImmediateOutput on MacOSX. Turns out that...
Greg Clayton [Wed, 30 Mar 2016 00:02:13 +0000 (00:02 +0000)]
Fixed the failing test TestCommandScriptImmediateOutput on MacOSX. Turns out that there are few things to watch out for when writing pexpect tests:

1 - If you plan on looking for the "(lldb) " prompt as a regular expression, look for "\(lldb\) " so you don't just find "lldb".
2 - Make sure to not use colors (specify --no-use-colors as an option to lldb when launching it) as our editline will print:

"(lldb) <color junk>(lldb) "

where "<color junk>" is a work around that is used to allow us to colorize our prompts. The bad thing is this will make pexepct code like this not execute as you would expect:

prompt = "\(lldb\) "
self.child.sendline("breakpoint set ...", prompt)
self.child.sendline("breakpoint clear ...", prompt)

The problem is the first "sendline" will create two lldb prompts and will match both the first and second prompts and you output will get off. So be sure to disable colors if you need to.

Fixed a case where "TestCommandScriptImmediateOutput.py" would fail if you have spaces in your directory names. I modified custom_command.py to use shlex to parse arguments and I quoted the file path we sent down to the custom_command.write_file function.

llvm-svn: 264810

8 years ago[LTO] Add a comment to explain how we handle @llvm.used.
Davide Italiano [Tue, 29 Mar 2016 23:57:22 +0000 (23:57 +0000)]
[LTO] Add a comment to explain how we handle @llvm.used.

Requested by: Rui Ueyama.

llvm-svn: 264809

8 years ago[CrashReproducer] Cleanup and move functionality around in ModuleDependencyCollector...
Bruno Cardoso Lopes [Tue, 29 Mar 2016 23:47:40 +0000 (23:47 +0000)]
[CrashReproducer] Cleanup and move functionality around in ModuleDependencyCollector. NFC

- Make ModuleDependencyCollector use the DependencyCollector interface
- Move some methods from ModuleDependencyListener to ModuleDependencyCollector
in order to share common functionality with other future possible
callbacks.

llvm-svn: 264808

8 years ago[PPC] Remove -ppc-loop-prefetch-distance in favor of -prefetch-distance
Adam Nemet [Tue, 29 Mar 2016 23:45:56 +0000 (23:45 +0000)]
[PPC] Remove -ppc-loop-prefetch-distance in favor of -prefetch-distance

After the previous change, this can now be overridden centrally in the
pass.

llvm-svn: 264807

8 years ago[LoopDataPrefetch] Centralize the tuning cl::opts under the pass
Adam Nemet [Tue, 29 Mar 2016 23:45:52 +0000 (23:45 +0000)]
[LoopDataPrefetch] Centralize the tuning cl::opts under the pass

This is effectively NFC, minus the renaming of the options
(-cyclone-prefetch-distance -> -prefetch-distance).

The change was requested by Tim in D17943.

llvm-svn: 264806

8 years ago[tsan] Do not instrument reads/writes to instruction profile counters.
Anna Zaks [Tue, 29 Mar 2016 23:19:40 +0000 (23:19 +0000)]
[tsan] Do not instrument reads/writes to instruction profile counters.

We have known races on profile counters, which can be reproduced by enabling
-fsanitize=thread and -fprofile-instr-generate simultaneously on a
multi-threaded program. This patch avoids reporting those races by not
instrumenting the reads and writes coming from the instruction profiler.

llvm-svn: 264805

8 years ago[libFuzzer] more trophies
Kostya Serebryany [Tue, 29 Mar 2016 23:13:25 +0000 (23:13 +0000)]
[libFuzzer] more trophies

llvm-svn: 264804

8 years ago[libFuzzer] more docs
Kostya Serebryany [Tue, 29 Mar 2016 23:07:36 +0000 (23:07 +0000)]
[libFuzzer] more docs

llvm-svn: 264803

8 years agoSimplify AHL handling.
Rafael Espindola [Tue, 29 Mar 2016 23:05:59 +0000 (23:05 +0000)]
Simplify AHL handling.

This simplifies a few things

* Read the value as early as possible, instead of passing a pointer to
  the location.
* Print the warning for missing pair close to where we find out it is
  missing.
* Don't pass the value to relocateOne.

llvm-svn: 264802

8 years agoFixing PR26558: remove the adx target attribute requirement from adc builtins.
Yunzhong Gao [Tue, 29 Mar 2016 22:59:20 +0000 (22:59 +0000)]
Fixing PR26558: remove the adx target attribute requirement from adc builtins.

The addcarry and subborrow variants of the builtins do not require the adx
target attribute; only the addcarryx variants require them.

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

llvm-svn: 264801

8 years agoADCE: Remove debug info intrinsics in dead scopes
Duncan P. N. Exon Smith [Tue, 29 Mar 2016 22:57:12 +0000 (22:57 +0000)]
ADCE: Remove debug info intrinsics in dead scopes

During ADCE, track which debug info scopes still have live references
from the code, and delete debug info intrinsics for the dead ones.

These intrinsics describe the locations of variables (in registers or
stack slots).  If there's no code left corresponding to a variable's
scope, then there's no way to reference the variable in the debugger and
it doesn't matter what its value is.

I add a DEBUG printout when the described location in an SSA register,
in case it helps some trying to track down why locations get lost.
However, we still delete these; the scope itself isn't attached to any
real code, so the ship has already sailed.

llvm-svn: 264800

8 years agoMachineSink: make shouldSink a TII target hook
Fiona Glaser [Tue, 29 Mar 2016 22:44:57 +0000 (22:44 +0000)]
MachineSink: make shouldSink a TII target hook

Some targets may disagree on what they want sunk or not sunk,
so make this a target hook instead of hardcoded.

llvm-svn: 264799

8 years ago[LoopDataPrefetch] Make more member functions private, NFC.
Adam Nemet [Tue, 29 Mar 2016 22:40:02 +0000 (22:40 +0000)]
[LoopDataPrefetch] Make more member functions private, NFC.

llvm-svn: 264798

8 years agoUpgrade some wildly anachronistic debug info in testcases.
Adrian Prantl [Tue, 29 Mar 2016 22:34:30 +0000 (22:34 +0000)]
Upgrade some wildly anachronistic debug info in testcases.

llvm-svn: 264797

8 years agouse FileCheck and auto-check-generation script for exact checking
Sanjay Patel [Tue, 29 Mar 2016 22:27:39 +0000 (22:27 +0000)]
use FileCheck and auto-check-generation script for exact checking

1. Removed the run line for mingw32 and made the Darwin triples unknown.
   This is a test of 32-bit vs. 64-bit platform and the underlying hardware.
   We have other tests for checking behavioral differences of the OS platform.

2. Changed the CPU specifiers to the attributes they were meant to represent.
   Any CPU that doesn't have SSE4.2 is assumed to have slow unaligned 16-byte accesses,
   so it won't use those here.

3. Although the stores really could all be CHECK-DAG, I left them as CHECK-NEXT to
   show the strange behavior of the instruction scheduler in the SLOW_32 case.

4. The odd-looking instructions are due to the use of a null pointer in the IR, so
   we have integer immediate store addresses. Cute.

llvm-svn: 264796

8 years ago[PGO] Test case fix for r264783
Betul Buyukkurt [Tue, 29 Mar 2016 22:17:52 +0000 (22:17 +0000)]
[PGO] Test case fix for r264783

llvm-svn: 264795

8 years agoLLDB top of tree SVN fails to attach to a MacOSX native process by pid only (no execu...
Greg Clayton [Tue, 29 Mar 2016 22:09:24 +0000 (22:09 +0000)]
LLDB top of tree SVN fails to attach to a MacOSX native process by pid only (no executable).

The problem was that the static DynamicLoaderDarwinKernel::Initialize() was recently changed to come before DynamicLoaderMacOSXDYLD::Initialize() which caused the DynamicLoaderDarwinKernel::CreateInstance(...) to be called before DynamicLoaderMacOSXDYLD::CreateInstance(...) and DynamicLoaderDarwinKernel would claim it could be the dynamic loader for a user space MacOSX process. The fix is to make DynamicLoaderDarwinKernel::CreateInstance() a bit more thourough when vetting the process so that it doesn't claim MacOSX user space processes.

<rdar://problem/25425373>

llvm-svn: 264794

8 years agoFigure out what the fixed expression is, and print it. Added another target setting to
Jim Ingham [Tue, 29 Mar 2016 22:00:08 +0000 (22:00 +0000)]
Figure out what the fixed expression is, and print it.  Added another target setting to
quietly apply fixits for those who really trust clang's fixits.

Also, moved the retry into ClangUserExpression::Evaluate, where I can make a whole new ClangUserExpression
to do the work.  Reusing any of the parts of a UserExpression in situ isn't supported at present.

<rdar://problem/25351938>

llvm-svn: 264793

8 years agoFix comment in test
Xinliang David Li [Tue, 29 Mar 2016 21:53:08 +0000 (21:53 +0000)]
Fix comment in test

llvm-svn: 264792

8 years ago[ELF] Drive-by cleanup, make LTO.cpp clang-format clean.
Davide Italiano [Tue, 29 Mar 2016 21:48:25 +0000 (21:48 +0000)]
[ELF] Drive-by cleanup, make LTO.cpp clang-format clean.

llvm-svn: 264791

8 years ago[LTO] Teach LTO about @llvm.used global.
Davide Italiano [Tue, 29 Mar 2016 21:46:35 +0000 (21:46 +0000)]
[LTO] Teach LTO about @llvm.used global.

If a symbol appears in @llvm.used, the linker is forced to treat
the symbol as there's a reference to it.

llvm-svn: 264790

8 years agoExploit graph properties during domain generation
Johannes Doerfert [Tue, 29 Mar 2016 21:31:05 +0000 (21:31 +0000)]
Exploit graph properties during domain generation

  As a CFG is often structured we can simplify the steps performed
  during domain generation. When we push domain information we can
  utilize the information from a block A to build the domain of a
  block B, if A dominates B. When we pull domain information we can
  use information from a block A to build the domain of a block B
  if B post-dominates A. This patch implements both ideas and thereby
  simplifies domains that were not simplified by isl. For the FINAL
  basic block in
    test/ScopInfo/complex-successor-structure-3.ll .
  we used to build a universe set with 81 basic sets. Now it actually is
  represented as universe set.

  While the initial idea to utilize the graph structure depended on the
  dominator and post-dominator tree we can use the available region
  information as a coarse grained replacement. To this end we push the
  region entry domain to the region exit and pull it from the region
  entry for the region exit.

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

llvm-svn: 264789

8 years ago[Sema] Attempt [3] to fix tests for utf-8 invalid format string specifiers
Bruno Cardoso Lopes [Tue, 29 Mar 2016 21:30:58 +0000 (21:30 +0000)]
[Sema] Attempt [3] to fix tests for utf-8 invalid format string specifiers

Make the tests darwin only. The bots complaining already output UTF-8
invalid specifiers, test the output as we expect on darwin systems.

llvm-svn: 264788

8 years agoEnable the SafeStack sanitizer on CloudABI by default.
Ed Schouten [Tue, 29 Mar 2016 21:13:53 +0000 (21:13 +0000)]
Enable the SafeStack sanitizer on CloudABI by default.

Over the last month we've been testing SafeStack extensively. As far as
we know, it works perfectly fine. That why I'd like to see us having
this enabled by default for CloudABI.

This change introduces a getDefaultSanitizers() function that toolchains
can use to specify which sanitizers are enabled by default. Once all
flags are processed, only flags that had no -fno-sanitize overrides are
enabled.

Extend the thests for CloudABI to test both the default case and the
case in which we want to explicitly disable SafeStack.

Reviewed by: eugenis, pcc
Differential Revision: http://reviews.llvm.org/D18505

llvm-svn: 264787

8 years agoFix comment in kmp_wait_release.h
Jonathan Peyton [Tue, 29 Mar 2016 21:08:29 +0000 (21:08 +0000)]
Fix comment in kmp_wait_release.h

Removed reference to "ref ct" in a comment, as ref_ct no longer exists. Also
moved the comment to where the task_team is about to be tested if NULL.

llvm-svn: 264786

8 years agoSimplify. NFC.
Rui Ueyama [Tue, 29 Mar 2016 20:53:21 +0000 (20:53 +0000)]
Simplify. NFC.

llvm-svn: 264785

8 years ago[Sema] Attempt [2] to fix tests for utf-8 invalid format string specifiers
Bruno Cardoso Lopes [Tue, 29 Mar 2016 20:47:09 +0000 (20:47 +0000)]
[Sema] Attempt [2] to fix tests for utf-8 invalid format string specifiers

Some buildbots still complain. Followup from r264752 and 264765.

llvm-svn: 264784

8 years ago[PGO] Move the instrumentation point closer to the value site.
Betul Buyukkurt [Tue, 29 Mar 2016 20:44:09 +0000 (20:44 +0000)]
[PGO] Move the instrumentation point closer to the value site.

For terminator instructions, the value profiling instrumentation
happens in a basic block other than where the value site resides.
This CR moves the instrumentation point prior to the value site.
Mostly NFC.

llvm-svn: 264783

8 years agoFactor out "adjustDomainDimensions" function [NFC]
Johannes Doerfert [Tue, 29 Mar 2016 20:41:24 +0000 (20:41 +0000)]
Factor out "adjustDomainDimensions" function [NFC]

llvm-svn: 264782

8 years agoFactor out "getFirstNonBoxedLoopFor" function [NFC]
Johannes Doerfert [Tue, 29 Mar 2016 20:32:43 +0000 (20:32 +0000)]
Factor out "getFirstNonBoxedLoopFor" function [NFC]

llvm-svn: 264781

8 years agoAdd a print method to MachineFunctionProperties for better error messages
Derek Schuff [Tue, 29 Mar 2016 20:28:20 +0000 (20:28 +0000)]
Add a print method to MachineFunctionProperties for better error messages

This makes check failures much easier to understand.
Make it empty (but leave it in the class) for NDEBUG builds.

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

llvm-svn: 264780

8 years agoClarifying some of the requirements for building with Visual Studio on Windows. Namel...
Aaron Ballman [Tue, 29 Mar 2016 20:23:55 +0000 (20:23 +0000)]
Clarifying some of the requirements for building with Visual Studio on Windows. Namely, we require the latest Update to be installed (for sanity purposes), and we require CMake 2.8.12.2 for building LLVM with Visual Studio.

llvm-svn: 264779

8 years agoFix some bugs in the posix output of llvm-nm. Which is documented on
Kevin Enderby [Tue, 29 Mar 2016 20:18:07 +0000 (20:18 +0000)]
Fix some bugs in the posix output of llvm-nm.  Which is documented on
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/nm.html .

1) For Mach-O files the code was not printing the values in hex as is the default.
2) The values printed had leading zeros which they should not have.
3) The address for undefined symbols was printed as spaces instead of 0.
4) With the -A option with posix output for an archive did not use square
brackets around the archive member name.

rdar://25311883 and rdar://25299678

llvm-svn: 264778

8 years agoFix incorrect indention in kmp_alloc.c
Jonathan Peyton [Tue, 29 Mar 2016 20:10:00 +0000 (20:10 +0000)]
Fix incorrect indention in kmp_alloc.c

llvm-svn: 264777

8 years agoRemove dead KMP_USE_POOLED_ALLOC code
Jonathan Peyton [Tue, 29 Mar 2016 20:05:27 +0000 (20:05 +0000)]
Remove dead KMP_USE_POOLED_ALLOC code

llvm-svn: 264776

8 years agoBail as early as possible
Johannes Doerfert [Tue, 29 Mar 2016 20:02:05 +0000 (20:02 +0000)]
Bail as early as possible

  Instead of waiting for the domain construction to finish we will now
  bail as early as possible in case a complexity problem is encountered.
  This might save compile time but more importantly it makes the "abort"
  explicit. While we can always check if we invalidated the assumed
  context we can simply propagate the result of the construction back.
  This also removes the HasComplexCFG flag that was used for the very
  same reason.

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

llvm-svn: 264775

8 years agoclang-cl: Silently ignore /d2FastFail flag.
Nico Weber [Tue, 29 Mar 2016 19:41:02 +0000 (19:41 +0000)]
clang-cl: Silently ignore /d2FastFail flag.

It's some debugging flag for cl.exe related to how it writes crash dumps.

llvm-svn: 264774

8 years ago[profile] Make a test work if run by the super-user
Vedant Kumar [Tue, 29 Mar 2016 19:24:58 +0000 (19:24 +0000)]
[profile] Make a test work if run by the super-user

llvm-svn: 264773

8 years agoReplace a FIXME with a regular comment.
Rui Ueyama [Tue, 29 Mar 2016 19:19:03 +0000 (19:19 +0000)]
Replace a FIXME with a regular comment.

Because it doesn't have to be fixed even though it is probably
better to do.

llvm-svn: 264772

8 years ago[SPARC] Use AtomicExpandPass to expand AtomicRMW instructions.
James Y Knight [Tue, 29 Mar 2016 19:09:54 +0000 (19:09 +0000)]
[SPARC] Use AtomicExpandPass to expand AtomicRMW instructions.

They were previously expanded to CAS loops in a custom isel expansion,
but AtomicExpandPass knows how to do that generically.

Testing is covered by the existing sparc atomics.ll testcases.

llvm-svn: 264771

8 years agoMake BitcodeCompiler::compile a non-template function. NFC.
Rui Ueyama [Tue, 29 Mar 2016 19:08:46 +0000 (19:08 +0000)]
Make BitcodeCompiler::compile a non-template function. NFC.

llvm-svn: 264770

8 years agoMachineVerifier: On dead-def live segments, check that corresponding machine operand...
Matthias Braun [Tue, 29 Mar 2016 19:07:43 +0000 (19:07 +0000)]
MachineVerifier: On dead-def live segments, check that corresponding machine operand has a dead flag

llvm-svn: 264769

8 years agoLiveVariables: Fix typo and shorten comment
Matthias Braun [Tue, 29 Mar 2016 19:07:40 +0000 (19:07 +0000)]
LiveVariables: Fix typo and shorten comment

llvm-svn: 264768

8 years agoIR: Add DbgInfoIntrinsic::getVariableLocation
Duncan P. N. Exon Smith [Tue, 29 Mar 2016 18:56:03 +0000 (18:56 +0000)]
IR: Add DbgInfoIntrinsic::getVariableLocation

Create a common accessor, DbgInfoIntrinsic::getVariableLocation, which
doesn't care about the type of debug info intrinsic.  Use this to
further unify the implementations of DbgDeclareInst::getAddress and
DbgValueInst::getValue.

Besides being a cleanup, I'm planning to use this to prepare DEBUG
output without having to branch on the concrete type.

llvm-svn: 264767

8 years ago[asan] Make the Darwin/dead-strip.c test require El Capitan or newer
Ryan Govostes [Tue, 29 Mar 2016 18:54:29 +0000 (18:54 +0000)]
[asan] Make the Darwin/dead-strip.c test require El Capitan or newer

llvm-svn: 264766

8 years ago[Sema] Attempt to fix tests for utf-8 invalid format string specifiers
Bruno Cardoso Lopes [Tue, 29 Mar 2016 18:38:44 +0000 (18:38 +0000)]
[Sema] Attempt to fix tests for utf-8 invalid format string specifiers

Followup from r264752.

Attempt to appease buildbots:
 http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2882
 http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2619

llvm-svn: 264765

8 years agoRevert "[asan] Make the global_metadata_darwin.ll test require El Capitan or newer"
Ryan Govostes [Tue, 29 Mar 2016 18:27:24 +0000 (18:27 +0000)]
Revert "[asan] Make the global_metadata_darwin.ll test require El Capitan or newer"

llvm-svn: 264764

8 years ago[ThinLTO] Remove post-pass metadata linking support
Teresa Johnson [Tue, 29 Mar 2016 18:24:19 +0000 (18:24 +0000)]
[ThinLTO] Remove post-pass metadata linking support

Since we have moved to a model where functions are imported in bulk from
each source module after making summary-based importing decisions, there
is no longer a need to link metadata as a postpass, and all users have
been removed.

This essentially reverts r255909 and follow-on fixes.

llvm-svn: 264763

8 years agoWhen creating typedefs, don't call Type::GetName() since that might recursively call...
Greg Clayton [Tue, 29 Mar 2016 18:22:07 +0000 (18:22 +0000)]
When creating typedefs, don't call Type::GetName() since that might recursively call "lldb_private::Type::ResolveClangType(lldb_private::Type::ResolveStateTag)" and cause a crash. A lldb_private::Type should have a valid name if it is created without a backing CompilerType. Also provide a name that we can recognize so if we see it in a as the typename of a variable, we will know to check it out. This crash is happening quite a bit and we need to determine if this is due to incorrect debug info, or just due to some bug in LLDBD.

<rdar://problem/25192037>

llvm-svn: 264762

8 years agoChange how we handle R_MIPS_LO16.
Rafael Espindola [Tue, 29 Mar 2016 18:18:19 +0000 (18:18 +0000)]
Change how we handle R_MIPS_LO16.

Mips aligns PT_LOAD to 16 bits (0x10000). That means that the lower 16
bits are always the same, so we can, effectively, say that the
relocation is relative.

llvm-svn: 264761

8 years agoRemoved class FormatStyle, which is a struct, forward declaration from Refactoring...
Eric Liu [Tue, 29 Mar 2016 18:17:11 +0000 (18:17 +0000)]
Removed class FormatStyle, which is a struct, forward declaration from Refactoring.h to avoid compilation error.

llvm-svn: 264760

8 years ago[clang-tidy] Add check to detect dangling references in value handlers.
Samuel Benzaquen [Tue, 29 Mar 2016 18:02:26 +0000 (18:02 +0000)]
[clang-tidy] Add check to detect dangling references in value handlers.

Summary:
Add check misc-dangling-handle to detect dangling references in value
handlers like std::experimental::string_view.
It provides a configuration option to specify other handle types that
should also be checked.

Right now it detects:
 - Construction from temporaries.
 - Assignment from temporaries.
 - Return statements from temporaries or locals.
 - Insertion into containers from temporaries.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 264759

8 years ago[asan] Make the global_metadata_darwin.ll test require El Capitan or newer
Ryan Govostes [Tue, 29 Mar 2016 17:58:49 +0000 (17:58 +0000)]
[asan] Make the global_metadata_darwin.ll test require El Capitan or newer

llvm-svn: 264758

8 years ago[Order Files] Fix order file usage
Chris Bieneman [Tue, 29 Mar 2016 17:51:08 +0000 (17:51 +0000)]
[Order Files] Fix order file usage

The CMake EXISTS operator needs to have the variable expanded. Not expanding this was causing the if statement to always be false, which made it impossible to pass linker order files in.

llvm-svn: 264757

8 years agoAdd support for no-jump-tables
Nirav Dave [Tue, 29 Mar 2016 17:46:23 +0000 (17:46 +0000)]
Add support for no-jump-tables

Add function soft attribute to the generation of Jump Tables in CodeGen
as initial step towards clang support of gcc's no-jump-table support

Reviewers: hans, echristo

Subscribers: llvm-commits

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

llvm-svn: 264756

8 years agoAdd MachineVerifier check for AllVRegsAllocated MachineFunctionProperty
Derek Schuff [Tue, 29 Mar 2016 17:40:22 +0000 (17:40 +0000)]
Add MachineVerifier check for AllVRegsAllocated MachineFunctionProperty

Summary:
Check that any function that has the property set is free of virtual
register operands.

Also, it is actually VirtRegMap (and not the register allocators) that
acutally remove the VReg operands (except for RegAllocFast).

Reviewers: qcolombet

Subscribers: MatzeB, llvm-commits, qcolombet

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

llvm-svn: 264755

8 years agoSwift Calling Convention: add swiftself attribute.
Manman Ren [Tue, 29 Mar 2016 17:37:21 +0000 (17:37 +0000)]
Swift Calling Convention: add swiftself attribute.

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

llvm-svn: 264754

8 years agoDon't try to call getTypeSize() on a class if it isn't complete as clang will assert...
Greg Clayton [Tue, 29 Mar 2016 17:36:38 +0000 (17:36 +0000)]
Don't try to call getTypeSize() on a class if it isn't complete as clang will assert and kill the process.

llvm-svn: 264753

8 years ago[Sema] Handle UTF-8 invalid format string specifiers
Bruno Cardoso Lopes [Tue, 29 Mar 2016 17:35:02 +0000 (17:35 +0000)]
[Sema] Handle UTF-8 invalid format string specifiers

Improve invalid format string specifier handling by printing out
invalid specifiers characters with \x, \u and \U. Previously clang
would print gargabe whenever the character is unprintable.

Example, before:
  NSLog(@"%\u25B9"); => warning: invalid conversion specifier ' [-Wformat-invalid-specifier]
after:
  NSLog(@"%\u25B9"); => warning: invalid conversion specifier '\u25b9' [-Wformat-invalid-specifier]

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

rdar://problem/24672159

llvm-svn: 264752

8 years ago[Darwin] [Builtins] Cleaning up OS X exclude lists. NFC.
Chris Bieneman [Tue, 29 Mar 2016 17:34:13 +0000 (17:34 +0000)]
[Darwin] [Builtins] Cleaning up OS X exclude lists. NFC.

This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives.

llvm-svn: 264751

8 years ago[Darwin] [Builtins] Remove multi3 from the exclude list.
Chris Bieneman [Tue, 29 Mar 2016 17:24:23 +0000 (17:24 +0000)]
[Darwin] [Builtins] Remove multi3 from the exclude list.

This addresses PR27077. For some historical reason Darwin wasn't shipping multi3 in the compiler builtin library or in the OS builtin library. This caused building ffmpeg to fail because Polly was generating calls to multi3. It is easy enough to just add the builtin.

llvm-svn: 264750

8 years ago[Darwin] [Builtins] Cleaning up 10.4 exclude lists NFC
Chris Bieneman [Tue, 29 Mar 2016 17:24:21 +0000 (17:24 +0000)]
[Darwin] [Builtins] Cleaning up 10.4 exclude lists NFC

This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives.

llvm-svn: 264749

8 years ago[x86] add tests to show current memset codegen
Sanjay Patel [Tue, 29 Mar 2016 17:09:27 +0000 (17:09 +0000)]
[x86] add tests to show current memset codegen

llvm-svn: 264748

8 years ago[SCEV] Extract out a MatchBinaryOp; NFCI
Sanjoy Das [Tue, 29 Mar 2016 16:40:44 +0000 (16:40 +0000)]
[SCEV] Extract out a MatchBinaryOp; NFCI

MatchBinaryOp abstracts out the IR instructions from the operations they
represent.  While this change is NFC, we will use this factoring later
to map things like `(extractvalue 0 (sadd.with.overflow X Y))` to `(add
X Y)`.

llvm-svn: 264747

8 years ago[SCEV] Use Operator::getOpcode instead of manual dispatch; NFC
Sanjoy Das [Tue, 29 Mar 2016 16:40:39 +0000 (16:40 +0000)]
[SCEV] Use Operator::getOpcode instead of manual dispatch; NFC

llvm-svn: 264746

8 years agoAdded formatAndApplyAllReplacements that works on multiple files in libTooling.
Eric Liu [Tue, 29 Mar 2016 16:31:53 +0000 (16:31 +0000)]
Added formatAndApplyAllReplacements that works on multiple files in libTooling.

Summary:
formatAndApplyAllReplacements takes a set of Replacements, applies them on a
Rewriter, and reformats the changed code.

Reviewers: klimek, djasper

Subscribers: ioeric, klimek, cfe-commits

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

llvm-svn: 264745

8 years agoMake InlineSimple's one-arg constructor explicit. NFC
Justin Lebar [Tue, 29 Mar 2016 16:26:06 +0000 (16:26 +0000)]
Make InlineSimple's one-arg constructor explicit. NFC

llvm-svn: 264744

8 years agoReformat a comment in InlineSimple.cpp. NFC
Justin Lebar [Tue, 29 Mar 2016 16:26:03 +0000 (16:26 +0000)]
Reformat a comment in InlineSimple.cpp. NFC

llvm-svn: 264743

8 years ago[CUDA] Add missing #undef __DEVICE__ to CUDA shim header.
Justin Lebar [Tue, 29 Mar 2016 16:24:23 +0000 (16:24 +0000)]
[CUDA] Add missing #undef __DEVICE__ to CUDA shim header.

llvm-svn: 264742

8 years ago[CUDA] Fix order of overloading preferences in comment.
Justin Lebar [Tue, 29 Mar 2016 16:24:22 +0000 (16:24 +0000)]
[CUDA] Fix order of overloading preferences in comment.

llvm-svn: 264741

8 years ago[CUDA] Make CUDA description strings in langopts into noun phrases. NFC
Justin Lebar [Tue, 29 Mar 2016 16:24:20 +0000 (16:24 +0000)]
[CUDA] Make CUDA description strings in langopts into noun phrases.  NFC

rsmith quoth in D18380:

> This should be a noun phrase -- this string appears in contexts like
> "support for %0 is enabled" -- so this should be "treating
> unattributed [...]".

llvm-svn: 264740

8 years ago[CUDA] Remove three obsolete CUDA cc1 flags.
Justin Lebar [Tue, 29 Mar 2016 16:24:16 +0000 (16:24 +0000)]
[CUDA] Remove three obsolete CUDA cc1 flags.

Summary:
* -fcuda-target-overloads

  Previously unconditionally set to true by the driver.  Necessary for
  correct functioning of the compiler -- our CUDA headers wrapper won't
  compile without this.

* -fcuda-disable-target-call-checks

  Previously unconditionally set to true by the driver.  Necessary to
  compile almost any external CUDA code -- almost all libraries assume
  that host+device code can call host or device functions.

* -fcuda-allow-host-calls-from-host-device

  No effect when target overloading is enabled.

Reviewers: tra

Subscribers: rsmith, cfe-commits

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

llvm-svn: 264739

8 years agoregenerate checks
Sanjay Patel [Tue, 29 Mar 2016 16:11:29 +0000 (16:11 +0000)]
regenerate checks

llvm-svn: 264738

8 years ago[AMDGPU] Switch linker to amdphdrs + update test
Konstantin Zhuravlyov [Tue, 29 Mar 2016 15:54:09 +0000 (15:54 +0000)]
[AMDGPU] Switch linker to amdphdrs + update test

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

llvm-svn: 264737

8 years agoTest commit access
Konstantin Zhuravlyov [Tue, 29 Mar 2016 15:15:44 +0000 (15:15 +0000)]
Test commit access

llvm-svn: 264736