platform/upstream/llvm.git
8 years agoClean up to avoid compiler warnings for casting away const qualifiers.
Sjoerd Meijer [Wed, 27 Apr 2016 18:35:02 +0000 (18:35 +0000)]
Clean up to avoid compiler warnings for casting away const qualifiers.

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

llvm-svn: 267753

8 years agoRevert "[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD."
Chad Rosier [Wed, 27 Apr 2016 18:29:11 +0000 (18:29 +0000)]
Revert "[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD."

This reverts commit r267733 due to a -Werror,-Wunused-function error.

llvm-svn: 267752

8 years ago[LV] Reallow positive-stride interleaved load groups with gaps
Matthew Simpson [Wed, 27 Apr 2016 18:21:36 +0000 (18:21 +0000)]
[LV] Reallow positive-stride interleaved load groups with gaps

We previously disallowed interleaved load groups that may cause us to
speculatively access memory out-of-bounds (r261331). We did this by ensuring
each load group had an access corresponding to the first and last member.
Instead of bailing out for these interleaved groups, this patch enables us to
peel off the last vector iteration, ensuring that we execute at least one
iteration of the scalar remainder loop. This solution was proposed in the
review of the previous patch.

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

llvm-svn: 267751

8 years ago[sanitizers] read/write page fault detection on mac.
Mike Aizatsky [Wed, 27 Apr 2016 18:02:21 +0000 (18:02 +0000)]
[sanitizers] read/write page fault detection on mac.

Summary: Resubmit of http://reviews.llvm.org/D19495 enabled only on intel.

Subscribers: kubabrecka

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

llvm-svn: 267750

8 years agoRenamed system plugin directory to address https://bugs.swift.org/browse/SR-1093
Kate Stone [Wed, 27 Apr 2016 17:49:51 +0000 (17:49 +0000)]
Renamed system plugin directory to address https://bugs.swift.org/browse/SR-1093

llvm-svn: 267749

8 years ago[SLPVectorizer] Refactor where MinVecRegSize and MaxVecRegSize live.
Arch D. Robison [Wed, 27 Apr 2016 17:46:25 +0000 (17:46 +0000)]
[SLPVectorizer] Refactor where MinVecRegSize and MaxVecRegSize live.

This is the first of two commits for extending SLP Vectorizer to deal with aggregates.
This commit merely refactors existing logic.

http://reviews.llvm.org/D14185

llvm-svn: 267748

8 years ago[sanitizer] [SystemZ] Abort if the kernel might be vulnerable to CVE-2016-2143.
Marcin Koscielnicki [Wed, 27 Apr 2016 17:42:00 +0000 (17:42 +0000)]
[sanitizer] [SystemZ] Abort if the kernel might be vulnerable to CVE-2016-2143.

In short, CVE-2016-2143 will crash the machine if a process uses both >4TB
virtual addresses and fork().  ASan, TSan, and MSan will, by necessity, map
a sizable chunk of virtual address space, which is much larger than 4TB.
Even worse, sanitizers will always use fork() for llvm-symbolizer when a bug
is detected.  Disable all three by aborting on process initialization if
the running kernel version is not known to contain a fix.

Unfortunately, there's no reliable way to detect the fix without crashing
the kernel.  So, we rely on whitelisting - I've included a list of upstream
kernel versions that will work.  In case someone uses a distribution kernel
or applied the fix themselves, an override switch is also included.

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

llvm-svn: 267747

8 years agoPR21823: 'nodebug' attribute on global/static variables.
Paul Robinson [Wed, 27 Apr 2016 17:37:12 +0000 (17:37 +0000)]
PR21823: 'nodebug' attribute on global/static variables.

Make 'nodebug' on a global/static variable suppress all debug info
for the variable. Previously it would only suppress info for the
associated initializer function, if any.

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

llvm-svn: 267746

8 years ago[DAGCombiner] Follow coding convention for function name (NFC)
Gerolf Hoflehner [Wed, 27 Apr 2016 17:27:16 +0000 (17:27 +0000)]
[DAGCombiner] Follow coding convention for function name (NFC)

llvm-svn: 267745

8 years agoRevert r267691, it caused PR27535.
Nico Weber [Wed, 27 Apr 2016 17:26:08 +0000 (17:26 +0000)]
Revert r267691, it caused PR27535.

llvm-svn: 267744

8 years ago[Mips] Add support for llvm.thread.pointer intrinsic.
Marcin Koscielnicki [Wed, 27 Apr 2016 17:21:49 +0000 (17:21 +0000)]
[Mips] Add support for llvm.thread.pointer intrinsic.

This will be used to implement __builtin_thread_pointer in clang.

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

llvm-svn: 267743

8 years ago[InstCombine] Sharpended test case in pr21210.ll
Gerolf Hoflehner [Wed, 27 Apr 2016 17:19:54 +0000 (17:19 +0000)]
[InstCombine] Sharpended  test case in  pr21210.ll

llvm-svn: 267742

8 years agoUse absolute module path when possible if sent in svr4 packets
Francis Ricci [Wed, 27 Apr 2016 17:10:15 +0000 (17:10 +0000)]
Use absolute module path when possible if sent in svr4 packets

Summary:
If the remote uses svr4 packets to communicate library info,
the LoadUnload tests will fail, as lldb only used the basename
for modules, causing problems when two modules have the same basename.

