platform/upstream/llvm.git
8 years agoRevert "Invariant start/end intrinsics overloaded for address space"
Anna Thomas [Thu, 21 Jul 2016 19:06:28 +0000 (19:06 +0000)]
Revert "Invariant start/end intrinsics overloaded for address space"

This reverts commit r276316.

llvm-svn: 276320

8 years ago[IndVars] Reflow oddly formatted condition; NFC
Sanjoy Das [Thu, 21 Jul 2016 18:58:01 +0000 (18:58 +0000)]
[IndVars] Reflow oddly formatted condition; NFC

llvm-svn: 276319

8 years ago[sanitizer] allocator: remove kPopulateSize and only use SizeClassMap::MaxCached...
Kostya Serebryany [Thu, 21 Jul 2016 18:47:53 +0000 (18:47 +0000)]
[sanitizer] allocator: remove kPopulateSize and only use SizeClassMap::MaxCached; ensure that TransferBatch size is a power of two, refactor TransferBatch creation/destruction into separate functions.

llvm-svn: 276318

8 years agoReroll "Include unreferenced nested types in member list only for CodeView"
Adrian McCarthy [Thu, 21 Jul 2016 18:43:20 +0000 (18:43 +0000)]
Reroll "Include unreferenced nested types in member list only for CodeView"

Another attempt at r276271, hopefully without breaking ModuleDebugInfo test.

llvm-svn: 276317

8 years agoInvariant start/end intrinsics overloaded for address space
Anna Thomas [Thu, 21 Jul 2016 18:41:44 +0000 (18:41 +0000)]
Invariant start/end intrinsics overloaded for address space

Summary:
The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address space.

With this change, these intrinsics are overloaded for any adddress space for memory objects
and we can use these llvm invariant intrinsics in non-default address spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant memory in managed languages.

Reviewers: tstellarAMD, reames, apilipenko

Subscribers: llvm-commits

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

llvm-svn: 276316

8 years agoFix MSVC 2015 compilation failure around range-for without curly braces
Reid Kleckner [Thu, 21 Jul 2016 18:39:28 +0000 (18:39 +0000)]
Fix MSVC 2015 compilation failure around range-for without curly braces

It doesn't appear to like this pattern:
  for (auto X : Xs)
    if (...) { ... }
    else ...;

We have heard anecdotes that range based for loops are implemented as a
token rewrite in MSVC's lexer, and that the most challenging part of the
rewrite is finding the end of the for loop. That makes sense, given that
it's a lexer.

llvm-svn: 276315

8 years agoFix clang-cl warning and crash in sanitizers
Reid Kleckner [Thu, 21 Jul 2016 18:31:01 +0000 (18:31 +0000)]
Fix clang-cl warning and crash in sanitizers

Make kStderrFd a macro to avoid dynamic initialization of the
report_file global. This actually causes a crash at runtime, because
ASan initializes before static initializers run.

Remove an unused variable in asan_win.cc.

llvm-svn: 276314

8 years agoUse just built llvm-as in tests.
Rafael Espindola [Thu, 21 Jul 2016 18:08:36 +0000 (18:08 +0000)]
Use just built llvm-as in tests.

llvm-svn: 276313

8 years agomake InstCombine compare helper functions private; NFC
Sanjay Patel [Thu, 21 Jul 2016 18:07:40 +0000 (18:07 +0000)]
make InstCombine compare helper functions private; NFC

Also, rename some of them for consistency and to follow current conventions.

llvm-svn: 276312

8 years agofix https://reviews.llvm.org/D22610
Etienne Bergeron [Thu, 21 Jul 2016 17:58:04 +0000 (17:58 +0000)]
fix https://reviews.llvm.org/D22610
AppleClang can't compile the assignment expression.

llvm-svn: 276311

8 years agoAvoid a string copy, NFC
Vedant Kumar [Thu, 21 Jul 2016 17:50:07 +0000 (17:50 +0000)]
Avoid a string copy, NFC

llvm-svn: 276310

8 years agoRemove FIXME for feature test macro
JF Bastien [Thu, 21 Jul 2016 17:34:28 +0000 (17:34 +0000)]
Remove FIXME for feature test macro

The value I'd picked was correct, as per the recently published SG10 paper http://wg21.link/p0096r3

llvm-svn: 276309

8 years ago[IRTranslator] Add G_SUB opcode.
Quentin Colombet [Thu, 21 Jul 2016 17:26:50 +0000 (17:26 +0000)]
[IRTranslator] Add G_SUB opcode.

This commit adds a generic SUB opcode to global-isel.

llvm-svn: 276308

8 years ago[llvm-config][GlobalISel] Canonicalize LLVM_HAS_GLOBAL_ISEL on ON/OFF.
Quentin Colombet [Thu, 21 Jul 2016 17:26:47 +0000 (17:26 +0000)]
[llvm-config][GlobalISel] Canonicalize LLVM_HAS_GLOBAL_ISEL on ON/OFF.

Previously LLVM_HAS_GLOBAL_ISEL would directly get the value of
LLVM_BUILD_GLOBAL_ISEL. This could be any integer value and not just ON
and OFF. The problem is that lit.cfg was checking for ON to define that
global-isel was supported, thus if we were setting
LLVM_BUILD_GLOBAL_ISEL with an integer value, say 1, this test would
fail whereas we do build global-isel and want to test it.

