platform/upstream/llvm.git
8 years agoAMDGPU: Fix trying to skip from a block with no successors
Matt Arsenault [Fri, 15 Jul 2016 00:58:13 +0000 (00:58 +0000)]
AMDGPU: Fix trying to skip from a block with no successors

Found while reducing bug 28550

llvm-svn: 275509

8 years agoAMDGPU: Fix splitting kill blocks with defs before kill
Matt Arsenault [Fri, 15 Jul 2016 00:58:09 +0000 (00:58 +0000)]
AMDGPU: Fix splitting kill blocks with defs before kill

llvm-svn: 275508

8 years agoFrontend: Simplify ownership model for clang's output streams.
Peter Collingbourne [Fri, 15 Jul 2016 00:55:40 +0000 (00:55 +0000)]
Frontend: Simplify ownership model for clang's output streams.

This changes the CompilerInstance::createOutputFile function to return
a std::unique_ptr<llvm::raw_ostream>, rather than an llvm::raw_ostream
implicitly owned by the CompilerInstance. This in most cases required that
I move ownership of the output stream to the relevant ASTConsumer.

The motivation for this change is to allow BackendConsumer to be a client
of interfaces such as D20268 which take ownership of the output stream.

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

llvm-svn: 275507

8 years agoadjust one of the NSLog output tests to only run on macOS 10.12+
Todd Fiala [Fri, 15 Jul 2016 00:51:26 +0000 (00:51 +0000)]
adjust one of the NSLog output tests to only run on macOS 10.12+

The LLDB NSLog handling when Xcode intends to suppress NSLog
output only works on Fall 2016 OS releases.  Skip it on earlier
OSes.

llvm-svn: 275506

8 years agolibc++abi: add a top level option for using CompilerRT
Saleem Abdulrasool [Fri, 15 Jul 2016 00:49:42 +0000 (00:49 +0000)]
libc++abi: add a top level option for using CompilerRT

Add an option to opt into compiler-rt instead of libgcc.  This option defaults
to OFF to avoid a behaviour change.  It is not possible to mix and match
different runtime libraries.  Disabling this requires that libc++ is built
accordingly.  This knob is particularly useful for targets that are GCC by
default (i.e. Linux).

llvm-svn: 275505

8 years agoCOFF: Remove `void error()` functions and use fatal instead.
Rui Ueyama [Fri, 15 Jul 2016 00:40:46 +0000 (00:40 +0000)]
COFF: Remove `void error()` functions and use fatal instead.

This change makes the control flow more explicit.

llvm-svn: 275504

8 years ago[AArch64] Set COPY ZR isAsCheapAsAMove when needed.
Haicheng Wu [Fri, 15 Jul 2016 00:27:01 +0000 (00:27 +0000)]
[AArch64] Set COPY ZR isAsCheapAsAMove when needed.

If a subtarget has both ZCZeroing and CustomCheapAsMoveHandling features (now
only Kryo has both), set COPY (W|X)ZR isAsCheapAsAMove.

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

llvm-svn: 275503

8 years ago[codeview] Shrink inlined call site line info tables
Reid Kleckner [Thu, 14 Jul 2016 23:47:15 +0000 (23:47 +0000)]
[codeview] Shrink inlined call site line info tables

For a fully inlined call chain like a -> b -> c -> d, we were emitting
line info for 'd' 3 separate times: once for d's actual InlineSite line
table, and twice for 'b' and 'c'. This is particularly inefficient when
all these functions are in different headers, because now we need to
encode the file change. Windbg was coping with our suboptimal output, so
this should not be noticeable from the debugger.

llvm-svn: 275502

8 years agoCOFF: Remove unnecessary explicit calls of Twine ctor.
Rui Ueyama [Thu, 14 Jul 2016 23:43:36 +0000 (23:43 +0000)]
COFF: Remove unnecessary explicit calls of Twine ctor.

llvm-svn: 275501

8 years agoCOFF: Rename noreturn error -> fatal.
Rui Ueyama [Thu, 14 Jul 2016 23:37:14 +0000 (23:37 +0000)]
COFF: Rename noreturn error -> fatal.

This new name is also consistent with ELF.

llvm-svn: 275500

8 years agoCOFF: Rename non-noreturn error -> check.
Rui Ueyama [Thu, 14 Jul 2016 23:37:10 +0000 (23:37 +0000)]
COFF: Rename non-noreturn error -> check.

The new name is consistent with ELF.

llvm-svn: 275499

8 years agollvm-objdump: extend __mh_execute_header handling to other special syms
Tim Northover [Thu, 14 Jul 2016 23:13:03 +0000 (23:13 +0000)]
llvm-objdump: extend __mh_execute_header handling to other special syms

We don't need to print any of the special __mh_*_header symbols when
disassembling. Since they point at the beginning of the segment (not where the
actual code is) they're pretty misleading.

Should also fix lld bots.

llvm-svn: 275498

8 years ago[X86][AVX2] Allow VPERMPD/VPERMQ shuffles to call combineShuffle (reapplied)
Simon Pilgrim [Thu, 14 Jul 2016 23:05:09 +0000 (23:05 +0000)]
[X86][AVX2] Allow VPERMPD/VPERMQ shuffles to call combineShuffle (reapplied)

