platform/upstream/llvm.git
8 years agoFix an issue where fast math flags were dropped during scalarization.
Owen Anderson [Tue, 1 Mar 2016 19:35:52 +0000 (19:35 +0000)]
Fix an issue where fast math flags were dropped during scalarization.

Most portions of InstCombine properly propagate fast math flags, but
apparently the vector scalarization section was overlooked.

llvm-svn: 262376

8 years ago[SCEVValidator] Remove redundant visit.
Michael Kruse [Tue, 1 Mar 2016 19:30:54 +0000 (19:30 +0000)]
[SCEVValidator] Remove redundant visit.

SCEVAddRecExpr::getStart() is synonymous to SCEVAddRecExpr::getOperand(0)
which will be visited in the following loop anyway.

llvm-svn: 262375

8 years ago[SCEV] Minor cleanup: rename method, C++11'ify; NFC
Sanjoy Das [Tue, 1 Mar 2016 19:28:01 +0000 (19:28 +0000)]
[SCEV] Minor cleanup: rename method, C++11'ify; NFC

llvm-svn: 262374

8 years ago[NVPTX] Use different, convergent MIs for convergent calls.
Justin Lebar [Tue, 1 Mar 2016 19:24:03 +0000 (19:24 +0000)]
[NVPTX] Use different, convergent MIs for convergent calls.

Summary:
Calls sometimes need to be convergent.  This is already handled at the
LLVM IR level, but it also needs to be handled at the MI level.

Ideally we'd propagate convergence from instructions, down through the
selection DAG, and into MIs.  But this is Hard, and would affect
optimizations in the SDNs -- right now only SDNs with two operands have
any flags at all.

Instead, here's a much simpler hack: Add new opcodes for NVPTX for
convergent calls, and generate these when lowering convergent LLVM
calls.

Reviewers: jholewinski

Subscribers: jholewinski, chandlerc, joker.eph, jhen, tra, llvm-commits

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

llvm-svn: 262373

8 years ago[NVPTX] Nix hack used to emit '{' and '}' for NVPTX calls.
Justin Lebar [Tue, 1 Mar 2016 19:24:00 +0000 (19:24 +0000)]
[NVPTX] Nix hack used to emit '{' and '}' for NVPTX calls.

Summary: Tablegen understands backslash as an escape char; that's sufficient.

Reviewers: jholewinski

Subscribers: llvm-commits, tra, jholewinski

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

llvm-svn: 262372

8 years ago[NVPTX] Reformat NVPTXInstrInfo.td, and add additional comments.
Justin Lebar [Tue, 1 Mar 2016 19:23:30 +0000 (19:23 +0000)]
[NVPTX] Reformat NVPTXInstrInfo.td, and add additional comments.

Summary:
Also simplify some of the embedded C++ logic.

No functional changes.

Reviewers: jholewinski

Subscribers: llvm-commits, tra, jholewinski

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

llvm-svn: 262371

8 years ago[X86] Elide references to _chkstk for dynamic allocas
David Majnemer [Tue, 1 Mar 2016 19:20:23 +0000 (19:20 +0000)]
[X86] Elide references to _chkstk for dynamic allocas

The _chkstk function is called by the compiler to probe the stack in an
order consistent with Windows' expectations.  However, it is possible to
elide the call to _chkstk and manually adjust the stack pointer if we
can prove that the allocation is fixed size and smaller than the probe
size.

This shrinks chrome.dll, chrome_child.dll and chrome.exe by a
cummulative ~133 KB.

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

llvm-svn: 262370

8 years ago[ELF] - More direct implementation of edata/etext
George Rimar [Tue, 1 Mar 2016 19:18:07 +0000 (19:18 +0000)]
[ELF] - More direct implementation of edata/etext

As was suggested in mails, this patch implements edata/etext
symbols in a more direct way.
It iterates through PT_LOADs.

Result seems to be the same and equal to gold output.

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

llvm-svn: 262369

8 years agoMove ObjectYAML code to a new library.
Rafael Espindola [Tue, 1 Mar 2016 19:15:06 +0000 (19:15 +0000)]
Move ObjectYAML code to a new library.

It is only ever used by obj2yaml and yaml2obj. No point in linking it
everywhere.

llvm-svn: 262368

8 years agofix function names; NFC
Sanjay Patel [Tue, 1 Mar 2016 19:14:09 +0000 (19:14 +0000)]
fix function names; NFC

llvm-svn: 262367

8 years ago[ELF] - do not create special symbols when creating relocatable output
George Rimar [Tue, 1 Mar 2016 19:12:35 +0000 (19:12 +0000)]
[ELF] - do not create special symbols when creating relocatable output

__start_/__end_ <section-name> symbols and other specials like:
preinit_array_start/end
init_array_start/end
fini_array_start/end

should not be created by linker when creating relocatable files.

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

llvm-svn: 262366

8 years ago[Verifier] Don't abort on invalid cleanuprets
David Majnemer [Tue, 1 Mar 2016 18:59:50 +0000 (18:59 +0000)]
[Verifier] Don't abort on invalid cleanuprets

