platform/upstream/llvm.git
9 years agoAllow UBSan+MSan and UBSan+TSan combinations (Clang part).
Alexey Samsonov [Tue, 28 Apr 2015 00:56:36 +0000 (00:56 +0000)]
Allow UBSan+MSan and UBSan+TSan combinations (Clang part).

Embed UBSan runtime into TSan and MSan runtimes in the same as we do
in ASan. Extend UBSan test suite to also run tests for these
combinations.

llvm-svn: 235953

9 years agoCleanup, remove unused return value
Matthias Braun [Tue, 28 Apr 2015 00:37:05 +0000 (00:37 +0000)]
Cleanup, remove unused return value

llvm-svn: 235952

9 years ago[MC] Split MCBinaryExpr::Shr into LShr and AShr.
Ahmed Bougacha [Tue, 28 Apr 2015 00:21:32 +0000 (00:21 +0000)]
[MC] Split MCBinaryExpr::Shr into LShr and AShr.

Defaulting to AShr without consulting the target MCAsmInfo isn't OK.
Add a flag to fix that.  Keep it off for now: target migrations will
follow in separate commits.

llvm-svn: 235951

9 years ago[MC] Move getBinOpPrecedence into AsmParser. NFC.
Ahmed Bougacha [Tue, 28 Apr 2015 00:17:39 +0000 (00:17 +0000)]
[MC] Move getBinOpPrecedence into AsmParser. NFC.

In preparation for a future patch.

llvm-svn: 235950

9 years agoms_struct does not imply the MS base-layout ABI; separate these
John McCall [Tue, 28 Apr 2015 00:17:18 +0000 (00:17 +0000)]
ms_struct does not imply the MS base-layout ABI; separate these
conditions in the IRGen struct layout code.

rdar://20636558

llvm-svn: 235949

9 years ago[TestProcessAttach] Decorate with expectedFailureLinux
Siva Chandra [Mon, 27 Apr 2015 23:56:23 +0000 (23:56 +0000)]
[TestProcessAttach] Decorate with expectedFailureLinux

Summary: Link to PR: llvm.org/pr23360

Test Plan: dotest.py -p TestProcessAttach

Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 235947

9 years agoRefactor: put these function declarations somewhere more appropriate.
Richard Smith [Mon, 27 Apr 2015 23:52:41 +0000 (23:52 +0000)]
Refactor: put these function declarations somewhere more appropriate.

llvm-svn: 235946

9 years agoSwitch lowering: use uint32_t for weights everywhere
Hans Wennborg [Mon, 27 Apr 2015 23:52:19 +0000 (23:52 +0000)]
Switch lowering: use uint32_t for weights everywhere

I previously thought switch clusters would need to use uint64_t in case
the weights of multiple cases overflowed a 32-bit int. It turns
out that the weights on a terminator instruction are capped to allow for
being added together, so using a uint32_t should be safe.

llvm-svn: 235945

9 years ago[asan] Fix ASan build on Android/AArch64.
Evgeniy Stepanov [Mon, 27 Apr 2015 23:49:39 +0000 (23:49 +0000)]
[asan] Fix ASan build on Android/AArch64.

The build for aarch64 is not enabled in cmake/config-ix.cmake yet.

llvm-svn: 235944

9 years agoLTO: Add API to choose whether to embed uselists
Duncan P. N. Exon Smith [Mon, 27 Apr 2015 23:38:54 +0000 (23:38 +0000)]
LTO: Add API to choose whether to embed uselists

