platform/upstream/llvm.git
8 years agoSimplify mips got handling.
Rafael Espindola [Tue, 19 Apr 2016 22:46:03 +0000 (22:46 +0000)]
Simplify mips got handling.

This avoids computing the address of a position in the got just to then
subtract got->getva().

llvm-svn: 266831

8 years ago[libFuzzer] more trophies
Kostya Serebryany [Tue, 19 Apr 2016 22:37:44 +0000 (22:37 +0000)]
[libFuzzer] more trophies

llvm-svn: 266830

8 years ago[Parse] Reuse OptionUnroll rather than matching it again. NFC
Adam Nemet [Tue, 19 Apr 2016 22:29:24 +0000 (22:29 +0000)]
[Parse] Reuse OptionUnroll rather than matching it again. NFC

llvm-svn: 266829

8 years agoARM: fix assertion failure on -O0 cmpxchg.
Tim Northover [Tue, 19 Apr 2016 22:25:02 +0000 (22:25 +0000)]
ARM: fix assertion failure on -O0 cmpxchg.

Because lowering of CMP_SWAP_64 occurs during type legalization, there can be
i64 types produced by more than just a BUILD_PAIR or similar. My initial tests
used just incoming function args.

llvm-svn: 266828

8 years ago[Parse] Use StringSwitch to improve readability. NFC
Adam Nemet [Tue, 19 Apr 2016 22:17:45 +0000 (22:17 +0000)]
[Parse] Use StringSwitch to improve readability. NFC

A subsequent patch will propose a "distribute" loop hint.  Similarly to
unroll, this does not have a "assume_safety" argument either so this
condition will get more complex.

llvm-svn: 266827

8 years agoAdd IntrWrite[Arg]Mem intrinsic property
Nicolai Haehnle [Tue, 19 Apr 2016 21:58:33 +0000 (21:58 +0000)]
Add IntrWrite[Arg]Mem intrinsic property

Summary:
This property is used to mark an intrinsic that only writes to memory, but
neither reads from memory nor has other side effects.

An example where this is useful is the llvm.amdgcn.buffer.store.format.*
intrinsic, which corresponds to a store instruction that goes through a special
buffer descriptor rather than through a plain pointer.

With this property, the intrinsic should still be handled as having side
effects at the LLVM IR level, but machine scheduling can make smarter
decisions.

Reviewers: tstellarAMD, arsenm, joker.eph, reames

Subscribers: arsenm, llvm-commits

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

llvm-svn: 266826

8 years agoAMDGPU: Guard VOPC instructions against incorrect commute
Nicolai Haehnle [Tue, 19 Apr 2016 21:58:22 +0000 (21:58 +0000)]
AMDGPU: Guard VOPC instructions against incorrect commute

Summary:
The added testcase, which triggered this, was derived from a shader-db case
via bugpoint. A separate question is why scalar branching wasn't used.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

llvm-svn: 266825

8 years agoAMDGPU/SI: SGPR accounting in getSIProgramInfo must ignore exec_lo/hi
Nicolai Haehnle [Tue, 19 Apr 2016 21:58:17 +0000 (21:58 +0000)]
AMDGPU/SI: SGPR accounting in getSIProgramInfo must ignore exec_lo/hi

Summary:
A shader stored the live mask (initial exec mask) in an SGPR which was then
spilled during register allocation. The allocator quite reasonably
optimized turned the spill into

  v_writelane_b32 %vgpr, exec_lo, N
  v_writelane_b32 %vgpr, exec_hi, N+1

at the beginning of the shader, confusing the SGPR accounting.

No test case, because si-sgpr-spill.ll together with an upcoming patch for
WQM handling exhibits the problem.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

llvm-svn: 266824

8 years ago[TableGen] Make an error message slightly more informative
Nicolai Haehnle [Tue, 19 Apr 2016 21:58:10 +0000 (21:58 +0000)]
[TableGen] Make an error message slightly more informative

Reviewers: ab, spop, stoklund

Subscribers: llvm-commits

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

llvm-svn: 266823

8 years agoRemove duplicated header contents, NFC
Vedant Kumar [Tue, 19 Apr 2016 21:55:14 +0000 (21:55 +0000)]
Remove duplicated header contents, NFC

It looks like InstrProfiling.h was the victim of a bad merge. The header
guards in the file prevented the build from blowing up.

llvm-svn: 266822

8 years ago[Hexagon] Fix operand swapping in HexagonPeephole
Krzysztof Parzyszek [Tue, 19 Apr 2016 21:36:24 +0000 (21:36 +0000)]
[Hexagon] Fix operand swapping in HexagonPeephole

Also, disable zero- and size-extend optimizations for now.

llvm-svn: 266821

8 years agoXFAILing new test on C++03
Ben Craig [Tue, 19 Apr 2016 21:07:30 +0000 (21:07 +0000)]
XFAILing new test on C++03

initializer_list doesn't exist in C++03.

llvm-svn: 266820

8 years agoDocument how a binary file was created.
Rafael Espindola [Tue, 19 Apr 2016 20:52:28 +0000 (20:52 +0000)]
Document how a binary file was created.

llvm-svn: 266819