llvm-svn: 276307

8 years ago[CMake][GlobalISel] Turn LLVM_BUILD_GLOBAL_ISEL into an option. NFC.
Quentin Colombet [Thu, 21 Jul 2016 17:26:45 +0000 (17:26 +0000)]
[CMake][GlobalISel] Turn LLVM_BUILD_GLOBAL_ISEL into an option. NFC.

Previously LLVM_BUILD_GLOBAL_ISEL was a boolean variable and although,
this is strictly identical to an option, it did not convey the
information that the user may set it. Options are here for that.

llvm-svn: 276306

8 years ago[IRTranslator] Add comments to explain the ordering of the switch. NFC.
Quentin Colombet [Thu, 21 Jul 2016 17:26:41 +0000 (17:26 +0000)]
[IRTranslator] Add comments to explain the ordering of the switch. NFC.

Group arithmetic operations, bitwise operations, and branch operations.

llvm-svn: 276305

8 years ago[InstCombine] break up visitICmpInstWithInstAndIntCst(); NFCI
Sanjay Patel [Thu, 21 Jul 2016 17:15:49 +0000 (17:15 +0000)]
[InstCombine] break up visitICmpInstWithInstAndIntCst(); NFCI

Making smaller pieces out of some of these ~1000 line functions should make
it easier to incrementally upgrade them to handle vector types.

llvm-svn: 276304

8 years agoAdd check for non-null log instance in PlatformAndroid.
Oleksiy Vyalov [Thu, 21 Jul 2016 17:03:25 +0000 (17:03 +0000)]
Add check for non-null log instance in PlatformAndroid.

llvm-svn: 276303

8 years agoAdding RELEASE_TESTERS.TXT
Renato Golin [Thu, 21 Jul 2016 16:46:44 +0000 (16:46 +0000)]
Adding RELEASE_TESTERS.TXT

llvm-svn: 276302

8 years ago[ELF] Fix bug in program header FLAGS processing + test case update (found by grimar)
Eugene Leviant [Thu, 21 Jul 2016 16:13:54 +0000 (16:13 +0000)]
[ELF] Fix bug in program header FLAGS processing + test case update (found by grimar)

llvm-svn: 276301

8 years ago[ELF] - Cleanup of LinkerScript<ELFT>::assignAddresses()
George Rimar [Thu, 21 Jul 2016 16:07:40 +0000 (16:07 +0000)]
[ELF] - Cleanup of LinkerScript<ELFT>::assignAddresses()

LinkerScript<ELFT>::assignAddresses is becoming larger and looks
it can be good time for splitting. I expect to can more SectionsCommand's there,
and dispatching some of them separatelly can help to keep method smaller either.

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

llvm-svn: 276300

8 years ago[compiler-rt] Fix memmove/memcpy overlap detection on windows
Etienne Bergeron [Thu, 21 Jul 2016 16:06:54 +0000 (16:06 +0000)]
[compiler-rt] Fix memmove/memcpy overlap detection on windows

Summary:
The memcpy and memmove functions are the same on windows.
The overlap detection logic is incorrect.

printf-1 test:
```
stdin>:2:114: note: possible intended match here
==877412==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x0000002bf2a8,0x0000002bf2ad) and [0x0000002bf2a9, 0x0000002bf2ae) overlap
```                                                                                                                 ^

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 276299

8 years ago[AMDGPU] Emit read-only data to .rodata for hsa
Konstantin Zhuravlyov [Thu, 21 Jul 2016 15:59:23 +0000 (15:59 +0000)]
[AMDGPU] Emit read-only data to .rodata for hsa

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

llvm-svn: 276298

8 years ago[IRTranslator] Add G_AND opcode.
Quentin Colombet [Thu, 21 Jul 2016 15:50:42 +0000 (15:50 +0000)]
[IRTranslator] Add G_AND opcode.

This commit adds a generic AND opcode to global-isel.

llvm-svn: 276297

8 years ago[ELF] - Fixed 3 testases failtures on win32 configuration.
George Rimar [Thu, 21 Jul 2016 15:35:06 +0000 (15:35 +0000)]
[ELF] - Fixed 3 testases failtures on win32 configuration.

Had 3 testcases failtures:
ELF/eh-frame-merge.s
ELF/gc-sections-eh.s
ELF/gc-sections-lsda.s​

Problem was that OutputOff is size_t, which is 32
for this configuration and next
condition never was checked correctly:

if (PieceI->OutputOff == (uintX_t)-1)
  continue;

llvm-svn: 276296

8 years agoELF/AMDGPU: Add support for R_AMDGPU_ABS32
Konstantin Zhuravlyov [Thu, 21 Jul 2016 15:30:13 +0000 (15:30 +0000)]
ELF/AMDGPU: Add support for R_AMDGPU_ABS32

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

llvm-svn: 276295

8 years agoAMDGPU/SI: Add support for R_AMDGPU_ABS32
Konstantin Zhuravlyov [Thu, 21 Jul 2016 15:29:19 +0000 (15:29 +0000)]
AMDGPU/SI: Add support for R_AMDGPU_ABS32

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

llvm-svn: 276294

8 years ago[AArch64] Load/store opt: Don't count transient instructions towards search limits.
Geoff Berry [Thu, 21 Jul 2016 15:20:25 +0000 (15:20 +0000)]
[AArch64] Load/store opt: Don't count transient instructions towards search limits.