Reverse libLTO's default behaviour for preserving use-list order in
bitcode, and add API for controlling it.  The default setting is now
`false` (don't preserve them), which is consistent with `clang`'s
default behaviour.

Users of libLTO should call `lto_codegen_should_embed_uselists(CG,true)`
prior to calling `lto_codegen_write_merged_modules()` whenever the
output file isn't part of the production workflow in order to reproduce
results with subsequent calls to `llc`.

(I haven't added tests since `llvm-lto` (the test tool for LTO) doesn't
support bitcode output, and even if it did: there isn't actually a good
way to test whether a tool has passed the flag.  If the order is already
"natural" (if the order will already round-trip) then no use-list
directives are emitted at all.  At some point I'll circle back to add
tests to `llvm-as` (etc.) that they actually respect the flag, at which
point I can somehow add a test here as well.)

llvm-svn: 235943

9 years agoSwitch lowering: Take branch weight into account when ordering for fall-through
Hans Wennborg [Mon, 27 Apr 2015 23:35:22 +0000 (23:35 +0000)]
Switch lowering: Take branch weight into account when ordering for fall-through

Previously, the code would try to put a fall-through case last,
even if that meant moving a case with much higher branch weight
further down the chain.

Ordering by branch weight is most important, putting a fall-through
block last is secondary.

llvm-svn: 235942

9 years ago[modules] Incrementally compute the list of overridden module macros based on
Richard Smith [Mon, 27 Apr 2015 23:21:38 +0000 (23:21 +0000)]
[modules] Incrementally compute the list of overridden module macros based on
the active module macros at the point of definition, rather than reconstructing
it from the macro history. No functionality change intended.

llvm-svn: 235941

9 years agoAdd an unnamed pipe fail-safe to launching lldb-gdbserver.
Chaoren Lin [Mon, 27 Apr 2015 23:20:30 +0000 (23:20 +0000)]
Add an unnamed pipe fail-safe to launching lldb-gdbserver.

Summary:
Currently, launching lldb-gdbserver from platform on Android requires root for
mkfifo() and an explicit TMPDIR variable. This should remove both requirements.

Test Plan: Successfully launched lldb-gdbserver on a non-rooted Android device.

Reviewers: tberghammer, vharron, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 235940

9 years agoLTO: Simplify code generator initialization
Duncan P. N. Exon Smith [Mon, 27 Apr 2015 23:19:26 +0000 (23:19 +0000)]
LTO: Simplify code generator initialization

Simplify `LTOCodeGenerator` initialization by initializing simple fields
at their definition.

llvm-svn: 235939

9 years agoRemove stale FIXMEs from test case
Reid Kleckner [Mon, 27 Apr 2015 23:14:24 +0000 (23:14 +0000)]
Remove stale FIXMEs from test case

llvm-svn: 235937

9 years agoAlways add the target-cpu and target-features sets if they're non-null.
Eric Christopher [Mon, 27 Apr 2015 23:11:34 +0000 (23:11 +0000)]
Always add the target-cpu and target-features sets if they're non-null.
This makes sure that the front end is specific about what they're expecting
the backend to produce. Update a FIXME with the idea that the target-features
could be more precise using backend knowledge.

llvm-svn: 235936

9 years ago[Windows] Add a RegisterContextWindows_x64.
Zachary Turner [Mon, 27 Apr 2015 22:58:57 +0000 (22:58 +0000)]
[Windows] Add a RegisterContextWindows_x64.

With this patch, LLDB can debug x64 executables on Windows with
the same level of functionality as for x86 executables.

llvm-svn: 235935

9 years ago[docs] Fix the link to SanitizerCoverage docs.
Alexey Samsonov [Mon, 27 Apr 2015 22:50:06 +0000 (22:50 +0000)]
[docs] Fix the link to SanitizerCoverage docs.

llvm-svn: 235934

9 years agoUse MemoryBufferRef instead of MemoryBuffer&. NFC.
Rafael Espindola [Mon, 27 Apr 2015 22:48:51 +0000 (22:48 +0000)]
Use MemoryBufferRef instead of MemoryBuffer&. NFC.

This just reduces the noise from another patch.

llvm-svn: 235933

9 years agoclang-tidy: [readability-else-after-return] Fix false positive. This
Daniel Jasper [Mon, 27 Apr 2015 22:42:20 +0000 (22:42 +0000)]
clang-tidy: [readability-else-after-return] Fix false positive. This
might be a little too strict now, but better be too strict than do the
wrong thing.

llvm-svn: 235932

9 years agoCheck whether the operand to a noexcept expression is valid or not. Fixes PR15842.
Aaron Ballman [Mon, 27 Apr 2015 22:31:12 +0000 (22:31 +0000)]
Check whether the operand to a noexcept expression is valid or not. Fixes PR15842.

llvm-svn: 235931

9 years agoremove obsolete pattern matches for scalar SSE ops
Sanjay Patel [Mon, 27 Apr 2015 22:23:17 +0000 (22:23 +0000)]
remove obsolete pattern matches for scalar SSE ops

The blendi pattern should always replace the insertps pattern after:
http://reviews.llvm.org/rL232850
http://reviews.llvm.org/rL235124

llvm-svn: 235930

9 years ago[UBSan] Reenable ASan+UBSan tests on Darwin now that PR21112 is fixed.
Alexey Samsonov [Mon, 27 Apr 2015 22:09:27 +0000 (22:09 +0000)]
[UBSan] Reenable ASan+UBSan tests on Darwin now that PR21112 is fixed.

llvm-svn: 235929

9 years agoIntroduce tsan_cxx and msan_cxx libraries (compiler-rt part).
Alexey Samsonov [Mon, 27 Apr 2015 22:08:09 +0000 (22:08 +0000)]
Introduce tsan_cxx and msan_cxx libraries (compiler-rt part).

For now tsan_cxx and msan_cxx contain only operator new/delete
replacements. In the future, when we add support for running UBSan+TSan
and UBSan+MSan, they will also contain bits ubsan_cxx runtime.

llvm-svn: 235928

9 years ago[TSan] Prepare TSan tests for splitting tsan_cxx library.
Alexey Samsonov [Mon, 27 Apr 2015 22:08:08 +0000 (22:08 +0000)]
[TSan] Prepare TSan tests for splitting tsan_cxx library.

llvm-svn: 235927

9 years ago[MSan] Prepare for splitting msan_new_delete.cc into a separate library. NFC.
Alexey Samsonov [Mon, 27 Apr 2015 22:08:04 +0000 (22:08 +0000)]
[MSan] Prepare for splitting msan_new_delete.cc into a separate library. NFC.

llvm-svn: 235926

9 years agoLTO: Correct some doxygen comments about API availability
Duncan P. N. Exon Smith [Mon, 27 Apr 2015 22:08:01 +0000 (22:08 +0000)]
LTO: Correct some doxygen comments about API availability

These look like copy/paste errors, and shouldn't have the "prior to"
qualifier.  Each API was introduced at the given values of
`LTO_API_VERSION`.  The "prior to" in other doxygen comments is because
I couldn't easily differentiate between versions 1 and 2 when I added
these comments.

llvm-svn: 235925

9 years agoIntroduce tsan_cxx and msan_cxx libraries (Clang part).
Alexey Samsonov [Mon, 27 Apr 2015 22:07:50 +0000 (22:07 +0000)]
Introduce tsan_cxx and msan_cxx libraries (Clang part).

For now tsan_cxx and msan_cxx contain only operator new/delete
replacements. In the future, when we add support for running UBSan+TSan
and UBSan+MSan, they will also contain bits ubsan_cxx runtime.

llvm-svn: 235924

9 years agoUse CIE version 1 for .eh_frame.
Rafael Espindola [Mon, 27 Apr 2015 22:04:24 +0000 (22:04 +0000)]
Use CIE version 1 for .eh_frame.

According to

http://www.linuxbase.org/betaspecs/lsb/LSB-Core-generic/LSB-Core-generic/ehframechpt.html

we should always use 1.

llvm-svn: 235923

9 years ago[AArch64] Also combine vector selects fed by non-i1 SETCCs.
Ahmed Bougacha [Mon, 27 Apr 2015 21:43:12 +0000 (21:43 +0000)]
[AArch64] Also combine vector selects fed by non-i1 SETCCs.

After legalization, scalar SETCC has an i32 result type on AArch64.
The i1 requirement seems too conservative, replace it with an assert.

This also means that we now can run after legalization. That should also
be fine, since the ops legalizer runs again after each combine, and
all types created all have the same sizes as the (legal) inputs.

Exposed by r235917; while there, robustize its tests (bsl also uses the
register it defines).

llvm-svn: 235922

9 years agoPR23334: Perform semantic checking of lambda capture initialization in the right...
Richard Smith [Mon, 27 Apr 2015 21:27:54 +0000 (21:27 +0000)]
PR23334: Perform semantic checking of lambda capture initialization in the right context.

Previously we'd try to perform checks on the captures from the middle of
parsing the lambda's body, at the point where we detected that a variable
needed to be captured. This was wrong in a number of subtle ways. In
PR23334, we couldn't correctly handle the list of potential odr-uses
resulting from the capture, and our attempt to recover from that resulted
in a use-after-free.

We now defer building the initialization expression until we leave the lambda
body and return to the enclosing context, where the initialization does the
right thing. This patch only covers lambda-expressions, but we should apply
the same change to blocks and captured statements too.

llvm-svn: 235921

9 years agoAdd missing library dependency in libPDB.
Pete Cooper [Mon, 27 Apr 2015 21:23:12 +0000 (21:23 +0000)]
Add missing library dependency in libPDB.

PDB uses COFFObjectFile::getPE32Header which lives in libObject.

Make sure that LLVMBuild.txt reflects this dependency.

llvm-svn: 235920

9 years agoRevert "PR21000: pass -I options to assembler" as the test was failing on hexagon.
Artem Belevich [Mon, 27 Apr 2015 21:11:08 +0000 (21:11 +0000)]
Revert "PR21000: pass -I options to assembler" as the test was failing on hexagon.

llvm-svn: 235919

9 years agoAllow building the gold plugin even if the gold binary is not found.
Rafael Espindola [Mon, 27 Apr 2015 21:08:47 +0000 (21:08 +0000)]
Allow building the gold plugin even if the gold binary is not found.

The gold binary is not required to build the plugin. All that is
needed is for LLVM_BINUTILS_INCDIR to point to the directory
containing plugin-api.h.

llvm-svn: 235918

9 years ago[AArch64] Don't assert when combining (v3f32 select (setcc f64)).
Ahmed Bougacha [Mon, 27 Apr 2015 21:01:20 +0000 (21:01 +0000)]
[AArch64] Don't assert when combining (v3f32 select (setcc f64)).

When the setcc has f64 operands, we can't build a vector setcc mask
to feed a vselect, because f64 doesn't divide v3f32 evenly.
Just bail out when that happens.

llvm-svn: 235917

9 years agoXFail flakey test.
Chaoren Lin [Mon, 27 Apr 2015 20:57:24 +0000 (20:57 +0000)]
XFail flakey test.

llvm-svn: 235916

9 years agoPR21000: pass -I options to assembler
Artem Belevich [Mon, 27 Apr 2015 20:51:44 +0000 (20:51 +0000)]
PR21000: pass -I options to assembler

Pass -I options to assembly so it can find files included with
.include.

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

llvm-svn: 235915

9 years agoFixes a hang that can occur if a signal comes in during malloc calls.
Chris Bieneman [Mon, 27 Apr 2015 20:45:35 +0000 (20:45 +0000)]
Fixes a hang that can occur if a signal comes in during malloc calls.

We need to dereference the signals mutex during handler registration so that we force its construction. This is to prevent the first use being during handling an actual signal because you can't safely allocate memory in a signal handler.

llvm-svn: 235914

9 years agoSilence unused variable errors for no-asserts builds
Bill Schmidt [Mon, 27 Apr 2015 20:22:35 +0000 (20:22 +0000)]
Silence unused variable errors for no-asserts builds

llvm-svn: 235913

9 years agoSwitch lowering: order bit tests by branch weight.
Hans Wennborg [Mon, 27 Apr 2015 20:21:17 +0000 (20:21 +0000)]
Switch lowering: order bit tests by branch weight.

llvm-svn: 235912

9 years ago[opaque pointer type] encode the pointee type of global variables
David Blaikie [Mon, 27 Apr 2015 19:58:56 +0000 (19:58 +0000)]
[opaque pointer type] encode the pointee type of global variables

Use a few extra bits in the const field (after widening it from a fixed
single bit) to stash the address space which is no longer provided by
the type (and an extra bit in there to specify that we're using that new
encoding).

llvm-svn: 235911

9 years ago[PPC64LE] Remove unnecessary swaps from lane-insensitive vector computations
Bill Schmidt [Mon, 27 Apr 2015 19:57:34 +0000 (19:57 +0000)]
[PPC64LE] Remove unnecessary swaps from lane-insensitive vector computations

This patch adds a new SSA MI pass that runs on little-endian PPC64
code with VSX enabled. Loads and stores of 4x32 and 2x64 vectors
without alignment constraints are accomplished for little-endian using
lxvd2x/xxswapd and xxswapd/stxvd2x. The existence of the additional
xxswapd instructions hurts performance in comparison with big-endian
code, but they are necessary in the general case to support correct
semantics.

However, the general case does not apply to most vector code. Many
vector instructions are lane-insensitive; they do not "care" which
lanes the parallel computations are performed within, provided that
the resulting data is stored into the correct locations. Thus this
pass looks for computations that perform only lane-insensitive
operations, and remove the unnecessary swaps from loads and stores in
such computations.

Future improvements will allow computations using certain
lane-sensitive operations to also be optimized in this manner, by
modifying the lane-sensitive operations to account for the permuted
order of the lanes. However, this patch only adds the infrastructure
to permit this; no lane-sensitive operations are optimized at this
time.

This code is heavily exercised by the various vectorizing applications
in the projects/test-suite tree. For the time being, I have only added
one simple test case to demonstrate what the pass is doing. Although
it is quite simple, it provides coverage for much of the code,
including the special case handling of copies and subreg-to-reg
operations feeding the swaps. I plan to add additional tests in the
future as I fill in more of the "special handling" code.

Two existing tests were affected, because they expected the swaps to
be present, but they are now removed.

llvm-svn: 235910

9 years ago[llvm-symbolizer] Link DebugInfoPDB for the autoconf build
Zachary Turner [Mon, 27 Apr 2015 19:41:40 +0000 (19:41 +0000)]
[llvm-symbolizer] Link DebugInfoPDB for the autoconf build

llvm-svn: 235909

9 years agoSimplify depfile quoting test.
Paul Robinson [Mon, 27 Apr 2015 19:40:04 +0000 (19:40 +0000)]
Simplify depfile quoting test.

With -MG we don't actually need to create the files with funky names.
Also use a more sensible check-prefix for the NMAKE case.

llvm-svn: 235908

9 years ago[cuda] Ignore "TLS unsupported by target" errors for host variables during device...
Artem Belevich [Mon, 27 Apr 2015 19:37:53 +0000 (19:37 +0000)]
[cuda] Ignore "TLS unsupported by target" errors for host variables during device compilation.

During device-side CUDA compilation clang currently complains about
all TLS variables, regardless of whether they are __host__ or
__device__.

This patch suppresses "TLS unsupported" errors for host variables
during device compilation and for device variables during host
compilation.

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

llvm-svn: 235907

9 years ago[TSan] Move new/delete interceptors into a separate source file. NFC.
Alexey Samsonov [Mon, 27 Apr 2015 19:33:55 +0000 (19:33 +0000)]
[TSan] Move new/delete interceptors into a separate source file. NFC.

llvm-svn: 235906

9 years ago[cuda] treat file scope __asm as __host__ and ignore it during device-side compilation.
Artem Belevich [Mon, 27 Apr 2015 18:52:00 +0000 (18:52 +0000)]
[cuda] treat file scope __asm as __host__ and ignore it during device-side compilation.

Currently clang emits file-scope asm during *both* host and device
compilation modes which is usually a wrong thing to do.

There's no way to attach any attribute to an __asm statement, so
there's no way to differentiate between host-side and device-side
file-scope asm.  This patch makes clang to match nvcc behavior and
emit file-scope-asm only during host-side compilation.

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

llvm-svn: 235905

9 years agolibc++abi: enable LLVM unwinder by default for ARM
Saleem Abdulrasool [Mon, 27 Apr 2015 18:19:33 +0000 (18:19 +0000)]
libc++abi: enable LLVM unwinder by default for ARM

libc++abi uses EHABI extensions, which are only part of the LLVM unwinder.  When
targeting ARM by default, enable the use of the LLVM unwinder.  Hopefully this
will fix the ARM native bot

llvm-svn: 235904

9 years agoSupport generating NMake/Jom-style depfiles.
Paul Robinson [Mon, 27 Apr 2015 18:14:32 +0000 (18:14 +0000)]
Support generating NMake/Jom-style depfiles.

NMake is a Make-like builder that comes with Microsoft Visual Studio.
Jom (https://wiki.qt.io/Jom) is an NMake-compatible build tool.
Dependency files for NMake/Jom need to use double-quotes to wrap
filespecs containing special characters, instead of the backslash
escapes that GNU Make wants.

Adds the -MV option, which specifies to use double-quotes as needed
instead of backslash escapes when writing the dependency file.

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

llvm-svn: 235903

9 years agofix 80-cols; NFC
Sanjay Patel [Mon, 27 Apr 2015 17:45:44 +0000 (17:45 +0000)]
fix 80-cols; NFC

llvm-svn: 235902

9 years agoFix build broken by incorrect class name.
Zachary Turner [Mon, 27 Apr 2015 17:22:30 +0000 (17:22 +0000)]
Fix build broken by incorrect class name.

llvm-svn: 235901

9 years agoMake llvm-symbolizer work on Windows.
Zachary Turner [Mon, 27 Apr 2015 17:19:51 +0000 (17:19 +0000)]
Make llvm-symbolizer work on Windows.

Differential Revision: http://reviews.llvm.org/D9234
Reviewed By: Alexey Samsonov

llvm-svn: 235900

9 years ago[MS ABI] Use 'continue' instead of 'return false' where intended
Reid Kleckner [Mon, 27 Apr 2015 17:19:49 +0000 (17:19 +0000)]
[MS ABI] Use 'continue' instead of 'return false' where intended

This was a bug in r218285 that prevented us from seeing subsequent
virtual bases in the class hierarchy, leading to crashes later.

Also add some comments to this function, now that we better understand
what it's trying to do.

Fixes PR21062 and PR21064.

llvm-svn: 235899

9 years agoMake an RAII com initializer.
Zachary Turner [Mon, 27 Apr 2015 17:19:26 +0000 (17:19 +0000)]
Make an RAII com initializer.

Differential Revision: http://reviews.llvm.org/D9267
Reviewed By: Aaron Ballman, David Majnemer

llvm-svn: 235898

9 years agoRemove trailing whitespace characters.
Rui Ueyama [Mon, 27 Apr 2015 17:18:04 +0000 (17:18 +0000)]
Remove trailing whitespace characters.

llvm-svn: 235897

9 years agofix typos; NFC
Sanjay Patel [Mon, 27 Apr 2015 17:03:31 +0000 (17:03 +0000)]
fix typos; NFC

llvm-svn: 235896

9 years agoELF: Simplify LinkerScript detection. NFC.
Rui Ueyama [Mon, 27 Apr 2015 16:54:48 +0000 (16:54 +0000)]
ELF: Simplify LinkerScript detection. NFC.

llvm-svn: 235895

9 years agoMake sure files in the Xcode project in source/API are in alphabetic order.
Greg Clayton [Mon, 27 Apr 2015 16:52:08 +0000 (16:52 +0000)]
Make sure files in the Xcode project in source/API are in alphabetic order.

llvm-svn: 235894

9 years agounwind: remove inclusion of private_typeinfo.h
Saleem Abdulrasool [Mon, 27 Apr 2015 16:51:52 +0000 (16:51 +0000)]
unwind: remove inclusion of private_typeinfo.h

This include is not currently used.  It is intended for type info based
switching, which is part of the EHABI specification.  However, the unwinder does
not currently support this functionality. This backwards dependency into
libc++abi is currently causing a buildbot failure, remove it until we have a
better solution.

llvm-svn: 235893

9 years agoMake sure versions are valid before we try to use them. Also check for invalid versio...
Greg Clayton [Mon, 27 Apr 2015 16:49:57 +0000 (16:49 +0000)]
Make sure versions are valid before we try to use them. Also check for invalid versions[0] by comparing it to UINT32_MAX instead of 0.

llvm-svn: 235892

9 years ago[mips] Correct bytes to bits in 2 comments. NFC.
Toma Tabacu [Mon, 27 Apr 2015 15:21:38 +0000 (15:21 +0000)]
[mips] Correct bytes to bits in 2 comments. NFC.

llvm-svn: 235891

9 years agoAdd missing snippets from r235880
Adhemerval Zanella [Mon, 27 Apr 2015 15:13:17 +0000 (15:13 +0000)]
Add missing snippets from r235880

llvm-svn: 235890

9 years agoAVX-512: added calling conventions for i1 vectors.
Elena Demikhovsky [Mon, 27 Apr 2015 15:11:19 +0000 (15:11 +0000)]
AVX-512: added calling conventions for i1 vectors.

Fixed bug: https://llvm.org/bugs/show_bug.cgi?id=20724

llvm-svn: 235889

9 years agoImprove handling of ctrl-c with MSVC.
Hafiz Abid Qadeer [Mon, 27 Apr 2015 15:04:42 +0000 (15:04 +0000)]
Improve handling of ctrl-c with MSVC.
Currently hitting Ctrl-C in Windows LLDB-MI just exits MI. But according to test_lldbmi_stopped_when_interrupt() in TestMiSignal.py Ctrl-C should send a SIGINT signal to the inferior.
Patch adds this functionality to Windows so SIGINT is sent on Ctrl-C.

Patch from EwanCrawford. Reviewed in http://reviews.llvm.org/D9248.

llvm-svn: 235887

9 years ago[Hexagon] Use constant extenders to fix up hardware loops
Brendon Cahoon [Mon, 27 Apr 2015 14:16:43 +0000 (14:16 +0000)]
[Hexagon] Use constant extenders to fix up hardware loops

Use a loop instruction with a constant extender for a hardware
loop instruction that is too far away from the start of the loop.
This is cheaper than changing the SA register value.

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

llvm-svn: 235882

9 years ago[mips] [IAS] Improve warning for using AT with .set noat.
Toma Tabacu [Mon, 27 Apr 2015 14:05:04 +0000 (14:05 +0000)]
[mips] [IAS] Improve warning for using AT with .set noat.

Summary:
Changed the warning message to show the current value of $at, similar to what clang does for typedef's, and renamed warnIfAssemblerTemporary to a more descriptive name.

I also changed the type of variables which store registers from int to unsigned, updated the relevant test and tried to make the related comments clearer.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235881

9 years agoELF/ARM: Ignore R_ARM_V4BX for ARMv4 but allow linking
Adhemerval Zanella [Mon, 27 Apr 2015 13:55:14 +0000 (13:55 +0000)]
ELF/ARM: Ignore R_ARM_V4BX for ARMv4 but allow linking

This patch allow the ARM relocation R_ARM_V4BX to be processed by lld,
although it is not really handled in the static relocation code.  The
relocation is in the form:

Relocation section '.rel.text' at offset 0x428 contains 4 entries:
 Offset     Info    Type            Sym.Value  Sym. Name
00000014  00000028 R_ARM_V4BX

Meaning it does have a direct target, but rather references to an absolute
section *ABS* (in this exemple to the .text segment itself).  It makes the
target Atom after file parse to not have a associated pointer and thus
generating a derrefence NULL point in ELFFile<ELFT>::findAtom.  Current
approach is just ignore and return nullptr in such cases.

The problem relies that default GCC configuration
for arm-linux-gnueabi{hf} emits the relocation for the asm:

--
.syntax unified
.arm

.p2align 2
.type fn, %function
fn:
  ldr r3, .LGOT
  ldr r2, .LGOT+4
.LPIC:
  add r3, pc, r3
  ldr r2, [r3, r2]
  cmp r2, #0
  bxeq lr
  b __start__
.LGOT:
 .word _GLOBAL_OFFSET_TABLE_-(.LPIC+8)
 .word __start__(GOT)
--

But only with the option -march=armv4 (which is the default GCC configuration).
For arm5 and forward the relocation is not created. This a special relocation
(defined miscellaneous for ARM) that instruct the linker to replace the bx
instruction into a mov.  GNU linker has some options related to which substitution
it can create for such cases.

With this patch I can dynamically link an application against a GLIBC
arm-linux-gnueabi system configured with default GCC.

llvm-svn: 235880

9 years agoReapply "[mips][FastISel] Implement shift ops for Mips fast-isel.""
Vasileios Kalintiris [Mon, 27 Apr 2015 13:28:05 +0000 (13:28 +0000)]
Reapply "[mips][FastISel] Implement shift ops for Mips fast-isel.""

This reapplies r235194, which was reverted in r235495 because it was causing a
failure in our out-of-tree buildbots for MIPS. With the sign-extension patch
in r235718, this patch doesn't cause any problem any more.

llvm-svn: 235878

9 years ago[mips] [IAS] Rename getATRegNum and setATReg to {g,s}etATRegIndex. NFC.
Toma Tabacu [Mon, 27 Apr 2015 13:12:59 +0000 (13:12 +0000)]
[mips] [IAS] Rename getATRegNum and setATReg to {g,s}etATRegIndex. NFC.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235877

9 years agoAVX-512: Extend/Truncate operations for SKX,
Elena Demikhovsky [Mon, 27 Apr 2015 12:57:59 +0000 (12:57 +0000)]
AVX-512: Extend/Truncate operations for SKX,
SETCC for bit-vectors

llvm-svn: 235875

9 years agoExtract IslNodeBuilder into its own file
Tobias Grosser [Mon, 27 Apr 2015 12:32:24 +0000 (12:32 +0000)]
Extract IslNodeBuilder into its own file

The IslNodeBuilder is a generic class that may be useful in other contexts
as well. Hence, we extract it into its own .h/.cpp file.

llvm-svn: 235873

9 years agoDrop some unused headers
Tobias Grosser [Mon, 27 Apr 2015 12:17:22 +0000 (12:17 +0000)]
Drop some unused headers

llvm-svn: 235871

9 years agoFix PTXGenerator after raw_pwrite_stream has been introduced
Tobias Grosser [Mon, 27 Apr 2015 12:06:32 +0000 (12:06 +0000)]
Fix PTXGenerator after raw_pwrite_stream has been introduced

Without this patch Polly with GPGPU support enabled did not compile any more.

llvm-svn: 235868

9 years agoFix formatting issues in banner
Tobias Grosser [Mon, 27 Apr 2015 12:02:36 +0000 (12:02 +0000)]
Fix formatting issues in banner

llvm-svn: 235867

9 years agoDo not expose code generator choice in the header
Tobias Grosser [Mon, 27 Apr 2015 12:02:33 +0000 (12:02 +0000)]
Do not expose code generator choice in the header

There is no need for other passes to access the code-generator command-line
option. Hence, drop it from the header to simplify the interface.

llvm-svn: 235866

9 years agoFix LLDB ARM build error on ubuntu precise with gcc4.7
Omair Javaid [Mon, 27 Apr 2015 12:01:59 +0000 (12:01 +0000)]
Fix LLDB ARM build error on ubuntu precise with gcc4.7

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

llvm-svn: 235865

9 years agoRemove unused variable, found with gcc-5.1 -Wunused-variable.
Patrik Hagglund [Mon, 27 Apr 2015 11:03:53 +0000 (11:03 +0000)]
Remove unused variable, found with gcc-5.1 -Wunused-variable.

The variable, MachOSectionTypes, seems to have been unused since its
introduction in r178679.

llvm-svn: 235863

9 years ago[MC] [IAS] Add support for the \@ .macro pseudo-variable.
Toma Tabacu [Mon, 27 Apr 2015 10:50:29 +0000 (10:50 +0000)]
[MC] [IAS] Add support for the \@ .macro pseudo-variable.

Summary:
When used, it is substituted with the number of .macro instantiations we've done up to that point in time.
So if this is the 1st time we've instantiated a .macro (any .macro, regardless of name), \@ will instantiate to 0, if it's the 2nd .macro instantiation, it will instantiate to 1 etc.

It can only be used inside a .macro definition, an .irp definition or an .irpc definition (those last 2 uses are undocumented).

Reviewers: echristo, rafael

Reviewed By: rafael

Subscribers: dsanders, llvm-commits

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

llvm-svn: 235862

9 years agoRemove flag '-polly-annotate-alias-scopes'
Tobias Grosser [Mon, 27 Apr 2015 10:43:10 +0000 (10:43 +0000)]
Remove flag '-polly-annotate-alias-scopes'

This option is enabled since a long time and there does not seem to be a
situation in which we would not want to print alias scopes. Remove this option
to reduce the set of command-line option combinations that may expose bugs.

llvm-svn: 235861

9 years agoRemove implementation of getNumberOfIterations from header [NFC]
Tobias Grosser [Mon, 27 Apr 2015 10:38:45 +0000 (10:38 +0000)]
Remove implementation of getNumberOfIterations from header [NFC]

We moved this implementation into the header file to share it between
the CLooG and isl code generator. As the CLooG code generator was dropped,
the implementation can be folded back into the .cpp file.

No functional change intended.

llvm-svn: 235860

9 years agoFix double stdout/stderr output from CLI commands in MI mode (MI)
Ilia K [Mon, 27 Apr 2015 10:07:49 +0000 (10:07 +0000)]
Fix double stdout/stderr output from CLI commands in MI mode (MI)

Summary:
This patch fixes stdout/stderr output that printed twice for CLI commands:
was:
```
(gdb)
target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
Current executable set to '~/p/hello' (x86_64).
^done
(gdb)
```
now:
```
(gdb)
target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
^done
(gdb)
```

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 235857

9 years agoConstfold insertelement to undef when index is out-of-bounds
Pawel Bylica [Mon, 27 Apr 2015 09:30:49 +0000 (09:30 +0000)]
Constfold insertelement to undef when index is out-of-bounds

Summary:
This patch adds constant folding of insertelement instruction to undef value when index operand is constant and is not less than vector size or is undef.

InstCombine does not support this case, but I'm happy to add it there also if this change is accepted.

Test Plan: Unittests and regression tests for ConstProp pass.

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: llvm-commits

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

llvm-svn: 235854

9 years agoAdd missing libraries to unittest link
Pavel Labath [Mon, 27 Apr 2015 09:26:03 +0000 (09:26 +0000)]
Add missing libraries to unittest link

Summary:
Currently, linking of the unittests fails on linux because it is missing a bunch of symbols from
libedit, curses, etc. This fixes the build by adding the correct dependencies.

Test Plan: Linking works, unit tests run.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 235853

9 years agoFix register read callback in linux-arm single stepping
Pavel Labath [Mon, 27 Apr 2015 09:21:14 +0000 (09:21 +0000)]
Fix register read callback in linux-arm single stepping

The previous read callback always read the value of the register what
caused problems when the emulator wrote some value into a register and
then expected to read the same value back. This CL add a register value
cache into the callbacks to return the correct value after a register
write also.

Test Plan: Stepping over BL/BLX instruction works on android-arm if the instruction set isn't change (other, unrelated patch will come for the case when we move to an other instruction set)

Reviewers: omjavaid, sas, clayborg

Reviewed By: clayborg

Subscribers: labath, tberghammer, rengolin, aemerson, lldb-commits

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

From: Tamas Berghammer <tberghammer@google.com>
llvm-svn: 235852

9 years agoXFAIL two mi tests on gcc to stabilise build bots
Pavel Labath [Mon, 27 Apr 2015 09:10:30 +0000 (09:10 +0000)]
XFAIL two mi tests on gcc to stabilise build bots

llvm-svn: 235851

9 years ago[OPENMP] Simplified iteration over clauses, NFC.
Alexey Bataev [Mon, 27 Apr 2015 08:00:32 +0000 (08:00 +0000)]
[OPENMP] Simplified iteration over clauses, NFC.

llvm-svn: 235838

9 years ago[X86][SSE] Add v16i8/v32i8 multiplication support
Simon Pilgrim [Mon, 27 Apr 2015 07:55:46 +0000 (07:55 +0000)]
[X86][SSE] Add v16i8/v32i8 multiplication support

Patch to allow int8 vectors to be multiplied on the SSE unit instead of being scalarized.

The patch sign extends the i8 lanes to i16, uses the SSE2 pmullw multiplication instruction, then packs the lower byte from each result.

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

llvm-svn: 235837

9 years ago[OPENMP] Codegen for 'taskwait' directive.
Alexey Bataev [Mon, 27 Apr 2015 05:22:09 +0000 (05:22 +0000)]
[OPENMP] Codegen for 'taskwait' directive.

Emit the following code for 'taskwait' directive within tied task:
call i32 @__kmpc_omp_taskwait(<loc>, i32 <thread_id>);
Differential Revision: http://reviews.llvm.org/D9245

llvm-svn: 235836

9 years ago[OPENMP] Codegen for 'reduction' clause in 'sections' directive.
Alexey Bataev [Mon, 27 Apr 2015 05:04:13 +0000 (05:04 +0000)]
[OPENMP] Codegen for 'reduction' clause in 'sections' directive.

Emit a code for reduction clause. Next code should be emitted for reductions:

static kmp_critical_name lock = { 0 };

void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
    *(Type0*)lhs[0] = ReductionOperation0(*(Type0*)lhs[0], *(Type0*)rhs[0]);
      ...
        *(Type<n>-1*)lhs[<n>-1] =
          ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
            *(Type<n>-1*)rhs[<n>-1]);
}