This improves the situation discussed in D19228 where we were forcing VPERMPD/VPERMQ where VPERM2F128/VPERM2I128 would have been better.

This was incorrectly reverted in rL275421 during triage of PR28552.

llvm-svn: 275497

8 years agoRemove the new module cache from the index-module test
Ben Langmuir [Thu, 14 Jul 2016 22:53:23 +0000 (22:53 +0000)]
Remove the new module cache from the index-module test

Forgot to add the new cache to the `rm -rf` line. This broke some bots
when trying to load a module built with an older compiler.

llvm-svn: 275496

8 years ago[LoopDist] Fix typo in diagnostic
Adam Nemet [Thu, 14 Jul 2016 22:33:46 +0000 (22:33 +0000)]
[LoopDist] Fix typo in diagnostic

llvm-svn: 275495

8 years ago[asan] Avoid hooking memchr() on Windows64
Etienne Bergeron [Thu, 14 Jul 2016 22:29:22 +0000 (22:29 +0000)]
[asan] Avoid hooking memchr() on Windows64

There is not enough padding in front of memchr(), and, the first 6 bytes
contains a branch instruction. Basically the current interception will
not work on memchr().

It was disabled before, but was missing the part to disable it for
INTERCEPT_LIBRARY_FUNCTION.

Patch by Wei Wang

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

llvm-svn: 275494

8 years agoC does not have inline variables.
Paul Robinson [Thu, 14 Jul 2016 22:22:58 +0000 (22:22 +0000)]
C does not have inline variables.
Add a few missing tests for related C++ diagnostics.

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

llvm-svn: 275493

8 years agoaddress comments in: https://reviews.llvm.org/D22363
Etienne Bergeron [Thu, 14 Jul 2016 22:18:21 +0000 (22:18 +0000)]
address comments in: https://reviews.llvm.org/D22363

llvm-svn: 275492

8 years ago[compiler-rt] Fix missing argument in asan unittest
Etienne Bergeron [Thu, 14 Jul 2016 22:16:31 +0000 (22:16 +0000)]
[compiler-rt] Fix missing argument in asan unittest

Summary:
Both test have the same command-line.
The second test is missing the /GS-.

Keep in mind that /GS is on by default.

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 275491

8 years agoAdd test inputs missed by r275481.
Richard Smith [Thu, 14 Jul 2016 22:15:06 +0000 (22:15 +0000)]
Add test inputs missed by r275481.

llvm-svn: 275490

8 years ago[compiler-rt] Add more assembly patterns for interception
Etienne Bergeron [Thu, 14 Jul 2016 22:14:33 +0000 (22:14 +0000)]
[compiler-rt] Add more assembly patterns for interception

Summary:
These patterns are encounter when using instrumented DLL.

Without this patch, asan lit test are crashing when trying to hook
on RaiseException function.

Reviewers: rnk

Subscribers: llvm-commits, wang0109, chrisha

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

llvm-svn: 275489

8 years ago[compiler-rt] Add internal wcslen to avoid crashing on windows 64-bits
Etienne Bergeron [Thu, 14 Jul 2016 22:13:41 +0000 (22:13 +0000)]
[compiler-rt] Add internal wcslen to avoid crashing on windows 64-bits

Summary:
The function wcslen is incorrectly hooked on windows 64-bits.

The interception library is not able to hook without breaking the code.
The function is too small and the interception must be done with
trampoline-hooking which turned out to be incorrect on a small
loop (first few instructions have a backedge).

Reviewers: rnk

Subscribers: wang0109, chrisha, llvm-commits, kubabrecka

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

llvm-svn: 275488

8 years agollvm-objdump: handle stubbed and malformed dylibs better
Tim Northover [Thu, 14 Jul 2016 22:13:32 +0000 (22:13 +0000)]
llvm-objdump: handle stubbed and malformed dylibs better

We were quite happy to read past the end of the valid section data when
disassembling. Instead we entirely skip stub dylibs, and tell the user what's
happened if their section only has partial data.

llvm-svn: 275487

8 years ago[compiler-rt] Fix missing frame with stackwalking on windows 64-bits
Etienne Bergeron [Thu, 14 Jul 2016 22:04:28 +0000 (22:04 +0000)]
[compiler-rt] Fix missing frame with stackwalking on windows 64-bits

Summary: Fix missing frame with stackwalking on windows 64-bits

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 275486

8 years agoLLDB help content has accumulated over time without a recent attempt to
Kate Stone [Thu, 14 Jul 2016 22:03:10 +0000 (22:03 +0000)]
LLDB help content has accumulated over time without a recent attempt to
review it for consistency, accuracy, and clarity. These changes attempt to
address all of the above while keeping the text relatively terse.

<rdar://problem/24868841>

llvm-svn: 275485

8 years agoAdd runtime support for __cpu_model (__builtin_cpu_supports)
Alina Sbirlea [Thu, 14 Jul 2016 22:02:35 +0000 (22:02 +0000)]
Add runtime support for __cpu_model (__builtin_cpu_supports)

Summary:
    This aims to add support for __cpu_model and address Bug 25510. It uses
    the code from lib/Support/Host.cpp for cpu detection, and creates
    __cpu_model with that info.

    Tested on OSX and built on Linux as well (though libgcc is the default).
    The use of "asm" required -std=gnu99, hence the cmake change. Corrections
    on better addressing this are welcome.

    Previously reverted, up for review again to iron out outstanding issues.