Summary:
This change also changes findMatchingInsn and
findMatchingUpdateInsnForward to take DBG_VALUE opcodes into account
when tracking register defs and uses, which could potentially inhibit
these optimizations in the presence of debug information.

Reviewers: mcrosier

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 276293

8 years agoMove some IntrusiveRefCntPtrs instead of copying.
Benjamin Kramer [Thu, 21 Jul 2016 15:06:51 +0000 (15:06 +0000)]
Move some IntrusiveRefCntPtrs instead of copying.

No functionality change intended.

llvm-svn: 276292

8 years agoWeaken ThreadSafeRefCountedBase atomics.
Benjamin Kramer [Thu, 21 Jul 2016 15:06:50 +0000 (15:06 +0000)]
Weaken ThreadSafeRefCountedBase atomics.

Doesn't make a difference on x86, but avoids memory barriers on
weakly-ordered archs like PowerPC and ARM.

llvm-svn: 276291

8 years ago[compiler-rt] Disable some unittests on windows that rely on shell command
Etienne Bergeron [Thu, 21 Jul 2016 14:55:17 +0000 (14:55 +0000)]
[compiler-rt] Disable some unittests on windows that rely on shell command

Summary:
These unittests are not running on windows because they are using incorrect commands.
They were not failing on 32-bits because there is a requirement: asan-64-bits.

```
$ "nm" "C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output\no_asan_gen_globals.c.tmp.exe"
# command stderr:
'nm': command not found
error: command failed with exit status: 127
```

```
$ "rm" "-rf" "C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output/coverage-tracing"
$ "mkdir" "C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output/coverage-tracing"
$ "A=x"
# command stderr:
'A=x': command not found
error: command failed with exit status: 127
```

```
$ "DIR=C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output/coverage-order-pcs"
# command stderr:
'DIR=C:\\src\\llvm\\ninja64\\projects\\compiler-rt\\test\\asan\\X86_64WindowsConfig\\TestCases\\Output/coverage-order-pcs': command not found
error: command failed with exit status: 127
```

Reviewers: rnk

Subscribers: tberghammer, llvm-commits, danalbert, wang0109, srhines, kubabrecka, chrisha

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

llvm-svn: 276290

8 years ago[X86][SSE] Allow folding of store/zext with PEXTRW of 0'th element
Simon Pilgrim [Thu, 21 Jul 2016 14:54:17 +0000 (14:54 +0000)]
[X86][SSE] Allow folding of store/zext with PEXTRW of 0'th element

Under normal circumstances we prefer the higher performance MOVD to extract the 0'th element of a v8i16 vector instead of PEXTRW.

But as detailed on PR27265, this prevents the SSE41 implementation of PEXTRW from folding the store of the 0'th element. Additionally it prevents us from making use of the fact that the (SSE2) reg-reg version of PEXTRW implicitly zero-extends the i16 element to the i32/i64 destination register.

This patch only preferentially lowers to MOVD if we will not be zero-extending the extracted i16, nor prevent a store from being folded (on SSSE41).

Fix for PR27265.

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

llvm-svn: 276289

8 years agoUnify process launching code on linux
Pavel Labath [Thu, 21 Jul 2016 14:54:03 +0000 (14:54 +0000)]
Unify process launching code on linux

Summary:
We've had two copies of code for launching processes:
- one in NativeProcessLinux, used for launching debugged processes
- one in ProcessLauncherAndroid, used on android for launching all other kinds of processes

These have over time acquired support for various launch options, but neither supported all of
them. I now replace them with a single implementation ProcessLauncherLinux, which supports all
the options the individual versions supported and set it to be used to launch all processes on
linux.

This also works around the ETXTBSY issue on android when the process is started from the platform
instance, as that used to go through the version which did not contain the workaround.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 276288

8 years agoFixed line endings
Simon Pilgrim [Thu, 21 Jul 2016 14:36:41 +0000 (14:36 +0000)]
Fixed line endings

llvm-svn: 276287

8 years ago[compiler-rt] Fix broken unittest on win64
Etienne Bergeron [Thu, 21 Jul 2016 14:36:25 +0000 (14:36 +0000)]
[compiler-rt] Fix broken unittest on win64

Summary:
This is an other tentative to fix:
https://reviews.llvm.org/D22588

It's less clever, but should work.

Turn out there is not an easy way to write a portable print
for a pointer in lowercase without the prefix 0x.

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 276286

8 years ago[X86][SSE] Pull out duplicate EXTRW lowering code. NFCI.
Simon Pilgrim [Thu, 21 Jul 2016 14:30:17 +0000 (14:30 +0000)]
[X86][SSE] Pull out duplicate EXTRW lowering code. NFCI.

As requested on D22509, I've pulled out the v8i16 extraction lowering as the SSE41 and pre-SSE41 implementations are effectively the same.

llvm-svn: 276285

8 years ago[profdata] Remove constructor that MSVC 2013 pretends to not understand.
Benjamin Kramer [Thu, 21 Jul 2016 14:29:11 +0000 (14:29 +0000)]
[profdata] Remove constructor that MSVC 2013 pretends to not understand.

No functionality change intended.

llvm-svn: 276284