...
void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n>-1]};
switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
case 1:
  <LHSExprs>[0] = ReductionOperation0(*<LHSExprs>[0], *<RHSExprs>[0]);
  ...
  <LHSExprs>[<n>-1] = ReductionOperation<n>-1(*<LHSExprs>[<n>-1], *<RHSExprs>[<n>-1]);
  __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
  break;
case 2:
  Atomic(<LHSExprs>[0] = ReductionOperation0(*<LHSExprs>[0], *<RHSExprs>[0]));
  ...
  Atomic(<LHSExprs>[<n>-1] = ReductionOperation<n>-1(*<LHSExprs>[<n>-1], *<RHSExprs>[<n>-1]));
  break;
default:;
}
Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.
If sections directive has only single section, then original shared variables are used instead with barrier at the end of the directive.
Differential Revision: http://reviews.llvm.org/D9242

llvm-svn: 235835

9 years ago[OPENMP] Codegen for 'lastprivate' clause in 'sections' directive.
Alexey Bataev [Mon, 27 Apr 2015 04:34:03 +0000 (04:34 +0000)]
[OPENMP] Codegen for 'lastprivate' clause in 'sections' directive.

#pragma omp sections lastprivate(<var>)
<BODY>;
This construct is translated into something like:

<last_iter> = alloca i32
<init for lastprivates>;
<last_iter> = 0
; No initializer for simple variables or a default constructor is called for objects.
; For arrays perform element by element initialization by the call of the default constructor.
...
OMP_FOR_START(...,<last_iter>, ..); sets <last_iter> to 1 if this is the last iteration.
<BODY>
...
OMP_FOR_END
if (<last_iter> != 0) {
  <final copy for lastprivate>; Update original variable with the lastprivate value.
}
call __kmpc_cancel_barrier() ; an implicit barrier to avoid possible data race.
If there is only one section, there is no special code generation, original shared variables are used + barrier is emitted at the end of the directive.
Differential Revision: http://reviews.llvm.org/D9240

