platform/upstream/llvm.git
7 years ago[X86][AVX] Ensure we only match against 1-byte alignment
Simon Pilgrim [Wed, 10 Aug 2016 09:59:49 +0000 (09:59 +0000)]
[X86][AVX] Ensure we only match against 1-byte alignment

llvm-svn: 278208

7 years ago[ARM] Improve sxta{b|h} and uxta{b|h} tests
Sam Parker [Wed, 10 Aug 2016 09:34:34 +0000 (09:34 +0000)]
[ARM] Improve sxta{b|h} and uxta{b|h} tests

Created a Thumb2 predicated pattern matcher that uses Thumb2 and
HasT2ExtractPack and used it to redefine the patterns for sxta{b|h}
and uxta{b|h}. Also used the similar patterns to fill in isel pattern
gaps for the corresponding instructions in the ARM backend.
The patch is mainly changes to tests since most of this functionality
appears not to have been tested.

Differential Revision: https://reviews.llvm.org/D23273

llvm-svn: 278207

7 years agoMake clang-format remove duplicate headers when sorting #includes.
Eric Liu [Wed, 10 Aug 2016 09:32:23 +0000 (09:32 +0000)]
Make clang-format remove duplicate headers when sorting #includes.

Summary: When sorting #includes, #include directives that have the same text will be deduplicated when sorting #includes, and only the first #include in the duplicate #includes remains. If the `Cursor` is provided and put on a deleted #include, it will be put on the remaining #include in the duplicate #includes.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D23274

llvm-svn: 278206

7 years ago[ELF] Add aarch64elf emulation mode
Eugene Leviant [Wed, 10 Aug 2016 08:19:35 +0000 (08:19 +0000)]
[ELF] Add aarch64elf emulation mode

llvm-svn: 278205

7 years ago[ELF] - Linkerscript: implement SIZEOF_HEADERS.
George Rimar [Wed, 10 Aug 2016 07:59:34 +0000 (07:59 +0000)]
[ELF] - Linkerscript: implement SIZEOF_HEADERS.

SIZEOF_HEADERS - Return the size in bytes of the output file’s headers.

It is is a feature used in FreeBsd script, for example.
There is a discussion on PR28688 page about it.

Differential revision: https://reviews.llvm.org/D23165

llvm-svn: 278204

7 years ago[x86] Fix a bug in the auto-upgrade from r276416 where we failed to give
Chandler Carruth [Wed, 10 Aug 2016 07:41:26 +0000 (07:41 +0000)]
[x86] Fix a bug in the auto-upgrade from r276416 where we failed to give
a sufficiently low alignment for the IR load created.

There is no test case because we don't have any test cases for the *IR*
produced by the autoupgrade, only the x86 assembly, and it happens that
the x86 assembly for this intrinsic as it is tested in the autoupgrade
path just happens to not produce a separate load instruction where we
might have observed the alignment.

I'm going to follow up on the original commit to suggest getting
IR-level testing in addition to the asm level testing here so that we
can see and test these kinds of issues. We might never get an x86
instruction out with an alignment constraint, but we could stil
miscompile code by folding against the alignment marked on (or inferred
for in this case) the load.

llvm-svn: 278203

7 years ago[x86] Fix a really nasty bug introduced in r276417 where alignment
Chandler Carruth [Wed, 10 Aug 2016 07:32:47 +0000 (07:32 +0000)]
[x86] Fix a really nasty bug introduced in r276417 where alignment
constraints were added to _mm256_broadcast_{pd,ps} intel intrinsics.

The spec for these intrinics is ... pretty much silent on alignment.
This is especially frustrating considering the amount of discussion of
alignment in the load and store instrinsics. So I was forced to rely on
the specification for the VBROADCASTF128 instruction.

That instruction's spec is *also* completely silent on alignment.
Fortunately, when it comes to the instruction's spec, silence is enough.
There is no #GP fault option for an underaligned address so this
instruction, and by inference the intrinsic, can read any alignment.

As it happens, the old code worked exactly this way and in fact we have
plenty of code that hands pointers with less than 16-byte alignment to
these intrinsics. This code broke pretty spectacularly with this commit.

Fortunately, the fix is super simple! Change a 16 to a 1, and ta da!

Anyways, a lot of debugging for a really boring fix. =]

llvm-svn: 278202

7 years agoclang-rename YAML reader: address post-commit comments
Miklos Vajna [Wed, 10 Aug 2016 07:13:29 +0000 (07:13 +0000)]
clang-rename YAML reader: address post-commit comments

llvm-svn: 278201

7 years ago[SimplifyLibCalls] Restore the old behaviour, emit a libcall.
Davide Italiano [Wed, 10 Aug 2016 06:33:32 +0000 (06:33 +0000)]
[SimplifyLibCalls] Restore the old behaviour, emit a libcall.

Hal pointed out that the semantic of our intrinsic and the libc
call are slightly different. Add a comment while I'm here to
explain why we can't emit an intrinsic. Thanks Hal!

llvm-svn: 278200

7 years agoCOFF: reorder the table construction
Saleem Abdulrasool [Wed, 10 Aug 2016 04:37:56 +0000 (04:37 +0000)]
COFF: reorder the table construction

Reorder the table setup to mirror the indices corresponding to them.  This means
that the table values are filled out as per the enumeration ordering.  Doing so
makes it easier to identify a particular table.  NFC.

llvm-svn: 278199

7 years ago[Documentation] Fix spelling mistakes in docs/clang-tidy/index.rst.
Eugene Zelenko [Wed, 10 Aug 2016 01:55:51 +0000 (01:55 +0000)]
[Documentation] Fix spelling mistakes in docs/clang-tidy/index.rst.

llvm-svn: 278198

7 years agoUndid LLVM macro usage in test suite test subject files.
Todd Fiala [Wed, 10 Aug 2016 01:37:27 +0000 (01:37 +0000)]
Undid LLVM macro usage in test suite test subject files.

llvm-svn: 278197

