platform/upstream/llvm.git
7 years ago[InstCombine] replace dyn_casts with matches; NFCI
Sanjay Patel [Tue, 2 Aug 2016 22:38:33 +0000 (22:38 +0000)]
[InstCombine] replace dyn_casts with matches; NFCI

Clean-up before changing this to allow folds for vectors.

llvm-svn: 277538

7 years ago[CUDA] Do not allow using NVPTX target for host compilation.
Artem Belevich [Tue, 2 Aug 2016 22:37:47 +0000 (22:37 +0000)]
[CUDA] Do not allow using NVPTX target for host compilation.

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

llvm-svn: 277537

7 years ago[sanitizer] Implement a __asan_default_options() equivalent for Scudo
Kostya Serebryany [Tue, 2 Aug 2016 22:25:38 +0000 (22:25 +0000)]
[sanitizer] Implement a __asan_default_options() equivalent for Scudo

Summary:
Currently, the Scudo Hardened Allocator only gets its flags via the SCUDO_OPTIONS environment variable.
With this patch, we offer the opportunity for programs to define their own options via __scudo_default_options() which behaves like __asan_default_options() (weak symbol).
A relevant test has been added as well, and the documentation updated accordingly.
I also used this patch as an opportunity to rename a few variables to comply with the LLVM naming scheme, and replaced a use of Report with dieWithMessage for consistency (and to avoid a callback).

Reviewers: llvm-commits, kcc

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

llvm-svn: 277536

7 years agoAMDGPU: fdiv -1, x -> rcp -x
Matt Arsenault [Tue, 2 Aug 2016 22:25:04 +0000 (22:25 +0000)]
AMDGPU: fdiv -1, x -> rcp -x

llvm-svn: 277535

7 years agoImported statistics types changes
Piotr Padlewski [Tue, 2 Aug 2016 22:18:47 +0000 (22:18 +0000)]
Imported statistics types changes

Reviewers: tejohnson, eraman

Subscribers: llvm-commits

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

llvm-svn: 277534

7 years ago[CFLAA] Be more conservative with values we haven't seen.
George Burgess IV [Tue, 2 Aug 2016 22:17:25 +0000 (22:17 +0000)]
[CFLAA] Be more conservative with values we haven't seen.

There were issues with simply reporting AttrUnknown on
previously-unknown values in CFLAnders. So, we now act *entirely*
conservatively for values we haven't seen before. As in the prior patch
(r277362), writing a lit test for this isn't exactly trivial. If someone
wants a test badly, I'm willing to try to write one.

Patch by Jia Chen.

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

llvm-svn: 277533

7 years agoSupport expressions inside FLAGS.
Rafael Espindola [Tue, 2 Aug 2016 22:14:57 +0000 (22:14 +0000)]
Support expressions inside FLAGS.

This is an undocumented bfd feature. It is reasonable for making the
scripts a bit more readable.

llvm-svn: 277532

7 years ago[ELF] Ignore -g option for compatibility.
Davide Italiano [Tue, 2 Aug 2016 22:14:00 +0000 (22:14 +0000)]
[ELF] Ignore -g option for compatibility.

Also ld.bfd and ld.gold ignore this options. I hit this one in
the wild, and just ignoring it's trivial, so, let's do it.

llvm-svn: 277531

7 years agoMove to having a single real instructionClobbersQuery
Daniel Berlin [Tue, 2 Aug 2016 21:57:52 +0000 (21:57 +0000)]
Move to having a single real instructionClobbersQuery

Summary: We really want to move towards MemoryLocOrCall (or fix AA) everywhere, but for now, this lets us have a single instructionClobbersQuery.

Reviewers: george.burgess.iv

Subscribers: llvm-commits

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

llvm-svn: 277530

7 years agoPDB: Mark extended file pages as free by default.
Rui Ueyama [Tue, 2 Aug 2016 21:56:37 +0000 (21:56 +0000)]
PDB: Mark extended file pages as free by default.

BitVector::extend initializes extended bits as true by default.
That is not desirable because new pages should be initially free.

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

llvm-svn: 277529

7 years ago[Hexagon] Recognize vcombine in copy propagation
Krzysztof Parzyszek [Tue, 2 Aug 2016 21:49:20 +0000 (21:49 +0000)]
[Hexagon] Recognize vcombine in copy propagation

llvm-svn: 277528

7 years ago[LoopUnroll] Fix a PowerPC test broken by r277524.
Michael Zolotukhin [Tue, 2 Aug 2016 21:43:25 +0000 (21:43 +0000)]
[LoopUnroll] Fix a PowerPC test broken by r277524.

llvm-svn: 277527

7 years ago[libcxx] basic_regex: add traits_type, string_type
Hubert Tong [Tue, 2 Aug 2016 21:34:48 +0000 (21:34 +0000)]
[libcxx] basic_regex: add traits_type, string_type

Summary:
In the synopsis in C++11 subclause 28.8 [re.regex], `basic_regex` is
specified to have member typedefs `traits_type` and `string_type`. This
change adds them to libc++.

Reviewers: mclow.lists, rsmith, hubert.reinterpretcast

Subscribers: cfe-commits

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

Patch by Jason Liu!

llvm-svn: 277526

7 years ago[LoopUnroll] Switch the default value of -unroll-runtime-epilog back to its original...
Michael Zolotukhin [Tue, 2 Aug 2016 21:24:14 +0000 (21:24 +0000)]
[LoopUnroll] Switch the default value of -unroll-runtime-epilog back to its original value.