Using absolute path as sent by the remote will ensure that lldb
locates the module from the correct directory when there are overlapping
basenames. When debugging a remote process, LoadModuleAtAddress will still
fall back to using basename and module_search_paths, so we don't
need to worry about using absolute paths in this case.

Reviewers: ADodds, jasonmolenda, clayborg, ovyalov

Subscribers: lldb-commits, sas

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

llvm-svn: 267741

8 years agoModule debugging: Fix the DWO filename for PCH in a relative path.
Adrian Prantl [Wed, 27 Apr 2016 17:06:22 +0000 (17:06 +0000)]
Module debugging: Fix the DWO filename for PCH in a relative path.
PCH in a relative location had a redundant relative path on the DWO
filename and the DW_AT_compilation_dir.
This patch fixes this and adds testcases for PCH in the same directory,
in a relative, and an absolute location.

rdar://problem/25537947

llvm-svn: 267740

8 years ago[find-all-symbols] Also update unittest dependencies.
Benjamin Kramer [Wed, 27 Apr 2016 16:56:29 +0000 (16:56 +0000)]
[find-all-symbols] Also update unittest dependencies.

llvm-svn: 267739

8 years ago[find-all-symbols] Clean up dependencies, fixing cmake shared build.
Benjamin Kramer [Wed, 27 Apr 2016 16:50:17 +0000 (16:50 +0000)]
[find-all-symbols] Clean up dependencies, fixing cmake shared build.

llvm-svn: 267738

8 years agoSilence a -Wdangling-else
Reid Kleckner [Wed, 27 Apr 2016 16:46:33 +0000 (16:46 +0000)]
Silence a -Wdangling-else

llvm-svn: 267737

8 years agoFix explain-check failure test on Windows.
Haojian Wu [Wed, 27 Apr 2016 16:39:42 +0000 (16:39 +0000)]
Fix explain-check failure test on Windows.

llvm-svn: 267736

8 years agoUn-XFAIL tests on Windows after fixing PR27492
Reid Kleckner [Wed, 27 Apr 2016 16:38:03 +0000 (16:38 +0000)]
Un-XFAIL tests on Windows after fixing PR27492

Private symbols in PDBs do not have parameter types in their names so we
have to drop the parens from the lambda call operator.

llvm-svn: 267735

8 years agoAdd parentheses to silence buildbot warning
Matthew Simpson [Wed, 27 Apr 2016 16:25:04 +0000 (16:25 +0000)]
Add parentheses to silence buildbot warning

llvm-svn: 267734