8 years ago[AArch64] [ARM] Make a target-independent llvm.thread.pointer intrinsic.
Marcin Koscielnicki [Tue, 19 Apr 2016 20:51:05 +0000 (20:51 +0000)]
[AArch64] [ARM] Make a target-independent llvm.thread.pointer intrinsic.

Both AArch64 and ARM support llvm.<arch>.thread.pointer intrinsics that
just return the thread pointer.  I have a pending patch that does the same
for SystemZ (D19054), and there are many more targets that could benefit
from one.

This patch merges the ARM and AArch64 intrinsics into a single target
independent one that will also be used by subsequent targets.

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

llvm-svn: 266818

8 years ago[AArch64] Fix D19098 fallout.
Marcin Koscielnicki [Tue, 19 Apr 2016 20:51:00 +0000 (20:51 +0000)]
[AArch64] Fix D19098 fallout.

The intrinsic is now called llvm.thread.pointer, not
llvm.aarch64.thread.pointer.  Also, the code handling it in CGBuiltin.cpp
is dead - it's already covered by GCCBuiltin.  Remove it.

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

llvm-svn: 266817

8 years agoMake a function file-scoped.
Rui Ueyama [Tue, 19 Apr 2016 20:50:25 +0000 (20:50 +0000)]
Make a function file-scoped.

llvm-svn: 266816

8 years agoEliminate circular dependency introduced between lldbtest.py and decorators.py
Kate Stone [Tue, 19 Apr 2016 20:45:47 +0000 (20:45 +0000)]
Eliminate circular dependency introduced between lldbtest.py and decorators.py

llvm-svn: 266815

8 years agocc1as: Don't crash when CIE is requested and no DWARF version is specified.
Adrian Prantl [Tue, 19 Apr 2016 20:31:19 +0000 (20:31 +0000)]
cc1as: Don't crash when CIE is requested and no DWARF version is specified.
This patch changes the default DWARF version for cc1as from invalid 0 to 2,
which should be the lowest common denominator on all platforms.

rdar://problem/24735813

llvm-svn: 266814

8 years ago[compiler-rt] Remove unwanted --check-prefix=CHECK from unit tests. NFC.
Mandeep Singh Grang [Tue, 19 Apr 2016 20:29:59 +0000 (20:29 +0000)]
[compiler-rt] Remove unwanted --check-prefix=CHECK from unit tests. NFC.

Summary:
Removed unwanted --check-prefix=CHECK from the following unit tests:
      test/asan/TestCases/Posix/start-deactivated.cc
      test/tsan/Darwin/ignored-interceptors.mm

 Patch by: Mandeep Singh Grang (mgrang)

Reviewers: samsonov, kcc, dvyukov, eugenis

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

llvm-svn: 266813

8 years ago[Orc] Add move ops for OrcRemoteTargetClient and OrcRemoteTargetServer to
Lang Hames [Tue, 19 Apr 2016 20:22:50 +0000 (20:22 +0000)]
[Orc] Add move ops for OrcRemoteTargetClient and OrcRemoteTargetServer to
appease MSVC.

llvm-svn: 266812

8 years ago[Hexagon] Fix printing the address operand of S2_storerinewabs
Krzysztof Parzyszek [Tue, 19 Apr 2016 20:20:33 +0000 (20:20 +0000)]
[Hexagon] Fix printing the address operand of S2_storerinewabs

llvm-svn: 266811

8 years agoFix pr27420.
Rafael Espindola [Tue, 19 Apr 2016 20:18:52 +0000 (20:18 +0000)]
Fix pr27420.

Return the right expression for R_X86_64_GOTPCRELX and
R_X86_64_REX_GOTPCRELX.

llvm-svn: 266810

8 years ago[PPC, SSP] Support PowerPC Linux stack protection.
Tim Shen [Tue, 19 Apr 2016 20:14:52 +0000 (20:14 +0000)]
[PPC, SSP] Support PowerPC Linux stack protection.

llvm-svn: 266809

8 years agoInclude initializer_list from utility
Ben Craig [Tue, 19 Apr 2016 20:13:55 +0000 (20:13 +0000)]
Include initializer_list from utility

The C++11 and C++14 standards both say in the header <utility> synopsis that
<utility> shall include <initializer_list>.

llvm-svn: 266808

8 years ago[ARM NEON] Define vfms_f32 on ARM, and all vfms using vfma.
Ahmed Bougacha [Tue, 19 Apr 2016 19:44:45 +0000 (19:44 +0000)]
[ARM NEON] Define vfms_f32 on ARM, and all vfms using vfma.

r259537 added vfma/vfms to armv7, but the builtin was only lowered
on the AArch64 side. Instead of supporting it on ARM, get rid of it.

The vfms builtin lowered to:
  %nb = fsub float -0.0, %b
  %r = @llvm.fma.f32(%a, %nb, %c)

Instead, define the operation in terms of vfma, and swap the
multiplicands. It now lowers to:
  %na = fsub float -0.0, %a
  %r = @llvm.fma.f32(%na, %b, %c)

This matches the instruction more closely, and lets current LLVM
generate the "natural" operand ordering:
  fmls.2s v0, v1, v2
instead of the crooked (but equivalent):
  fmls.2s v0, v2, v1