As agreed in post-commit review of r265388, I'm switching the flag to
its original value until the 90% runtime performance regression on
SingleSource/Benchmarks/Stanford/Bubblesort is addressed.

llvm-svn: 277524

7 years ago[clang-tidy] Fix segfault in cppcore-guidelines-special-member-functions check
Jonathan Coe [Tue, 2 Aug 2016 21:18:37 +0000 (21:18 +0000)]
[clang-tidy] Fix segfault in cppcore-guidelines-special-member-functions check

Summary:
Use a set rather than a vector of defined special member functions so
that multiple declarations of the same function are only counted once.

Move some private static member functions into the cpp file.

Run clang-format on header.

Reviewers: ericLemanissier, Prazek, aaron.ballman

Subscribers: Prazek, cfe-commits, nemanjai

Projects: #clang-tools-extra

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

llvm-svn: 277523

7 years ago[CFG] Fix crash finding destructor of lifetime-extended temporary.
Devin Coughlin [Tue, 2 Aug 2016 21:07:23 +0000 (21:07 +0000)]
[CFG] Fix crash finding destructor of lifetime-extended temporary.

Fix a crash under -Wthread-safety when finding the destructor for a
lifetime-extending reference.

A patch by Nandor Licker!

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

llvm-svn: 277522

7 years ago[lli] Add the ability for OrcLazyJIT to accept multiple input modules.
Lang Hames [Tue, 2 Aug 2016 21:00:40 +0000 (21:00 +0000)]
[lli] Add the ability for OrcLazyJIT to accept multiple input modules.

LLI already supported passing multiple input modules to MCJIT via the
-extra-module option. This patch adds the plumbing to pass these modules to
the OrcLazy JIT too.

This functionality will be used in an upcoming test case for weak symbol
handling.

llvm-svn: 277521

7 years ago[NVPTX] remove unnecessary named metadata update that happens to break debug info.
Artem Belevich [Tue, 2 Aug 2016 20:58:24 +0000 (20:58 +0000)]
[NVPTX] remove unnecessary named metadata update that happens to break debug info.

Also added test case to verify IR changes done by NVPTXGenericToNVVM pass.

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

llvm-svn: 277520

7 years ago[compiler-rt] Add more interception patterns.
Etienne Bergeron [Tue, 2 Aug 2016 20:38:05 +0000 (20:38 +0000)]
[compiler-rt] Add more interception patterns.

Summary:
These instructions where not supported on my win7 computer.
They were happening on strstr when building chrome unittests with asan.

Reviewers: rnk

Subscribers: llvm-commits, chrisha

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

llvm-svn: 277519

7 years ago[asan] Intercept RtlRaiseException instead of kernel32!RaiseException
Reid Kleckner [Tue, 2 Aug 2016 20:36:29 +0000 (20:36 +0000)]
[asan] Intercept RtlRaiseException instead of kernel32!RaiseException

Summary:
On my install of Windows 10, RaiseException is a tail call to
kernelbase!RaiseException. Obviously, we fail to intercept that.
Instead, try hooking at the ntdll!RtlRaiseException layer. It is
unlikely that this layer will contain control flow.

Intercepting at this level requires adding a decoding for
'LEA ESP, [ESP + 0xXXXXXXXX]', which is a really obscure way to write
'SUB ESP, 0xXXXXXXXX' that avoids clobbering EFLAGS.

Reviewers: etienneb

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 277518

7 years ago[docs] Fix links format.
Alexander Kornienko [Tue, 2 Aug 2016 20:29:47 +0000 (20:29 +0000)]
[docs] Fix links format.

llvm-svn: 277517

7 years ago[clang-tidy] MPITypeMismatchCheck
Alexander Kornienko [Tue, 2 Aug 2016 20:29:35 +0000 (20:29 +0000)]
[clang-tidy] MPITypeMismatchCheck

This check verifies if buffer type and MPI (Message Passing Interface)
datatype pairs match. All MPI datatypes defined by the MPI standard (3.1)
are verified by this check. User defined typedefs, custom MPI datatypes and
null pointer constants are skipped, in the course of verification.

Instructions on how to apply the check can be found at:
https://github.com/0ax1/MPI-Checker/tree/master/examples

Patch by Alexander Droste!

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

llvm-svn: 277516

7 years ago[LoopVectorize] Change comment for isOutOfScope in collectLoopUniforms, NFC
Wei Mi [Tue, 2 Aug 2016 20:27:49 +0000 (20:27 +0000)]
[LoopVectorize] Change comment for isOutOfScope in collectLoopUniforms, NFC

Update comment for isOutOfScope and add a testcase for uniform value being used
out of scope.

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

llvm-svn: 277515

7 years agoRemove stale CHECK lines that should have been included in r277478
Reid Kleckner [Tue, 2 Aug 2016 20:26:59 +0000 (20:26 +0000)]
Remove stale CHECK lines that should have been included in r277478

We no longer assign ids to unregistered threads. We don't have any stack
trace for thread creation for these worker threads, so this shouldn't
affect report quality much.

llvm-svn: 277514

7 years agoAArch64: properly calculate cmpxchg status in FastISel.
Tim Northover [Tue, 2 Aug 2016 20:22:36 +0000 (20:22 +0000)]
AArch64: properly calculate cmpxchg status in FastISel.