llvm-svn: 235834

9 years ago[OPENMP] Codegen for 'private' clause in 'sections' directive.
Alexey Bataev [Mon, 27 Apr 2015 04:12:12 +0000 (04:12 +0000)]
[OPENMP] Codegen for 'private' clause in 'sections' directive.

If there are 2 or more sections in a 'section' directive the following code is generated:

<default init for privates>
@__kmpc_for_static_init_4();
<BODY for sections directive>
@__kmpc_for_static_fini()
If there is only one section, the following code is generated:

if (@__kmpc_single()) {
  <default init for privates>
  @__kmpc_end_single();
}
Differential Revision: http://reviews.llvm.org/D9239

llvm-svn: 235833

9 years ago[OPENMP] Codegen for 'private' clause in 'single' directive.
Alexey Bataev [Mon, 27 Apr 2015 03:48:52 +0000 (03:48 +0000)]
[OPENMP] Codegen for 'private' clause in 'single' directive.
Emit the following code for 'single' directive with 'private' clause:

if (@__kmpc_single()) {
  <default init for privates>
  @__kmpc_end_single();
}
Differential Revision: http://reviews.llvm.org/D9238

llvm-svn: 235832

9 years ago[MS ABI] Rephrase the mangling of array types in parameters
David Majnemer [Mon, 27 Apr 2015 03:07:47 +0000 (03:07 +0000)]
[MS ABI] Rephrase the mangling of array types in parameters