Except for theses changes, assembly is identical.

LLVM accepts both commutations, and the LLVM tests in:
  test/CodeGen/AArch64/arm64-fmadd.ll
  test/CodeGen/AArch64/fp-dp3.ll
  test/CodeGen/AArch64/neon-fma.ll
  test/CodeGen/ARM/fusedMAC.ll
already check either the new one only, or both.

Also verified against the test-suite unittests.

llvm-svn: 266807

8 years ago[SSP, 2/2] Create llvm.stackguard() intrinsic and lower it to LOAD_STACK_GUARD
Tim Shen [Tue, 19 Apr 2016 19:40:37 +0000 (19:40 +0000)]
[SSP, 2/2] Create llvm.stackguard() intrinsic and lower it to LOAD_STACK_GUARD

With this change, ideally IR pass can always generate llvm.stackguard
call to get the stack guard; but for now there are still IR form stack
guard customizations around (see getIRStackGuard()). Future SSP
customization should go through LOAD_STACK_GUARD.

There is a behavior change: stack guard values are not CSEed anymore,
since we should never reuse the value in case that it has been spilled (and
corrupted). See ssp-guard-spill.ll. This also cause the change of stack
size and codegen in X86 and AArch64 test cases.

Ideally we'd like to know if the guard created in llvm.stackprotector() gets
spilled or not. If the value is spilled, discard the value and reload
stack guard; otherwise reuse the value. This can be done by teaching
register allocator to know how to rematerialize LOAD_STACK_GUARD and
force a rematerialization (which seems hard), or check for spilling in
expandPostRAPseudo. It only makes sense when the stack guard is a global
variable, which requires more instructions to load. Anyway, this seems to go out
of the scope of the current patch.

llvm-svn: 266806

8 years ago[Orc] Add explicit move ops to OrcRemoteTargetRPCAPI for MSVC.
Lang Hames [Tue, 19 Apr 2016 19:35:16 +0000 (19:35 +0000)]
[Orc] Add explicit move ops to OrcRemoteTargetRPCAPI for MSVC.

llvm-svn: 266805

8 years ago[Orc] Fix missing return in RPC move assignment operator.
Lang Hames [Tue, 19 Apr 2016 19:34:46 +0000 (19:34 +0000)]
[Orc] Fix missing return in RPC move assignment operator.

llvm-svn: 266804

8 years agoFixed a bug in AnnotatedLine::startsWith when there are comments in the line.
Eric Liu [Tue, 19 Apr 2016 19:25:33 +0000 (19:25 +0000)]
Fixed a bug in AnnotatedLine::startsWith when there are comments in the line.

Summary: When there are comments in the line, one token may be checked multiple times.

Reviewers: mprobst, djasper

Subscribers: ioeric, cfe-commits, klimek

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

llvm-svn: 266803

8 years ago[lanai] Add lowering for SETCCE i32.
Jacques Pienaar [Tue, 19 Apr 2016 19:15:25 +0000 (19:15 +0000)]
[lanai] Add lowering for SETCCE i32.

* Add lowering for SETCCE i32.
* Add test to check lowering of i64 compares uses SETCCE expansion (outside of EQ and NE).
* Fix select.ll test and immediate form selection for RI operations.

llvm-svn: 266802

8 years ago[ValueTracking, VectorUtils] Refactor getIntrinsicIDForCall
David Majnemer [Tue, 19 Apr 2016 19:10:21 +0000 (19:10 +0000)]
[ValueTracking, VectorUtils] Refactor getIntrinsicIDForCall

The functionality contained within getIntrinsicIDForCall is two-fold: it
checks if a CallInst's callee is a vectorizable intrinsic.  If it isn't
an intrinsic, it attempts to map the call's target to a suitable
intrinsic.

Move the mapping functionality into getIntrinsicForCallSite and rename
getIntrinsicIDForCall to getVectorIntrinsicIDForCall while
reimplementing it in terms of getIntrinsicForCallSite.

llvm-svn: 266801

8 years agoObjC Class Property: don't emit class properties on old deployment targets.
Manman Ren [Tue, 19 Apr 2016 19:05:03 +0000 (19:05 +0000)]
ObjC Class Property: don't emit class properties on old deployment targets.

For old deployment targets, emit nil for all class property lists.

rdar://25616128

llvm-svn: 266800

8 years agoAttempt to fix buildbot.
Rui Ueyama [Tue, 19 Apr 2016 19:04:03 +0000 (19:04 +0000)]
Attempt to fix buildbot.

llvm-svn: 266799

8 years agoELF: Add +, -, *, / and & to SECTIONS linker script command.
Rui Ueyama [Tue, 19 Apr 2016 18:58:11 +0000 (18:58 +0000)]
ELF: Add +, -, *, / and & to SECTIONS linker script command.

This patch is based heavily on George Rimor's patch
http://reviews.llvm.org/D19221.

In the linker script, you can write expressions to compute addresses.
Currently we only support "+" operator. This adds a few more operators.

Since this patch adds * and /, we need to handle operator precedences
properly. I implemented that using the operator-precedence grammar.

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

llvm-svn: 266798