8 years ago[ELF] - Linkerscript: add InputSectionDescription command to LS parser.
George Rimar [Thu, 21 Jul 2016 14:26:59 +0000 (14:26 +0000)]
[ELF] - Linkerscript: add InputSectionDescription command to LS parser.

This adds InputSectionDescription command to represent
the input section declaration.

This leads to next cleanup:
SectionRule removed.
ScriptConfiguration::Sections mamber removed.
LinkerScript<ELFT>::getOutputSection() removed.

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

llvm-svn: 276283

8 years ago[clang-tidy] Avoid duplicated DenseMap lookup.
Benjamin Kramer [Thu, 21 Jul 2016 14:13:45 +0000 (14:13 +0000)]
[clang-tidy] Avoid duplicated DenseMap lookup.

The std::string is still constructed on demand. No functionality change
intended.

llvm-svn: 276282

8 years ago[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128
Simon Pilgrim [Thu, 21 Jul 2016 14:10:54 +0000 (14:10 +0000)]
[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128

As reported on PR26235, we don't currently make use of the VBROADCASTF128/VBROADCASTI128 instructions (or the AVX512 equivalents) to load+splat a 128-bit vector to both lanes of a 256-bit vector.

This patch enables lowering from subvector insertion/concatenation patterns and auto-upgrades the llvm.x86.avx.vbroadcastf128.pd.256 / llvm.x86.avx.vbroadcastf128.ps.256 intrinsics to match.

We could possibly investigate using VBROADCASTF128/VBROADCASTI128 to load repeated constants as well (similar to how we already do for scalar broadcasts).

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

llvm-svn: 276281

8 years ago[include-fixer] Add mising qualifiers to all instances of an unidentified symbol.
Haojian Wu [Thu, 21 Jul 2016 13:47:09 +0000 (13:47 +0000)]
[include-fixer] Add mising qualifiers to all instances of an unidentified symbol.

Reviewers: bkramer

Subscribers: ioeric, cfe-commits

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

llvm-svn: 276280

8 years agoRevert "Include unreferenced nested types in member list only for CodeView"
Adrian McCarthy [Thu, 21 Jul 2016 13:41:25 +0000 (13:41 +0000)]
Revert "Include unreferenced nested types in member list only for CodeView"

Patch broke ModuleDebugInfo test on the build bots (but not locally).  Again.

svn revision:  r276271

This reverts commit 9da8a1b05362bc96f2855fb32b5588b89407685d.

llvm-svn: 276279

8 years ago[DemandedBits] Reduce number of duplicated DenseMap lookups.
Benjamin Kramer [Thu, 21 Jul 2016 13:37:55 +0000 (13:37 +0000)]
[DemandedBits] Reduce number of duplicated DenseMap lookups.

No functionality change intended.

llvm-svn: 276278

8 years ago[DenseMap] Add a C++17-style try_emplace method.
Benjamin Kramer [Thu, 21 Jul 2016 13:37:53 +0000 (13:37 +0000)]
[DenseMap] Add a C++17-style try_emplace method.

This provides an elegant pattern to solve the "construct if not in map
already" problem we have many times in LLVM. Without try_emplace we
either have to rely on a sentinel value (nullptr) or do two lookups.

llvm-svn: 276277

8 years agoRename StringMap::emplace_second to try_emplace.
Benjamin Kramer [Thu, 21 Jul 2016 13:37:48 +0000 (13:37 +0000)]
Rename StringMap::emplace_second to try_emplace.

Coincidentally this function maps to the C++17 try_emplace. Rename it
for consistentcy with C++17 std::map. NFC.

llvm-svn: 276276

8 years agoDelete SplitInputSection.
Rafael Espindola [Thu, 21 Jul 2016 13:32:37 +0000 (13:32 +0000)]
Delete SplitInputSection.

This opens the way for having a different Piece type for EhInputSection.

llvm-svn: 276275

8 years ago[AMDGPU] Some code cleaning in SIRegisterInfo.td
Sam Kolton [Thu, 21 Jul 2016 13:29:57 +0000 (13:29 +0000)]
[AMDGPU] Some code cleaning in SIRegisterInfo.td

Reviewers: tstellarAMD, vpykhtin

Subscribers: arsenm, kzhuravl

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

llvm-svn: 276274

8 years agoAgain, w/o the tabs
Marshall Clow [Thu, 21 Jul 2016 13:19:36 +0000 (13:19 +0000)]
Again, w/o the tabs

llvm-svn: 276273

8 years agoAnother fix to appease the no-exception bots.
Marshall Clow [Thu, 21 Jul 2016 13:18:50 +0000 (13:18 +0000)]
Another fix to appease the no-exception bots.

llvm-svn: 276272

8 years agoInclude unreferenced nested types in member list only for CodeView
Adrian McCarthy [Thu, 21 Jul 2016 13:16:14 +0000 (13:16 +0000)]
Include unreferenced nested types in member list only for CodeView

Unreferenced nested structs and classes were omitted from the debug info.  In DWARF, this was intentional, to avoid bloat.  But for CodeView, we want this information to be consistent with what Microsoft tools would produce and expect.

llvm-svn: 276271

8 years agoGPGPU: generate code for ScopStatements
Tobias Grosser [Thu, 21 Jul 2016 13:15:59 +0000 (13:15 +0000)]
GPGPU: generate code for ScopStatements

This change introduces the actual compute code in the GPU kernels. To ensure
all values referenced from the statements in the GPU kernel are indeed available
we scan all ScopStmts in the GPU kernel for references to llvm::Values that
are not yet covered by already modeled outer loop iterators, parameters, or
array base pointers and also pass these additional llvm::Values to the
GPU kernel.

For arrays used in the GPU kernel we introduce a new ScopArrayInfo object, which
is referenced by the newly generated access functions within the GPU kernel and
which is used to help with code generation.

llvm-svn: 276270

8 years agoIslNodeBuilder: expose addReferencesFromStmt [NFC]
Tobias Grosser [Thu, 21 Jul 2016 13:15:55 +0000 (13:15 +0000)]
IslNodeBuilder: expose addReferencesFromStmt [NFC]

This will be used by Polly GPGPU to determine the values that need to be
passed to GPU kernels.

llvm-svn: 276269

8 years agoIslExprBuilder: allow to specify an external isl_id to ScopArrayInfo mapping
Tobias Grosser [Thu, 21 Jul 2016 13:15:51 +0000 (13:15 +0000)]
IslExprBuilder: allow to specify an external isl_id to ScopArrayInfo mapping

This is useful for external users using IslExprBuilder, in case they cannot
embed ScopArrayInfo data into their isl_ids, because the isl_ids either already
carry other information or the isl_ids have been created and their user pointers
cannot be updated any more.

llvm-svn: 276268

8 years agoSimplify symbol version handling.
Rui Ueyama [Thu, 21 Jul 2016 13:13:21 +0000 (13:13 +0000)]
Simplify symbol version handling.

r275711 for "speedng up symbol version handling" was committed
by misunderstanding; the benchmark number was measured with
a debug build. The number with a release build didn't actually change.
This patch removes false optimizations added in that patch.

llvm-svn: 276267

8 years agoExecutionDepsFix - Fix bug in clearance calculation
Marina Yatsina [Thu, 21 Jul 2016 12:37:07 +0000 (12:37 +0000)]
ExecutionDepsFix - Fix bug in clearance calculation

The clearance calculation did not take into account registers defined as outputs or clobbers in inline assembly machine instructions because these register defs are implicit.

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

llvm-svn: 276266

8 years ago[GCOV] Remove a layer of indirection.
Benjamin Kramer [Thu, 21 Jul 2016 12:06:31 +0000 (12:06 +0000)]
[GCOV] Remove a layer of indirection.

StringMap is designed to hold large values. No functionality change
intended.

llvm-svn: 276265

8 years ago[docs] Update release docs
Renato Golin [Thu, 21 Jul 2016 12:00:50 +0000 (12:00 +0000)]
[docs] Update release docs

llvm-svn: 276264

8 years agoBlockGenerator: remove dead instructions in normal statements
Tobias Grosser [Thu, 21 Jul 2016 11:48:36 +0000 (11:48 +0000)]
BlockGenerator: remove dead instructions in normal statements

This ensures that no trivially dead code is generated. This is not only cleaner,
but also avoids troubles in case code is generated in a separate function and
some of this dead code contains references to values that are not available.
This issue may happen, in case the memory access functions have been updated
and old getelementptr instructions remain in the code. With normal Polly,
a test case is difficult to draft, but the upcoming GPU code generation can
possibly trigger such problems. We will later extend this dead-code elimination
to region and vector statements.

llvm-svn: 276263

8 years agotests: make test cases more robust using regexp
Tobias Grosser [Thu, 21 Jul 2016 11:48:31 +0000 (11:48 +0000)]
tests: make test cases more robust using regexp

llvm-svn: 276262

8 years agoInstantiate Interp output section only when needed.
Rui Ueyama [Thu, 21 Jul 2016 11:01:23 +0000 (11:01 +0000)]
Instantiate Interp output section only when needed.

This change simplifies interaction between Writer and the linker script
because we can make needsInterpSection() a file-scope function.

llvm-svn: 276261

8 years ago[ELF] Support FLAGS attribute in program header definition
Eugene Leviant [Thu, 21 Jul 2016 10:43:25 +0000 (10:43 +0000)]
[ELF] Support FLAGS attribute in program header definition

llvm-svn: 276260

8 years ago[clang-rename] check whether -new-name is valid identifier in C++17
Kirill Bobyrev [Thu, 21 Jul 2016 10:21:31 +0000 (10:21 +0000)]
[clang-rename] check whether -new-name is valid identifier in C++17

llvm-svn: 276259

8 years agoRevert r276256 - Attempt to fix clang-cmake-mips after r268977.
Daniel Sanders [Thu, 21 Jul 2016 09:52:33 +0000 (09:52 +0000)]
Revert r276256 - Attempt to fix clang-cmake-mips after r268977.

It didn't fix the problem on the buildbot. CAN_TARGET_mips64 is still true.

llvm-svn: 276258

8 years agoAMDGPU: Fix phis from blocks split due to register indexing
Matt Arsenault [Thu, 21 Jul 2016 09:40:57 +0000 (09:40 +0000)]
AMDGPU: Fix phis from blocks split due to register indexing

llvm-svn: 276257

8 years agoAttempt to fix clang-cmake-mips after r268977.
Daniel Sanders [Thu, 21 Jul 2016 09:28:09 +0000 (09:28 +0000)]
Attempt to fix clang-cmake-mips after r268977.

I think it's wiped out the build area and fully-reconfigured for the first time
since r268977. This seems to have caused Mips64 to become enabled when it wasn't
before because compiling with -mabi=64 succeeds but linking with -mabi=64 fails.

llvm-svn: 276256

8 years agoDefault XRay building to OFF to let build bots that do not support building sanitizer...
Dean Michael Berris [Thu, 21 Jul 2016 08:53:31 +0000 (08:53 +0000)]
Default XRay building to OFF to let build bots that do not support building sanitizers to disable explicitly too

llvm-svn: 276255

8 years agoAdd a new DynamicLoader plugin that uses SPI that are in development
Jason Molenda [Thu, 21 Jul 2016 08:30:55 +0000 (08:30 +0000)]
Add a new DynamicLoader plugin that uses SPI that are in development
for the fall (northern hemisphere) 2016 Darwin platforms to learn
about loaded images, instead of reading dyld internal data structures.
These new SPI don't exist on older releases, and new packets are
needed from debugserver to use them (those changes are already committed).

I had to change the minimum deployment target for debugserver in the xcode
project file to macOS 10.10 so that debugserver will use the
[[NSProcessInfo processInfo] operatingSystemVersion]
call in MachProcess::GetOSVersionNumbers to get the operarting system
version # -- this API is only available in macOS 10.10 and newer
("OS X Yosemite", released Oct 2014).  If we have many people building
llvm.org lldb on older systems still, we can back off on this for the
llvm.org sources.

There should be no change in behavior with this commit, either to
older darwin systems or newer darwin systems.

For now the new DynamicLoader plugin is never activated - I'm forcing
the old plugin to be used in DynamicLoaderDarwin::UseDYLDSPI.
I'll remove that unconditional use of the old plugin soon, so the
newer plugin is used on the newest Darwin platforms.

<rdar://problem/25251243>

llvm-svn: 276254

8 years ago[ELF] - Linkerscript: remove excessive ScriptConfiguration::Filler field
George Rimar [Thu, 21 Jul 2016 07:48:54 +0000 (07:48 +0000)]
[ELF] - Linkerscript: remove excessive ScriptConfiguration::Filler field

Previously OutputSectionCommand::Filler was introduced, but unused.
Patch fixes that.

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

llvm-svn: 276253

8 years agoProvide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu language...
Yaron Keren [Thu, 21 Jul 2016 07:44:41 +0000 (07:44 +0000)]
Provide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu language extensions.
These are used by libstdc++ <type_traits> for is_integral<__int128>.
Addresses http://llvm.org/pr23156.

llvm-svn: 276252

8 years ago[compiler-rt][XRay] re-submitting r276117, with fixes for build breakage due to extra...
Dean Michael Berris [Thu, 21 Jul 2016 07:39:55 +0000 (07:39 +0000)]
[compiler-rt][XRay] re-submitting r276117, with fixes for build breakage due to extraneous and missing dependencies and attempts to build on unsupported OSes

Summary:
This is a fixed-up version of D21612, to address failure identified post-commit.

Original commit description:

This patch implements the initialisation and patching routines for the XRay runtime, along with the necessary trampolines for function entry/exit handling. For now we only define the basic hooks for allowing an implementation to define a handler that gets run on function entry/exit. We expose a minimal API for controlling the behaviour of the runtime (patching, cleanup, and setting the handler to invoke when instrumenting).

Fixes include:
- Gating XRay build to only Linux x86_64 and with the right dependencies in case it is the only library being built
- Including <cstddef> to fix std::size_t issue

Reviewers: kcc, rnk, echristo

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 276251

8 years ago[Sema,X86] Add explicit check to ensure that builtins that require x86-64 target...
Craig Topper [Thu, 21 Jul 2016 07:38:43 +0000 (07:38 +0000)]
[Sema,X86] Add explicit check to ensure that builtins that require x86-64 target throw an error if used on 32-bit target.

If these builtins are allowed to go through on a 32-bit target they will fire assertions in the backend.

Fixes PR28635.

llvm-svn: 276250

8 years ago[X86] Add missing __x86_64__ qualifiers on a bunch of intrinsics that assume 64-bit...
Craig Topper [Thu, 21 Jul 2016 07:38:39 +0000 (07:38 +0000)]
[X86] Add missing __x86_64__ qualifiers on a bunch of intrinsics that assume 64-bit GPRs are available.

Usages of these intrinsics in a 32-bit build results in assertions in the backend.

llvm-svn: 276249

8 years ago[GVNHoist] Preserve optimization hints which agree
David Majnemer [Thu, 21 Jul 2016 07:16:26 +0000 (07:16 +0000)]
[GVNHoist] Preserve optimization hints which agree

If we have optimization hints with agree with each other along different
paths, preserve them.

llvm-svn: 276248

8 years agotests: fix order of memory accesses to ensure import succeeds
Tobias Grosser [Thu, 21 Jul 2016 07:12:17 +0000 (07:12 +0000)]
tests: fix order of memory accesses to ensure import succeeds

It seems the order in which we generated memory accesses changed such that
the import of these updated memory accesses failed for the 'loop3' statement
in this test case. Unfortunately, the existing CHECK lines were not strict
enough to catch this. Hence, besides fixing the order of the memory access
lines we also ensure that the memory access changes are both clearly visibly
and well checked.

llvm-svn: 276247

8 years agoJScop: Factor out importContext [NFC]
Tobias Grosser [Thu, 21 Jul 2016 06:56:33 +0000 (06:56 +0000)]
JScop: Factor out importContext [NFC]

This makes the structure of the code clearer and reduces the size of runOnScop.

We also adjust the coding style to the latest LLVM style guide.

llvm-svn: 276246

8 years agoJScop: Factor out importContext [NFC]
Tobias Grosser [Thu, 21 Jul 2016 06:56:31 +0000 (06:56 +0000)]
JScop: Factor out importContext [NFC]

This makes the structure of the code clearer and reduces the size of runOnScop.

We also adjust the coding style to the latest LLVM style guide.

llvm-svn: 276245

8 years agoJScop: Factor out importSchedule [NFC]
Tobias Grosser [Thu, 21 Jul 2016 06:56:28 +0000 (06:56 +0000)]
JScop: Factor out importSchedule [NFC]

This makes the structure of the code clearer and reduces the size of runOnScop.

We also adjust the coding style to the latest LLVM style guide.

llvm-svn: 276244

8 years ago[ELF] - Initial support of tree-style linker script implemented.
George Rimar [Thu, 21 Jul 2016 06:43:01 +0000 (06:43 +0000)]
[ELF] - Initial support of tree-style linker script implemented.

Approach uses LLVM-style RTTI for representing the linker script
commands in a form of tree for future simplification of parsing.

Core idea and code sample belongs to Rui Ueyama.

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

llvm-svn: 276243

8 years ago[CodeGen] Handle recursion in LLVMIRGeneration Timer.
Davide Italiano [Thu, 21 Jul 2016 06:28:48 +0000 (06:28 +0000)]
[CodeGen] Handle recursion in LLVMIRGeneration Timer.

This can happen when emitting a local decl, which triggers
loading a decl imported from an AST file, which we then
hand to the AST consumer. Timer is not allowed to recurse
so an assertion fire. Keep a reference counter to avoid this
problem. LGTM'd by Richard Smith on IRC.

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

llvm-svn: 276242

8 years agoFix some string_view tests that were failing when exceptions were disabled. Also...
Marshall Clow [Thu, 21 Jul 2016 06:24:04 +0000 (06:24 +0000)]
Fix some string_view tests that were failing when exceptions were disabled. Also comment out a _LIBCPP_ASSERT that gcc4.9 was complaining about. Will revisit that later.

llvm-svn: 276241

8 years ago[GVNHoist] Don't wrongly preserve TBAA
David Majnemer [Thu, 21 Jul 2016 05:59:53 +0000 (05:59 +0000)]
[GVNHoist] Don't wrongly preserve TBAA

We hoisted loads/stores without taking into account which can cause
miscompiles.

llvm-svn: 276240

8 years ago[MergedLoadStoreMotion] Remove out of date comment
David Majnemer [Thu, 21 Jul 2016 05:59:51 +0000 (05:59 +0000)]
[MergedLoadStoreMotion] Remove out of date comment

llvm-svn: 276239

8 years agoImplement std::string_view as described in http://wg21.link/P0254R1. Reviewed as...
Marshall Clow [Thu, 21 Jul 2016 05:31:24 +0000 (05:31 +0000)]
Implement std::string_view as described in wg21.link/P0254R1. Reviewed as https://reviews.llvm.org/D21459

llvm-svn: 276238

8 years agoAdd missing import to fix the build
Amaury Sechet [Thu, 21 Jul 2016 04:31:38 +0000 (04:31 +0000)]
Add missing import to fix the build

llvm-svn: 276237

8 years agoExpose AttributeSetNode, use it to provide aggregate getter for attribute in the...
Amaury Sechet [Thu, 21 Jul 2016 04:25:06 +0000 (04:25 +0000)]
Expose AttributeSetNode, use it to provide aggregate getter for attribute in the C API.

Summary: See D19181 for context.

Reviewers: whitequark, Wallbraker, jyknight, echristo, bkramer, void

Subscribers: mehdi_amini

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

llvm-svn: 276236

8 years agoIPRA: Fix RegMask calculation for alias registers
Matthias Braun [Thu, 21 Jul 2016 03:50:39 +0000 (03:50 +0000)]
IPRA: Fix RegMask calculation for alias registers

This patch fixes a very subtle bug in regmask calculation. Thanks to zan
jyu Wong <zyfwong@gmail.com> for bringing this to notice.
For example if CL is only clobbered than CH should not be marked
clobbered but CX, RCX and ECX should be mark clobbered. Previously for
each modified register all of its aliases are marked clobbered by
markRegClobbred() in RegUsageInfoCollector.cpp but that is wrong because
when CL is clobbered then MRI::isPhysRegModified() will return true for
CL, CX, ECX, RCX which is correct behavior but then for CX, EXC, RCX we
mark CH also clobbered as CH is aliased to CX,ECX,RCX so
markRegClobbred() is not required because isPhysRegModified already take
cares of proper aliasing register. A very simple test case has been
added to verify this change.
Please find relevant bug report here :
http://llvm.org/PR28567

Patch by Vivek Pandya <vivekvpandya@gmail.com>

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

llvm-svn: 276235

8 years ago[Profile] bug fix: profile dir not recursively created
Xinliang David Li [Thu, 21 Jul 2016 03:38:07 +0000 (03:38 +0000)]
[Profile] bug fix: profile dir not recursively created

llvm-svn: 276234

8 years agoMark P0358r1 as complete. It is already implemented
Eric Fiselier [Thu, 21 Jul 2016 03:28:52 +0000 (03:28 +0000)]
Mark P0358r1 as complete. It is already implemented

llvm-svn: 276233

8 years ago[Sema] Fix PR28623.
George Burgess IV [Thu, 21 Jul 2016 03:28:13 +0000 (03:28 +0000)]
[Sema] Fix PR28623.

In atomic builtins, we assumed that the LValue conversion on the first
argument would succeed. So, we would crash given code like:

```
void ovl(char);
void ovl(int);
__atomic_store_n(ovl, 0, 0);
```

This patch makes us not assume that said conversion is successful. :)

llvm-svn: 276232

8 years agoMark P0337r0 as complete. It was already implemented in std::experimental
Eric Fiselier [Thu, 21 Jul 2016 03:24:43 +0000 (03:24 +0000)]
Mark P0337r0 as complete. It was already implemented in std::experimental

llvm-svn: 276231

8 years agoImplement P0084r2. Changing emplace return types.
Eric Fiselier [Thu, 21 Jul 2016 03:20:17 +0000 (03:20 +0000)]
Implement P0084r2. Changing emplace return types.

llvm-svn: 276230

8 years ago[Profile] Add new test to cover %m specifier with shared library (instrumented)
Xinliang David Li [Thu, 21 Jul 2016 02:58:28 +0000 (02:58 +0000)]
[Profile] Add new test to cover %m specifier with shared library (instrumented)

llvm-svn: 276229

8 years ago[compiler-rt] Fix broken SymInitialize unittest
Etienne Bergeron [Thu, 21 Jul 2016 02:32:37 +0000 (02:32 +0000)]
[compiler-rt] Fix broken SymInitialize unittest

Summary:
By adding the initialisation of the symbolisation library (DbgHelp)
we are swapping the order in which both warnings are produced.

We can't use CHECK-NEXT as the dbghelp warning is multiline.

Reviewers: rnk

Subscribers: kubabrecka, llvm-commits, wang0109, chrisha

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

llvm-svn: 276228

8 years agofix warning when generating sphinx doc.
Etienne Bergeron [Thu, 21 Jul 2016 02:27:05 +0000 (02:27 +0000)]
fix warning when generating sphinx doc.

llvm-svn: 276227

8 years ago[Profile] More test clean up to read profile from directory specified by -fprofile...
Xinliang David Li [Thu, 21 Jul 2016 02:14:55 +0000 (02:14 +0000)]
[Profile] More test clean up to read profile from directory specified by -fprofile-generate=

llvm-svn: 276226

8 years ago[Profile] Cleanup test to use new dir input feature
Xinliang David Li [Thu, 21 Jul 2016 01:53:41 +0000 (01:53 +0000)]
[Profile] Cleanup test to use new dir input feature

llvm-svn: 276225

8 years ago[OptDiag] Missed these when making the IR Value a const pointer
Adam Nemet [Thu, 21 Jul 2016 01:11:12 +0000 (01:11 +0000)]
[OptDiag] Missed these when making the IR Value a const pointer

llvm-svn: 276224

8 years ago[OptDiag,LV] Add hotness attribute to applied-optimization remarks
Adam Nemet [Thu, 21 Jul 2016 01:07:13 +0000 (01:07 +0000)]
[OptDiag,LV] Add hotness attribute to applied-optimization remarks

Test coverage is provided by modifying the function in the FP-math
testcase that we are allowed to vectorize.

llvm-svn: 276223

8 years agoX86InstrInfo: No need for liveness analysis in classifyLEAReg()
Matthias Braun [Thu, 21 Jul 2016 00:33:38 +0000 (00:33 +0000)]
X86InstrInfo: No need for liveness analysis in classifyLEAReg()

classifyLEAReg() deals with switching operands from 32bit to 64bit in
order to use a LEA64_32 instruction (for three address code goodness).
It currently performs a liveness analysis to determine the kill/undef
flag for the newly added operand. This should not be necessary:

- If the previous operand had a kill flag, then the 32bit part of the
  register gets killed, this will kill the super register as well.
- If the previous operand had an undef flag then we didn't care what
  value we read, just use the same flag on the new operand.
  (No matter what an operand with an undef flag won't affect liveness)

This makes the code independent of the presence of kill flags because it
avoids a call to MachineBasicBlock::computeRegisterLiveness().

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

llvm-svn: 276222

8 years ago[InstCombine] LogicOpc (zext X), C --> zext (LogicOpc X, C) (PR28476)
Sanjay Patel [Thu, 21 Jul 2016 00:24:18 +0000 (00:24 +0000)]
[InstCombine] LogicOpc (zext X), C --> zext (LogicOpc X, C) (PR28476)

The benefits of this change include:
1. Remove DeMorgan-matching code that was added specifically to work-around
   the missing transform in http://reviews.llvm.org/rL248634.
2. Makes the DeMorgan transform work for vectors too.
3. Fix PR28476: https://llvm.org/bugs/show_bug.cgi?id=28476

Extending this transform to other casts and other associative operators may
be useful too. See https://reviews.llvm.org/D22421 for a prerequisite for
doing that though.

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

llvm-svn: 276221