Code in visitEHPadPredecessors assume a little too much about the
validity of a cleanupret with an invalid cleanuppad operand.

llvm-svn: 262364

8 years agoFix breakage caused by r262360.
Easwaran Raman [Tue, 1 Mar 2016 18:59:11 +0000 (18:59 +0000)]
Fix breakage caused by r262360.

llvm-svn: 262363

8 years agoAdd the beginnings of an update API for preserving MemorySSA
Daniel Berlin [Tue, 1 Mar 2016 18:46:54 +0000 (18:46 +0000)]
Add the beginnings of an update API for preserving MemorySSA

Summary:
This adds the beginning of an update API to preserve MemorySSA.  In particular,
this patch adds a way to remove memory SSA accesses when instructions are
deleted.

It also adds relevant unit testing infrastructure for MemorySSA's API.

(There is an actual user of this API, i will make that diff dependent on this one.  In practice, a ton of opt passes remove memory instructions, so it's hopefully an obviously useful API :P)

Reviewers: hfinkel, reames, george.burgess.iv

Subscribers: llvm-commits

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

llvm-svn: 262362

8 years ago[DebugInfo] Dump CIE augmentation data as a list of hex bytes
Simon Atanasyan [Tue, 1 Mar 2016 18:38:05 +0000 (18:38 +0000)]
[DebugInfo] Dump CIE augmentation data as a list of hex bytes

CIE augmentation data might contain non-printable characters.
The patch prints the data as a list of hex bytes.

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

llvm-svn: 262361

8 years agoMetadata support for profile summary.
Easwaran Raman [Tue, 1 Mar 2016 18:30:58 +0000 (18:30 +0000)]
Metadata support for profile summary.

This adds support to convert ProfileSummary object to Metadata and create a
ProfileSummary object from metadata. This would allow attaching profile summary
information to Module allowing optimization passes to use it.

llvm-svn: 262360

8 years ago[PPC64][VSX] Add short, char, and bool data type for vec_vsx_ld and vec_vsx_st intrinsics
Kit Barton [Tue, 1 Mar 2016 18:11:28 +0000 (18:11 +0000)]
[PPC64][VSX] Add short, char, and bool data type for vec_vsx_ld and vec_vsx_st intrinsics

Issue: https://llvm.org/bugs/show_bug.cgi?id=26720

Fix compile error when building ffmpeg for PowerPC64LE because of some
vec_vsx_ld/vec_vsx_st intrinsics are not supported by current clang.

New added intrinsics:

(vector) {signed|unsigned} {short|char} vec_vsx_ld: (total: 8)
bool vec_vsx_ld: (total: 1)
(vector) {signed|unsigned} {short|char} vec_vsx_st: (total: 8)
bool vec_vsx_st: (total: 1)
Total: 18 intrinsics

Phabricator: http://reviews.llvm.org/D17637
llvm-svn: 262359

8 years agoDAGCombiner: Turn extract of bitcasted integer into truncate
Matt Arsenault [Tue, 1 Mar 2016 18:01:37 +0000 (18:01 +0000)]
DAGCombiner: Turn extract of bitcasted integer into truncate

This reduces the number of bitcast nodes and generally cleans up the
DAG when bitcasting between integers and vectors everywhere.

llvm-svn: 262358

8 years agoAdd isScalarInteger helper to EVT/MVT
Matt Arsenault [Tue, 1 Mar 2016 18:01:28 +0000 (18:01 +0000)]
Add isScalarInteger helper to EVT/MVT

llvm-svn: 262357

8 years agoAMDGPU/SI: Implement DS_PERMUTE/DS_BPERMUTE Instruction Definitions and Intrinsics
Changpeng Fang [Tue, 1 Mar 2016 17:51:23 +0000 (17:51 +0000)]
AMDGPU/SI: Implement DS_PERMUTE/DS_BPERMUTE Instruction Definitions and Intrinsics

Summary:
  This patch impleemnts DS_PERMUTE/DS_BPERMUTE instruction definitions and intrinsics,
which are new since VI.

Reviewers: tstellarAMD, arsenm

Subscribers: llvm-commits, arsenm

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

llvm-svn: 262356

8 years ago[CLANG][AVX512][BUILTIN] Adding PSRL{DI|QI}{128|256|512} builtin
Michael Zuckerman [Tue, 1 Mar 2016 17:49:03 +0000 (17:49 +0000)]
[CLANG][AVX512][BUILTIN] Adding PSRL{DI|QI}{128|256|512} builtin

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

llvm-svn: 262355

8 years ago[libFuzzer] remove FuzzerSanitizerOptions.cpp
Kostya Serebryany [Tue, 1 Mar 2016 17:46:32 +0000 (17:46 +0000)]
[libFuzzer] remove FuzzerSanitizerOptions.cpp

llvm-svn: 262354

8 years ago[LLVM][AVX512] PSRL{DI|QI} Change imm8 to int
Michael Zuckerman [Tue, 1 Mar 2016 17:46:32 +0000 (17:46 +0000)]
[LLVM][AVX512] PSRL{DI|QI} Change imm8 to int
Differential Revision: http://reviews.llvm.org/D17713

llvm-svn: 262353

8 years ago[X86] Check that attribute parameters match for tail calls (PR26590)
Hans Wennborg [Tue, 1 Mar 2016 17:45:23 +0000 (17:45 +0000)]
[X86] Check that attribute parameters match for tail calls (PR26590)

In the code below on 32-bit targets, x would previously get forwarded to g()
without sign-extension to 32 bits as required by the parameter attribute.

  void g(signed short);
  void f(unsigned short x) {
    g(x);
  }

llvm-svn: 262352

8 years agofix documentation comments; NFC
Sanjay Patel [Tue, 1 Mar 2016 17:25:35 +0000 (17:25 +0000)]
fix documentation comments; NFC

llvm-svn: 262351

8 years agoExplicitly select IAS in new embed-bitcode.c test.
Daniel Sanders [Tue, 1 Mar 2016 17:15:11 +0000 (17:15 +0000)]
Explicitly select IAS in new embed-bitcode.c test.

This should fix clang-cmake-mips builder since MIPS does not have IAS enabled
by default (yet).

llvm-svn: 262350

8 years agoRevert "calculate builtin_object_size if argument is a removable pointer"
Petar Jovanovic [Tue, 1 Mar 2016 16:50:08 +0000 (16:50 +0000)]
Revert "calculate builtin_object_size if argument is a removable pointer"

Revert r262337 as "check-llvm ubsan" step failed on
sanitizer-x86_64-linux-fast buildbot.

llvm-svn: 262349

8 years ago[ELF] - Create _DYNAMIC symbol for dynamic output
George Rimar [Tue, 1 Mar 2016 16:23:13 +0000 (16:23 +0000)]
[ELF] - Create _DYNAMIC symbol for dynamic output

lld needs to provide _DYNAMIC symbol when creating a shared library
both bfd and gold do that.

This should fix the https://llvm.org/bugs/show_bug.cgi?id=26732

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

llvm-svn: 262348

8 years agofunction names start with a lowercase letter; NFC
Sanjay Patel [Tue, 1 Mar 2016 16:17:48 +0000 (16:17 +0000)]
function names start with a lowercase letter; NFC

llvm-svn: 262347

8 years ago[AMDGPU] Remove unused disassembler code.
Nikolay Haustov [Tue, 1 Mar 2016 16:02:40 +0000 (16:02 +0000)]
[AMDGPU] Remove unused disassembler code.

llvm-svn: 262346

8 years agoFix BUILD_SHARED_LIBS build.
Rafael Espindola [Tue, 1 Mar 2016 15:56:53 +0000 (15:56 +0000)]
Fix BUILD_SHARED_LIBS build.

llvm-svn: 262345

8 years agoRefactor duplicated code for linking with pthread.
Rafael Espindola [Tue, 1 Mar 2016 15:54:40 +0000 (15:54 +0000)]
Refactor duplicated code for linking with pthread.

llvm-svn: 262344

8 years agotsan: describe heap/data locations in Go
Dmitry Vyukov [Tue, 1 Mar 2016 15:38:12 +0000 (15:38 +0000)]
tsan: describe heap/data locations in Go

llvm-svn: 262343

8 years agosanitizer_common: silence compiler warning
Dmitry Vyukov [Tue, 1 Mar 2016 15:36:42 +0000 (15:36 +0000)]
sanitizer_common: silence compiler warning

llvm-svn: 262342

8 years ago[cmake] Add a few more compiler-rt check-* targets for EXTERNAL_COMPILER_RT
Filipe Cabecinhas [Tue, 1 Mar 2016 15:33:52 +0000 (15:33 +0000)]
[cmake] Add a few more compiler-rt check-* targets for EXTERNAL_COMPILER_RT

llvm-svn: 262341

8 years ago[cmake] Try to appease the buildbots.
Filipe Cabecinhas [Tue, 1 Mar 2016 15:07:19 +0000 (15:07 +0000)]
[cmake] Try to appease the buildbots.

llvm-svn: 262340

8 years agoDWARFExpression: Don't resolve load address in DW_OP_plus
Tamas Berghammer [Tue, 1 Mar 2016 15:01:05 +0000 (15:01 +0000)]
DWARFExpression: Don't resolve load address in DW_OP_plus

If we have a TargetLoadAddress on the top of the DWARF stack then a
DW_OP_plus or a DW_OP_plus_ucons sholudn't dereference (resolve) it
and then add the value to the dereferenced value but it should offset
the load address by the specified constant.

llvm-svn: 262339

8 years ago[AMDGPU] Fix build warnings.
Nikolay Haustov [Tue, 1 Mar 2016 14:50:59 +0000 (14:50 +0000)]
[AMDGPU] Fix build warnings.

llvm-svn: 262338

8 years agocalculate builtin_object_size if argument is a removable pointer
Petar Jovanovic [Tue, 1 Mar 2016 14:39:55 +0000 (14:39 +0000)]
calculate builtin_object_size if argument is a removable pointer

This patch fixes calculating correct value for builtin_object_size function
when pointer is used only in builtin_object_size function call and never
after that.

Patch by Strahinja Petrovic.

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

llvm-svn: 262337

8 years ago[cmake] Pass through the cmake_3_2_USES_TERMINAL variable so we get progress bars...
Filipe Cabecinhas [Tue, 1 Mar 2016 14:10:38 +0000 (14:10 +0000)]
[cmake] Pass through the cmake_3_2_USES_TERMINAL variable so we get progress bars on an external compiler-rt build

llvm-svn: 262336

8 years ago[cmake] Use CMake's USES_TERMINAL for the test targets.
Filipe Cabecinhas [Tue, 1 Mar 2016 14:08:18 +0000 (14:08 +0000)]
[cmake] Use CMake's USES_TERMINAL for the test targets.

llvm-svn: 262335

8 years ago[cmake] Fallback to LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR if COMPILER_RT_SRC_ROOT...
Filipe Cabecinhas [Tue, 1 Mar 2016 14:08:13 +0000 (14:08 +0000)]
[cmake] Fallback to LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR if COMPILER_RT_SRC_ROOT doesn't exist.

llvm-svn: 262334

8 years agoSlightly improve logging in LLGS tests
Pavel Labath [Tue, 1 Mar 2016 14:04:41 +0000 (14:04 +0000)]
Slightly improve logging in LLGS tests

we're sometimes getting an exception here, and I want to see why...

llvm-svn: 262333

8 years ago[AMDGPU] Disassembler code refactored + error messages.
Nikolay Haustov [Tue, 1 Mar 2016 13:57:29 +0000 (13:57 +0000)]
[AMDGPU] Disassembler code refactored + error messages.

Idea behind this change is to make code shorter and as much common for all targets as possible. Let's even accept more code than is valid for a particular target, leaving it for the assembler to sort out.

64bit instructions decoding added.

Error\warning messages on unrecognized instructions operands added, InstPrinter allowed to print invalid operands helping to find invalid/unsupported code.

The change is massive and hard to compare with previous version, so it makes sense just to take a look on the new version. As a bonus, with a few TD changes following, it disassembles the majority of instructions. Currently it fully disassembles >300K binary source of some blas kernel.

Previous TODOs were saved whenever possible.

Patch by: Valery Pykhtin

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

llvm-svn: 262332

8 years agoProduce PT_NOTE program headers.
Rafael Espindola [Tue, 1 Mar 2016 13:23:29 +0000 (13:23 +0000)]
Produce PT_NOTE program headers.

llvm-svn: 262331

8 years ago[LTO] Fix error reporting from lto_module_create_in_local_context()
Petr Pavlu [Tue, 1 Mar 2016 13:13:49 +0000 (13:13 +0000)]
[LTO] Fix error reporting from lto_module_create_in_local_context()

Function lto_module_create_in_local_context() would previously
rely on the default LLVMContext being created for it by
LTOModule::makeLTOModule(). This context exits the program on
error and is not arranged to update sLastStringError in
tools/lto/lto.cpp.

Function lto_module_create_in_local_context() now creates an
LLVMContext by itself, sets it up correctly to its needs and then
passes it to LTOModule::createInLocalContext() which takes
ownership of the context and keeps it present for the lifetime of
the returned LTOModule.

Function LTOModule::makeLTOModule() is modified to take a
reference to LLVMContext (instead of a pointer) and no longer
creates a default context when nullptr is passed to it. Method
LTOModule::createInContext() that takes a pointer to LLVMContext
is removed because it allows to pass a nullptr to it. Instead
LTOModule::createFromBuffer() (that takes a reference to
LLVMContext) should be used.

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

llvm-svn: 262330

8 years agoFormatTests: Update libdeps corresponding to r262323.
NAKAMURA Takumi [Tue, 1 Mar 2016 13:11:36 +0000 (13:11 +0000)]
FormatTests: Update libdeps corresponding to r262323.

llvm-svn: 262329

8 years agoTrack assumptions and restrictions separatly
Johannes Doerfert [Tue, 1 Mar 2016 13:06:28 +0000 (13:06 +0000)]
Track assumptions and restrictions separatly

  In order to speed up compile time and to avoid random timeouts we now
  separately track assumptions and restrictions. In this context
  assumptions describe parameter valuations we need and restrictions
  describe parameter valuations we do not allow. During AST generation
  we create a runtime check for both, whereas the one for the
  restrictions is negated before a conjunction is build.

  Except the In-Bounds assumptions we currently only track restrictions.

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

llvm-svn: 262328

8 years ago[FIX] Prevent compile time problems due to complex invariant loads
Johannes Doerfert [Tue, 1 Mar 2016 13:05:14 +0000 (13:05 +0000)]
[FIX] Prevent compile time problems due to complex invariant loads

  This cures the symptoms we see in h264 of SPEC2006 but not the cause.

llvm-svn: 262327

8 years ago[CLANG][AVX512][BUILTIN] Adding PSRLV builtin
Michael Zuckerman [Tue, 1 Mar 2016 13:03:45 +0000 (13:03 +0000)]
[CLANG][AVX512][BUILTIN] Adding PSRLV builtin

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

llvm-svn: 262326

8 years agoFix test breakage on windows where the default std is c++11 by forcing c++03 in the...
Manuel Klimek [Tue, 1 Mar 2016 12:53:18 +0000 (12:53 +0000)]
Fix test breakage on windows where the default std is c++11 by forcing c++03 in the test.

llvm-svn: 262325

8 years agoFix DLL build by adding required dependency.
Manuel Klimek [Tue, 1 Mar 2016 12:47:30 +0000 (12:47 +0000)]
Fix DLL build by adding required dependency.

llvm-svn: 262324

8 years agoAdd functions to apply replacements and reformat them.
Manuel Klimek [Tue, 1 Mar 2016 12:37:30 +0000 (12:37 +0000)]
Add functions to apply replacements and reformat them.

This is a commonly useful feature to have, and we have implemented it
multiple times with different kinds of bugs. This implementation
centralizes the idea in a set of functions that we can then use from the various
tools.

Reverts r262234, which is a revert of r262232, and puts the functions
into FOrmat.h, as they are closely coupled to clang-format, and we
otherwise introduce a cyclic dependency between libFormat and
libTooling.

Patch by Eric Liu.

llvm-svn: 262323

8 years agoFix warning in NSDictionary.cpp
Pavel Labath [Tue, 1 Mar 2016 11:40:47 +0000 (11:40 +0000)]
Fix warning in NSDictionary.cpp

llvm-svn: 262322

8 years ago[CLANG] [AVX512] [BUILTIN] Adding PSRA{Q|D|QI|DI}{128|256|512} builtin
Michael Zuckerman [Tue, 1 Mar 2016 11:38:16 +0000 (11:38 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding PSRA{Q|D|QI|DI}{128|256|512} builtin

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

llvm-svn: 262321

8 years ago[AVX512][PSRAQ][PSRAD] Change imm8 to int.
Michael Zuckerman [Tue, 1 Mar 2016 11:36:23 +0000 (11:36 +0000)]
[AVX512][PSRAQ][PSRAD] Change imm8 to int.

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

llvm-svn: 262320

8 years agoDisallow generating vzeroupper before return instruction (iret) in interrupt handler...
Amjad Aboud [Tue, 1 Mar 2016 11:32:03 +0000 (11:32 +0000)]
Disallow generating vzeroupper before return instruction (iret) in interrupt handler function.
This resolves https://llvm.org/bugs/show_bug.cgi?id=26412

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

llvm-svn: 262319

8 years agoOptionally demote fatal errors to non-fatal errors.
Manuel Klimek [Tue, 1 Mar 2016 10:56:19 +0000 (10:56 +0000)]
Optionally demote fatal errors to non-fatal errors.

This behavior is enabled when the new CXTranslationUnit_KeepGoing
option is passed to clang_parseTranslationUnit{,2}. It is geared
towards use by IDEs and similar consumers of the clang-c API where
fatal errors may arise when parsing incomplete code mid-edit, or
when include paths are not properly configured yet. In such situations
one still wants to get as much information as possible about a TU.
Previously, the semantic analysis would not instantiate templates
or report additional fatal errors after the first fatal error was
encountered.

Fixes PR24268.

Patch by Milian Wolff.

llvm-svn: 262318

8 years ago[MC][YAML] Rangify the loop. NFC
Simon Atanasyan [Tue, 1 Mar 2016 10:11:27 +0000 (10:11 +0000)]
[MC][YAML] Rangify the loop. NFC

llvm-svn: 262317

8 years ago[mips] Promote the result of SETCC nodes to GPR width.
Vasileios Kalintiris [Tue, 1 Mar 2016 10:08:01 +0000 (10:08 +0000)]
[mips] Promote the result of SETCC nodes to GPR width.

Summary:
This patch modifies the existing comparison, branch, conditional-move
and select patterns, and adds new ones where needed. Also, the updated
SLT{u,i,iu} set of instructions generate a GPR width result.

The majority of the code changes in the Mips back-end fix the wrong
assumption that the result of SETCC nodes always produce an i32 value.
The changes in the common code path account for the fact that in 64-bit
MIPS targets, i1 is promoted to i32 instead of i64.

Reviewers: dsanders

Subscribers: dsanders, llvm-commits

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

llvm-svn: 262316

8 years ago[ELF] use of already declared reference instead of indirect access to fields. NFC.
George Rimar [Tue, 1 Mar 2016 08:46:03 +0000 (08:46 +0000)]
[ELF] use of already declared reference instead of indirect access to fields. NFC.

llvm-svn: 262315

8 years ago[TableGen] AsmMatcher: Skip optional operands in the midle of instruction if it is...
Nikolay Haustov [Tue, 1 Mar 2016 08:34:43 +0000 (08:34 +0000)]
[TableGen] AsmMatcher: Skip optional operands in the midle of instruction if it is not present

Previosy, if actual instruction have one of optional operands then other optional operands listed before this also should be presented.
For example instruction v_fract_f32 v0, v1, mul:2 have one optional operand - OMod and do not have optional operand clamp. Previously this was not allowed because clamp is listed before omod in AsmString:

string AsmString = "v_fract_f32$vdst, $src0_modifiers$clamp$omod";
Making this work required some hacks (both OMod and Clamp match classes have same PredicateMethod).

Now, if MatchInstructionImpl meets formal optional operand that is not presented in actual instruction it skips this formal operand and tries to match current actual operand with next formal.

Patch by: Sam Kolton

Review: http://reviews.llvm.org/D17568

[AMDGPU] Assembler: Check immediate types for several optional operands in predicate methods
With this change you should place optional operands in order specified by asm string:

clamp -> omod
offset -> glc -> slc -> tfe
Fixes for several tests.
Depends on D17568

Patch by: Sam Kolton

Review: http://reviews.llvm.org/D17644
llvm-svn: 262314

8 years agoAsmParser: Fix nested .irp/.irpc
Nikolay Haustov [Tue, 1 Mar 2016 08:18:28 +0000 (08:18 +0000)]
AsmParser: Fix nested .irp/.irpc

Count .irp/.irpc in parseMacroLikeBody similar to .rept
Update tests.

Review: http://reviews.llvm.org/D17707
llvm-svn: 262313

8 years ago[X86] Centralize the masking of TSFlags with FormMask into a variable earlier so...
Craig Topper [Tue, 1 Mar 2016 07:15:59 +0000 (07:15 +0000)]
[X86] Centralize the masking of TSFlags with FormMask into a variable earlier so we can stop masking in multiple places. NFC

llvm-svn: 262312

8 years agoTest template instantiation of ns_consumed and ns_returns_retained.
John McCall [Tue, 1 Mar 2016 06:54:30 +0000 (06:54 +0000)]
Test template instantiation of ns_consumed and ns_returns_retained.

llvm-svn: 262311

8 years ago[X86] Localize a temporary variable into the cases its need in. NFC
Craig Topper [Tue, 1 Mar 2016 06:42:48 +0000 (06:42 +0000)]
[X86] Localize a temporary variable into the cases its need in. NFC

llvm-svn: 262310

8 years ago[X86] Be consistent about using pre/post increment/decrement in nearby code. NFC
Craig Topper [Tue, 1 Mar 2016 06:42:46 +0000 (06:42 +0000)]
[X86] Be consistent about using pre/post increment/decrement in nearby code. NFC

llvm-svn: 262309

8 years agoBetter comments for ExtParameterInfo.
John McCall [Tue, 1 Mar 2016 06:27:40 +0000 (06:27 +0000)]
Better comments for ExtParameterInfo.

llvm-svn: 262308

8 years ago[Compiler-rt][MIPS] Correct Dynamic Thread Vector offset for MIPS
Mohit K. Bhakkad [Tue, 1 Mar 2016 05:56:33 +0000 (05:56 +0000)]
[Compiler-rt][MIPS] Correct Dynamic Thread Vector offset for MIPS

Reviewers: samsonov

Subscribers: dsanders, jaydeep, sagar, llvm-commits

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

llvm-svn: 262303

8 years ago[Compiler-rt][MSan] fix param_tls_limit test for platforms where big arguments are...
Mohit K. Bhakkad [Tue, 1 Mar 2016 05:53:30 +0000 (05:53 +0000)]
[Compiler-rt][MSan] fix param_tls_limit test for platforms where big arguments are sliced in smaller ones

Reviewers: eugenis

Subscribers: dsanders, jaydeep, sagar, llvm-commits

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

llvm-svn: 262302

8 years ago[X86] Combine some initialization code with variable declaration and comments. NFC
Craig Topper [Tue, 1 Mar 2016 05:42:16 +0000 (05:42 +0000)]
[X86] Combine some initialization code with variable declaration and comments. NFC

llvm-svn: 262301

8 years agoUpdate the on-device arm specific code to match the API changes
Jason Molenda [Tue, 1 Mar 2016 05:34:05 +0000 (05:34 +0000)]
Update the on-device arm specific code to match the API changes
that happened in other parts of this file so it builds cleanly
for arm again.

llvm-svn: 262300

8 years agoLegalizeDAG: Use correct ptr type when expanding unaligned load/store
Matt Arsenault [Tue, 1 Mar 2016 05:13:35 +0000 (05:13 +0000)]
LegalizeDAG: Use correct ptr type when expanding unaligned load/store

This fixes regressions exposed in existing AMDGPU tests in a
future commit when all loads are custom lowered.

llvm-svn: 262299

8 years agoAMDGPU: Don't emit build_pair during udivrem legalization
Matt Arsenault [Tue, 1 Mar 2016 05:06:05 +0000 (05:06 +0000)]
AMDGPU: Don't emit build_pair during udivrem legalization

Technically you aren't supposed to emit these after type legalization
for some reason, and we use vector extracts of bitcasted integers
as the canonical way to do this.

llvm-svn: 262298

8 years agoAMDGPU: Don't use estimated stack size when we know the real stack size
Matt Arsenault [Tue, 1 Mar 2016 04:58:20 +0000 (04:58 +0000)]
AMDGPU: Don't use estimated stack size when we know the real stack size

llvm-svn: 262297

8 years agoAMDGPU: Set HasExtractBitInsn
Matt Arsenault [Tue, 1 Mar 2016 04:58:17 +0000 (04:58 +0000)]
AMDGPU: Set HasExtractBitInsn

This currently does not have the control over the bitwidth,
and there are missing optimizations to reduce the integer to
32-bit if it can be.

But in most situations we do want the sinking to occur.

llvm-svn: 262296

8 years ago[test] After r262290 reducing stack usage, try re-enabling asan on the related test.
Argyrios Kyrtzidis [Tue, 1 Mar 2016 04:40:20 +0000 (04:40 +0000)]
[test] After r262290 reducing stack usage, try re-enabling asan on the related test.

llvm-svn: 262295

8 years ago[WinEH] Allocate the registration node before the catch objects
David Majnemer [Tue, 1 Mar 2016 04:30:16 +0000 (04:30 +0000)]
[WinEH] Allocate the registration node before the catch objects

The CatchObjOffset is relative to the end of the EH registration node
for 32-bit x86 WinEH targets.  A special sentinel value, 0, is used to
indicate that no catch object should be initialized.

This means that a catch object allocated immediately before the
registration node would be assigned a CatchObjOffset of 0, leading the
runtime to believe that a catch object should not be initialized.

To handle this, allocate the registration node prior to any other frame
object.  This will ensure that catch objects will not be allocated
before the registration node.

This fixes PR26757.

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

llvm-svn: 262294

8 years agoclang-format: Correctly apply wrap before multi-line RHS rule to
Daniel Jasper [Tue, 1 Mar 2016 04:19:59 +0000 (04:19 +0000)]
clang-format: Correctly apply wrap before multi-line RHS rule to
ternary expressions.

Before:
  return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb +
     cccccccccccccccc;

After:
  return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
     aaaaa :
     bbbbbbbbbbbbbbb + cccccccccccccccc;

llvm-svn: 262293

8 years agoclang-format: Increase the penalty for breaking between array subscripts.
Daniel Jasper [Tue, 1 Mar 2016 04:19:55 +0000 (04:19 +0000)]
clang-format: Increase the penalty for breaking between array subscripts.

Before:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa]
                                    [a].aaaaaaaaaaaaaaaaaaaaaa();

After:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa][a]
      .aaaaaaaaaaaaaaaaaaaaaa();

llvm-svn: 262292

8 years agoclang-format: [JS] Support quoted object literal keys.
Daniel Jasper [Tue, 1 Mar 2016 04:19:47 +0000 (04:19 +0000)]
clang-format: [JS] Support quoted object literal keys.

Before:
  var x = {
    a: a,
    b: b, 'c': c,
  };

After:
  var x = {
    a: a,
    b: b,
    'c': c,
  };

llvm-svn: 262291

8 years ago[index] Fix issue where data visitation was disabled with C++ operator call expressio...
Argyrios Kyrtzidis [Tue, 1 Mar 2016 02:46:32 +0000 (02:46 +0000)]
[index] Fix issue where data visitation was disabled with C++ operator call expressions, during indexing.

llvm-svn: 262290

8 years agoFix the template instantiation of ExtParameterInfos; tests to follow.
John McCall [Tue, 1 Mar 2016 02:09:25 +0000 (02:09 +0000)]
Fix the template instantiation of ExtParameterInfos; tests to follow.

llvm-svn: 262289

8 years agoAdd an llvm_unreachable back to the autogeneration of this covered switch.
John McCall [Tue, 1 Mar 2016 02:09:20 +0000 (02:09 +0000)]
Add an llvm_unreachable back to the autogeneration of this covered switch.

llvm-svn: 262288

8 years agoFix MSVC build failure in source/Target/Process.cpp.
Eugene Zelenko [Tue, 1 Mar 2016 02:08:37 +0000 (02:08 +0000)]
Fix MSVC build failure in source/Target/Process.cpp.

Will be good idea to introduce macro/constexpr for NULL thread_result_t.

llvm-svn: 262287

8 years agoFix the testcase in r262282
Steven Wu [Tue, 1 Mar 2016 01:24:54 +0000 (01:24 +0000)]
Fix the testcase in r262282

-bitcode_bundle is only passed to the darwin ld64 linker and it is only
implemented there. Remove the check on the linker flag.

llvm-svn: 262286

8 years agoMake test more robust.
Sean Silva [Tue, 1 Mar 2016 01:20:15 +0000 (01:20 +0000)]
Make test more robust.

Really all these tests are checking is that we find a file path. The
behavior when we don't find one will have `"ps4-ld"` in it. We just need
a path separator to know that a path has been found.

The root cause of the flakiness of these tests is the same on Windows
and non-Windows: setting the PATH environment variable is not sufficient
to guarantee that a particular path is looked up first.
Driver::GetProgramPath checks some paths before deferring to PATH
(in particular, the directory containing the clang binary itself).

I initally ran into this on Windows when putting a PS4 linker in
build-dir/bin/ps4-ld for testing.
After digging for a while thinking that it was some windows path search
oddity (the Windows SearchPathW documentation indicates that its
behavior varies depending on a registry setting...).
I eventually tried reproducing the issue on Mac and to my surprise found
the same issue.
Ultimately I traced it down to the extra lookups in
Driver::GetProgramPath.

llvm-svn: 262285

8 years ago[Verifier] Diagnose when unwinding out of cycles of blocks
David Majnemer [Tue, 1 Mar 2016 01:19:05 +0000 (01:19 +0000)]
[Verifier] Diagnose when unwinding out of cycles of blocks

Generally speaking, this can only happen with unreachable code.
However, neglecting to check for this condition would lead us to loop
forever.

llvm-svn: 262284

8 years ago[asan] Retry failed adb commands in android tests.
Evgeniy Stepanov [Tue, 1 Mar 2016 01:16:03 +0000 (01:16 +0000)]
[asan] Retry failed adb commands in android tests.

Add limited retries for push/pull adb commands in android tests.
May help with the adb flakiness.

llvm-svn: 262283

8 years agoIntroduce -fembed-bitcode driver option
Steven Wu [Tue, 1 Mar 2016 01:07:58 +0000 (01:07 +0000)]
Introduce -fembed-bitcode driver option

Summary:
This is the clang driver part of the change to embedded bitcode. This
includes:
1. -fembed-bitcode option which breaks down the compilation into two
stages. The first stage emits optimized bitcode and the second stage
compiles bitcode into object file.
2. -fembed-bitcode-marker option which doesn't really break down to
two stages to speedup the compilation flow.
3. pass the correct linker flag to darwin linker if tool chains supports
embedded bitcode.

Reviewers: rsmith, thakis

Subscribers: thakis, cfe-commits

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

llvm-svn: 262282

8 years agoFix Clang-tidy modernize-use-nullptr warnings in some files in source/Target/Process...
Eugene Zelenko [Tue, 1 Mar 2016 00:55:51 +0000 (00:55 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Target/Process.cpp; other minor fixes.

llvm-svn: 262281

8 years ago[LLE] Add testcase for the fix in r262267
Adam Nemet [Tue, 1 Mar 2016 00:50:14 +0000 (00:50 +0000)]
[LLE] Add testcase for the fix in r262267

llvm-svn: 262280

8 years ago[LAA] Add missing debug output
Adam Nemet [Tue, 1 Mar 2016 00:50:08 +0000 (00:50 +0000)]
[LAA] Add missing debug output

llvm-svn: 262279

8 years agoGeneralize the consumed-parameter array on FunctionProtoType
John McCall [Tue, 1 Mar 2016 00:49:02 +0000 (00:49 +0000)]
Generalize the consumed-parameter array on FunctionProtoType
to allow arbitrary data to be associated with a parameter.

Also, fix a bug where we apparently haven't been serializing
this information for the last N years.

llvm-svn: 262278

8 years ago[analyzer] Update CheckObjCDealloc diagnostic for missing -dealloc.
Devin Coughlin [Tue, 1 Mar 2016 00:39:04 +0000 (00:39 +0000)]
[analyzer] Update CheckObjCDealloc diagnostic for missing -dealloc.

Update the diagnostic for classes missing -dealloc to mention an instance
variable that needs to be released.

llvm-svn: 262277

8 years ago[asan] Fix new[]/delete mismatch in tests.
Evgeniy Stepanov [Tue, 1 Mar 2016 00:38:39 +0000 (00:38 +0000)]
[asan] Fix new[]/delete mismatch in tests.

This code is actually never executed because all RUN lines trigger an
earlier heap-use-after-free, but there is still a compiler warning.

llvm-svn: 262276

8 years agoInfrastructure improvements to Clang attribute TableGen.
John McCall [Tue, 1 Mar 2016 00:18:05 +0000 (00:18 +0000)]
Infrastructure improvements to Clang attribute TableGen.

This should make it easier to add new Attr subclasses.

llvm-svn: 262275

8 years ago[x86, InstCombine] transform more x86 masked loads to LLVM intrinsics
Sanjay Patel [Mon, 29 Feb 2016 23:59:00 +0000 (23:59 +0000)]
[x86, InstCombine] transform more x86 masked loads to LLVM intrinsics

Continuation of:
http://reviews.llvm.org/rL262269

llvm-svn: 262273

8 years ago[analyzer] Teach CheckObjCDealloc about Block_release().
Devin Coughlin [Mon, 29 Feb 2016 23:57:10 +0000 (23:57 +0000)]
[analyzer] Teach CheckObjCDealloc about Block_release().

It now treats Block_release(b) as a release in addition to [b release].

llvm-svn: 262272

8 years agoWhen 'help' cannot find a command, produce additional help text that also points...
Enrico Granata [Mon, 29 Feb 2016 23:22:53 +0000 (23:22 +0000)]
When 'help' cannot find a command, produce additional help text that also points the user to the apropos and type lookup commands

This is useful in cases such as, e.g.

(lldb) help NSString
(the user meant type lookup)

or

(lldb) help kill
(the user is looking for process kill)

Fixes rdar://24868537

llvm-svn: 262271