8 years agoFix PR26999 better- RenderDebugEnablingArgs() once only
Douglas Katzman [Tue, 19 Apr 2016 18:55:53 +0000 (18:55 +0000)]
Fix PR26999 better- RenderDebugEnablingArgs() once only

llvm-svn: 266797

8 years ago[CUDA] Add a test for r266496 (raise an error if a CUDA installation isn't found)
Justin Lebar [Tue, 19 Apr 2016 18:52:28 +0000 (18:52 +0000)]
[CUDA] Add a test for r266496 (raise an error if a CUDA installation isn't found)

llvm-svn: 266796

8 years ago[Clang-tidy] Fix extra semicolon warning in cppcoreguidelines/ProTypeMemberInitCheck...
Eugene Zelenko [Tue, 19 Apr 2016 18:49:21 +0000 (18:49 +0000)]
[Clang-tidy] Fix extra semicolon warning in cppcoreguidelines/ProTypeMemberInitCheck.cpp.

llvm-svn: 266795

8 years ago[X86] Simplify StackMapShadowTracker; NFC
Sanjoy Das [Tue, 19 Apr 2016 18:48:16 +0000 (18:48 +0000)]
[X86] Simplify StackMapShadowTracker; NFC

 - Elide trivial contructor and desctructor
 - Move implementation out of an unnecessary explicit llvm namespace
   scope

llvm-svn: 266794

8 years ago[X86MCInstLower] Clean up EmitNops; NFC
Sanjoy Das [Tue, 19 Apr 2016 18:48:13 +0000 (18:48 +0000)]
[X86MCInstLower] Clean up EmitNops; NFC

Instead of having a conditional assert inside EmitNops, refactor so that
the caller can have the assert instead.

llvm-svn: 266793

8 years ago[Hexagon] Implement branch relaxation
Krzysztof Parzyszek [Tue, 19 Apr 2016 18:30:18 +0000 (18:30 +0000)]
[Hexagon] Implement branch relaxation

Patch by Sirish Pande.

llvm-svn: 266792

8 years agoAdds a test to detect when clang omits specialized generic types from debug informati...
Kate Stone [Tue, 19 Apr 2016 18:20:11 +0000 (18:20 +0000)]
Adds a test to detect when clang omits specialized generic types from debug information when using precompiled headers and -gmodules.

llvm-svn: 266791

8 years agoreuse mustBeJSIdent for interface detection
Martin Probst [Tue, 19 Apr 2016 18:19:06 +0000 (18:19 +0000)]
reuse mustBeJSIdent for interface detection

llvm-svn: 266790

8 years agoclang-format: [JS] support `interface` as a free standing identifier.
Martin Probst [Tue, 19 Apr 2016 18:18:59 +0000 (18:18 +0000)]
clang-format: [JS] support `interface` as a free standing identifier.

Summary:
`interface` can be used as a fee standing identifier in JavaScript/TypeScript.
This change uses the heuristic of whether it's followed by another identifier
as an indication.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 266789

8 years ago[builtin_expect] tighten checks, add test, add comments
Sanjay Patel [Tue, 19 Apr 2016 18:17:34 +0000 (18:17 +0000)]
[builtin_expect] tighten checks, add test, add comments

llvm-svn: 266788

8 years agoreduce indentation; NFCI
Sanjay Patel [Tue, 19 Apr 2016 18:06:33 +0000 (18:06 +0000)]
reduce indentation; NFCI

llvm-svn: 266787

8 years agoIR: Enable debug info type ODR uniquing for forward decls
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 18:00:19 +0000 (18:00 +0000)]
IR: Enable debug info type ODR uniquing for forward decls

Add a new method, DICompositeType::buildODRType, that will create or
mutate the DICompositeType for a given ODR identifier, and use it in
LLParser and BitcodeReader instead of DICompositeType::getODRType.

The logic is as follows:

  - If there's no node, create one with the given arguments.
  - Else, if the current node is a forward declaration and the new
    arguments would create a definition, mutate the node to match the
    new arguments.
  - Else, return the old node.

This adds a missing feature supported by the current DITypeIdentifierMap
(which I'm slowly making redudant).  The only remaining difference is
that the DITypeIdentifierMap has a "the-last-one-wins" rule, whereas
DICompositeType::buildODRType has a "the-first-one-wins" rule.

For now I'm leaving behind DICompositeType::getODRType since it has
obvious, low-level semantics that are convenient for unit testing.

llvm-svn: 266786

8 years ago[CodeGen] Widen non-power-of-2 vector HFA base types.
Ahmed Bougacha [Tue, 19 Apr 2016 17:54:29 +0000 (17:54 +0000)]
[CodeGen] Widen non-power-of-2 vector HFA base types.

Currently, for the ppc64--gnu and aarch64 ABIs, we recognize:
  typedef __attribute__((__ext_vector_type__(3))) float v3f32;
  typedef __attribute__((__ext_vector_type__(16))) char v16i8;
  struct HFA {
    v3f32 a;
    v16i8 b;
  };

as an HFA. Since the first type encountered is used as the base type,
we pass the HFA as:
    [2 x <3 x float>]
Which leads to incorrect IR (relying on padding values) when the
second field is used.

Instead, explicitly widen the vector (after size rounding) in
isHomogeneousAggregate.

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

llvm-svn: 266784

8 years ago[CodeGen] Fix whitespace. NFC.
Ahmed Bougacha [Tue, 19 Apr 2016 17:54:24 +0000 (17:54 +0000)]
[CodeGen] Fix whitespace. NFC.

llvm-svn: 266783

8 years agoPass dwarf-version to cc1as.
Douglas Katzman [Tue, 19 Apr 2016 17:43:54 +0000 (17:43 +0000)]
Pass dwarf-version to cc1as.

Fix PR26999 - crashing in cc1as with any '*bsd' target.

llvm-svn: 266775

8 years agoPreliminary changes for fixing PR27241. Generalized/restructured some things
David L Kreitzer [Tue, 19 Apr 2016 17:43:44 +0000 (17:43 +0000)]
Preliminary changes for fixing PR27241. Generalized/restructured some things
in preparation for enabling the outgoing parameter store-to-push optimization
for 64-bit targets.

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

llvm-svn: 266774

8 years agoLinker: Simplify test/Linker/dicompositetype-unique.ll, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 17:43:43 +0000 (17:43 +0000)]
Linker: Simplify test/Linker/dicompositetype-unique.ll, NFC

Simplify the test logic a little, sharing logic between the two linking
directions by specifying -check-prefix multiple times.  Now it's more
obvious what's hte same and different between the two directions, and
there is less CHECK duplication.  This is a prep for expanding the test.

llvm-svn: 266773

8 years ago[llvm-pdbdump] Print a better error message when PDB loading fails.
Zachary Turner [Tue, 19 Apr 2016 17:36:58 +0000 (17:36 +0000)]
[llvm-pdbdump] Print a better error message when PDB loading fails.

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

llvm-svn: 266772

8 years ago[Release Notes] Mention Clang-tidy misc-unused-using-decls check.
Eugene Zelenko [Tue, 19 Apr 2016 17:31:58 +0000 (17:31 +0000)]
[Release Notes] Mention Clang-tidy misc-unused-using-decls check.

llvm-svn: 266770

8 years ago[Orc] Add move ops to RPC to satisfy MSVC.
Lang Hames [Tue, 19 Apr 2016 17:26:59 +0000 (17:26 +0000)]
[Orc] Add move ops to RPC to satisfy MSVC.

llvm-svn: 266768

8 years ago[ValueTracking] Improve isImpliedCondition for conditions with matching operands.
Chad Rosier [Tue, 19 Apr 2016 17:19:14 +0000 (17:19 +0000)]
[ValueTracking] Improve isImpliedCondition for conditions with matching operands.

This patch improves SimplifyCFG to catch cases like:

  if (a < b) {
    if (a > b) <- known to be false
      unreachable;
  }

Phabricator Revision: http://reviews.llvm.org/D18905

llvm-svn: 266767

8 years ago[Orc] Add pthread dependence to the RPCUtilsTest unit test.
Lang Hames [Tue, 19 Apr 2016 17:13:52 +0000 (17:13 +0000)]
[Orc] Add pthread dependence to the RPCUtilsTest unit test.

llvm-svn: 266766

8 years agoreduce indentation; NFCI
Sanjay Patel [Tue, 19 Apr 2016 17:13:14 +0000 (17:13 +0000)]
reduce indentation; NFCI

llvm-svn: 266765

8 years agoIR: LLVMContextTest => DebugTypeODRUniquingTest, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 17:11:06 +0000 (17:11 +0000)]
IR: LLVMContextTest => DebugTypeODRUniquingTest, NFC