8 years ago[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD.
Artem Tamazov [Wed, 27 Apr 2016 16:20:23 +0000 (16:20 +0000)]
[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD.

Added support of TTMP quads.
Reworked M0 exclusion machinery for SMRD and similar instructions
to enable usage of TTMP registers in those instructions as destinations.
Tests added.

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

llvm-svn: 267733

8 years ago[PDB] Fix function names for private symbols in PDBs
Reid Kleckner [Wed, 27 Apr 2016 16:10:29 +0000 (16:10 +0000)]
[PDB] Fix function names for private symbols in PDBs

Summary:
llvm-symbolizer wants to get linkage names of functions for historical
reasons. Linkage names are only recorded in the PDB for public symbols,
and the linkage name is apparently stored separately in some "public
symbol" record. We had a workaround in PDBContext which would look for
such symbols when the user requested linkage names.

However, when given an address that was truly in a private function and
public funciton, we would accidentally find nearby public symbols and
return those function names. The fix is to look for both function
symbols and public symbols and only prefer the public symbol name if the
addresses of the symbols agree.

Fixes PR27492

Reviewers: zturner

Subscribers: llvm-commits

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

llvm-svn: 267732

8 years agoDon't search compilation database in explain-check, fixing buildbot test
Haojian Wu [Wed, 27 Apr 2016 16:09:34 +0000 (16:09 +0000)]
Don't search compilation database in explain-check, fixing buildbot test
failure.

llvm-svn: 267731

8 years agotsan: fix windows support
Dmitry Vyukov [Wed, 27 Apr 2016 15:55:05 +0000 (15:55 +0000)]
tsan: fix windows support

UnmapOrDie used to do MEM_DECOMMIT and so worked
on partial regions. But r263160 changed it to use
MEM_RELEASE and MEM_RELEASE can only work with
whole regions mapped by VirtualAlloc. This broke
windows as:

FATAL: ThreadSanitizer CHECK failed: gotsan.cc:8296 "((mbi.AllocationBase == addr && "Windows cannot unmap part of a previous mapping")) != (0)" (0x0, 0x0)

Restore the previous behavior.

llvm-svn: 267730

8 years agoAMDGPU/SI: Add llvm.amdgcn.s.waitcnt.all intrinsic
Nicolai Haehnle [Wed, 27 Apr 2016 15:46:01 +0000 (15:46 +0000)]
AMDGPU/SI: Add llvm.amdgcn.s.waitcnt.all intrinsic

Summary:
So it appears that to guarantee some of the ordering requirements of a GLSL
memoryBarrier() executed in the shader, we need to emit an s_waitcnt.

(We can't use an s_barrier, because memoryBarrier() may appear anywhere in
the shader, in particular it may appear in non-uniform control flow.)

Reviewers: arsenm, mareko, tstellarAMD

Subscribers: arsenm, llvm-commits

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

llvm-svn: 267729

8 years ago[Clang][Builtin][AVX512] Adding intrisnics for the vpconflict{q|d} instruction set
Michael Zuckerman [Wed, 27 Apr 2016 15:35:13 +0000 (15:35 +0000)]
[Clang][Builtin][AVX512] Adding intrisnics for the vpconflict{q|d} instruction set

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

llvm-svn: 267728

8 years agoDecorate TSan tests with "@skipUnlessThreadSanitizer" which skips the tests if the...
Kuba Brecka [Wed, 27 Apr 2016 15:26:27 +0000 (15:26 +0000)]
Decorate TSan tests with "@skipUnlessThreadSanitizer" which skips the tests if the selected compiler can't compile with "-fsanitize=thread".

llvm-svn: 267726

8 years ago[TTI] Add hook for vector extract with extension
Matthew Simpson [Wed, 27 Apr 2016 15:20:21 +0000 (15:20 +0000)]
[TTI] Add hook for vector extract with extension

This change adds a new hook for estimating the cost of vector extracts followed
by zero- and sign-extensions. The motivating example for this change is the
SMOV and UMOV instructions on AArch64. These instructions move data from vector
to general purpose registers while performing the corresponding extension
(sign-extend for SMOV and zero-extend for UMOV) at the same time. For these
operations, TargetTransformInfo can assume the extensions are free and only
report the cost of the vector extract. The SLP vectorizer has been updated to
make use of the new hook.

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

llvm-svn: 267725

8 years ago[AMDGPU][llvm-mc] s_getreg/setreg* - Support symbolic names of hardware registers.
Artem Tamazov [Wed, 27 Apr 2016 15:17:03 +0000 (15:17 +0000)]
[AMDGPU][llvm-mc] s_getreg/setreg* - Support symbolic names of hardware registers.

Possibility to specify code of hardware register kept.
Disassemble to symbolic name, if name is known.
Tests updated/added.

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

llvm-svn: 267724

8 years agoRevert r267649, it caused PR27539.
Nico Weber [Wed, 27 Apr 2016 15:16:54 +0000 (15:16 +0000)]
Revert r267649, it caused PR27539.

llvm-svn: 267723

8 years agoRemove size 1 from check as that isn't part of what the test is meant to be testing.
Kristof Beyls [Wed, 27 Apr 2016 15:03:09 +0000 (15:03 +0000)]
Remove size 1 from check as that isn't part of what the test is meant to be testing.

This test also runs on e.g. ARM-native builds when the X86 backend is also
built.  This test produces code for the default instruction set, even though it
is in a "X86" sub-directory. Given that this test doesn't seem to be testing
anything architecture-specific, it seems it's best to adapt the check to not
check for an architecture-dependent value (the size of the function), rather
than hard-code the test to target x86.

llvm-svn: 267722

8 years agoAdd missing dependency.
Benjamin Kramer [Wed, 27 Apr 2016 14:32:36 +0000 (14:32 +0000)]
Add missing dependency.

llvm-svn: 267721

8 years agotsan: fix darwin Go support
Dmitry Vyukov [Wed, 27 Apr 2016 14:28:42 +0000 (14:28 +0000)]
tsan: fix darwin Go support

os_trace turns out to be a macro that creates static object.
Function-static objects use __cxa_atexit and __dso_handle
which are not present in Go runtime.

llvm-svn: 267720

8 years ago[include-fixer] Add a find-all-symbols tool for include-fixer.
Haojian Wu [Wed, 27 Apr 2016 14:27:05 +0000 (14:27 +0000)]
[include-fixer] Add a find-all-symbols tool for include-fixer.

Summary:
The find-all-symbols tool generates a yaml symbol database for
include-fixer.

The symbol matcher is originally written by Xiaoyi Liu.

Reviewers: bkramer, djasper

Subscribers: cfe-commits, klimek, ioeric

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

llvm-svn: 267719

8 years agoClean up the include fixer 'driver' a bit and make the database configurable.
Benjamin Kramer [Wed, 27 Apr 2016 14:24:32 +0000 (14:24 +0000)]
Clean up the include fixer 'driver' a bit and make the database configurable.

Also add a test for it. The library is covered by unit tests, the driver
was not.

llvm-svn: 267718

8 years ago[ThinLTO] Refine fix to avoid renaming of uses in inline assembly.
Teresa Johnson [Wed, 27 Apr 2016 14:19:38 +0000 (14:19 +0000)]
[ThinLTO] Refine fix to avoid renaming of uses in inline assembly.

Summary:
Refine the workaround from r266877 that attempts to prevent
renaming of locals in inline assembly, so that in addition to looking
for a llvm.used local value, that there is at least one inline assembly
call in the module. Otherwise, debug functions added to the llvm.used
can block importing/exporting unnecessarily.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

llvm-svn: 267717

8 years agotsan: fix windows Go support
Dmitry Vyukov [Wed, 27 Apr 2016 14:03:14 +0000 (14:03 +0000)]
tsan: fix windows Go support

Unmap can't unmap arbitrary regions on windows.

llvm-svn: 267716

8 years agotsan: fix darwin Go build
Dmitry Vyukov [Wed, 27 Apr 2016 13:40:05 +0000 (13:40 +0000)]
tsan: fix darwin Go build

syslog_lock is not defined in Go build.

llvm-svn: 267714

8 years agotsan: make windows shadow mapping a bijection
Dmitry Vyukov [Wed, 27 Apr 2016 13:34:01 +0000 (13:34 +0000)]
tsan: make windows shadow mapping a bijection

CheckShadowMapping function started catching that
mem->shadow->mem mapping is not bijection.
Make it bijection.

llvm-svn: 267713

8 years ago[ThinLTO] Use valueid instead of bitcode offsets in combined index file
Teresa Johnson [Wed, 27 Apr 2016 13:28:35 +0000 (13:28 +0000)]
[ThinLTO] Use valueid instead of bitcode offsets in combined index file

Summary:
With the removal of support for lazy parsing of combined index summary
records (e.g. r267344), we no longer need to include the summary record
bitcode offset in the VST entries for definitions. Change the combined
index format to be similar to the per-module index format in using value
ids to cross-reference from the summary record to the VST entry (rather
than the summary record bitcode offset to cross-reference in the other
direction).

The visible changes are:
1) Add the value id to the combined summary records
2) Remove the summary offset from the combined VST records, which has
the following effects:
- No longer need the VST_CODE_COMBINED_GVDEFENTRY record, as all
  combined index VST entries now only contain the value id and
  corresponding GUID.