Reviewers: llvm-commits, joerg, echristo, mehdi_amini

Subscribers: mehdi_amini

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

llvm-svn: 275484

8 years ago[GVN] Fold constant expression in GVN.
Ekaterina Romanova [Thu, 14 Jul 2016 22:02:25 +0000 (22:02 +0000)]
[GVN] Fold constant expression in GVN.

Fix for PR 28418.

opt never finishes compiling a test when -gvn option is passed.
The problem is caused by the fact that GVN fails to fold a constant expression.

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

llvm-svn: 275483

8 years agoEditing multi-line content in a terminal environment involves a lot of
Kate Stone [Thu, 14 Jul 2016 22:00:04 +0000 (22:00 +0000)]
Editing multi-line content in a terminal environment involves a lot of
trade-offs. When LLDB's multi-line editing support was first introduced
for expressions / REPL contexts the behavior was as follows:

* The Return key is treated as a line-break except at the end of the input
  buffer, where a completeness test is applied

This worked well enough when writing code, and makes it trivial to insert
new lines above code you've already typed. Just use cursor navigation to
move up and type freely. Where it was awkward is that the gesture to insert
a line break and end editing is conflated for most people. Sometimes you
want Return to end the editing session and other times you want to insert
a line break.

This commit changes the behavior as follows:

* The Return key is treated as the end of editing except at the end of the
  input buffer, where a completeness test is applied

* The Meta+Return sequence is always treated as a line break. This is
  consistent with conventions in Facebook and elsewhere since
  Alt/Option+Return is often mapped to Meta+Return. The unfortunate
  exception is on macOS where this *can* be the case, but isn't by
  default. Sigh.

Note that by design both before and after the patch pasting a Return
character always introduces a line break.

<rdar://problem/26886287>

llvm-svn: 275482

8 years ago[modules] Don't pass interesting decls to the consumer for a module file that's
Richard Smith [Thu, 14 Jul 2016 21:50:09 +0000 (21:50 +0000)]
[modules] Don't pass interesting decls to the consumer for a module file that's
passed on the command line but never actually used. We consider a (top-level)
module to be used if any part of it is imported, either by the current
translation unit, or by any part of a top-level module that is itself used.

(Put another way, a module is used if an implicit modules build would have
loaded its .pcm file.)

llvm-svn: 275481

8 years agoCOFF: Update remaining #include paths.
Peter Collingbourne [Thu, 14 Jul 2016 21:30:37 +0000 (21:30 +0000)]
COFF: Update remaining #include paths.

llvm-svn: 275480

8 years agoremoved darwin_log.py file from previous check-in
Todd Fiala [Thu, 14 Jul 2016 21:25:42 +0000 (21:25 +0000)]
removed darwin_log.py file from previous check-in

This file was not intended to be part of the last check-in.

llvm-svn: 275478

8 years agoELF: Update #include path for D22173.
Peter Collingbourne [Thu, 14 Jul 2016 21:21:20 +0000 (21:21 +0000)]
ELF: Update #include path for D22173.

llvm-svn: 275477

8 years agoMove legacy LTO interface headers to legacy/ directory.
Peter Collingbourne [Thu, 14 Jul 2016 21:21:16 +0000 (21:21 +0000)]
Move legacy LTO interface headers to legacy/ directory.

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

llvm-svn: 275476

8 years agoReplace -mllvm -asan-use-after-scope=1 with -fsanitize-address-use-after-scope
Vitaly Buka [Thu, 14 Jul 2016 21:18:06 +0000 (21:18 +0000)]
Replace -mllvm -asan-use-after-scope=1 with -fsanitize-address-use-after-scope

Summary:
When test was added we had no -fsanitize-address-use-after-scope in clang
so we had to use -mllvm -asan-use-after-scope=1.

Reviewers: eugenis

Subscribers: kubabrecka

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

llvm-svn: 275475

8 years ago[ThinLTO/gold] Perform index-based weak/linkonce resolution
Teresa Johnson [Thu, 14 Jul 2016 21:13:24 +0000 (21:13 +0000)]
[ThinLTO/gold] Perform index-based weak/linkonce resolution

Summary:
Invoke the weak/linkonce symbol resolution support (already used by
libLTO) that operates via the summary index.

This ensures prevailing linkonce are kept, by making them weak, and
marks preempted copies as available_externally when possible.

With this change, the older support for keeping the prevailing linkonce
(by changing their symbol resolution) is removed.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 275474

8 years ago[LV] Rename StrideAccesses to AccessStrideInfo (NFC)
Matthew Simpson [Thu, 14 Jul 2016 21:05:08 +0000 (21:05 +0000)]
[LV] Rename StrideAccesses to AccessStrideInfo (NFC)

We now collect all accesses with a constant stride, not just the ones with a
stride greater than one. This change was requested in the review of D19984.

llvm-svn: 275473

8 years agofix command-line LLDB so NSLog messages show up
Todd Fiala [Thu, 14 Jul 2016 21:02:45 +0000 (21:02 +0000)]
fix command-line LLDB so NSLog messages show up