The second test in this file is actually testing DICompositeType API,
not LLVMContext API (after r266742 moved it to a higher level).  This
really doesn't make sense in an LLVMContextTest.  Rename the tests
before adding more.

llvm-svn: 266764

8 years ago[Clang][Builtin][AVX512] Adding intrinsics for VGETMANT{PD|PS} and VGETEXP{PD|PS...
Michael Zuckerman [Tue, 19 Apr 2016 17:10:29 +0000 (17:10 +0000)]
[Clang][Builtin][AVX512] Adding intrinsics for VGETMANT{PD|PS} and VGETEXP{PD|PS} instruction set

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

llvm-svn: 266763

8 years agoLinker: Avoid constructing ValueMap::MDMapT
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 16:57:24 +0000 (16:57 +0000)]
Linker: Avoid constructing ValueMap::MDMapT

Calling ValueMap::MD lazily constructs a ValueMap, which mallocs the
buckets.  Instead of swapping constructed maps, move around the
underlying Optional<MDMapT>.  This gets rid of some unnecessary malloc
traffic from r266579 (not that it showed up on a profile).

llvm-svn: 266761

8 years ago[ITTNOTIFY] Remove serialized parallel regions from frame notification
Jonathan Peyton [Tue, 19 Apr 2016 16:55:17 +0000 (16:55 +0000)]
[ITTNOTIFY] Remove serialized parallel regions from frame notification

llvm-svn: 266760

8 years ago[DependenceAnalysis] Refactor uses of getConstantPart. NFC.
Brendon Cahoon [Tue, 19 Apr 2016 16:46:57 +0000 (16:46 +0000)]
[DependenceAnalysis] Refactor uses of getConstantPart. NFC.