Make the canonicalization of array types more consistent.

llvm-svn: 235831

9 years agolibc++abi: remove unused variable
Saleem Abdulrasool [Mon, 27 Apr 2015 02:21:57 +0000 (02:21 +0000)]
libc++abi: remove unused variable

The externC variable was set but unused.  This constantly flagged a warning from
gcc.  Replace it with a comment until such a time that we need it.

llvm-svn: 235830

9 years agolibc++abi: clear up some -Wqual-cast warnings
Saleem Abdulrasool [Mon, 27 Apr 2015 02:21:55 +0000 (02:21 +0000)]
libc++abi: clear up some -Wqual-cast warnings

Cleans up cast qualifier warnings identified by GCC 4.9.2.

llvm-svn: 235829

9 years agolibc++abi: silence some warnings
Saleem Abdulrasool [Mon, 27 Apr 2015 02:21:52 +0000 (02:21 +0000)]
libc++abi: silence some warnings

Cleans up the -Wundef warning caused by the use of the __LITTLE_ENDIAN__ macro.
Instead use `__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__`.  `__BYTE_ORDER__` is
defined by GCC since 4.2 and by clang.  This avoids the undef case where a macro
may be undefined.  This has previously caught real errors in libunwind.

llvm-svn: 235828

9 years ago[PerformanceTips] Italics are *word*, not _word_
Philip Reames [Sun, 26 Apr 2015 22:25:29 +0000 (22:25 +0000)]
[PerformanceTips] Italics are *word*, not _word_