We were relying on the misleadingly-names $status result to actually be the
status. Actually it's just a scratch register that may or may not be valid (and
is the inverse of the real ststus anyway). Success can be determined by
comparing the value loaded against the one we wanted to see for "cmpxchg
strong" loops like this.

Should fix PR28819.

llvm-svn: 277513

7 years agoPass compilers when configuring Google Benchmark.
Eric Fiselier [Tue, 2 Aug 2016 20:21:07 +0000 (20:21 +0000)]
Pass compilers when configuring  Google Benchmark.

llvm-svn: 277512

7 years agofix comments typos [NFC]
Etienne Bergeron [Tue, 2 Aug 2016 20:07:49 +0000 (20:07 +0000)]
fix comments typos [NFC]

llvm-svn: 277511

7 years agoFixes for post-commit review comments on r277480
Daniel Berlin [Tue, 2 Aug 2016 20:02:21 +0000 (20:02 +0000)]
Fixes for post-commit review comments on r277480

llvm-svn: 277510

7 years ago[Profile] track ownership of filename pattern string
Xinliang David Li [Tue, 2 Aug 2016 19:34:00 +0000 (19:34 +0000)]
[Profile] track ownership of filename pattern string

Make sure runtime copy and owns the string when passed
in from external users of runtime API.

llvm-svn: 277507

7 years ago[IRCE] Rename variable; NFC
Sanjoy Das [Tue, 2 Aug 2016 19:32:01 +0000 (19:32 +0000)]
[IRCE] Rename variable; NFC

There is nothing "Original" about "OriginalLoopInfo".

llvm-svn: 277506

7 years ago[IRCE] Preserve DomTree and LCSSA
Sanjoy Das [Tue, 2 Aug 2016 19:31:54 +0000 (19:31 +0000)]
[IRCE] Preserve DomTree and LCSSA

This changes IRCE to "preserve" LCSSA and DomTree by recomputing them.
It still does not preserve LoopSimplify.

llvm-svn: 277505

7 years agoAMDGPU: Stay in WQM for non-intrinsic stores
Nicolai Haehnle [Tue, 2 Aug 2016 19:31:14 +0000 (19:31 +0000)]
AMDGPU: Stay in WQM for non-intrinsic stores

Summary:
Two types of stores are possible in pixel shaders: stores to memory that are
explicitly requested at the API level, and stores that are an implementation
detail of register spilling or lowering of arrays.

For the first kind of store, we must ensure that helper pixels have no effect
and hence WQM must be disabled. The second kind of store must always be
executed, because the written value may be loaded again in a way that is
relevant for helper pixels as well -- and there are no externally visible
effects anyway.

This is a candidate for the 3.9 release branch.

Reviewers: arsenm, tstellarAMD, mareko

Subscribers: arsenm, kzhuravl, llvm-commits

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

llvm-svn: 277504

7 years agotest commit
Albert Gutowski [Tue, 2 Aug 2016 19:25:17 +0000 (19:25 +0000)]
test commit

llvm-svn: 277503

7 years ago[LoopUnroll] Ensure we create prolog loops in simplified form.
Michael Zolotukhin [Tue, 2 Aug 2016 19:19:31 +0000 (19:19 +0000)]
[LoopUnroll] Ensure we create prolog loops in simplified form.

llvm-svn: 277502

7 years agoFix handling of end-of-line preprocessor comments Attempt 2
Nirav Dave [Tue, 2 Aug 2016 19:17:54 +0000 (19:17 +0000)]
Fix handling of end-of-line preprocessor comments Attempt 2

Attempt 2: Retryign after Tsan.mman test fix.

Attempt 1: Recommitting after fixing test.

When parsing assembly where the line comment syntax is not hash, the
lexer cannot distinguish between hash's that start a hash line comment
and one that is part of an assembly statement and must be distinguished
during parsing. Previously, this was incompletely handled by not checking
for EndOfStatement at the end of statements and interpreting hash
prefixed statements as comments.

Change EndOfStatement Parsing to check for Hash comments and reintroduce
Hash statement parsing to catch previously handled cases.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

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

llvm-svn: 277501

7 years agoAMDGPU: Track physical registers in SIWholeQuadMode
Nicolai Haehnle [Tue, 2 Aug 2016 19:17:37 +0000 (19:17 +0000)]
AMDGPU: Track physical registers in SIWholeQuadMode

Summary:
There are cases where uniform branch conditions are computed in VGPRs, and
we didn't correctly mark those as WQM.

The stray change in basic-branch.ll is because invoking the LiveIntervals
analysis leads to the detection of a dead register that would otherwise not
be seen at -O0.

This is a candidate for the 3.9 branch, as it fixes a possible hang.

Reviewers: arsenm, tstellarAMD, mareko

Subscribers: arsenm, llvm-commits, kzhuravl

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

llvm-svn: 277500

7 years ago[AArch64][GlobalISel] Replace test REQUIRES with lit.local.cfg. NFC.
Ahmed Bougacha [Tue, 2 Aug 2016 19:04:29 +0000 (19:04 +0000)]
[AArch64][GlobalISel] Replace test REQUIRES with lit.local.cfg. NFC.

I forgot the REQUIRES once (see r277486).
Let's prevent it from happening again.

llvm-svn: 277499

7 years ago[AArch64] Remove useless 'import re' from CodeGen lit.local.cfg. NFC.
Ahmed Bougacha [Tue, 2 Aug 2016 19:04:25 +0000 (19:04 +0000)]
[AArch64] Remove useless 'import re' from CodeGen lit.local.cfg. NFC.