Rather than checking for the SCEV type prior to calling
getContantPart, perform the checks in the function. This reduces
the number of places where the checks are needed.

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

llvm-svn: 266759

8 years agoRevert "[OPENMP] Codegen for untied tasks."
Alexey Bataev [Tue, 19 Apr 2016 16:36:01 +0000 (16:36 +0000)]
Revert "[OPENMP] Codegen for untied tasks."

This reverts commit r266754.

llvm-svn: 266755

8 years ago[OPENMP] Codegen for untied tasks.
Alexey Bataev [Tue, 19 Apr 2016 16:27:55 +0000 (16:27 +0000)]
[OPENMP] Codegen for untied tasks.

If the untied clause is present on a task construct, any thread in the
team can resume the task region after a suspension. Patch adds proper
codegen for untied tasks.

llvm-svn: 266754

8 years agoRevert r266747 (Compilation for Intel MCU (Part 1/3)) since it breaks a few buildbots.
Andrey Turetskiy [Tue, 19 Apr 2016 16:25:30 +0000 (16:25 +0000)]
Revert r266747 (Compilation for Intel MCU (Part 1/3)) since it breaks a few buildbots.

llvm-svn: 266753

8 years agoFix Gold test after r266750 (ModuleLinker: Do not import linkonce/weak as "external_w...
Mehdi Amini [Tue, 19 Apr 2016 16:21:37 +0000 (16:21 +0000)]
Fix Gold test after r266750 (ModuleLinker: Do not import linkonce/weak as "external_weak")

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266752

8 years agoIR: Use Optional instead of unique_ptr for Metadata map in ValueMap, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 16:17:48 +0000 (16:17 +0000)]
IR: Use Optional instead of unique_ptr for Metadata map in ValueMap, NFC

llvm-svn: 266751

8 years agoModuleLinker: Do not import linkonce/weak as "external_weak"
Mehdi Amini [Tue, 19 Apr 2016 16:11:05 +0000 (16:11 +0000)]
ModuleLinker: Do not import linkonce/weak as "external_weak"

Summary:
There is no reason to have a weak reference because the external
definition will be weak.

Reviewers: rafael

Subscribers: llvm-commits, tejohnson

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266750

8 years agoIR: Use Optional instead of unique_ptr for debug info ODR type map, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 16:06:50 +0000 (16:06 +0000)]
IR: Use Optional instead of unique_ptr for debug info ODR type map, NFC

Save a level of malloc indirection.

llvm-svn: 266749

8 years ago[ASTMatchers] Do not try to memoize nodes we can't compare.
Samuel Benzaquen [Tue, 19 Apr 2016 15:52:56 +0000 (15:52 +0000)]
[ASTMatchers] Do not try to memoize nodes we can't compare.

Summary:
Prevent hasAncestor from comparing nodes that are not supported.
hasDescendant was fixed some time ago to avoid this problem.
I'm applying the same fix to hasAncestor: if any object in the Builder map is
not comparable, skip the cache.

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 266748

8 years agoCompilation for Intel MCU (Part 1/3)
Andrey Turetskiy [Tue, 19 Apr 2016 15:50:57 +0000 (15:50 +0000)]
Compilation for Intel MCU (Part 1/3)

Add -miamcu option which:
  * Sets IAMCU triple
  * Sets IAMCU ABI
  * Enforces static compilation

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

llvm-svn: 266747

8 years agoEnable ODR uniquing of DITypes in more places
Teresa Johnson [Tue, 19 Apr 2016 15:48:30 +0000 (15:48 +0000)]
Enable ODR uniquing of DITypes in more places

Summary:
This is a follow-on to apply Duncan's new DIType ODR uniquing from
r266549 and r266713 in more places.

Enable enableDebugTypeODRUniquing() for ThinLTO backends invoked via
libLTO, similar to the way r266549 enabled this for ThinLTO backend
threads launched from gold-plugin.

Also enable enableDebugTypeODRUniquing in opt, similar to the way
r266549 enabled this for llvm-link (on by default, can be disabled with
new -disable-debug-info-type-map option), since we may perform ThinLTO
importing from opt.

Reviewers: dexonsmith, joker.eph

Subscribers: joker.eph, llvm-commits

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

llvm-svn: 266746

8 years ago[Clang][AVX512][BUILTIN] Adding intrinsics support to VEXTRACT{I|F} and VINSERT{I...
Michael Zuckerman [Tue, 19 Apr 2016 15:18:23 +0000 (15:18 +0000)]
[Clang][AVX512][BUILTIN] Adding intrinsics support to VEXTRACT{I|F} and VINSERT{I|F} instruction set

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

llvm-svn: 266745

8 years agoSummary:
Martin Probst [Tue, 19 Apr 2016 14:59:16 +0000 (14:59 +0000)]
Summary:
clang-format: [JS] unit tests for type aliases.

Also adds a test for "foo as bar" casts.

Spec:
https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.10

These are already handled correctly.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 266744

8 years agoclang-format: [JS] simplify import/export.
Martin Probst [Tue, 19 Apr 2016 14:55:37 +0000 (14:55 +0000)]
clang-format: [JS] simplify import/export.

Summary:
Change `import` and `export` parsing to special case the renaming
syntax (`import x, {y as bar} ...`, `export {x}`) and otherwise just
parse a regular structural element.

This simplifies the code a bit and should be more correct - it's easier
to recognise the specific import syntax than to recognise arbitrary
expressions and declarations.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 266743

8 years agoIR: getOrInsertODRUniquedType => DICompositeType::getODRType, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 14:55:09 +0000 (14:55 +0000)]
IR: getOrInsertODRUniquedType => DICompositeType::getODRType, NFC