7 years ago[CUDA] Reject calls to __device__ functions from host variable global initializers.
Justin Lebar [Wed, 10 Aug 2016 01:09:21 +0000 (01:09 +0000)]
[CUDA] Reject calls to __device__ functions from host variable global initializers.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23335

llvm-svn: 278196

7 years ago[CUDA] Print a "previous-decl" note when calling an illegal member fn.
Justin Lebar [Wed, 10 Aug 2016 01:09:18 +0000 (01:09 +0000)]
[CUDA] Print a "previous-decl" note when calling an illegal member fn.

Summary:
When we emit err_ref_bad_target, we should emit a "'method' declared
here" note.  We already do so in most places, just not in
BuildCallToMemberFunction.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23240

llvm-svn: 278195

7 years ago[CUDA] Add __device__ overloads for placement new and delete.
Justin Lebar [Wed, 10 Aug 2016 01:09:14 +0000 (01:09 +0000)]
[CUDA] Add __device__ overloads for placement new and delete.

Summary:
Previously these sort of worked because they didn't end up resulting in
calls at the ptx layer.  But I'm adding stricter checks that break
placement new without these changes.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23239

llvm-svn: 278194

7 years ago[CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC
Justin Lebar [Wed, 10 Aug 2016 01:09:11 +0000 (01:09 +0000)]
[CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC

Summary:
I want to reuse "CheckCUDAFoo" in a later patch.  Also, I think
IsAllowedCUDACall gets the point across more clearly.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23238

llvm-svn: 278193

7 years ago[Diag] Fix idiom in comment: "on the lam", not "on the lamb".
Justin Lebar [Wed, 10 Aug 2016 01:09:07 +0000 (01:09 +0000)]
[Diag] Fix idiom in comment: "on the lam", not "on the lamb".

llvm-svn: 278192

7 years agotest/hard_link_count(): Fix test on darwin
Matthias Braun [Wed, 10 Aug 2016 01:02:28 +0000 (01:02 +0000)]
test/hard_link_count(): Fix test on darwin

The hard link count that stat reports are different between normal hfs and the
case sensitive variant. Accept both.

llvm-svn: 278191

7 years agoUndo usage of LLVM macros in debugserver
Todd Fiala [Wed, 10 Aug 2016 00:53:21 +0000 (00:53 +0000)]
Undo usage of LLVM macros in debugserver

We don't take a dependency on LLVM in debugserver.
This was failing to compile before.

llvm-svn: 278190

7 years agoDo not directly use inline threshold cl options in cost analysis.
Easwaran Raman [Wed, 10 Aug 2016 00:48:04 +0000 (00:48 +0000)]
Do not directly use inline threshold cl options in cost analysis.

This adds an InlineParams struct which is populated from the command line options by getInlineParams and passed to getInlineCost for the call analyzer to use.

Differential revision: https://reviews.llvm.org/D22120

llvm-svn: 278189

7 years agoAdd a newline to the end of the file to remove the clang warnings.
Jim Ingham [Wed, 10 Aug 2016 00:45:58 +0000 (00:45 +0000)]
Add a newline to the end of the file to remove the clang warnings.

llvm-svn: 278188

7 years ago[compiler-rt] Allow nm program to be over-ridden for global symbol detection
Francis Ricci [Wed, 10 Aug 2016 00:45:30 +0000 (00:45 +0000)]
[compiler-rt] Allow nm program to be over-ridden for global symbol detection

Summary:
While cross-compiling, a custom nm program may be required. This will also allow for the
use of llvm-nm if desired.

Reviewers: samsonov, beanz, compnerd, eugenis

Subscribers: kubabrecka, dberris, llvm-commits

Differential Revision: https://reviews.llvm.org/D23278

llvm-svn: 278187

7 years ago[OptDiag] Add class Doxygen comment
Adam Nemet [Wed, 10 Aug 2016 00:44:56 +0000 (00:44 +0000)]
[OptDiag] Add class Doxygen comment

This was requested in D22694.

llvm-svn: 278186

7 years ago[Inliner,OptDiag] Add hotness attribute to opt diagnostics
Adam Nemet [Wed, 10 Aug 2016 00:44:44 +0000 (00:44 +0000)]
[Inliner,OptDiag] Add hotness attribute to opt diagnostics

Summary:
The inliner not being a function pass requires the work-around of
generating the OptimizationRemarkEmitter and in turn BFI on demand.
This will go away after the new PM is ready.

BFI is only computed inside ORE if the user has requested hotness
information for optimization diagnostitics (-pass-remark-with-hotness at
the 'opt' level).  Thus there is no additional overhead without the
flag.

Reviewers: hfinkel, davidxl, eraman

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22694

llvm-svn: 278185

7 years ago[CUDA] Fix out-of-date comment.
Justin Lebar [Wed, 10 Aug 2016 00:40:46 +0000 (00:40 +0000)]
[CUDA] Fix out-of-date comment.

LangOpts.CUDADisableTargetCallChecks no longer exists (it's effectively
always true now).

llvm-svn: 278184

7 years ago[CUDA] Minor comment nits.
Justin Lebar [Wed, 10 Aug 2016 00:40:43 +0000 (00:40 +0000)]
[CUDA] Minor comment nits.

llvm-svn: 278183

7 years agoFix build on android and Linux.
Zachary Turner [Wed, 10 Aug 2016 00:02:58 +0000 (00:02 +0000)]
Fix build on android and Linux.

gettimeofday() isn't defined without a special header.  Rather
than rely on C apis, let's just use modern C++11 to do this
portably on all platforms using std::chrono.

llvm-svn: 278182

7 years ago[Core] tentativeDefinition() is now unused.
Davide Italiano [Wed, 10 Aug 2016 00:01:13 +0000 (00:01 +0000)]
[Core] tentativeDefinition() is now unused.

llvm-svn: 278181

7 years ago[scudo] Documentation update for Scudo, from https://reviews.llvm.org/D23332
Kostya Serebryany [Tue, 9 Aug 2016 23:57:04 +0000 (23:57 +0000)]
[scudo] Documentation update for Scudo, from https://reviews.llvm.org/D23332

llvm-svn: 278180

7 years ago[sanitizer] use 32-bit offset instead of 64-bit pointers in the 64-bit allocator...
Kostya Serebryany [Tue, 9 Aug 2016 23:30:22 +0000 (23:30 +0000)]
[sanitizer] use 32-bit offset instead of 64-bit pointers in the 64-bit allocator's transfer batches. This saves 2x memory for the transfer batches (up to ~1.5% overall in some cases)

llvm-svn: 278179

7 years ago[IR] Remove some unused #includes (NFC)
Vedant Kumar [Tue, 9 Aug 2016 23:14:37 +0000 (23:14 +0000)]
[IR] Remove some unused #includes (NFC)

I needed a reader-writer lock for a downstream project and noticed that
llvm has one. Function.cpp is the only file in-tree that refers to it.
To anyone reading this: are you using RWMutex in out-of-tree code? Maybe
it's not worth keeping around any more...

Since we're not actually using RWMutex *here*, remove the #include (and
a few other stale headers while we're at it).

llvm-svn: 278178

7 years agoDelete Host/windows/win32.h
Zachary Turner [Tue, 9 Aug 2016 23:06:08 +0000 (23:06 +0000)]
Delete Host/windows/win32.h

It's always hard to remember when to include this file, and
when you do include it it's hard to remember what preprocessor
check it needs to be behind, and then you further have to remember
whether it's windows.h or win32.h which you need to include.

This patch changes the name to PosixApi.h, which is more appropriately
named, and makes it independent of any preprocessor setting.

There's still the issue of people not knowing when to include this,
because there's not a well-defined set of things it exposes other
than "whatever is missing on Windows", but at least this should
make it less painful to fix when problems arise.

This patch depends on LLVM revision r278170.

llvm-svn: 278177

7 years agoMake LLVM_PRETTY_FUNCTION support __func__.
Zachary Turner [Tue, 9 Aug 2016 23:03:55 +0000 (23:03 +0000)]
Make LLVM_PRETTY_FUNCTION support __func__.

In case there are compilers that support neither __FUNCSIG__ or
__PRETTY_FUNCTION__, we fall back to __func__ as a last resort,
which should be guaranteed by C++11 and C99.

llvm-svn: 278176

7 years agoGlobalISel: support 'undef' constant.
Tim Northover [Tue, 9 Aug 2016 23:01:30 +0000 (23:01 +0000)]
GlobalISel: support 'undef' constant.

llvm-svn: 278174

7 years ago[LoopSimplify] Rebuild LCSSA for the inner loop after separating nested loops.
Michael Zolotukhin [Tue, 9 Aug 2016 22:44:56 +0000 (22:44 +0000)]
[LoopSimplify] Rebuild LCSSA for the inner loop after separating nested loops.

Summary:
This hopefully fixes PR28825. The problem now was that a value from the
original loop was used in a subloop, which became a sibling after separation.
While a subloop doesn't need an lcssa phi node, a sibling does, and that's
where we broke LCSSA. The most natural way to fix this now is to simply call
formLCSSA on the original loop: it'll do what we've been doing before plus
it'll cover situations described above.

I think we don't need to run formLCSSARecursively here, and we have an assert
to verify this (I've tried testing it on LLVM testsuite + SPECs). I'd be happy
to be corrected here though.

I also changed a run line in the test from '-lcssa -loop-unroll' to
'-lcssa -loop-simplify -indvars', because it exercises LCSSA
preservation to the same extent, but also makes less unrelated
transformation on the CFG, which makes it easier to verify.

Reviewers: chandlerc, sanjoy, silvas

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23288

llvm-svn: 278173

7 years ago[ValueTracking] Improve ValueTracking on left shift with nsw flag
Andrew Kaylor [Tue, 9 Aug 2016 22:41:35 +0000 (22:41 +0000)]
[ValueTracking] Improve ValueTracking on left shift with nsw flag

Patch by Li Huang

Differential Revison: https://reviews.llvm.org/D23296

llvm-svn: 278172

7 years ago[WebAssembly] Add -emscripten-cxx-exceptions-whitelist option
Derek Schuff [Tue, 9 Aug 2016 22:37:00 +0000 (22:37 +0000)]
[WebAssembly] Add -emscripten-cxx-exceptions-whitelist option

This patch adds -emscripten-cxx-exceptions-whitelist option to
WebAssemblyLowerEmscriptenExceptions pass. This options is the list of
function names in which Emscripten-style exception handling is enabled.
This is to support emscripten's EXCEPTION_CATCHING_WHITELIST which
exists because of the performance impact of emscripten's non-zero-cost
EH method.

Patch by Heejin Ahn

Differential Revision: https://reviews.llvm.org/D23292

llvm-svn: 278171

7 years agoAdd a platform independent version of __PRETTY_FUNCTION__.
Zachary Turner [Tue, 9 Aug 2016 22:03:45 +0000 (22:03 +0000)]
Add a platform independent version of __PRETTY_FUNCTION__.

MSVC doesn't have this, it only has __FUNCSIG__.  So this adds
a new macro called LLVM_PRETTY_FUNCTION which evaluates to the
right thing on any platform.

llvm-svn: 278170

7 years agoDepend directly on unwind when not building standalone
Petr Hosek [Tue, 9 Aug 2016 21:28:52 +0000 (21:28 +0000)]
Depend directly on unwind when not building standalone

When using libunwind and not building as standalone project, we
can directly depend on the unwind library target.

Differential Revision: https://reviews.llvm.org/D23289

llvm-svn: 278169

7 years agoGlobalISel: first translation support for Constants.
Tim Northover [Tue, 9 Aug 2016 21:28:04 +0000 (21:28 +0000)]
GlobalISel: first translation support for Constants.

For now put them all in the entry block. This should be correct but may give
poor runtime performance. Hopefully MachineSinking combined with
isReMaterializable can solve those issues, but if not the interface is sound
enough to support alternatives.

llvm-svn: 278168

7 years agoAdjust LLDB's iOS simulator interface for changes in CoreSimulator
Enrico Granata [Tue, 9 Aug 2016 21:16:58 +0000 (21:16 +0000)]
Adjust LLDB's iOS simulator interface for changes in CoreSimulator

rdar://27732333 and rdar://27732377

llvm-svn: 278166

7 years agoadd test cases for missed vselect optimizations (PR28895)
Sanjay Patel [Tue, 9 Aug 2016 21:07:17 +0000 (21:07 +0000)]
add test cases for missed vselect optimizations (PR28895)

llvm-svn: 278165

7 years ago[test] Update coverage tests to sync up with r278152
Vedant Kumar [Tue, 9 Aug 2016 21:04:22 +0000 (21:04 +0000)]
[test] Update coverage tests to sync up with r278152

This should fix the following bot failure:

  http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/6522

Patch by Ying Yi!

llvm-svn: 278164

7 years ago[sanitizer] minor refactoring in the allocator, NFC
Kostya Serebryany [Tue, 9 Aug 2016 20:54:50 +0000 (20:54 +0000)]
[sanitizer] minor refactoring in the allocator, NFC

llvm-svn: 278163

7 years ago[ExecutionEngine] Disable weak symbol tests for COFF.
Lang Hames [Tue, 9 Aug 2016 20:48:22 +0000 (20:48 +0000)]
[ExecutionEngine] Disable weak symbol tests for COFF.

COFF doesn't support weak linkage on functions.

llvm-svn: 278162

7 years agoFix the runtime error caused by "Use ValueOffsetPair to enhance value reuse during...
Wei Mi [Tue, 9 Aug 2016 20:40:03 +0000 (20:40 +0000)]
Fix the runtime error caused by "Use ValueOffsetPair to enhance value reuse during SCEV expansion".

The patch is to fix the bug in PR28705. It was caused by setting wrong return
value for SCEVExpander::findExistingExpansion. The return values of findExistingExpansion
have different meanings when the function is used in different ways so it is easy to make
mistake. The fix creates two new interfaces to replace SCEVExpander::findExistingExpansion,
and specifies where each interface is expected to be used.

Differential Revision: https://reviews.llvm.org/D22942

llvm-svn: 278161

7 years agoRecommit "Use ValueOffsetPair to enhance value reuse during SCEV expansion".
Wei Mi [Tue, 9 Aug 2016 20:37:50 +0000 (20:37 +0000)]
Recommit "Use ValueOffsetPair to enhance value reuse during SCEV expansion".

The fix for PR28705 will be committed consecutively.

In D12090, the ExprValueMap was added to reuse existing value during SCEV expansion.
However, const folding and sext/zext distribution can make the reuse still difficult.

A simplified case is: suppose we know S1 expands to V1 in ExprValueMap, and
  S1 = S2 + C_a
  S3 = S2 + C_b
where C_a and C_b are different SCEVConstants. Then we'd like to expand S3 as
V1 - C_a + C_b instead of expanding S2 literally. It is helpful when S2 is a
complex SCEV expr and S2 has no entry in ExprValueMap, which is usually caused
by the fact that S3 is generated from S1 after const folding.

In order to do that, we represent ExprValueMap as a mapping from SCEV to
ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a} into the
ExprValueMap when we create SCEV for V1. When S3 is expanded, it will first
expand S2 to V1 - C_a because of S2->{V1, C_a} in the map, then expand S3 to
V1 - C_a + C_b.

Differential Revision: https://reviews.llvm.org/D21313

llvm-svn: 278160

7 years agoWithout explicitly including <string>, I'm getting an error on the new code in this...
Chris Dewhurst [Tue, 9 Aug 2016 20:32:59 +0000 (20:32 +0000)]
Without explicitly including <string>, I'm getting an error on the new code in this file. Won't present an issue for anyone that isn't having the same trouble as me.

llvm-svn: 278159

7 years agoRemove CFData from the xcodeproj as well
Enrico Granata [Tue, 9 Aug 2016 20:32:42 +0000 (20:32 +0000)]
Remove CFData from the xcodeproj as well

llvm-svn: 278158

7 years ago[ADT] Change iterator_adaptor_base's default template arguments to forward more under...
Tim Shen [Tue, 9 Aug 2016 20:23:13 +0000 (20:23 +0000)]
[ADT] Change iterator_adaptor_base's default template arguments to forward more underlying typedefs

Reviewers: chandlerc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23217

llvm-svn: 278157

7 years ago[ADT] Change iterator_adaptor_base's default template arguments to forward more under...
Tim Shen [Tue, 9 Aug 2016 20:22:55 +0000 (20:22 +0000)]
[ADT] Change iterator_adaptor_base's default template arguments to forward more underlying typedefs

Summary:
The corresponding LLVM change: D23217.

LazyVector::iterator breaks, because int isn't an iterator type.
Since iterator_adaptor_base shouldn't be blamed to break at the call to
iterator_traits<int>::xxx, I'd rather "fix" LazyVector::iterator.

The perfect solution is to model "relative pointer", but it's beyond the goal of this patch.

Reviewers: chandlerc, bkramer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23218

llvm-svn: 278156

7 years ago[OpenCL] Handle -cl-fp32-correctly-rounded-divide-sqrt
Yaxun Liu [Tue, 9 Aug 2016 20:10:18 +0000 (20:10 +0000)]
[OpenCL] Handle -cl-fp32-correctly-rounded-divide-sqrt

Let the driver pass the option to frontend. Do not set precision metadata for division instructions when this option is set. Set function attribute "correctly-rounded-divide-sqrt-fp-math" based on this option.

Differential Revision: https://reviews.llvm.org/D22940

llvm-svn: 278155

7 years agoregenerate checks and remove 'opt' run dependency
Sanjay Patel [Tue, 9 Aug 2016 20:09:16 +0000 (20:09 +0000)]
regenerate checks and remove 'opt' run dependency

llvm-svn: 278154

7 years ago[EarlyCSE] Teach about CSE'ing over invariant.start intrinsics
Anna Thomas [Tue, 9 Aug 2016 20:00:47 +0000 (20:00 +0000)]
[EarlyCSE] Teach about CSE'ing over invariant.start intrinsics

Summary:
Teach EarlyCSE about invariant.start intrinsic. Specifically, we can perform
store-load, load-load forwarding over this call.

Reviewers: majnemer, reames, dberlin, sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23268

llvm-svn: 278153

7 years ago[llvm-cov] Swapped the line and count columns.
Ying Yi [Tue, 9 Aug 2016 19:53:35 +0000 (19:53 +0000)]
[llvm-cov]  Swapped the line and count columns.

In the coverage report, the line and count columns have been swapped to make it more readable.
A follow-up commit in compiler-rt is needed

Differential Revision: https://reviews.llvm.org/D23281

llvm-svn: 278152

7 years ago[OpenCL][AMDGPU] Add support for -cl-denorms-are-zero
Yaxun Liu [Tue, 9 Aug 2016 19:43:38 +0000 (19:43 +0000)]
[OpenCL][AMDGPU] Add support for -cl-denorms-are-zero

Adjust target features for amdgcn target when -cl-denorms-are-zero is set.

Denormal support is controlled by feature strings fp32-denormals fp64-denormals in amdgcn target. If -cl-denorms-are-zero is not set and the command line does not set fp32/64-denormals feature string, +fp32-denormals +fp64-denormals will be on for GPU's supporting them.

A new virtual function virtual void TargetInfo::adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const is introduced to allow adjusting target option by codegen option.

Differential Revision: https://reviews.llvm.org/D22815

llvm-svn: 278151

7 years agoupdate to use FileCheck and auto-generate checks
Sanjay Patel [Tue, 9 Aug 2016 19:42:52 +0000 (19:42 +0000)]
update to use FileCheck and auto-generate checks

llvm-svn: 278150

7 years agoRe-apply r278065 (Weak symbol support in RuntimeDyld) with a fix for ELF.
Lang Hames [Tue, 9 Aug 2016 19:27:17 +0000 (19:27 +0000)]
Re-apply r278065 (Weak symbol support in RuntimeDyld) with a fix for ELF.

llvm-svn: 278149

7 years agoAdd a missing -no-canonical-prefixes.
Benjamin Kramer [Tue, 9 Aug 2016 19:20:25 +0000 (19:20 +0000)]
Add a missing -no-canonical-prefixes.

llvm-svn: 278148

7 years agoUpdate in-tree Google Benchmark to current ToT.
Eric Fiselier [Tue, 9 Aug 2016 18:56:48 +0000 (18:56 +0000)]
Update in-tree Google Benchmark to current ToT.

I've put some work into the Google Benchmark library in order to make it easier
to benchmark libc++. These changes have already been upstreamed into
Google Benchmark and this patch applies the changes to the in-tree version.

The main improvement in the addition of a 'compare_bench.py' script which
makes it very easy to compare benchmarks. For example to compare the native
STL to libc++ you would run:

`$ compare_bench.py ./util_smartptr.native.out ./util_smartptr.libcxx.out`

And the output would look like:

RUNNING: ./util_smartptr.native.out
Benchmark                          Time           CPU Iterations
----------------------------------------------------------------
BM_SharedPtrCreateDestroy         62 ns         62 ns   10937500
BM_SharedPtrIncDecRef             31 ns         31 ns   23972603
BM_WeakPtrIncDecRef               28 ns         28 ns   23648649
RUNNING: ./util_smartptr.libcxx.out
Benchmark                          Time           CPU Iterations
----------------------------------------------------------------
BM_SharedPtrCreateDestroy         46 ns         46 ns   14957265
BM_SharedPtrIncDecRef             31 ns         31 ns   22435897
BM_WeakPtrIncDecRef               34 ns         34 ns   21084337
Comparing ./util_smartptr.native.out to ./util_smartptr.libcxx.out
Benchmark                          Time           CPU
-----------------------------------------------------
BM_SharedPtrCreateDestroy         -0.26         -0.26
BM_SharedPtrIncDecRef             +0.00         +0.00
BM_WeakPtrIncDecRef               +0.21         +0.21

llvm-svn: 278147

7 years ago[vim] Update the llvm.vim syntax file
David Majnemer [Tue, 9 Aug 2016 18:34:19 +0000 (18:34 +0000)]
[vim] Update the llvm.vim syntax file

We never updated this file to contain the WinEH instructions.
Also, add the dereferenceable attribute.

llvm-svn: 278146

7 years agoclang-rename rename-all: support reading old/newname pairs from a YAML file
Miklos Vajna [Tue, 9 Aug 2016 18:20:41 +0000 (18:20 +0000)]
clang-rename rename-all: support reading old/newname pairs from a YAML file

This is handy in case by the time clang-rename is invoked, an external
tool already genereated a list of oldname -> newname pairs to handle.

Reviewers: omtcyfz

Differential Revision: https://reviews.llvm.org/D23198

llvm-svn: 278145

7 years ago[X86] Don't model UD2/UD2B as a terminator
David Majnemer [Tue, 9 Aug 2016 17:55:12 +0000 (17:55 +0000)]
[X86] Don't model UD2/UD2B as a terminator

A UD2 might make its way into the program via a call to @llvm.trap.
Obviously, calls are not terminators.  However, we modeled the X86
instruction, UD2, as a terminator.  Later on, this confuses the epilogue
insertion machinery which results in the epilogue getting inserted
before the UD2.  For some platforms, like x64, the result is a
violation of the ABI.

Instead, model UD2/UD2B as a side effecting instruction which may
observe memory.

llvm-svn: 278144

7 years agoFix spacing around variable initializations and for-loops. NFC.
Mandeep Singh Grang [Tue, 9 Aug 2016 17:49:24 +0000 (17:49 +0000)]
Fix spacing around variable initializations and for-loops. NFC.

Reviewers: grosser, _jdoerfert, zinob

Projects: #polly

Differential Revision: https://reviews.llvm.org/D23285

llvm-svn: 278143

7 years ago[debugserver] Delete CFData.{h,cpp}, since they appear to be dead (NFCI)
Vedant Kumar [Tue, 9 Aug 2016 17:42:11 +0000 (17:42 +0000)]
[debugserver] Delete CFData.{h,cpp}, since they appear to be dead (NFCI)

Differential Revision: https://reviews.llvm.org/D23070

llvm-svn: 278142

7 years ago[DAGCombiner] Better support for shifting large value type by constants
Simon Pilgrim [Tue, 9 Aug 2016 17:39:11 +0000 (17:39 +0000)]
[DAGCombiner] Better support for shifting large value type by constants

As detailed on D22726, much of the shift combining code assume constant values will fit into a uint64_t value and calls ConstantSDNode::getZExtValue where it probably shouldn't (leading to asserts). Using APInt directly avoids this problem but we encounter other assertions if we attempt to compare/operate on 2 APInt of different bitwidths.

This patch adds a helper function to ensure that 2 APInt values are zero extended as required so that they can be safely used together. I've only added an initial example use for this to the '(SHIFT (SHIFT x, c1), c2) --> (SHIFT x, (ADD c1, c2))' combines. Further cases can easily be added as required.

Differential Revision: https://reviews.llvm.org/D23007

llvm-svn: 278141

7 years ago[CUDA] Regression test to make sure C++ include path are forwarded to host and device...
Samuel Antao [Tue, 9 Aug 2016 17:27:24 +0000 (17:27 +0000)]
[CUDA] Regression test to make sure C++ include path are forwarded to host and device frontends.

Summary: Add test to detect the C++ include paths are passed to both CUDA host and device frontends.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D22946

llvm-svn: 278140

7 years ago[clang-cl] Make -gline-tables-only imply -gcodeview
Reid Kleckner [Tue, 9 Aug 2016 17:23:56 +0000 (17:23 +0000)]
[clang-cl] Make -gline-tables-only imply -gcodeview

It's surprising that you have to pass /Z7 in addition to -gcodeview to
get debug info. The sanitizer runtime, for example, expects that if the
compiler supports the -gline-tables-only flag, then it will emit debug
info.

llvm-svn: 278139

7 years ago[AliasAnalysis] Treat invariant.start as read-memory
Anna Thomas [Tue, 9 Aug 2016 17:18:05 +0000 (17:18 +0000)]
[AliasAnalysis] Treat invariant.start as read-memory

Summary:
We teach alias analysis that invariant.start is readonly.
This helps with GVN and memcopy optimizations that currently treat.
invariant.start as a clobber.
We need to treat this as readonly, so that DSE does not incorrectly
remove stores prior to the invariant.start

Reviewers: sanjoy, reames, majnemer, dberlin

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23214

llvm-svn: 278138

7 years agoauto-generate checks
Sanjay Patel [Tue, 9 Aug 2016 17:03:51 +0000 (17:03 +0000)]
auto-generate checks

llvm-svn: 278137

7 years agoauto-generate checks
Sanjay Patel [Tue, 9 Aug 2016 17:02:17 +0000 (17:02 +0000)]
auto-generate checks

llvm-svn: 278136

7 years agoauto-generate checks
Sanjay Patel [Tue, 9 Aug 2016 16:59:54 +0000 (16:59 +0000)]
auto-generate checks

llvm-svn: 278135

7 years agotest-release.sh: Drop autoconf support
Hans Wennborg [Tue, 9 Aug 2016 16:46:02 +0000 (16:46 +0000)]
test-release.sh: Drop autoconf support

The autoconf build was deleted some time ago.

llvm-svn: 278133

7 years agoadd tests for missing vector icmp folds
Sanjay Patel [Tue, 9 Aug 2016 16:39:05 +0000 (16:39 +0000)]
add tests for missing vector icmp folds

llvm-svn: 278132

7 years agoupdate to use FileCheck and auto-generate checks
Sanjay Patel [Tue, 9 Aug 2016 16:19:57 +0000 (16:19 +0000)]
update to use FileCheck and auto-generate checks

llvm-svn: 278131

7 years agoregenerate checks
Sanjay Patel [Tue, 9 Aug 2016 16:17:46 +0000 (16:17 +0000)]
regenerate checks

llvm-svn: 278130

7 years agoadd tests for missing vector icmp folds
Sanjay Patel [Tue, 9 Aug 2016 16:05:57 +0000 (16:05 +0000)]
add tests for missing vector icmp folds

llvm-svn: 278129

7 years ago[Profile] turn off verbose warnings by default
Xinliang David Li [Tue, 9 Aug 2016 15:35:28 +0000 (15:35 +0000)]
[Profile] turn off verbose warnings by default

no prof data for func warning is turned off by default
due to its high verbosity and minimal usefulness.

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

llvm-svn: 278127

7 years ago[GPGPU] Support PHI nodes used in GPU kernel
Tobias Grosser [Tue, 9 Aug 2016 15:35:06 +0000 (15:35 +0000)]
[GPGPU] Support PHI nodes used in GPU kernel

Ensure the right scalar allocations are used as the host location of data
transfers. For the device code, we clear the allocation cache before device
code generation to be able to generate new device-specific allocation and
we need to make sure to add back the old host allocations as soon as the
device code generation is finished.

llvm-svn: 278126

7 years ago[GPGPU] Use separate basic block for GPU initialization code
Tobias Grosser [Tue, 9 Aug 2016 15:35:03 +0000 (15:35 +0000)]
[GPGPU] Use separate basic block for GPU initialization code

This increases the readability of the IR and also clarifies that the GPU
inititialization is executed _after_ the scalar initialization which needs
to before the code of the transformed scop is executed.

Besides increased readability, the IR should not change. Specifically, I
do not expect any changes in program semantics due to this patch.

llvm-svn: 278125

7 years ago[BlockGenerator] Insert initializations at beginning of start block
Tobias Grosser [Tue, 9 Aug 2016 15:34:59 +0000 (15:34 +0000)]
[BlockGenerator] Insert initializations at beginning of start block

In case some code -- not guarded by control flow -- would be emitted directly in
the start block, it may happen that this code would use uninitalized scalar
values if the scalar initialization is only emitted at the end of the start
block. This is not a problem today in normal Polly, as all statements are
emitted in their own basic blocks, but Polly-ACC emits host-to-device copy
statements into the start block.

Additional Polly-ACC test coverage will be added in subsequent changes that
improve the handling of PHI nodes in Polly-ACC.

llvm-svn: 278124

7 years ago[ASTMatchers] Add matchers canReferToDecl() and hasUnderlyingDecl()
Martin Bohme [Tue, 9 Aug 2016 15:07:52 +0000 (15:07 +0000)]
[ASTMatchers] Add matchers canReferToDecl() and hasUnderlyingDecl()

Summary: Required for D22220

Reviewers: sbenza, klimek, aaron.ballman, alexfh

Subscribers: alexfh, klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D23004

llvm-svn: 278123

7 years ago[LVI] Make LVI smarter about comparisons with non-constants
Artur Pilipenko [Tue, 9 Aug 2016 14:50:08 +0000 (14:50 +0000)]
[LVI] Make LVI smarter about comparisons with non-constants

Make LVI smarter about comparisons with a non-constant. For example, a s< b constraints a to be in [INT_MIN, INT_MAX) range. This is a part of https://llvm.org/bugs/show_bug.cgi?id=28620 fix.

Reviewed By: sanjoy

Differential Revision: https://reviews.llvm.org/D23205

llvm-svn: 278122

7 years agoclang-format: Add SpaceAfterTemplate
Sylvestre Ledru [Tue, 9 Aug 2016 14:24:40 +0000 (14:24 +0000)]
clang-format: Add SpaceAfterTemplate

Summary:
This is required for compliance with the Mozilla style guide.

This is a rebase+minor change of Birunthan Mohanathas's patch

Reviewers: djasper

Subscribers: klimek, cfe-commits, opilarium

Differential Revision: https://reviews.llvm.org/D23317

llvm-svn: 278121

7 years ago[X86][XOP] Add support for combining target shuffles to VPERMIL2PD/VPERMIL2PS
Simon Pilgrim [Tue, 9 Aug 2016 12:56:15 +0000 (12:56 +0000)]
[X86][XOP] Add support for combining target shuffles to VPERMIL2PD/VPERMIL2PS

llvm-svn: 278120

7 years agoAdd `#ifdef __cplusplus` around `extern "C"` in Compiler.h. NFC.
Kuba Brecka [Tue, 9 Aug 2016 12:12:15 +0000 (12:12 +0000)]
Add `#ifdef __cplusplus` around `extern "C"` in Compiler.h.  NFC.

llvm-svn: 278119

7 years agoReapply "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"
Pavel Labath [Tue, 9 Aug 2016 12:04:46 +0000 (12:04 +0000)]
Reapply "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"

Resumbitting the commit after fixing the following problems:
- broken unit tests on windows: incorrect gtest usage on my part (TEST vs. TEST_F)
- the new code did not correctly handle the case where we went to interrupt the process, but it
  stopped due to a different reason - the interrupt request would remain queued and would
  interfere with the following "continue". I also added a unit test for this case.

This reapplies r277156 and r277139.

llvm-svn: 278118

7 years agoAVX-512: A new test for FMA intrinsic
Elena Demikhovsky [Tue, 9 Aug 2016 11:54:14 +0000 (11:54 +0000)]
AVX-512: A new test for FMA intrinsic

A new test that explores sub-optimal sequence of FMA intrinsic and FNEG operation.
An upcoming patch will fix it.

llvm-svn: 278117

7 years ago[sanitizers] Make it possible to XFAIL on the effective target, not just the default.
Daniel Sanders [Tue, 9 Aug 2016 11:50:53 +0000 (11:50 +0000)]
[sanitizers] Make it possible to XFAIL on the effective target, not just the default.

Summary:
The triple is not the right thing to XFAIL on since LIT only sees the default
triple and not the effective triple chosen by any -target option in the RUN
directives. This discrepancy is shown in the table below:

  Default Triple   | Options                           | XFAIL  | LIT's expected result | Desired expectation
  =================+===================================+========+=======================+====================
  mips-linux-gnu   | -target mips-linux-gnu            |        | Pass                  | Pass
  mips-linux-gnu   | -target mips64-linux-gnu -mabi=64 |        | Pass                  | Pass
  mips-linux-gnu   | -target mips-linux-gnu            | mips   | Fail                  | Fail
  mips-linux-gnu   | -target mips64-linux-gnu -mabi=64 | mips   | Fail                  | Fail/Pass* (debatable**)
  mips-linux-gnu   | -target mips-linux-gnu            | mips-  | Fail                  | Fail
  mips-linux-gnu   | -target mips64-linux-gnu -mabi=64 | mips-  | Fail                  | Pass*
  mips-linux-gnu   | -target mips-linux-gnu            | mips64 | Pass                  | Pass
  mips-linux-gnu   | -target mips64-linux-gnu -mabi=64 | mips64 | Pass                  | Fail*
  mips64-linux-gnu | -target mips-linux-gnu            |        | Pass                  | Pass
  mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 |        | Pass                  | Pass
  mips64-linux-gnu | -target mips-linux-gnu            | mips   | Fail                  | Fail*
  mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips   | Fail                  | Fail/Pass (debatable**)
  mips64-linux-gnu | -target mips-linux-gnu            | mips-  | Pass                  | Fail*
  mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips-  | Pass                  | Pass
  mips64-linux-gnu | -target mips-linux-gnu            | mips64 | Fail                  | Pass*
  mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips64 | Fail                  | Fail
  x64_64-linux-gnu | -target i386-linux-gnu            |        | Pass                  | Pass
  x64_64-linux-gnu | -target x86_64-linux-gnu          |        | Pass                  | Pass
  x64_64-linux-gnu | -target i386-linux-gnu            | i386   | Pass                  | Fail*
  x64_64-linux-gnu | -target x86_64-linux-gnu          | i386   | Pass                  | Pass
  x64_64-linux-gnu | -target i386-linux-gnu            | x86_64 | Fail                  | Pass
  x64_64-linux-gnu | -target x86_64-linux-gnu          | x86_64 | Fail                  | Fail*
  * These all differ from LIT's current behaviour.
  ** People's expectations vary depending on whether they know that LIT does a
   substring match on the default triple or think it's an exact match on an
   architecture.

This patch adds "target-is-${target_arch}" to the available features list and
updates the mips XFAIL's to use them. XFAIL'ing on these features will
correctly account for the target being tested. Making the table:

  Options                           | XFAIL            | LIT's expected result
  ==================================+==================+======================
  -target mips-linux-gnu            |                  | Pass
  -target mips64-linux-gnu -mabi=64 |                  | Pass
  -target mips-linux-gnu            | target-is-mips   | Fail
  -target mips64-linux-gnu -mabi=64 | target-is-mips   | Pass
  -target mips-linux-gnu            | target-is-mips64 | Pass
  -target mips64-linux-gnu -mabi=64 | target-is-mips64 | Fail
  -target i386-linux-gnu            |                  | Pass
  -target x86_64-linux-gnu          |                  | Pass
  -target i386-linux-gnu            | target-is-i386   | Fail
  -target x86_64-linux-gnu          | target-is-i386   | Pass
  -target i386-linux-gnu            | target-is-x86_64 | Pass
  -target x86_64-linux-gnu          | target-is-x86_64 | Fail

Reviewers: probinson

Subscribers: probinson, kubabrecka, llvm-commits, samsonov

Differential Revision: https://reviews.llvm.org/D22802

llvm-svn: 278116

7 years ago[ELF] - Removed dead code. NFC.
George Rimar [Tue, 9 Aug 2016 10:57:42 +0000 (10:57 +0000)]
[ELF] - Removed dead code. NFC.

llvm-svn: 278115

7 years ago[X86][XOP] Add support for combining target shuffles to VPPERM
Simon Pilgrim [Tue, 9 Aug 2016 10:56:29 +0000 (10:56 +0000)]
[X86][XOP] Add support for combining target shuffles to VPPERM

llvm-svn: 278114

7 years ago[XRay] Test for xray_instr_map in object file. (NFC)
Dean Michael Berris [Tue, 9 Aug 2016 10:42:11 +0000 (10:42 +0000)]
[XRay] Test for xray_instr_map in object file. (NFC)

This makes a trivial change in the emission of the per-function XRay
tables, and makes sure that the xray_instr_map section does show up in
the object file.

llvm-svn: 278113

7 years ago[clang-rename] cleanup: use isWritten
Kirill Bobyrev [Tue, 9 Aug 2016 10:03:33 +0000 (10:03 +0000)]
[clang-rename] cleanup: use isWritten

nit: use isWritten and const auto *Initializer in
NamedDeclFindingASTVisitor::VisitCXXConstructorDecl method.
Test plan: make -j8 check-clang-tools (passed)

Patch by Alexander Shaposhnikov!

Reviewers: omtcyfz

Differential Revision: https://reviews.llvm.org/D23298

llvm-svn: 278112

7 years agoFix Wdocumentation unknown parameter warning
Simon Pilgrim [Tue, 9 Aug 2016 10:02:11 +0000 (10:02 +0000)]
Fix Wdocumentation unknown parameter warning

llvm-svn: 278111

7 years ago[analyzer] Try to fix coverity CID 1360469.
Vassil Vassilev [Tue, 9 Aug 2016 10:00:23 +0000 (10:00 +0000)]
[analyzer] Try to fix coverity CID 1360469.

Patch by Raphael Isemann!

llvm-svn: 278110

7 years agoRevert 278107 which causes buildbot failures and in addition has wrong commit message
Artur Pilipenko [Tue, 9 Aug 2016 10:00:22 +0000 (10:00 +0000)]
Revert 278107 which causes buildbot failures and in addition has wrong commit message

llvm-svn: 278109

7 years ago[modules]Add missing include.
Vassil Vassilev [Tue, 9 Aug 2016 09:46:11 +0000 (09:46 +0000)]
[modules]Add missing include.

llvm-svn: 278108

7 years agoTeach CorrelatedValuePropagation to mark adds as no wrap
Artur Pilipenko [Tue, 9 Aug 2016 09:41:34 +0000 (09:41 +0000)]
Teach CorrelatedValuePropagation to mark adds as no wrap

Use LVI to prove that adds do not wrap. The change is motivated by https://llvm.org/bugs/show_bug.cgi?id=28620 bug and it's the first step to fix that problem.

Reviewed By: sanjoy

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

llvm-svn: 278107

7 years ago[X86][SSE] Fix memory folding of (v)roundsd / (v)roundss
Simon Pilgrim [Tue, 9 Aug 2016 09:32:34 +0000 (09:32 +0000)]
[X86][SSE] Fix memory folding of (v)roundsd / (v)roundss

We only had partial memory folding support for the intrinsic definitions, and (as noted on PR27481) was causing FR32/FR64/VR128 mismatch errors with the machine verifier.

This patch adds missing memory folding support for both intrinsics and the ffloor/fnearbyint/fceil/frint/ftrunc patterns and in doing so fixes the failing machine verifier stack folding tests from PR27481.

Differential Revision: https://reviews.llvm.org/D23276

llvm-svn: 278106

7 years ago[LVI] NFC. Fix a typo Bofore -> Before
Artur Pilipenko [Tue, 9 Aug 2016 09:14:29 +0000 (09:14 +0000)]
[LVI] NFC. Fix a typo Bofore -> Before

llvm-svn: 278105