- No longer have duplicate VST entries in the case where there are
  multiple definitions of a symbol (e.g. weak/linkonce), as they all
  have the same value id and GUID.

An implication of #2 above is that in order to hook up an alias to the
correct aliasee based on the value id of the aliasee recorded in the
combined index alias record, we need to scan the entries in the index
for that GUID to find the one from the same module (i.e. the case where
there are multiple entries for the aliasee). But the reader no longer
has to maintain a special map to hook up the alias/aliasee.

Reviewers: joker.eph

Subscribers: joker.eph, llvm-commits

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

llvm-svn: 267712

8 years agoRemove explain-config testcase that detect hard-coded check.
Haojian Wu [Wed, 27 Apr 2016 13:23:39 +0000 (13:23 +0000)]
Remove explain-config testcase that detect hard-coded check.

Remove it for now, we need to better way to figure out how to test it.

llvm-svn: 267711

8 years agotsan: fix build
Dmitry Vyukov [Wed, 27 Apr 2016 12:59:35 +0000 (12:59 +0000)]
tsan: fix build

error: implicit declaration of function 'abort' is invalid in C99
llvm-svn: 267710

8 years agotsan: fix darwin Go build
Dmitry Vyukov [Wed, 27 Apr 2016 12:56:16 +0000 (12:56 +0000)]
tsan: fix darwin Go build

Ifdef out global variables with destructors.
This requires runtime support that is not provided by Go runtime
(in particular _dso_handle symbol).

llvm-svn: 267709

8 years agoNFC. Introduce Value::getPointerDerferecnceableBytes
Artur Pilipenko [Wed, 27 Apr 2016 12:51:01 +0000 (12:51 +0000)]
NFC. Introduce Value::getPointerDerferecnceableBytes

Extract a part of isDereferenceableAndAlignedPointer functionality to Value::getPointerDerferecnceableBytes. Currently it's a NFC, but in future I'm going to accumulate all the logic about value dereferenceability in this function similarly to Value::getPointerAlignment function (D16144).

Reviewed By: reames

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

llvm-svn: 267708

8 years ago[FIX] Propagate execution domain of invariant loads
Johannes Doerfert [Wed, 27 Apr 2016 12:49:11 +0000 (12:49 +0000)]
[FIX] Propagate execution domain of invariant loads

  If the base pointer of an invariant load is is loaded conditionally, that
  condition needs to hold for the invariant load too. The structure of the
  program will imply this for domain constraints but not for imprecisions in
  the modeling. To this end we will propagate the execution context of base
  pointers during code generation and thus ensure the derived pointer does
  not access an invalid base pointer.

llvm-svn: 267707

8 years agoExpose cxx constructor and method properties through libclang and python bindings.
Jonathan Coe [Wed, 27 Apr 2016 12:48:25 +0000 (12:48 +0000)]
Expose cxx constructor and method properties through libclang and python bindings.

Summary:
I have exposed the following function through libclang and the clang.cindex python bindings:

clang_CXXConstructor_isConvertingConstructor,
clang_CXXConstructor_isCopyConstructor,
clang_CXXConstructor_isDefaultConstructor,
clang_CXXConstructor_isMoveConstructor,
clang_CXXMethod_isDefaulted

I need (some of) these methods for a C++ code model I am building in Python to drive a code generator.

Reviewers: compnerd, skalinichev

Subscribers: cfe-commits

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

llvm-svn: 267706

8 years agoReduce usage of isRelRelative.
Rafael Espindola [Wed, 27 Apr 2016 12:47:30 +0000 (12:47 +0000)]
Reduce usage of isRelRelative.

It is now used only for relocations that only set the low bits inside a
page. Everything else is handled by getRelExpr.

I will send a another review renaming and better documenting
isRelRelative.

llvm-svn: 267705

8 years agoRemove flaky decorator from three tests on linux
Pavel Labath [Wed, 27 Apr 2016 12:43:37 +0000 (12:43 +0000)]
Remove flaky decorator from three tests on linux

The flakyness is no longer reproducible, and the tests seem to be passing reliably now.

llvm-svn: 267704