llvm-svn: 277498

7 years ago[Hexagon] Prefer _io over _rr for 64-bit store with constant offset
Krzysztof Parzyszek [Tue, 2 Aug 2016 18:50:05 +0000 (18:50 +0000)]
[Hexagon] Prefer _io over _rr for 64-bit store with constant offset

Identify patterns where the address is aligned to an 8-byte boundary,
but both the base address and the constant offset are both proper
multiples of 4. In such cases, extract Base+4 into a separate instruc-
tion, and use S2_storerd_io, instead of using S4_storerd_rr.

llvm-svn: 277497

7 years ago[Hexagon] Remove unused option
Krzysztof Parzyszek [Tue, 2 Aug 2016 18:39:32 +0000 (18:39 +0000)]
[Hexagon] Remove unused option

llvm-svn: 277496

7 years ago[Concepts] Add TODO and requires-clause placeholder; NFC
Hubert Tong [Tue, 2 Aug 2016 18:36:15 +0000 (18:36 +0000)]
[Concepts] Add TODO and requires-clause placeholder; NFC

llvm-svn: 277495

7 years ago[Hexagon] Improvements to address mode checks in TargetLowering
Krzysztof Parzyszek [Tue, 2 Aug 2016 18:34:31 +0000 (18:34 +0000)]
[Hexagon] Improvements to address mode checks in TargetLowering

- Implement getOptimalMemOpType.
- Check BaseOffset in isLegalAddressingMode.

llvm-svn: 277494

7 years agoRevert "[Order Files] Remove dtrace predicate"
Chris Bieneman [Tue, 2 Aug 2016 18:23:56 +0000 (18:23 +0000)]
Revert "[Order Files] Remove dtrace predicate"

This reverts commit r277487.

Removing the probe predicate was a red herring. It results in more symbols being placed in the final order file, but they are symbols from outside the clang image.

llvm-svn: 277492

7 years ago[clang-rename] fix Emacs integration script
Kirill Bobyrev [Tue, 2 Aug 2016 18:23:08 +0000 (18:23 +0000)]
[clang-rename] fix Emacs integration script

llvm-svn: 277491

7 years agoUpdate Clang Parser test error message to match new parser errors
Nirav Dave [Tue, 2 Aug 2016 17:58:14 +0000 (17:58 +0000)]
Update Clang Parser test error message to match new parser errors

Update clang tests in light of r277489.

llvm-svn: 277490

7 years ago[MC] Fix Intel Operand assembly parsing for .set ids
Nirav Dave [Tue, 2 Aug 2016 17:56:03 +0000 (17:56 +0000)]
[MC] Fix Intel Operand assembly parsing for .set ids

Recommitting after fixing overaggressive fastpath return in parsing.

Fix intel syntax special case identifier operands that refer to a constant
(e.g. .set <ID> n) to be interpreted as immediate not memory in parsing.

Associated commit to fix clang test commited shortly.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 277489

7 years agoUpdated documentation
Vitaly Buka [Tue, 2 Aug 2016 17:51:48 +0000 (17:51 +0000)]
Updated documentation

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

llvm-svn: 277488

7 years ago[Order Files] Remove dtrace predicate
Chris Bieneman [Tue, 2 Aug 2016 17:50:53 +0000 (17:50 +0000)]
[Order Files] Remove dtrace predicate

Having the dtrace predicate setup to only show probes in clang filters out static initializers executed by dyld, which we do want included in the order files.

llvm-svn: 277487

7 years ago[AArch64][GlobalISel] Add REQUIRES: global-isel to verifier tests.
Ahmed Bougacha [Tue, 2 Aug 2016 17:19:35 +0000 (17:19 +0000)]
[AArch64][GlobalISel] Add REQUIRES: global-isel to verifier tests.

I thought the directory had a lit.local.cfg, but it doesn't.
I'll add one, but for now, add the REQUIRES line. While there,
move the triple into the IR and add a datalayout.

llvm-svn: 277486

7 years agoMSVC 2013 does not implement C++11 unions properly, so remove the anoymous union...
Daniel Berlin [Tue, 2 Aug 2016 16:59:51 +0000 (16:59 +0000)]
MSVC 2013 does not implement C++11 unions properly, so remove the anoymous union for now,
and leave a FIXME.

llvm-svn: 277485

7 years ago[GlobalISel] Set the Selected MF property.
Ahmed Bougacha [Tue, 2 Aug 2016 16:49:25 +0000 (16:49 +0000)]
[GlobalISel] Set the Selected MF property.

None of GlobalISel requires the property, but this lets us use the
verifier instead of rolling our own "all instructions selected" check.

llvm-svn: 277484

7 years ago[GlobalISel] Verify Selected MF property.
Ahmed Bougacha [Tue, 2 Aug 2016 16:49:22 +0000 (16:49 +0000)]
[GlobalISel] Verify Selected MF property.

After instruction selection, there should be no pre-isel generic
instructions remaining, nor should generic virtual registers be
used. Verify that.

llvm-svn: 277483

7 years ago[GlobalISel] Add Selected MachineFunction property.
Ahmed Bougacha [Tue, 2 Aug 2016 16:49:19 +0000 (16:49 +0000)]
[GlobalISel] Add Selected MachineFunction property.

Selected: the InstructionSelect pass ran and all pre-isel generic
instructions have been eliminated; i.e., all instructions are now
target-specific or non-pre-isel generic instructions (e.g., COPY).