Lift the API for debug info ODR type uniquing up a layer.  Instead of
clients managing the map directly on the LLVMContext, add a static
method to DICompositeType called getODRType and handle the map in the
background.  Also adds DICompositeType::getODRTypeIfExists, so far just
for convenience in the unit tests.

This simplifies the logic in LLParser and BitcodeReader.  Because of
argument spam there are actually a few more lines of code now; I'll see
if I come up with a reasonable way to clean that up.

llvm-svn: 266742

8 years agoRelate domains to statements during construction [NFC]
Johannes Doerfert [Tue, 19 Apr 2016 14:53:13 +0000 (14:53 +0000)]
Relate domains to statements during construction [NFC]

  Instead of the Scop::getPwAff() function we now use the ScopStmt::getPwAff()
  function during the statements domain construction.

llvm-svn: 266741

8 years agoAdd user assumptions after domain generation [NFC]
Johannes Doerfert [Tue, 19 Apr 2016 14:49:42 +0000 (14:49 +0000)]
Add user assumptions after domain generation [NFC]

llvm-svn: 266740

8 years agoDo not build domains for out of SCoP blocks [NFC]
Johannes Doerfert [Tue, 19 Apr 2016 14:49:05 +0000 (14:49 +0000)]
Do not build domains for out of SCoP blocks [NFC]

llvm-svn: 266739

8 years agoMark Scop::getDomainConditions as const [NFC]
Johannes Doerfert [Tue, 19 Apr 2016 14:48:22 +0000 (14:48 +0000)]
Mark Scop::getDomainConditions as const [NFC]

llvm-svn: 266738

8 years agoIR: Require DICompositeType for ODR uniquing type map
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 14:42:55 +0000 (14:42 +0000)]
IR: Require DICompositeType for ODR uniquing type map

Tighten up the API for debug info ODR type uniquing in LLVMContext.  The
only reason to allow other DIType subclasses is to make the unit tests
prettier :/.

llvm-svn: 266737

8 years agoRevert "LLDB: Fixed two race conditions when stopping private state thread"
Pavel Labath [Tue, 19 Apr 2016 14:03:43 +0000 (14:03 +0000)]
Revert "LLDB: Fixed two race conditions when stopping private state thread"

This reverts commit r266733 as it causes a number of failures on linux buildbots.

llvm-svn: 266736

8 years agoInitial version of misc-unused-using-decl check.
Daniel Jasper [Tue, 19 Apr 2016 13:48:39 +0000 (13:48 +0000)]
Initial version of misc-unused-using-decl check.

llvm-svn: 266735

8 years ago[clang-tidy] readability-container-size-empty fixes
Gabor Horvath [Tue, 19 Apr 2016 13:29:05 +0000 (13:29 +0000)]
[clang-tidy] readability-container-size-empty fixes

Summary: This patch fixes PR27410 and adds std::basic_string support.

Reviewers: Eugene.Zelenko, hokein

Subscribers: cfe-commits, o.gyorgy

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

llvm-svn: 266734

8 years agoLLDB: Fixed two race conditions when stopping private state thread
Marianne Mailhot-Sarrasin [Tue, 19 Apr 2016 13:21:46 +0000 (13:21 +0000)]
LLDB: Fixed two race conditions when stopping private state thread

When stopping the private state thread, there was a race condition between the time the thread exits (resetting the HostThread object) and the time a Join was attempted, especially in the case of a timeout.

The previous workaround of copying the HostThread object is not enough, since on a Reset the internal thread stuff gets nulled out regardless of which HostThread object actually has Reset called on it, resulting in an attempt to dereference a null pointer on the subsequent call to Join from the copy as well.

Additionally, there was a race between the detach (called when stopping the process) and the stop itself, causing the stop to time out because it was waiting for the private state thread to see the stop state, but it had exited immediately after entering the detached state.

Patch by cameron314

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

llvm-svn: 266733

8 years ago[InstCombine][X86] Added extra tests introduced for D17490
Simon Pilgrim [Tue, 19 Apr 2016 12:59:52 +0000 (12:59 +0000)]
[InstCombine][X86] Added extra tests introduced for D17490

llvm-svn: 266732

8 years ago[InstCombine][X86] Regenerate SSE combine tests as part of setup for D17490
Simon Pilgrim [Tue, 19 Apr 2016 12:56:46 +0000 (12:56 +0000)]
[InstCombine][X86] Regenerate SSE combine tests as part of setup for D17490

Regenerated with utils/update_test_checks.py

llvm-svn: 266731

8 years agoFramework to allow testing of static libc++abi
Ben Craig [Tue, 19 Apr 2016 12:49:05 +0000 (12:49 +0000)]
Framework to allow testing of static libc++abi