llvm-svn: 235827

9 years ago[PerformanceTips] Provide context on the impact of assume(x)
Philip Reames [Sun, 26 Apr 2015 22:23:12 +0000 (22:23 +0000)]
[PerformanceTips] Provide context on the impact of assume(x)

Sean Silva suggested I add something here a while back.  Sorry it's taken so long to get back to this.

llvm-svn: 235826

9 years agoAdd two new items to PerformanceTips
Philip Reames [Sun, 26 Apr 2015 22:15:18 +0000 (22:15 +0000)]
Add two new items to PerformanceTips

1) Turns out we're not great at recognizing redundant checks when one is a != and the other is an ==.  This is a bug, but it's one that matters to frontend authors.

2) Frontends shouldn't use intrinsics unless strictly neccessary.  This has been pretty widely proven by this point and is good to document.

llvm-svn: 235825

9 years agoMake the message associated with a fatal error slightly more helpful
Philip Reames [Sun, 26 Apr 2015 22:00:34 +0000 (22:00 +0000)]
Make the message associated with a fatal error slightly more helpful

Looking into 23095, my best guess is that the CodeGen library itself isn't getting linked and initialized properly.  To make this slightly more obvious to consumers of LLVM, emit a different error message if we can tell that the registry is empty vs you've simply happened to name a collector which hasn't been registered.

llvm-svn: 235824