8 years agotsan: change tsan/Go interface for obtaining the current Processor
Dmitry Vyukov [Wed, 27 Apr 2016 12:30:48 +0000 (12:30 +0000)]
tsan: change tsan/Go interface for obtaining the current Processor

Current interface assumes that Go calls ProcWire/ProcUnwire
to establish the association between thread and proc.
With the wisdom of hindsight, this interface does not work
very well. I had to sprinkle Go scheduler with wire/unwire
calls, and any mistake leads to hard to debug crashes.
This is not something one wants to maintian.
Fortunately, there is a simpler solution. We can ask Go
runtime as to what is the current Processor, and that
question is very easy to answer on Go side.
Switch to such interface.

llvm-svn: 267703

8 years agoRepresent TOC relative relocations as GOTREL.
Rafael Espindola [Wed, 27 Apr 2016 12:25:22 +0000 (12:25 +0000)]
Represent TOC relative relocations as GOTREL.

That way we only need to subtract the offset is relocateOne.

llvm-svn: 267702

8 years agoCreate a .got when PPC64 uses a TOC.
Rafael Espindola [Wed, 27 Apr 2016 12:21:27 +0000 (12:21 +0000)]
Create a .got when PPC64 uses a TOC.

This simplifies the logic for computing the value of the toc base.

llvm-svn: 267701

8 years agoFix a crash in cppcoreguidelines-pro-type-member-init when checking a type with a...
Haojian Wu [Wed, 27 Apr 2016 12:17:04 +0000 (12:17 +0000)]
Fix a crash in cppcoreguidelines-pro-type-member-init when checking a type with a template parameter as a base class.

Summary: Fixed a crash in cppcoreguidelines-pro-type-member-init when encountering a type that uses one of its template parameters as a base when compiling for C++98.

Patch by Michael Miller!

Reviewers: aaron.ballman, alexfh, hokein

Subscribers: cfe-commits

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

llvm-svn: 267700

8 years ago[InstCombine][SSE] Regenerated vector shift tests
Simon Pilgrim [Wed, 27 Apr 2016 12:04:44 +0000 (12:04 +0000)]
[InstCombine][SSE] Regenerated vector shift tests

llvm-svn: 267699

8 years agoSimplify handling of R_PPC64_TOC. NFC.
Rafael Espindola [Wed, 27 Apr 2016 11:54:07 +0000 (11:54 +0000)]
Simplify handling of R_PPC64_TOC. NFC.

llvm-svn: 267698

8 years agoclang-tidy -list-checks should exit with non-zero code when no checks are enabled.
Alexander Kornienko [Wed, 27 Apr 2016 11:45:14 +0000 (11:45 +0000)]
clang-tidy -list-checks should exit with non-zero code when no checks are enabled.

llvm-svn: 267697

8 years ago[Clang][BuiltIn][AVX512] Adding intrinsics without mask for VBROADCAST and VPBROADCAS...
Michael Zuckerman [Wed, 27 Apr 2016 11:43:14 +0000 (11:43 +0000)]
[Clang][BuiltIn][AVX512] Adding intrinsics without mask for VBROADCAST and VPBROADCAST instruction set .

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

llvm-svn: 267696

8 years ago[OPENMP] Fix crash on initialization of classes with no init clause in
Alexey Bataev [Wed, 27 Apr 2016 11:38:05 +0000 (11:38 +0000)]
[OPENMP] Fix crash on initialization of classes with no init clause in
declare reductions.

If reduction clause is applied to instance of class with user-defined
reduction operation without initialization clause, it may cause a crash.
Patch fixes this issue.

llvm-svn: 267695

8 years ago[mips][microMIPS] Add CodeGen support for SUBU16, SUB, SUBU, DSUB and DSUBU instructions
Zlatko Buljan [Wed, 27 Apr 2016 11:31:44 +0000 (11:31 +0000)]
[mips][microMIPS] Add CodeGen support for SUBU16, SUB, SUBU, DSUB and DSUBU instructions
Differential Revision: http://reviews.llvm.org/D16676

llvm-svn: 267694

8 years ago[mips][microMIPS] Add CodeGen support for SLL16, SRL16, SLL, SLLV, SRA, SRAV, SRL...
Zlatko Buljan [Wed, 27 Apr 2016 11:02:23 +0000 (11:02 +0000)]
[mips][microMIPS] Add CodeGen support for SLL16, SRL16, SLL, SLLV, SRA, SRAV, SRL and SRLV instructions
Differential Revision: http://reviews.llvm.org/D17989

llvm-svn: 267693

8 years agoisSafeToLoadUnconditionally support queries without a context
Artur Pilipenko [Wed, 27 Apr 2016 11:00:48 +0000 (11:00 +0000)]
isSafeToLoadUnconditionally support queries without a context

This is required to use this function from isSafeToSpeculativelyExecute

Reviewed By: hfinkel

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

llvm-svn: 267692

8 years ago[modules] Fix Decl's Used invariant.
Vassil Vassilev [Wed, 27 Apr 2016 10:46:06 +0000 (10:46 +0000)]
[modules] Fix Decl's Used invariant.

The Decl::isUsed has a value for every decl. In non-module builds it is very
difficult (but possible) to break this invariant but when we walk up the redecl
chain we find the neccessary information.