These changes make linking against static libraries more explicit. Instead
of using -lc++ and -lc++abi in the tests, an absolute path to the library is
provided instead.

The choices of shared vs. static, and the choices of library paths for both
libcxx and libcxxabi needed to be exchanged for this to work. In other words,
libcxx tests need to know the library path of libcxxabi, and whether libcxxabi
is a static or shared library.

Some Mac specific logic for testing against libc++abi had to be moved from
libcxxabi's config.py, as it was overriding choices made in libcxx's config.py.
That logic is now in libcxx's target_info.py.

Testing a static libcxx on Linux will now automatically link in librt most of
the time. Previously, lots of pthread tests would fail because of an
unresolved clock_gettime.

http://reviews.llvm.org/D16544

llvm-svn: 266730

8 years agoEnable testing for static libc++abi
Ben Craig [Tue, 19 Apr 2016 12:47:38 +0000 (12:47 +0000)]
Enable testing for static libc++abi

This change leverages framework changes made in libcxx. See those changes for
more details. (http://reviews.llvm.org/D16544)

Some Mac specific logic for testing against libc++abi had to be moved from
libcxxabi's config.py, as it was overriding choices made in libcxx's config.py.
That logic is now in libcxx's target_info.py.

http://reviews.llvm.org/D16545

llvm-svn: 266729

8 years ago[X86][AVX2] Prefer VPERMQ/VPERMPD over VINSERTI128/VINSERTF128 for unary shuffles
Simon Pilgrim [Tue, 19 Apr 2016 12:26:40 +0000 (12:26 +0000)]
[X86][AVX2] Prefer VPERMQ/VPERMPD over VINSERTI128/VINSERTF128 for unary shuffles

Using VPERMQ/VPERMPD allows memory folding of the (repeated) input where VINSERTI128/VINSERTF128 can not.

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

llvm-svn: 266728

8 years agoUpdated comment. NFC.
George Rimar [Tue, 19 Apr 2016 12:09:25 +0000 (12:09 +0000)]
Updated comment. NFC.

llvm-svn: 266727

8 years agoD17487: [analyzer][scan-build-py] flag filter modification for compilation database...
Laszlo Nagy [Tue, 19 Apr 2016 12:03:03 +0000 (12:03 +0000)]
D17487: [analyzer][scan-build-py] flag filter modification for compilation database creation

llvm-svn: 266726

8 years agoFix typo in TestSourceManager.py
Pavel Labath [Tue, 19 Apr 2016 09:31:14 +0000 (09:31 +0000)]
Fix typo in TestSourceManager.py

llvm-svn: 266725

8 years agoRevert "[OPENMP] Codegen for untied tasks."
Alexey Bataev [Tue, 19 Apr 2016 09:27:38 +0000 (09:27 +0000)]
Revert "[OPENMP] Codegen for untied tasks."

This reverts commit 266722.

llvm-svn: 266724

8 years agoMinor improvement to debug output for Function Importer (NFC)
Mehdi Amini [Tue, 19 Apr 2016 09:21:30 +0000 (09:21 +0000)]
Minor improvement to debug output for Function Importer (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266723

8 years ago[OPENMP] Codegen for untied tasks.
Alexey Bataev [Tue, 19 Apr 2016 09:10:27 +0000 (09:10 +0000)]
[OPENMP] Codegen for untied tasks.

If the untied clause is present on a task construct, any thread in the team can resume the task region after a suspension. Patch adds proper codegen for untied tasks.

llvm-svn: 266722

8 years agoAdd a description for the PatchableFunction pass; NFC
Sanjoy Das [Tue, 19 Apr 2016 06:25:02 +0000 (06:25 +0000)]
Add a description for the PatchableFunction pass; NFC

llvm-svn: 266721

8 years agoDisable the PatchableFunction pass for NVPTX & Wasm
Sanjoy Das [Tue, 19 Apr 2016 06:24:58 +0000 (06:24 +0000)]
Disable the PatchableFunction pass for NVPTX & Wasm

PatchableFunction requires AllVRegsAllocated that these targets don't
provide.

llvm-svn: 266720

8 years agoWarn if function or variable cannot be implicitly instantiated
Serge Pavlov [Tue, 19 Apr 2016 06:19:52 +0000 (06:19 +0000)]
Warn if function or variable cannot be implicitly instantiated

With this patch compiler emits warning if it tries to make implicit instantiation
of a template but cannot find the template definition. The warning can be suppressed
by explicit instantiation declaration or by command line options
-Wundefined-var-template and -Wundefined-func-template. The implementation follows
the discussion of http://reviews.llvm.org/D12326.

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

llvm-svn: 266719

8 years agoCorrect IDF calculator for ReverseIDF
Daniel Berlin [Tue, 19 Apr 2016 06:13:28 +0000 (06:13 +0000)]
Correct IDF calculator for ReverseIDF

Summary:
Need to use predecessors for reverse graph, successors for forward graph.
succ_iterator/pred_iterator are not compatible, this patch is all the work necessary to work around that (which is what everywhere else does).  Not sure if there is a better way, so cc'ing some random folks to take a gander :)

Reviewers: dblaikie, qcolombet, echristo

Subscribers: llvm-commits

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

llvm-svn: 266718