Since only pre-isel generic instructions can have generic virtual register
operands, this also means that all generic virtual registers have been
constrained to virtual registers (assigned to register classes) and that
all sizes attached to them have been eliminated.

This lets us enforce certain invariants across passes.
This property is GlobalISel-specific, but is always available.

llvm-svn: 277482

7 years agoRewrite the use optimizer to be less memory intensive and 50% faster.
Daniel Berlin [Tue, 2 Aug 2016 16:24:03 +0000 (16:24 +0000)]
Rewrite the use optimizer to be less memory intensive and 50% faster.
Fixes PR28670

Summary:
Rewrite the use optimizer to be less memory intensive and 50% faster.
Fixes PR28670

The new use optimizer works like a standard SSA renaming pass, storing
all possible versions a MemorySSA use could get in a stack, and just
tracking indexes into the stack.
This uses much less memory than caching N^2 alias query results.
It's also a lot faster.

The current version defers phi node walking to the normal walker.

Reviewers: george.burgess.iv

Subscribers: llvm-commits

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

llvm-svn: 277480

7 years ago[LVI] NFC. Sink a condition type check from the caller down to getValueFromCondition
Artur Pilipenko [Tue, 2 Aug 2016 16:20:48 +0000 (16:20 +0000)]
[LVI] NFC. Sink a condition type check from the caller down to getValueFromCondition

This is a preparatory refactoring to support conditions other than ICmpInst.

llvm-svn: 277479

7 years ago[asan] Remove NtWaitForWorkViaWorkerFactory interceptor
Reid Kleckner [Tue, 2 Aug 2016 16:17:32 +0000 (16:17 +0000)]
[asan] Remove NtWaitForWorkViaWorkerFactory interceptor

Summary:
On Windows 10, this gets called after TLS has been torn down from NTDLL,
and we crash attempting to return fake_tsd. This interceptor isn't
needed after r242948 anyway, so let's remove it. The ASan runtime can
now tolerate unregistered threads calling __asan_handle_no_return.

Reviewers: vitalybuka, etienneb

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 277478

7 years ago[GlobalISel] Set and require RegBankSelected MF property.
Ahmed Bougacha [Tue, 2 Aug 2016 16:17:18 +0000 (16:17 +0000)]
[GlobalISel] Set and require RegBankSelected MF property.

The InstructionSelect pass assumes that RegBankSelect ran; set the
property on all tests (thereby verifying the test inputs) and require
it in the pass.

llvm-svn: 277477

7 years ago[GlobalISel] Verify RegBankSelected MF property.
Ahmed Bougacha [Tue, 2 Aug 2016 16:17:15 +0000 (16:17 +0000)]
[GlobalISel] Verify RegBankSelected MF property.

RegBankSelected functions shouldn't have any generic virtual
register not assigned to a bank. Verify that.

llvm-svn: 277476

7 years ago[GlobalISel] Add RegBankSelected MachineFunction property.
Ahmed Bougacha [Tue, 2 Aug 2016 16:17:10 +0000 (16:17 +0000)]
[GlobalISel] Add RegBankSelected MachineFunction property.

RegBankSelected: the RegBankSelect pass ran and all generic virtual
registers have been assigned to a register bank.

This lets us enforce certain invariants across passes.
This property is GlobalISel-specific, but is always available.

llvm-svn: 277475

7 years ago[LV] Generate both scalar and vector integer induction variables
Matthew Simpson [Tue, 2 Aug 2016 15:25:16 +0000 (15:25 +0000)]
[LV] Generate both scalar and vector integer induction variables

This patch enables the vectorizer to generate both scalar and vector versions
of an integer induction variable for a given loop. Previously, we only
generated a scalar induction variable if we knew all its users were going to be
scalar. Otherwise, we generated a vector induction variable. In the case of a
loop with both scalar and vector users of the induction variable, we would
generate the vector induction variable and extract scalar values from it for
the scalar users. With this patch, we now generate both versions of the
induction variable when there are both scalar and vector users and select which
version to use based on whether the user is scalar or vector.

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

llvm-svn: 277474

7 years ago[analyzer] Hotfix for buildbot failure due to unspecified triple in r277449
Artem Dergachev [Tue, 2 Aug 2016 15:16:06 +0000 (15:16 +0000)]
[analyzer] Hotfix for buildbot failure due to unspecified triple in r277449

If a target triple is not specified, the default host triple is used,
which is not good for compiling inline assembler code.

Patch by Raphael Isemann!

llvm-svn: 277473

7 years ago[GlobalISel] Set, require, and verify Legalized MF property.
Ahmed Bougacha [Tue, 2 Aug 2016 15:10:32 +0000 (15:10 +0000)]
[GlobalISel] Set, require, and verify Legalized MF property.

RegBankSelect and InstructionSelect run after the legalizer and
require a Legalized function: check that all instructions are legal.

Note that this should be in the MachineVerifier, but it can't use the
MachineLegalizer as it's currently in the separate GlobalISel library.
Note that the RegBankSelect verifier checks have the same layering
problem, but we only use inline methods so end up not needing to link
against the GlobalISel library.

llvm-svn: 277472

7 years ago[AArch64][GlobalISel] Mark basic binops/memops as legal.
Ahmed Bougacha [Tue, 2 Aug 2016 15:10:28 +0000 (15:10 +0000)]
[AArch64][GlobalISel] Mark basic binops/memops as legal.