When deserializing the decls from a module it is much more difficult to update
correctly this invariant. The patch centralizes the information whether a decl
is used in the canonical decl marking the entire entity as being used.

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

Patch by Cristina Cristescu and me.

Thanks to Richard Smith who helped to debug and understand the issue!

Reviewed by Richard Smith.

llvm-svn: 267691

8 years ago[Clang][BuiltIn][AVX512]Adding intrinsics for vmovntdqa vmovntpd vmovntps instruction set
Michael Zuckerman [Wed, 27 Apr 2016 10:44:15 +0000 (10:44 +0000)]
[Clang][BuiltIn][AVX512]Adding intrinsics for vmovntdqa vmovntpd vmovntps instruction set

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

llvm-svn: 267690

8 years agoUse DL preferred alignment for alloca in Value::getPointerAlignment
Artur Pilipenko [Wed, 27 Apr 2016 10:42:29 +0000 (10:42 +0000)]
Use DL preferred alignment for alloca in Value::getPointerAlignment

Teach Value::getPointerAlignment that allocas with no explicit alignment are aligned to preferred alignment of the allocated type.

Reviewed By: hfinkel

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

llvm-svn: 267689

8 years agoFix compiler warnings in SymbolFilePDBTests
Pavel Labath [Wed, 27 Apr 2016 10:40:52 +0000 (10:40 +0000)]
Fix compiler warnings in SymbolFilePDBTests

llvm-svn: 267688

8 years agoDon't search compilation database in explain-check test.
Haojian Wu [Wed, 27 Apr 2016 10:22:31 +0000 (10:22 +0000)]
Don't search compilation database in explain-check test.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 267687

8 years ago[InstCombine][SSE] Added DemandedBits tests for MOVMSK instructions
Simon Pilgrim [Wed, 27 Apr 2016 09:53:09 +0000 (09:53 +0000)]
[InstCombine][SSE] Added DemandedBits tests for MOVMSK instructions

MOVMSK zeros the upper bits of the gpr - we should be able to use this.

llvm-svn: 267686

8 years agoRemoved dead code. NFC.
George Rimar [Wed, 27 Apr 2016 09:24:03 +0000 (09:24 +0000)]
Removed dead code. NFC.

llvm-svn: 267685

8 years ago[ELF] - Align sections file offsets correctly.
George Rimar [Wed, 27 Apr 2016 09:16:28 +0000 (09:16 +0000)]
[ELF] - Align sections file offsets correctly.