Changes to the underlying logging infrastructure in Fall 2016 Darwin
OSes were no longer showing up NSLog messages in command-line LLDB.
This change restores that functionality, and adds test cases to
verify the new behavior.

rdar://26732492

llvm-svn: 275472

8 years ago[LV] Allow interleaved accesses in loops with predicated blocks
Matthew Simpson [Thu, 14 Jul 2016 20:59:47 +0000 (20:59 +0000)]
[LV] Allow interleaved accesses in loops with predicated blocks

This patch allows the formation of interleaved access groups in loops
containing predicated blocks. However, the predicated accesses are prevented
from forming groups.

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

llvm-svn: 275471

8 years agodon't repeat function names in comments; NFC
Sanjay Patel [Thu, 14 Jul 2016 20:54:43 +0000 (20:54 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 275470

8 years ago[Object] Change Archive::findSym to return an Expected<Optional<Child>>.
Lang Hames [Thu, 14 Jul 2016 20:44:27 +0000 (20:44 +0000)]
[Object] Change Archive::findSym to return an Expected<Optional<Child>>.

As suggested by Rafael in review of D22079 - this was accidentally left out of
the final commit (r275316).

llvm-svn: 275469

8 years ago[SCCP] Pass the Solver by reference, copies are expensive ...
Davide Italiano [Thu, 14 Jul 2016 20:25:54 +0000 (20:25 +0000)]
[SCCP] Pass the Solver by reference, copies are expensive ...

.. enough to cause LTO compile time to regress insanely.
Thanks *a lot* to Rafael for reporting the problem and testing
the fix!

llvm-svn: 275468

8 years agoAdd recently added TargetOptions::EnableIPRA member to operator==
Mehdi Amini [Thu, 14 Jul 2016 20:22:13 +0000 (20:22 +0000)]
Add recently added TargetOptions::EnableIPRA member to operator==

llvm-svn: 275467

8 years ago[arcmt/objcmt] Fix ParentMap crash with invalid code.
Argyrios Kyrtzidis [Thu, 14 Jul 2016 20:21:16 +0000 (20:21 +0000)]
[arcmt/objcmt] Fix ParentMap crash with invalid code.

rdar://22489560

llvm-svn: 275466

8 years ago[ValueTracking] Use Instruction::getFunction; NFC
Sanjoy Das [Thu, 14 Jul 2016 20:19:01 +0000 (20:19 +0000)]
[ValueTracking] Use Instruction::getFunction; NFC

llvm-svn: 275465

8 years agoAttempt to workaround Windows bots after my previous commit
Ben Langmuir [Thu, 14 Jul 2016 20:08:43 +0000 (20:08 +0000)]
Attempt to workaround Windows bots after my previous commit

For some reason it seems the second invocation is getting DMOD_OTHER_H
set to a path with/forward/slashes, but one of the use sites
has\back\slashes. There should be no difference with what was already
there, but for now try to avoid checking those paths.

llvm-svn: 275464

8 years agos/constexpr/LLVM_CONSTEXPR in AArch64InstrInfo.cpp.
Justin Lebar [Thu, 14 Jul 2016 20:08:23 +0000 (20:08 +0000)]
s/constexpr/LLVM_CONSTEXPR in AArch64InstrInfo.cpp.

Yet again.

llvm-svn: 275463

8 years agoReverting 275417
Roger Ferrer Ibanez [Thu, 14 Jul 2016 20:05:30 +0000 (20:05 +0000)]
Reverting 275417

This change has triggered unexpected failures.

llvm-svn: 275462

8 years agocppcoreguidelines-pro-bounds-constant-array-index: crash for value dependent index...
Matthias Gehre [Thu, 14 Jul 2016 20:00:48 +0000 (20:00 +0000)]
cppcoreguidelines-pro-bounds-constant-array-index: crash for value dependent index in c++03 mode

Summary:
When the expression is value dependent,
isIntegerConstantExpr() crashes in C++03 mode with
 ../tools/clang/lib/AST/ExprConstant.cpp:9330: (anonymous namespace)::ICEDiag CheckICE(const clang::Expr *, const clang::ASTContext &):
  Assertion `!E->isValueDependent() && "Should not see value dependent exprs!"' failed.
In C++11 mode, that assert does not trigger.

This commit works around this in the check. We don't check
value-dependent indices and instead check their specialization.

Reviewers: alexfh, aaron.ballman

Subscribers: nemanjai, cfe-commits

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

llvm-svn: 275461

8 years agoWhen importing classes and structs with anonymous structs, it is critical that
Sean Callanan [Thu, 14 Jul 2016 19:53:44 +0000 (19:53 +0000)]
When importing classes and structs with anonymous structs, it is critical that
distinct anonymous structs remain distinct despite having similar layout.

This is already ensured by distinguishing based on their placement in the parent
struct, using the function `findAnonymousStructOrUnionIndex`.

The problem is that this function only handles anonymous structs, like
```
class Foo { struct { int a; } }
```
and not untagged structs like
```
class Foo { struct { int a; } var; }
```
Both need to be handled, and this patch fixes that.  The test case ensures that this functionality doesn't regress.

Thanks to Manman Ren for review.

https://reviews.llvm.org/D22270

llvm-svn: 275460

8 years agoAdd support for Objective-C class properties.
Greg Clayton [Thu, 14 Jul 2016 19:31:18 +0000 (19:31 +0000)]
Add support for Objective-C class properties.

Added test cases to exiting tests to cover the new functionality.

<rdar://problem/24311282>

llvm-svn: 275459

8 years ago[Hexagon] Packetize function call arguments with tail call instructions
Krzysztof Parzyszek [Thu, 14 Jul 2016 19:30:55 +0000 (19:30 +0000)]
[Hexagon] Packetize function call arguments with tail call instructions

On Hexagon is it legal to packetize the instructions setting up call
arguments with the call instruction itself. This was already done,
except for tail calls. Make sure tail calls are handled as well.

llvm-svn: 275458

8 years ago[AArch64] Adjust the scheduling model for Exynos-M1.
Evandro Menezes [Thu, 14 Jul 2016 19:25:46 +0000 (19:25 +0000)]
[AArch64] Adjust the scheduling model for Exynos-M1.

Enable use-postra-scheduler. (NFC)

llvm-svn: 275457

8 years ago[JumpThreading] PRE unordered loads
Sanjoy Das [Thu, 14 Jul 2016 19:21:15 +0000 (19:21 +0000)]
[JumpThreading] PRE unordered loads

Summary: Extend JumpThreading's PRE to unordered atomic loads.

Reviewers: hfinkel, reames

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 275456

8 years agoAdd debugging code to the packetizer
Krzysztof Parzyszek [Thu, 14 Jul 2016 19:04:26 +0000 (19:04 +0000)]
Add debugging code to the packetizer

llvm-svn: 275455

8 years ago[index] Index system ImportDecls even when there is a DeclarationsOnly filter
Ben Langmuir [Thu, 14 Jul 2016 18:51:55 +0000 (18:51 +0000)]
[index] Index system ImportDecls even when there is a DeclarationsOnly filter

Whether we call an ImportDecl a decl or a reference symbol role is
somewhat academic, but in practice it's more like a declaration because
it is interesting even to consumers who wouldn't care about references.
Most importantly, we want to report the module dependencies of system
modules even when we have declaration-only filtering.

rdar://problem/27134855

llvm-svn: 275454

8 years ago[PM] Port Dead Loop Deletion Pass to the new PM
Jun Bum Lim [Thu, 14 Jul 2016 18:28:29 +0000 (18:28 +0000)]
[PM] Port Dead Loop Deletion Pass to the new PM

Summary: Port Dead Loop Deletion Pass to the new pass manager.

Reviewers: silvas, davide

Subscribers: llvm-commits, sanjoy, mcrosier

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

llvm-svn: 275453

8 years ago[CodeGen] Refactor MachineMemOperand::Flags's target-specific flags.
Justin Lebar [Thu, 14 Jul 2016 18:15:20 +0000 (18:15 +0000)]
[CodeGen] Refactor MachineMemOperand::Flags's target-specific flags.

Summary:
Make the target-specific flags in MachineMemOperand::Flags real, bona
fide enum values.  This simplifies users, prevents various constants
from going out of sync, and avoids the false sense of security provided
by declaring static members in classes and then forgetting to define
them inside of cpp files.

Reviewers: MatzeB

Subscribers: llvm-commits

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

llvm-svn: 275451

8 years agoTableGen: Fix a confusing use of both i and I as variables. NFC
Justin Bogner [Thu, 14 Jul 2016 18:08:33 +0000 (18:08 +0000)]
TableGen: Fix a confusing use of both i and I as variables. NFC

llvm-svn: 275450

8 years ago[sanitizer-coverage] make sure that calls to __sanitizer_cov_trace_pc are not merged...
Kostya Serebryany [Thu, 14 Jul 2016 17:59:01 +0000 (17:59 +0000)]
[sanitizer-coverage] make sure that calls to __sanitizer_cov_trace_pc are not merged (otherwise different calls get the same PC and confuse fuzzers)

llvm-svn: 275449

8 years agoUpdate error message to use "ld.lld" instead of "lld -flavor gnu".
Rui Ueyama [Thu, 14 Jul 2016 17:57:33 +0000 (17:57 +0000)]
Update error message to use "ld.lld" instead of "lld -flavor gnu".

Dispatching based on argv[0] seems to be more convenient for users
than dispatching based on -flavor option. Currently, when a user
invoke LLD as "lld", we recommend them pass -flavor option. This
patch changes the message so that we recommend use ld.lld, ld or
lld-link instead.

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

llvm-svn: 275448

8 years agoRemove TargetInfo::getImageBase. NFC.
Rui Ueyama [Thu, 14 Jul 2016 17:43:28 +0000 (17:43 +0000)]
Remove TargetInfo::getImageBase. NFC.

llvm-svn: 275447

8 years agoSet DT_MIPS_BASE_ADDRESS correctly if -image-base is given.
Rui Ueyama [Thu, 14 Jul 2016 17:40:18 +0000 (17:40 +0000)]
Set DT_MIPS_BASE_ADDRESS correctly if -image-base is given.

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

llvm-svn: 275446

8 years ago[X86][MC] Fix bracket expression parsing in intel-style assembly.
Nirav Dave [Thu, 14 Jul 2016 17:37:05 +0000 (17:37 +0000)]
[X86][MC] Fix bracket expression parsing in intel-style assembly.

Only perform struct field check on Identifier tokens.

Fixes PR28547.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 275445

8 years ago[GlobalISel] Fix G_OR opcode after the addition of a TargetOpcode.
Ahmed Bougacha [Thu, 14 Jul 2016 17:29:49 +0000 (17:29 +0000)]
[GlobalISel] Fix G_OR opcode after the addition of a TargetOpcode.

r275367 fixed G_ADD and G_BR, but not G_OR.

llvm-svn: 275444

8 years ago[CodeGen] Simplify reg bank/class union is+get into dyn_cast. NFC.
Ahmed Bougacha [Thu, 14 Jul 2016 17:29:46 +0000 (17:29 +0000)]
[CodeGen] Simplify reg bank/class union is+get into dyn_cast. NFC.

llvm-svn: 275443

8 years agoX86: handle external tail calls in Windows JIT
Saleem Abdulrasool [Thu, 14 Jul 2016 17:27:06 +0000 (17:27 +0000)]
X86: handle external tail calls in Windows JIT

If there was a tail call, we would incorrectly handle the relocation.  It would
end up indexing into the array with an incorrect section id.  The symbol was
external to the module, so the Section ID was UNDEFINED (-1).  We would then
index the SmallVector with this ID, triggering an assertion.  Use the Value
rather than the section load address in this case.

llvm-svn: 275442

8 years ago[CodeGen] s/constexpr/LLVM_CONSTEXPR/ in MachineMemOperand.h.
Justin Lebar [Thu, 14 Jul 2016 17:16:40 +0000 (17:16 +0000)]
[CodeGen] s/constexpr/LLVM_CONSTEXPR/ in MachineMemOperand.h.

llvm-svn: 275441

8 years agoDespite there being an option, it seems that Sphinx has decided that "=123" is part...
Aaron Ballman [Thu, 14 Jul 2016 17:15:06 +0000 (17:15 +0000)]
Despite there being an option, it seems that Sphinx has decided that "=123" is part of the option directive name, and so having "=0" in the option tag is problematic. Since the option tag is part of the option directive definition, it's superfluous, and so I've removed it.

llvm-svn: 275440

8 years agoauto-generate checks
Sanjay Patel [Thu, 14 Jul 2016 17:07:55 +0000 (17:07 +0000)]
auto-generate checks

Note: I removed the checks after each jump because that's noise, but we apparently
need branches rather than returning i1 to see the bt codegen in some cases.

llvm-svn: 275439

8 years ago[CodeGen] Refactor MachineMemOperand's Flags enum.
Justin Lebar [Thu, 14 Jul 2016 17:07:44 +0000 (17:07 +0000)]
[CodeGen] Refactor MachineMemOperand's Flags enum.

Summary:
- Give it a shorter name (because we're going to refer to it often from
  SelectionDAG and friends).

- Split the flags and alignment into separate variables.

- Specialize FlagsEnumTraits for it, so we can do bitwise ops on it
  without losing type information.

- Make some enum values constants in MachineMemOperand instead.
  MOMaxBits should not be a valid Flag.

- Simplify some of the bitwise ops for dealing with Flags.

Reviewers: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 275438

8 years agoARM: fix vmov.i64 immediate validity check
Tim Northover [Thu, 14 Jul 2016 17:04:34 +0000 (17:04 +0000)]
ARM: fix vmov.i64 immediate validity check

Typo meant we were only checking the low byte (repeatedly).

llvm-svn: 275437

8 years agoGPGPU: Generate an AST for the GPU-mapped schedule
Tobias Grosser [Thu, 14 Jul 2016 15:51:37 +0000 (15:51 +0000)]
GPGPU: Generate an AST for the GPU-mapped schedule

For this we need to provide an explicit list of statements as they occur in
the polly::Scop to ppcg.

We also setup basic AST printing facilities to facilitate debugging. To allow
code reuse some (minor) changes in ppcg are have been necessary.

llvm-svn: 275436

8 years agoGPGPU: Add dummy implementation for ast expression construction
Tobias Grosser [Thu, 14 Jul 2016 15:51:32 +0000 (15:51 +0000)]
GPGPU: Add dummy implementation for ast expression construction

Instead of calling to a pet function that does not return anything, we pass
our own dummy implementation to ppcg that always returns a nullptr. This
ensures that the list of ast expressions always contains a nullptr and we do
not accidentally free a random (uninitalized) pointer. This resolves the
last valgrind warning we see.

We provide an implementation for this function, when the generated AST
expressions can be used and consequently can be tested.

llvm-svn: 275435

8 years agoGlobalsAA: Functions with the argmemonly attribute won't read arbitrary globals
Tom Stellard [Thu, 14 Jul 2016 15:50:27 +0000 (15:50 +0000)]
GlobalsAA: Functions with the argmemonly attribute won't read arbitrary globals

Summary:
In preparation for changing GlobalsAA to stop assuming that intrinsics
can't read arbitrary globals, we need to make sure GlobalsAA is querying
function attributes rather than relying on this assumption.

This patch was inspired by: http://reviews.llvm.org/D20206

Reviewers: jmolloy, hfinkel

Subscribers: eli.friedman, llvm-commits

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

llvm-svn: 275433

8 years agoDon't optimize movs to pushes in -O0 builds.
Nico Weber [Thu, 14 Jul 2016 15:40:22 +0000 (15:40 +0000)]
Don't optimize movs to pushes in -O0 builds.

https://reviews.llvm.org/D22362

llvm-svn: 275431

8 years agoRemoving a few more :option: tags that we do not have corresponding .. option directi...
Aaron Ballman [Thu, 14 Jul 2016 15:32:11 +0000 (15:32 +0000)]
Removing a few more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15197/steps/docs-clang-html/logs/stdio).

llvm-svn: 275430

8 years agoDelete some trailing whitespace.
Nico Weber [Thu, 14 Jul 2016 15:07:44 +0000 (15:07 +0000)]
Delete some trailing whitespace.

llvm-svn: 275429

8 years ago[OpenCL] In test/Driver/opencl.cl, don't require name of Clang binary to contain...
Benjamin Kramer [Thu, 14 Jul 2016 15:06:57 +0000 (15:06 +0000)]
[OpenCL] In test/Driver/opencl.cl, don't require name of Clang binary to contain "clang"

The test currently fails if the name of the Clang binary doesn't contain "clang".

This patch removes that requirement, as some environments may choose to run the test with a differently named binary. This shouldn't make the test any less strict -- the only place where the flags we're searching for can really occur is the Clang command line.

Patch by Martin Böhme!

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

llvm-svn: 275428

8 years ago[X86] Decode MPX BND registers.
Ahmed Bougacha [Thu, 14 Jul 2016 14:53:21 +0000 (14:53 +0000)]
[X86] Decode MPX BND registers.

We were able to assemble, but not disassemble.

Note that fixupRMValue was truncating EA_REG_BND0-3 because we hit
the uint8_t max.  The control registers were already squarely above
it, but I don't think they ever go in .r/m, only in .reg.

I also did notice an extra REX.W in our encoding, but I think that's
fine.

llvm-svn: 275427

8 years ago[X86] Don't mark addressing mode operands as "outs". NFC-ish.
Ahmed Bougacha [Thu, 14 Jul 2016 14:53:17 +0000 (14:53 +0000)]
[X86] Don't mark addressing mode operands as "outs". NFC-ish.

Nothing in-tree can tell the difference, but it's incorrect: the
addressing mode registers aren't what's defined.

llvm-svn: 275426

8 years ago[TableGen] Autobrief-ize Record. NFC.
Ahmed Bougacha [Thu, 14 Jul 2016 14:53:14 +0000 (14:53 +0000)]
[TableGen] Autobrief-ize Record. NFC.

llvm-svn: 275425

8 years ago[TableGen] Cleanup Record comments. NFC.
Ahmed Bougacha [Thu, 14 Jul 2016 14:53:11 +0000 (14:53 +0000)]
[TableGen] Cleanup Record comments. NFC.

LLVM doesn't use exceptions anymore.
Also remove the implementation comments. Some of them diverged.

llvm-svn: 275424

8 years ago[GlobalISel] Fix #include ordering/spacing. NFC.
Ahmed Bougacha [Thu, 14 Jul 2016 14:52:55 +0000 (14:52 +0000)]
[GlobalISel] Fix #include ordering/spacing. NFC.

llvm-svn: 275423

8 years ago[AMDGPU] Assembler: fix row_bcast parsing
Sam Kolton [Thu, 14 Jul 2016 14:50:35 +0000 (14:50 +0000)]
[AMDGPU] Assembler: fix row_bcast parsing

Summary: This change fix bug 28538

Reviewers: tstellarAMD, vpykhtin

Subscribers: arsenm, kzhuravl

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

llvm-svn: 275422

8 years agoRevert r275411, it cause PR28552.
Nico Weber [Thu, 14 Jul 2016 14:49:35 +0000 (14:49 +0000)]
Revert r275411, it cause PR28552.

llvm-svn: 275421

8 years agoRevert r275401, it caused PR28551.
Nico Weber [Thu, 14 Jul 2016 14:41:25 +0000 (14:41 +0000)]
Revert r275401, it caused PR28551.

llvm-svn: 275420

8 years ago[LV] Avoid unnecessary IV scalar-to-vector-to-scalar conversions
Matthew Simpson [Thu, 14 Jul 2016 14:36:06 +0000 (14:36 +0000)]
[LV] Avoid unnecessary IV scalar-to-vector-to-scalar conversions

This patch prevents increases in the number of instructions, pre-instcombine,
due to induction variable scalarization. An increase in instructions can lead
to an increase in the compile-time required to simplify the induction
variables. We now maintain a new map for scalarized induction variables to
prevent us from converting between the scalar and vector forms.

This patch should resolve compile-time regressions seen after r274627.

llvm-svn: 275419

8 years agoGPGPU: Use a tile size of 32 by default
Tobias Grosser [Thu, 14 Jul 2016 14:14:02 +0000 (14:14 +0000)]
GPGPU: Use a tile size of 32 by default

The tile size was previously uninitialized. As a result, it was often zero (aka.
no tiling), which is not what we want in general. More importantly, there was
the risk for arbitrary tile sizes to be choosen, which we did not observe, but
which still is highly problematic.

llvm-svn: 275418

8 years agoDiagnose taking address and reference binding of packed members
Roger Ferrer Ibanez [Thu, 14 Jul 2016 14:10:43 +0000 (14:10 +0000)]
Diagnose taking address and reference binding of packed members

This patch implements PR#22821.

Taking the address of a packed member is dangerous since the reduced
alignment of the pointee is lost. This can lead to memory alignment
faults in some architectures if the pointer value is dereferenced.

This change adds a new warning to clang emitted when taking the address
of a packed member. A packed member is either a field/data member
declared as attribute((packed)) or belonging to a struct/class
declared as such. The associated flag is -Waddress-of-packed-member.
Conversions (either implicit or via a valid casting) to pointer types
with lower or equal alignment requirements (e.g. void* or char*)
silence the warning.

This change also adds a new error diagnostic when the user attempts to
bind a reference to a packed member, regardless of the alignment.

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

llvm-svn: 275417

8 years agoRemoving more :option: tags that we do not have corresponding .. option directives...
Aaron Ballman [Thu, 14 Jul 2016 14:07:37 +0000 (14:07 +0000)]
Removing more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15195/steps/docs-clang-html/logs/stdio).

llvm-svn: 275416

8 years agoThe test added in r275267 does not work on read-only checkouts because of the use...
Pierre Gousseau [Thu, 14 Jul 2016 13:58:27 +0000 (13:58 +0000)]
The test added in r275267 does not work on read-only checkouts because of the use of touch -m -t.
Following Tom Rybka suggestion, the test files are now copied to a temporary directory first.

llvm-svn: 275415

8 years agoTeach fast isel calls and rets about stdcall.
Nico Weber [Thu, 14 Jul 2016 13:54:26 +0000 (13:54 +0000)]
Teach fast isel calls and rets about stdcall.

stdcall is callee-pop like thiscall, so the thiscall changes already did most
of the work for this.  This change only opts stdcall in and adds tests.

llvm-svn: 275414

8 years ago[X86][AVX] Added an additional vperm2f128 memory folding test
Simon Pilgrim [Thu, 14 Jul 2016 13:40:53 +0000 (13:40 +0000)]
[X86][AVX] Added an additional vperm2f128 memory folding test

llvm-svn: 275413

8 years agoRemove trailing whitespace.
Simon Pilgrim [Thu, 14 Jul 2016 13:29:23 +0000 (13:29 +0000)]
Remove trailing whitespace.

llvm-svn: 275412

8 years ago[X86][AVX2] Allow VPERMPD/VPERMQ shuffles to call combineShuffle
Simon Pilgrim [Thu, 14 Jul 2016 13:28:43 +0000 (13:28 +0000)]
[X86][AVX2] Allow VPERMPD/VPERMQ shuffles to call combineShuffle

This improves the situation discussed in D19228 where we were forcing VPERMPD/VPERMQ where VPERM2F128/VPERM2I128 would have been better.

llvm-svn: 275411

8 years ago[mips] SelectionDAGISel subclasses now follow the optimization level.
Daniel Sanders [Thu, 14 Jul 2016 13:25:22 +0000 (13:25 +0000)]
[mips] SelectionDAGISel subclasses now follow the optimization level.

Summary:
It was recently discovered that, for Mips's SelectionDAGISel subclasses,
all optimization levels caused SelectionDAGISel to behave like -O2.

This change adds the necessary plumbing to initialize the optimization level.

Reviewers: andrew.w.kaylor

Subscribers: andrew.w.kaylor, sdardis, dean, llvm-commits, vradosavljevic, petarj, qcolombet, probinson, dsanders

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

llvm-svn: 275410

8 years agoUpgrade all the .arcconfigs to https.
Benjamin Kramer [Thu, 14 Jul 2016 13:15:37 +0000 (13:15 +0000)]
Upgrade all the .arcconfigs to https.

llvm-svn: 275409

8 years agoSpeculatively fix the sphinx build, which does not think the original code was valid...
Aaron Ballman [Thu, 14 Jul 2016 13:08:16 +0000 (13:08 +0000)]
Speculatively fix the sphinx build, which does not think the original code was valid nasm (lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11854/steps/docs-llvm-html/logs/stdio).

llvm-svn: 275408

8 years agoThis is a malformed :option: tag -- we don't have an option directive that matches...
Aaron Ballman [Thu, 14 Jul 2016 13:01:00 +0000 (13:01 +0000)]
This is a malformed :option: tag -- we don't have an option directive that matches it, so turning it actual text instead of a markup tag. This will hopefully fix the clang docs build (lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15194/steps/docs-clang-html/logs/stdio)

llvm-svn: 275407

8 years ago[X86][AVX] Add support for narrowing 128-bit+ shuffle mask elements to 64-bits to...
Simon Pilgrim [Thu, 14 Jul 2016 12:58:04 +0000 (12:58 +0000)]
[X86][AVX] Add support for narrowing 128-bit+ shuffle mask elements to 64-bits to allow combining

Primarily this is to allow blend with zero instead of having to use vperm2f128, but we can use this in the future to deal with AVX512 cases where we need to keep the original element size to correctly fold masked operations.

llvm-svn: 275406