We currently use and test these, and select most of them. Mark them
as legal even though we don't go through the full ir->asm flow yet.

This doesn't currently have standalone tests, but the verifier will
soon learn to check that the regbankselect/select tests are legal.

llvm-svn: 277471

7 years ago[GlobalISel] Add Legalized MachineFunction property.
Ahmed Bougacha [Tue, 2 Aug 2016 15:10:25 +0000 (15:10 +0000)]
[GlobalISel] Add Legalized MachineFunction property.

Legalized: The MachineLegalizer ran; all pre-isel generic instructions
have been legalized, i.e., all instructions are now one of:
  - generic and always legal (e.g., COPY)
  - target-specific
  - legal pre-isel generic instructions.

This lets us enforce certain invariants across passes.
This property is GlobalISel-specific, but is always available.

llvm-svn: 277470

7 years ago[clang-rename] fix Emacs script build failure
Kirill Bobyrev [Tue, 2 Aug 2016 15:10:17 +0000 (15:10 +0000)]
[clang-rename] fix Emacs script build failure

Clang-rename Emacs integration script sometimes doesn't work correctly.

llvm-svn: 277469

7 years agoRevert "[MC] Fix handling of end-of-line preprocessor comments"
Nirav Dave [Tue, 2 Aug 2016 15:08:52 +0000 (15:08 +0000)]
Revert "[MC] Fix handling of end-of-line preprocessor comments"

Causes TSan failure on PPC64

This reverts commit r277459.

llvm-svn: 277468

7 years ago[WebAssembly] Remove a README.txt entry that is now implemented.
Dan Gohman [Tue, 2 Aug 2016 14:53:44 +0000 (14:53 +0000)]
[WebAssembly] Remove a README.txt entry that is now implemented.

llvm-svn: 277467

7 years ago[LVI] NFC. Fix a typo getValueFromFromCondition -> getValueFromCondition
Artur Pilipenko [Tue, 2 Aug 2016 14:44:32 +0000 (14:44 +0000)]
[LVI] NFC. Fix a typo getValueFromFromCondition -> getValueFromCondition

llvm-svn: 277466

7 years ago[CodeGen] Generalize MachineFunctionProperties::print comma handling.
Ahmed Bougacha [Tue, 2 Aug 2016 14:42:57 +0000 (14:42 +0000)]
[CodeGen] Generalize MachineFunctionProperties::print comma handling.

This is only used for debug prints, but the previous hardcoded ", "
caused it to be printed unnecessarily when OnlySet, and is annoying
when adding new properties.

llvm-svn: 277465

7 years ago[GlobalISel] Require isSSA in GISel passes.
Ahmed Bougacha [Tue, 2 Aug 2016 14:42:55 +0000 (14:42 +0000)]
[GlobalISel] Require isSSA in GISel passes.

The GISel passes don't make sense on non-SSA functions.
All GISel tests already set isSSA. Enforce that.

llvm-svn: 277464

7 years agoFollow-up for r277458: Update the tsan_mman_test.cc unit test.
Kuba Brecka [Tue, 2 Aug 2016 14:41:03 +0000 (14:41 +0000)]
Follow-up for r277458: Update the tsan_mman_test.cc unit test.

llvm-svn: 277463

7 years ago[tsan] Fix the behavior of OSAtomicTestAndClear
Kuba Brecka [Tue, 2 Aug 2016 14:30:52 +0000 (14:30 +0000)]
[tsan] Fix the behavior of OSAtomicTestAndClear

The system implementation of OSAtomicTestAndClear returns the original bit, but the TSan interceptor has a bug which always returns zero from the function. This patch fixes this and adds a test.

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

llvm-svn: 277461

7 years ago[LV] Untangle the concepts of uniform and scalar
Matthew Simpson [Tue, 2 Aug 2016 14:29:41 +0000 (14:29 +0000)]
[LV] Untangle the concepts of uniform and scalar

This patch refactors the logic in collectLoopUniforms and
collectValuesToIgnore, untangling the concepts of "uniform" and "scalar". It
adds isScalarAfterVectorization along side isUniformAfterVectorization to
distinguish the two. Known scalar values include those that are uniform,
getelementptr instructions that won't be vectorized, and induction variables
and induction variable update instructions whose users are all known to be
scalar.

This patch includes the following functional changes:

- In collectLoopUniforms, we mark uniform the pointer operands of interleaved
  accesses. Although non-consecutive, these pointers are treated like
  consecutive pointers during vectorization.

- In collectValuesToIgnore, we insert a value into VecValuesToIgnore if it
  isScalarAfterVectorization rather than isUniformAfterVectorization. This
  differs from the previous functionaly in that we now add getelementptr
  instructions that will not be vectorized into VecValuesToIgnore.

This patch also removes the ValuesNotWidened set used for induction variable
scalarization since, after the above changes, it is now equivalent to
isScalarAfterVectorization.

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

llvm-svn: 277460

7 years ago[MC] Fix handling of end-of-line preprocessor comments
Nirav Dave [Tue, 2 Aug 2016 14:25:49 +0000 (14:25 +0000)]
[MC] Fix handling of end-of-line preprocessor comments

Recommitting after fixing test.

When parsing assembly where the line comment syntax is not hash, the
lexer cannot distinguish between hash's that start a hash line comment
and one that is part of an assembly statement and must be distinguished
during parsing. Previously, this was incompletely handled by not checking
for EndOfStatement at the end of statements and interpreting hash
prefixed statements as comments.