System V ABI 4.1 specifies that program header's p_vaddr should equal p_offset, modulo p_align.
(https://docs.oracle.com/cd/E19683-01/816-1386/chapter6-83432/index.html).
It was possible to violate this using the linkerscript.
Patch fixes the issue.

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

llvm-svn: 267684

8 years ago[ClangTidy] Add an 'explain-checks' option to diagnose where each checks comes from.
Haojian Wu [Wed, 27 Apr 2016 09:15:01 +0000 (09:15 +0000)]
[ClangTidy] Add an 'explain-checks' option to diagnose where each checks comes from.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 267683

8 years agotsan: fix windows build
Dmitry Vyukov [Wed, 27 Apr 2016 08:41:31 +0000 (08:41 +0000)]
tsan: fix windows build

warning: '__sanitizer::uptr __sanitizer::GetPreferredBase(const char*)' defined but not used
llvm-svn: 267682

8 years agotsan: fix windows build
Dmitry Vyukov [Wed, 27 Apr 2016 08:39:32 +0000 (08:39 +0000)]
tsan: fix windows build

llvm-svn: 267681

8 years agotsan: add missing file
Dmitry Vyukov [Wed, 27 Apr 2016 08:34:55 +0000 (08:34 +0000)]
tsan: add missing file

llvm-svn: 267680

8 years agotsan: fix compiler warning
Dmitry Vyukov [Wed, 27 Apr 2016 08:28:08 +0000 (08:28 +0000)]
tsan: fix compiler warning

tsan_debugging.cc: In function ‘void* __tsan_get_current_report()’:
tsan_debugging.cc:61:18: warning: cast from type ‘const __tsan::ReportDesc*’
                         to type ‘void*’ casts away qualifiers [-Wcast-qual]
   return (void *)rep;

llvm-svn: 267679

8 years agotsan: split thread into logical and physical state
Dmitry Vyukov [Wed, 27 Apr 2016 08:23:02 +0000 (08:23 +0000)]
tsan: split thread into logical and physical state

This is reincarnation of http://reviews.llvm.org/D17648 with the bug fix pointed out by Adhemerval (zatrazz).

Currently ThreadState holds both logical state (required for race-detection algorithm, user-visible)
and physical state (various caches, most notably malloc cache). Move physical state in a new
Process entity. Besides just being the right thing from abstraction point of view, this solves several
problems:

Cache everything on P level in Go. Currently we cache on a mix of goroutine and OS thread levels.
This unnecessary increases memory consumption.

Properly handle free operations in Go. Frees are issue by GC which don't have goroutine context.
As the result we could not do anything more than just clearing shadow. For example, we leaked
sync objects and heap block descriptors.

This will allow to get rid of libc malloc in Go (now we have Processor context for internal allocator cache).
This in turn will allow to get rid of dependency on libc entirely.

Potentially we can make Processor per-CPU in C++ mode instead of per-thread, which will
reduce resource consumption.
The distinction between Thread and Processor is currently used only by Go, C++ creates Processor per OS thread,
which is equivalent to the current scheme.

llvm-svn: 267678

8 years ago[OPENMP] Fix for codegen of captured variables in inlined directives.
Alexey Bataev [Wed, 27 Apr 2016 07:56:03 +0000 (07:56 +0000)]
[OPENMP] Fix for codegen of captured variables in inlined directives.

Currently there is a problem with codegen of inlined directives inside
lambdas, it may cause a crash during codegen because of incorrect
capturing of variables. Patch fixes this problem.

llvm-svn: 267677

8 years agoUpdated doxygen comments for intrinsics.
Ekaterina Romanova [Wed, 27 Apr 2016 07:14:02 +0000 (07:14 +0000)]
Updated doxygen comments for intrinsics.
(1) Removed \code.. \endcode tags around the instruction name. This matches the doxygen format for all other intrinsics.
(2) Did a better formatting for the comments (to fit into 80 columns more compactly).

llvm-svn: 267676

8 years agoFixed sphinx warning from r267672
Adam Nemet [Wed, 27 Apr 2016 05:59:51 +0000 (05:59 +0000)]
Fixed sphinx warning from r267672

llvm-svn: 267675

8 years ago[Compiler-rt][CFI] Enabling CFI for MIPS64
Mohit K. Bhakkad [Wed, 27 Apr 2016 05:49:42 +0000 (05:49 +0000)]
[Compiler-rt][CFI] Enabling CFI for MIPS64

Reviewers: eugenis

Subscribers: jaydeep, sagar, Sanitizers

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

llvm-svn: 267674

8 years ago[ELF][MIPS] Remove getMipsGpAddr(). NFC
Simon Atanasyan [Wed, 27 Apr 2016 05:31:28 +0000 (05:31 +0000)]
[ELF][MIPS] Remove getMipsGpAddr(). NFC

llvm-svn: 267673

8 years ago[LoopDist] Add llvm.loop.distribute.enable loop metadata
Adam Nemet [Wed, 27 Apr 2016 05:28:18 +0000 (05:28 +0000)]
[LoopDist] Add llvm.loop.distribute.enable loop metadata

Summary:
D19403 adds a new pragma for loop distribution.  This change adds
support for the corresponding metadata that the pragma is translated to
by the FE.

As part of this I had to rethink the flag -enable-loop-distribute.  My
goal was to be backward compatible with the existing behavior:

  A1. pass is off by default from the optimization pipeline
  unless -enable-loop-distribute is specified

  A2. pass is on when invoked directly from opt (e.g. for unit-testing)

The new pragma/metadata overrides these defaults so the new behavior is:

  B1. A1 + enable distribution for individual loop with the pragma/metadata

  B2. A2 + disable distribution for individual loop with the pragma/metadata

The default value whether the pass is on or off comes from the initiator
of the pass.  From the PassManagerBuilder the default is off, from opt
it's on.

I moved -enable-loop-distribute under the pass.  If the flag is
specified it overrides the default from above.

Then the pragma/metadata can further modifies this per loop.

As a side-effect, we can now also use -enable-loop-distribute=0 from opt
to emulate the default from the optimization pipeline.  So to be precise
this is the new behavior:

  C1. pass is off by default from the optimization pipeline
  unless -enable-loop-distribute or the pragma/metadata enables it

  C2. pass is on when invoked directly from opt
  unless -enable-loop-distribute=0 or the pragma/metadata disables it

Reviewers: hfinkel

Subscribers: joker.eph, mzolotukhin, llvm-commits

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

llvm-svn: 267672

8 years ago[Cloning] cloneLoopWithPreheader(): add assert to ensure no sub-loops
Vaivaswatha Nagaraj [Wed, 27 Apr 2016 05:25:09 +0000 (05:25 +0000)]
[Cloning] cloneLoopWithPreheader(): add assert to ensure no sub-loops

Summary:
cloneLoopWithPreheader() does not update LoopInfo for sub-loop of
the original loop being cloned. Add assert to ensure no sub-loops for loop being cloned.

Reviewers: anemet, ashutosh.nema, hfinkel

Subscribers: mzolotukhin, llvm-commits

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

llvm-svn: 267671

8 years ago[Support][X86] Add a few more Intel model numbers to getHostCPUName for airmont and...
Craig Topper [Wed, 27 Apr 2016 05:17:00 +0000 (05:17 +0000)]
[Support][X86] Add a few more Intel model numbers to getHostCPUName for airmont and knl.

llvm-svn: 267670

8 years ago[Support][X86] Change the case values in the Intel family 6 code to hex so its easier...
Craig Topper [Wed, 27 Apr 2016 05:16:58 +0000 (05:16 +0000)]
[Support][X86] Change the case values in the Intel family 6 code to hex so its easier to compare with Intel's docs. NFC

llvm-svn: 267669

8 years agoRevert "Support "preserving" the summary information when using setModule() API in...
Mehdi Amini [Wed, 27 Apr 2016 05:11:44 +0000 (05:11 +0000)]
Revert "Support "preserving" the summary information when using setModule() API in LTOCodeGenerator"

This reverts commit r267665.
ASAN shows that there is a use of undefined value.

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

8 years agoCommitting patch from <Michael Woerister <michaelwoerister@posteo.net>
Jason Molenda [Wed, 27 Apr 2016 04:50:51 +0000 (04:50 +0000)]
Committing patch from <Michael Woerister <michaelwoerister@posteo.net>
to use the default clang C/C++ expression parser when debugging
Rust programs.  Ideally there would be a rust language plugin to
support their language natively, but until then this will get simple
variable display to work.

http://reviews.llvm.org/D19545

llvm-svn: 267667

8 years ago[Support][X86] Add a couple more Broadwell CPU models numbers to getHostCPUName.
Craig Topper [Wed, 27 Apr 2016 04:40:03 +0000 (04:40 +0000)]
[Support][X86] Add a couple more Broadwell CPU models numbers to getHostCPUName.

llvm-svn: 267666

8 years agoSupport "preserving" the summary information when using setModule() API in LTOCodeGen...
Mehdi Amini [Wed, 27 Apr 2016 04:24:10 +0000 (04:24 +0000)]
Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

Another attempt at r267655...

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

8 years agoRevert "Support "preserving" the summary information when using setModule() API in...
Mehdi Amini [Wed, 27 Apr 2016 03:34:28 +0000 (03:34 +0000)]
Revert "Support "preserving" the summary information when using setModule() API in LTOCodeGenerator"

This reverts commit r267657, r267656, and r267655.
The test does not pass on multiple bots, I'm unsure why yet but let's unbreak them.

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

8 years agoSimplify. NFC.
Rui Ueyama [Wed, 27 Apr 2016 03:04:56 +0000 (03:04 +0000)]
Simplify. NFC.

llvm-svn: 267663

8 years agoThe patch fixes PR27392.
Evgeny Stupachenko [Wed, 27 Apr 2016 03:04:54 +0000 (03:04 +0000)]
The patch fixes PR27392.
Summary:
 It is incorrect to compare TripCount (which is BECount + 1)
  with extraiters (or Count) to check if we should enter unrolled
  loop or not, because TripCount can potentially overflow
  (when BECount is max unsigned integer).
 While comparing BECount with (Count - 1) is overflow safe and
  therefore correct.

Reviewer: hfinkel

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

From: Evgeny Stupachenko <evstupac@gmail.com>
llvm-svn: 267662

8 years ago[LVI] Delete stale and misleading comment.
Philip Reames [Wed, 27 Apr 2016 03:03:15 +0000 (03:03 +0000)]
[LVI] Delete stale and misleading comment.

llvm-svn: 267661

8 years ago[ppc64] fix bug in prologue that mfocrf's cr operand should be explict state instead...
Chuang-Yu Cheng [Wed, 27 Apr 2016 02:59:28 +0000 (02:59 +0000)]
[ppc64] fix bug in prologue that mfocrf's cr operand should be explict state instead of implicit

This fixes PR27414

Reviewers: kbarton mgrang tjablin

http://reviews.llvm.org/D19255

llvm-svn: 267660

8 years agoRemove unnecessary trailing semicolons.
Rui Ueyama [Wed, 27 Apr 2016 02:58:27 +0000 (02:58 +0000)]
Remove unnecessary trailing semicolons.

Since this semicolon existed in an early test file,
it has spread to many files.

llvm-svn: 267659

8 years ago[X86] Set AddPristinesAndCSRs to FixupBW LivePhysRegs. NFC.
Ahmed Bougacha [Wed, 27 Apr 2016 01:51:38 +0000 (01:51 +0000)]
[X86] Set AddPristinesAndCSRs to FixupBW LivePhysRegs. NFC.

We run after PEI, so we need to AddPristinesAndCSRs.
In practice, that makes no difference here, because we only ask about
liveness of super-registers of defined GR8/GR16 registers, so they
can't be pristine. Still, it's the correct thing to do.

Thanks to Quentin for noticing!

Follow-up to r267495.

llvm-svn: 267658

8 years agoFix the test from r267656: Support "preserving" the summary information when using...
Mehdi Amini [Wed, 27 Apr 2016 01:49:11 +0000 (01:49 +0000)]
Fix the test from r267656: Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

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

8 years agoAdd a test for r267655: Support "preserving" the summary information when using setMo...
Mehdi Amini [Wed, 27 Apr 2016 01:47:46 +0000 (01:47 +0000)]
Add a test for r267655: Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

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

8 years agoSupport "preserving" the summary information when using setModule() API in LTOCodeGen...
Mehdi Amini [Wed, 27 Apr 2016 01:46:48 +0000 (01:46 +0000)]
Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

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

8 years agoFix = that should have been == in test. Thanks to STL@microsoft for the catch
Marshall Clow [Wed, 27 Apr 2016 01:46:43 +0000 (01:46 +0000)]
Fix = that should have been == in test. Thanks to STL@microsoft for the catch

llvm-svn: 267654

8 years agoFix typo in comment; NFC
Sanjoy Das [Wed, 27 Apr 2016 01:44:31 +0000 (01:44 +0000)]
Fix typo in comment; NFC

llvm-svn: 267653

8 years ago[X86] Don't assume that MMX extractelts are from index 0.
Ahmed Bougacha [Wed, 27 Apr 2016 01:35:29 +0000 (01:35 +0000)]
[X86] Don't assume that MMX extractelts are from index 0.

It's probably the case for all 3 MMX users out there, but with
hand-crafted IR, you can trigger selection failures. Fix that.

llvm-svn: 267652