Change EndOfStatement Parsing to check for Hash comments and reintroduce
Hash statement parsing to catch previously handled cases.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

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

llvm-svn: 277459

7 years ago[tsan] Fix behavior of realloc(nullptr, 0) on Darwin
Kuba Brecka [Tue, 2 Aug 2016 14:22:12 +0000 (14:22 +0000)]
[tsan] Fix behavior of realloc(nullptr, 0) on Darwin

On Darwin, there are some apps that rely on realloc(nullptr, 0) returning a valid pointer. TSan currently returns nullptr in this case, let's fix it to avoid breaking binary compatibility.

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

llvm-svn: 277458

7 years ago[clang-cl] Fix PCH tests to use x86_64 as target
Diana Picus [Tue, 2 Aug 2016 13:53:00 +0000 (13:53 +0000)]
[clang-cl] Fix PCH tests to use x86_64 as target

These tests require x86-registered-target, but they don't force the target as
x86 on the command line, which means they will be run and they might fail when
building the x86 backend on another platform (such as AArch64).

Fixes https://llvm.org/bugs/show_bug.cgi?id=28797

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

llvm-svn: 277457

7 years agoFixing 'Aquire' typo and libcxx build.
Ben Craig [Tue, 2 Aug 2016 13:43:48 +0000 (13:43 +0000)]
Fixing 'Aquire' typo and libcxx build.

llvm-svn: 277456

7 years agoRevert rL277454
David Callahan [Tue, 2 Aug 2016 13:26:07 +0000 (13:26 +0000)]
Revert rL277454

llvm-svn: 277455

7 years agotest commit
David Callahan [Tue, 2 Aug 2016 13:19:12 +0000 (13:19 +0000)]
test commit

llvm-svn: 277454

7 years agoRevert rL277429: Correct makefile.rules to use toolchain specific AR and OBJCOPY
Omair Javaid [Tue, 2 Aug 2016 13:17:49 +0000 (13:17 +0000)]
Revert rL277429: Correct makefile.rules to use toolchain specific AR and OBJCOPY

This commit is causing problems on gcc-* compiler with version number sufix.

Requires a new solution will post a follow up patch.

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

llvm-svn: 277453

7 years agoclang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Appease targeting...
NAKAMURA Takumi [Tue, 2 Aug 2016 13:17:40 +0000 (13:17 +0000)]
clang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Appease targeting ms mode.

llvm-svn: 277452

7 years agoclang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Move RUN: lines...
NAKAMURA Takumi [Tue, 2 Aug 2016 13:17:36 +0000 (13:17 +0000)]
clang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Move RUN: lines below not to be affected by tweaks of parameters.

llvm-svn: 277451

7 years ago[ARM] Improve smul* and smla* isel for Thumb2
Sam Parker [Tue, 2 Aug 2016 12:44:27 +0000 (12:44 +0000)]
[ARM] Improve smul* and smla* isel for Thumb2

Added (sra (shl x, 16), 16) to the sext_16_node PatLeaf for ARM to
simplify some pattern matching. This has allowed several patterns
for smul* and smla* to be removed as well as making it easier to add
the matching for the corresponding instructions for Thumb2 targets.
Also added two Pat classes that are predicated on Thumb2 with the
hasDSP flag and UseMulOps flags. Updated the smul codegen test with
the wider range of patterns plus the ThumbV6 and ThumbV6T2 targets.

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

llvm-svn: 277450

7 years ago[analyzer] Respect statement-specific data in CloneDetection.
Artem Dergachev [Tue, 2 Aug 2016 12:21:09 +0000 (12:21 +0000)]
[analyzer] Respect statement-specific data in CloneDetection.

So far the CloneDetector only respected the kind of each statement when
searching for clones. This patch refines the way the CloneDetector collects data
from each statement by providing methods for each statement kind,
that will read the kind-specific attributes.

For example, statements 'a < b' and 'a > b' are no longer considered to be
clones, because they are different in operation code, which is an attribute
specific to the BinaryOperator statement kind.

Patch by Raphael Isemann!

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

llvm-svn: 277449

7 years agoHexagonVectorPrint.cpp: Fix r277370. Don't use getInstrVecReg() in the expression...
NAKAMURA Takumi [Tue, 2 Aug 2016 11:59:16 +0000 (11:59 +0000)]
HexagonVectorPrint.cpp: Fix r277370. Don't use getInstrVecReg() in the expression of assert(). It has side effects.

llvm-svn: 277448

7 years ago[GlobalISel] Don't RegBankSelect target-specific instructions.
Ahmed Bougacha [Tue, 2 Aug 2016 11:41:16 +0000 (11:41 +0000)]
[GlobalISel] Don't RegBankSelect target-specific instructions.

They don't have types and should be using register classes.

llvm-svn: 277447

7 years ago[GlobalISel] Don't legalize non-generic instructions.
Ahmed Bougacha [Tue, 2 Aug 2016 11:41:09 +0000 (11:41 +0000)]
[GlobalISel] Don't legalize non-generic instructions.

They don't have types and should be legal.

llvm-svn: 277446

7 years ago[GlobalISel] Const-ify MachineInstrs passed to MachineLegalizer.
Ahmed Bougacha [Tue, 2 Aug 2016 11:41:03 +0000 (11:41 +0000)]
[GlobalISel] Const-ify MachineInstrs passed to MachineLegalizer.

llvm-svn: 277445

7 years ago[clang-tidy] Fix an unused-using-decl false positive about template arguments in
Haojian Wu [Tue, 2 Aug 2016 11:26:35 +0000 (11:26 +0000)]
[clang-tidy] Fix an unused-using-decl false positive about template arguments in
function call expression.

Summary:
The check doesn't mark the template argument as used when the template
argument is a template.

Reviewers: djasper, alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 277444

7 years agoSupport for OCaml native debugging
Tamas Berghammer [Tue, 2 Aug 2016 11:15:55 +0000 (11:15 +0000)]
Support for OCaml native debugging

This introduces basic support for debugging OCaml binaries.
Use of the native compiler with DWARF emission support (see
https://github.com/ocaml/ocaml/pull/574) is required.

Available variables are considered as 64 bits unsigned integers,
their interpretation will be left to a OCaml-made debugging layer.

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

llvm-svn: 277443

7 years ago[include-fixer] Correct nested class search for identifiers with scoped information
Haojian Wu [Tue, 2 Aug 2016 10:43:10 +0000 (10:43 +0000)]
[include-fixer] Correct nested class search for identifiers with scoped information

Summary:
include-fixer will firstly try to use scoped namespace context information to
search identifier. However, in some cases, it's unsafe to do nested class
search, because it might treat the identifier as a nested class of scoped
namespace.

Given the following code, and the symbol database only has two classes: "foo" and
"b::Bar".

    namespace foo { Bar t; }

Before getting fixing, include-fixer will never search "Bar" symbol.
Because it firstly tries to search "foo::Bar", there is no "Bar" in foo namespace,
then it finds "foo" in database finally. So it treats "Bar" is a nested class
of "foo".

Reviewers: bkramer

Subscribers: cfe-commits

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

llvm-svn: 277442

7 years ago[mips] Update the P5600 scheduler for isComplete = 1
Simon Dardis [Tue, 2 Aug 2016 10:32:00 +0000 (10:32 +0000)]
[mips] Update the P5600 scheduler for isComplete = 1

These changes update the schedule model for the P5600 and includes the
rest of the MSA and MIPS32R5 instruction sets.

Reviewers: dsanders, vkalintris

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

llvm-svn: 277441

7 years ago[ARM] Some saturation instructions not DSP-only
Bernard Ogden [Tue, 2 Aug 2016 10:04:03 +0000 (10:04 +0000)]
[ARM] Some saturation instructions not DSP-only

Summary:
Commit 276701 requires that targets have the DSP extensions to use
certain saturating instructions. This requires some corrections.

For ARM ISA the instructions in question are available in all v6*
architectures.

For Thumb2, the instructions in question are available from v6T2.
SSAT and USAT are part of the base architecture while SSAT16 and
USAT16 require the DSP extensions.

Reviewers: rengolin

Subscribers: aemerson, rengolin, samparker, llvm-commits

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

llvm-svn: 277439

7 years agoclang-rename: split existing options into two new subcommands
Miklos Vajna [Tue, 2 Aug 2016 09:51:31 +0000 (09:51 +0000)]
clang-rename: split existing options into two new subcommands

- rename-at is meant to be integrated with editors and works mainly off
  of a location in a file, and this is the default
- rename-all is optimized for one or more oldname->newname renames, and
  works with clang-apply-replacements

Reviewers: bkramer, klimek

Subscribers: omtcyfz

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

llvm-svn: 277438

7 years ago[clang-rename] add support for template parameter renaming
Kirill Bobyrev [Tue, 2 Aug 2016 09:38:38 +0000 (09:38 +0000)]
[clang-rename] add support for template parameter renaming

Few simple tweaks allow template parameters to be renamed. See
TemplateTypenameFindBy{TemplateParam|TypeInside}.cpp

Reviewers: alexfh

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

llvm-svn: 277437

7 years ago[LoadStoreVectorizer] Don't use a linear walk for an existence check in a SmallPtrSet
Benjamin Kramer [Tue, 2 Aug 2016 09:35:17 +0000 (09:35 +0000)]
[LoadStoreVectorizer] Don't use a linear walk for an existence check in a SmallPtrSet

No functionality change intended.

llvm-svn: 277436

7 years ago[AVX512] Don't use i128 masked gather/scatter/load/store. Do more accurately dataWidt...
Igor Breger [Tue, 2 Aug 2016 09:15:28 +0000 (09:15 +0000)]
[AVX512] Don't use i128 masked gather/scatter/load/store. Do more accurately dataWidth check.

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

llvm-svn: 277435

7 years agoAArch64: Assert on branch displacement bits
Matt Arsenault [Tue, 2 Aug 2016 08:56:52 +0000 (08:56 +0000)]
AArch64: Assert on branch displacement bits

llvm-svn: 277434

7 years ago[clang-rename] add basic Emacs integration
Kirill Bobyrev [Tue, 2 Aug 2016 08:51:26 +0000 (08:51 +0000)]
[clang-rename] add basic Emacs integration

This patch aims to add very basic Emacs integration.

Reviewers: hokein, alexfh

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

llvm-svn: 277433

7 years ago[ELF] - Fix: do not ignore relocations addends when using lld -r
George Rimar [Tue, 2 Aug 2016 08:49:57 +0000 (08:49 +0000)]
[ELF] - Fix: do not ignore relocations addends when using lld -r

Previously addends were ignored. This is PR28779.
Patch fixes the issue.

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

llvm-svn: 277432