platform/upstream/llvm.git
7 years agoWrite multiple REQUIRES in one line.
Rui Ueyama [Wed, 19 Apr 2017 12:21:46 +0000 (12:21 +0000)]
Write multiple REQUIRES in one line.

llvm-svn: 300685

7 years ago[AVR] Remove the 'multibyte' asm test
Dylan McKay [Wed, 19 Apr 2017 12:13:45 +0000 (12:13 +0000)]
[AVR] Remove the 'multibyte' asm test

It tests registers which are not actually used on AVR.

llvm-svn: 300684

7 years agoRegenerate test. NFCI.
Simon Pilgrim [Wed, 19 Apr 2017 12:06:40 +0000 (12:06 +0000)]
Regenerate test. NFCI.

llvm-svn: 300683

7 years ago[AVR] Fix the test suite
Dylan McKay [Wed, 19 Apr 2017 12:02:52 +0000 (12:02 +0000)]
[AVR] Fix the test suite

A bunch of tests failed because memory operations have been reordered.

I am unsure which commit changed this behaviour as the AVR build was
failing at that point with an unrelated error.

This commit just reoders some of the CHECK lines in some tests to suit
current llc output.

llvm-svn: 300682

7 years agoFix buildbot failure.
Rui Ueyama [Wed, 19 Apr 2017 11:58:59 +0000 (11:58 +0000)]
Fix buildbot failure.

llvm-svn: 300681

7 years agoRename a test file so that it matches with the option name it is testing.
Rui Ueyama [Wed, 19 Apr 2017 11:42:12 +0000 (11:42 +0000)]
Rename a test file so that it matches with the option name it is testing.

llvm-svn: 300679

7 years ago[GlobalIsel][X86] support G_TRUNC selection.
Igor Breger [Wed, 19 Apr 2017 11:34:59 +0000 (11:34 +0000)]
[GlobalIsel][X86] support G_TRUNC selection.

Summary:
[GlobalIsel][X86] support G_TRUNC selection.
Add regbank-select and legalizer tests. Currently legalization of trunc i64 on 32bit platform not supported.

Reviewers: ab, zvi, rovka

Reviewed By: zvi

Subscribers: dberris, kristof.beyls, llvm-commits

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

llvm-svn: 300678

7 years agoRemove a redundant test.
Rui Ueyama [Wed, 19 Apr 2017 11:34:55 +0000 (11:34 +0000)]
Remove a redundant test.

We already have compress-debug-output.s, and that test should suffice
for the -compressed-debug-section option.

llvm-svn: 300677

7 years agoUpdate comment.
Rui Ueyama [Wed, 19 Apr 2017 11:32:27 +0000 (11:32 +0000)]
Update comment.

llvm-svn: 300676

7 years agoRename CompressedHeader ZDebugHeader.
Rui Ueyama [Wed, 19 Apr 2017 11:32:13 +0000 (11:32 +0000)]
Rename CompressedHeader ZDebugHeader.

`CompressedHeader` is a header for compressed data, and the header
itself is not compressed. So the previous name was confusing.

llvm-svn: 300675

7 years agoSimplify createHeader and inline it.
Rui Ueyama [Wed, 19 Apr 2017 11:31:58 +0000 (11:31 +0000)]
Simplify createHeader and inline it.

createHeader didn't use data members of Elf_Chdr type and write
directly to a given buffer. That is not a good practice because
the function had a knowledge of the struct layout.

llvm-svn: 300674

7 years agoFallthrough to reduce code a bit. NFC.
Rui Ueyama [Wed, 19 Apr 2017 11:31:45 +0000 (11:31 +0000)]
Fallthrough to reduce code a bit. NFC.

llvm-svn: 300673

7 years ago[X86] Add D32039/PR31357 tests to show current BSWAP codegen
Simon Pilgrim [Wed, 19 Apr 2017 11:06:22 +0000 (11:06 +0000)]
[X86] Add D32039/PR31357 tests to show current BSWAP codegen

llvm-svn: 300672

7 years ago[X86][SSE] Add scheduling latency/throughput tests for (most) SSE2 instructions
Simon Pilgrim [Wed, 19 Apr 2017 10:52:09 +0000 (10:52 +0000)]
[X86][SSE] Add scheduling latency/throughput tests for (most) SSE2 instructions

llvm-svn: 300671

7 years agoFix TestRegisterVariables for clang/arm
Pavel Labath [Wed, 19 Apr 2017 10:13:29 +0000 (10:13 +0000)]
Fix TestRegisterVariables for clang/arm

Clang rejects __attribute__((regparm)) when targetting arm. The default
calling convention passes arguments in registers anyway, so we can just
remove them in this case.

llvm-svn: 300670

7 years agoRevert yesterdays IPv6 patches
Pavel Labath [Wed, 19 Apr 2017 10:13:22 +0000 (10:13 +0000)]
Revert yesterdays IPv6 patches

The break the linux bots (and probably any other machine which would
run the test suite in a massively parallel way). The problem is that it
can happen that we only successfully create an IPv6 listening socket
(because the relevant IPv4 port is used by another process) and then the
connecting side attempts to connect to the IPv4 port and fails.

It's not very obvious how to fix this problem, so I am reverting this
until we come up with a solution.

llvm-svn: 300669

7 years agoRevert "ARMFrameLowering: Reserve emergency spill slot for large arguments"
Renato Golin [Wed, 19 Apr 2017 09:02:52 +0000 (09:02 +0000)]
Revert "ARMFrameLowering: Reserve emergency spill slot for large arguments"

This reverts commit r300639, as it broke self-hosting on ARM. PR32709.

llvm-svn: 300668

7 years agoAdd support for editor placeholders to Clang
Alex Lorenz [Wed, 19 Apr 2017 08:58:56 +0000 (08:58 +0000)]
Add support for editor placeholders to Clang

This commit teaches Clang to recognize editor placeholders that are produced
when an IDE like Xcode inserts a code-completion result that includes a
placeholder. Now when the lexer sees a placeholder token, it emits an
'editor placeholder in source file' error and creates an identifier token
that represents the placeholder. The parser/sema can now recognize the
placeholders and can suppress the diagnostics related to the placeholders. This
ensures that live issues in an IDE like Xcode won't get spurious diagnostics
related to placeholders.

This commit also adds a new compiler option named '-fallow-editor-placeholders'
that silences the 'editor placeholder in source file' error. This is useful
for an IDE like Xcode as we don't want to display those errors in live issues.

rdar://31581400

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

llvm-svn: 300667

7 years ago[GlobalISel][X86] Split select tests. NFC.
Igor Breger [Wed, 19 Apr 2017 08:40:44 +0000 (08:40 +0000)]
[GlobalISel][X86] Split select tests. NFC.

llvm-svn: 300666

7 years ago[ARM] GlobalISel: Add support for G_MUL
Diana Picus [Wed, 19 Apr 2017 07:29:46 +0000 (07:29 +0000)]
[ARM] GlobalISel: Add support for G_MUL

Support G_MUL, very similar to G_ADD and G_SUB. The only difference is
in the instruction selector, where we have to select either MUL or MULv5
depending on the target.

llvm-svn: 300665

7 years ago[GlobalISel] Support vector-of-pointers in LLT
Kristof Beyls [Wed, 19 Apr 2017 07:23:57 +0000 (07:23 +0000)]
[GlobalISel] Support vector-of-pointers in LLT

This fixes PR32471.

As comment 10 on that bug report highlights
(https://bugs.llvm.org//show_bug.cgi?id=32471#c10), there are quite a
few different defendable design tradeoffs that could be made, including
not representing pointers at all in LLT.

I decided to go for representing vector-of-pointer as a concept in LLT,
while keeping the size of the LLT type 64 bits (this is an increase from
48 bits before). My rationale for keeping pointers explicit is that on
some targets probably it's very handy to have the distinction between
pointer and non-pointer (e.g. 68K has a different register bank for
pointers IIRC). If we keep a scalar pointer, it probably is easiest to
also have a vector-of-pointers to keep LLT relatively conceptually clean
and orthogonal, while we don't have a very strong reason to break that
orthogonality.  Once we gain more experience on the use of LLT, we can
of course reconsider this direction.

Rejecting vector-of-pointer types in the IRTranslator is also an option
to avoid the crash reported in PR32471, but that is only a very
short-term solution; also needs quite a bit of code tweaks in places,
and is probably fragile. Therefore I didn't consider this the best
option.

llvm-svn: 300664

7 years ago[GlobalISel] Remove non-determinism from IRTranslator.
Kristof Beyls [Wed, 19 Apr 2017 06:38:37 +0000 (06:38 +0000)]
[GlobalISel] Remove non-determinism from IRTranslator.

This showed up in r300535/r300537, which were reverted in r300538 due to
some of the introduced tests in there failing on some bots, due to the
non-determinism fixed in this commit.

Re-committing r300535/r300537 will add 2 tests for the change in this
commit.

llvm-svn: 300663

7 years agoRevert r300657 due to crashes in stage2 of bootstraps:
Chandler Carruth [Wed, 19 Apr 2017 06:23:20 +0000 (06:23 +0000)]
Revert r300657 due to crashes in stage2 of bootstraps:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/2476/steps/build-stage2-LLVMgold.so/logs/stdio
http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/15036/steps/build_llvmclang/logs/stdio

I've updated the commit thread, reverting to get the bots back to green.

Original commit summary:
[JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor.

llvm-svn: 300662

7 years agoclang-format: Properly match parens of macro parameter lists.
Daniel Jasper [Wed, 19 Apr 2017 06:06:38 +0000 (06:06 +0000)]
clang-format: Properly match parens of macro parameter lists.

No tests yet, but this will be tested by the upcoming:
https://reviews.llvm.org/D28462

llvm-svn: 300661

7 years ago[XRay][compiler-rt] Fix up CFI annotations and stack alignment
Dean Michael Berris [Wed, 19 Apr 2017 05:37:14 +0000 (05:37 +0000)]
[XRay][compiler-rt] Fix up CFI annotations and stack alignment

Summary:
Previously, we had been very undisciplined about CFI annotations with
the XRay trampolines. This leads to runtime crashes due to mis-alined
stack pointers that some function implementations may run into (i.e.
those using instructions that require properly aligned addresses coming
from the stack). This patch attempts to clean that up, as well as more
accurately use the correct amounts of space on the stack for stashing
and un-stashing registers.

Reviewers: eugenis, kcc

Subscribers: kpw, llvm-commits

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

llvm-svn: 300660

7 years agoRevert r300653 and r300650. The underlying commit fixes one issue with
Chandler Carruth [Wed, 19 Apr 2017 05:25:13 +0000 (05:25 +0000)]
Revert r300653 and r300650. The underlying commit fixes one issue with
modules but exposes much more widespread issues. Example and more
information is on the review thread for r300650.

Original commit summary:
[modules] Properly look up the owning module for an instantiation of a merged template.

llvm-svn: 300659

7 years ago[CodeGen] Use APInt::lshrInPlace instead of APInt::lshr. NFC
Craig Topper [Wed, 19 Apr 2017 05:17:33 +0000 (05:17 +0000)]
[CodeGen] Use APInt::lshrInPlace instead of APInt::lshr. NFC

llvm-svn: 300658

7 years ago[JumpThread] We want to fold (not thread) when all predecessor go to single BB's...
Xin Tong [Wed, 19 Apr 2017 05:15:57 +0000 (05:15 +0000)]
[JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor. .

Summary: In case all predecessor go to a single successor of current BB. We want to fold (not thread).

Reviewers: efriedma, sanjoy

Reviewed By: sanjoy

Subscribers: dberlin, majnemer, llvm-commits

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

llvm-svn: 300657

7 years agoCleanup some GraphTraits iteration code
Tim Shen [Wed, 19 Apr 2017 03:22:50 +0000 (03:22 +0000)]
Cleanup some GraphTraits iteration code

Use children<> and nodes<> in appropriate places to cleanup the code.

Also, as part of the cleanup,
change the signature of DominatorTreeBase's Split.
It is a protected non-virtual member function called only twice,
both from within the class,
and the removed passed argument in both cases is '*this'.
The reason for the existence of that argument seems to be that
back before r43115 Split was a free function,
so an argument to get '*this' was needed - but now that is no longer the
case.

Patch by Yoav Ben-Shalom!

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

llvm-svn: 300656

7 years agoARM: Use methods to access data stored with frame instructions
Serge Pavlov [Wed, 19 Apr 2017 03:12:05 +0000 (03:12 +0000)]
ARM: Use methods to access data stored with frame instructions

In r300196 several methods were added to TarfetInstrInfo to access
data stored with call frame setup/destroy instructions. This change
replaces calls to getOperand with calls to such special methods in
ARM target.

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

llvm-svn: 300655

7 years ago[CMake] Add configure check for sys/event.h
Chris Bieneman [Wed, 19 Apr 2017 02:53:53 +0000 (02:53 +0000)]
[CMake] Add configure check for sys/event.h

This enables the kqueue path in MainLoop for Darwin and BSD.

llvm-svn: 300654

7 years agoFix member function call with null 'this' pointer.
Richard Smith [Wed, 19 Apr 2017 02:19:21 +0000 (02:19 +0000)]
Fix member function call with null 'this' pointer.

llvm-svn: 300653

7 years agoFix tests for extended noexcept in the container adaptors tests
Eric Fiselier [Wed, 19 Apr 2017 02:07:12 +0000 (02:07 +0000)]
Fix tests for extended noexcept in the container adaptors tests

llvm-svn: 300652

7 years agoRemove buggy 'addAttributes(unsigned, AttrBuilder)' overload
Reid Kleckner [Wed, 19 Apr 2017 01:51:13 +0000 (01:51 +0000)]
Remove buggy 'addAttributes(unsigned, AttrBuilder)' overload

The 'addAttributes(unsigned, AttrBuilder)' overload delegated to 'get'
instead of 'addAttributes'.

Since we can implicitly construct an AttrBuilder from an AttributeSet,
just standardize on AttrBuilder.

llvm-svn: 300651

7 years ago[modules] Properly look up the owning module for an instantiation of a merged template.
Richard Smith [Wed, 19 Apr 2017 01:36:43 +0000 (01:36 +0000)]
[modules] Properly look up the owning module for an instantiation of a merged template.

When looking for the template instantiation pattern of a templated entity,
consistently select the definition of the pattern if there is one. This means
we'll pick the same owning module when we start instantiating a template that
we'll later pick when determining which modules are visible during that
instantiation.

llvm-svn: 300650

7 years agoCleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <exception>
Eric Fiselier [Wed, 19 Apr 2017 01:35:58 +0000 (01:35 +0000)]
Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <exception>

llvm-svn: 300649

7 years agoCleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <bitset>, <ios>, <locale>, and...
Eric Fiselier [Wed, 19 Apr 2017 01:34:08 +0000 (01:34 +0000)]
Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <bitset>, <ios>, <locale>, and <iterator>

llvm-svn: 300648

7 years agoOne more attempt and Windows
Chris Bieneman [Wed, 19 Apr 2017 01:32:08 +0000 (01:32 +0000)]
One more attempt and Windows

This is the last Windows compile error, so... Hit me with your best shot.

llvm-svn: 300647

7 years agoCleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in the functional library
Eric Fiselier [Wed, 19 Apr 2017 01:28:47 +0000 (01:28 +0000)]
Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in the functional library

llvm-svn: 300646

7 years agoCleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utility
Eric Fiselier [Wed, 19 Apr 2017 01:23:39 +0000 (01:23 +0000)]
Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utility

llvm-svn: 300644

7 years agoCleanup remaining _LIBCPP_HAS_NO_<c++11-feature> usages in container headers
Eric Fiselier [Wed, 19 Apr 2017 01:23:04 +0000 (01:23 +0000)]
Cleanup remaining _LIBCPP_HAS_NO_<c++11-feature> usages in container headers

llvm-svn: 300643

7 years ago[libFuzzer] update -help: mention -exact_artifact_path in help for -minimize_crash...
Kostya Serebryany [Wed, 19 Apr 2017 01:22:04 +0000 (01:22 +0000)]
[libFuzzer] update -help: mention -exact_artifact_path in help for -minimize_crash and -cleanse_crash

llvm-svn: 300642

7 years ago[AVR] Migrate to new MCAsmInfo CodePointerSize
Leslie Zhai [Wed, 19 Apr 2017 01:20:43 +0000 (01:20 +0000)]
[AVR] Migrate to new MCAsmInfo CodePointerSize

Reviewers: dylanmckay, rengolin, kzhuravl, jroelofs

Reviewed By: kzhuravl, jroelofs

Subscribers: kzhuravl, llvm-commits

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

llvm-svn: 300641

7 years agoAnother netbsd build failure...
Chris Bieneman [Wed, 19 Apr 2017 01:17:29 +0000 (01:17 +0000)]
Another netbsd build failure...

llvm-svn: 300640

7 years agoARMFrameLowering: Reserve emergency spill slot for large arguments
Matthias Braun [Wed, 19 Apr 2017 01:16:07 +0000 (01:16 +0000)]
ARMFrameLowering: Reserve emergency spill slot for large arguments

We need to reserve an emergency spill slot in cases with large argument
types that could overflow immediate offsets for FP relative address
calculations.

rdar://31317893

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

llvm-svn: 300639

7 years agoBuildbot wack-a-mole!
Chris Bieneman [Wed, 19 Apr 2017 01:15:17 +0000 (01:15 +0000)]
Buildbot wack-a-mole!

This should fix the netbsd bot I just broke.

llvm-svn: 300638

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in support headers and final tests
Eric Fiselier [Wed, 19 Apr 2017 01:02:49 +0000 (01:02 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in support headers and final tests

llvm-svn: 300637

7 years agoifdefing out the signal handling code on Windows
Chris Bieneman [Wed, 19 Apr 2017 01:00:16 +0000 (01:00 +0000)]
ifdefing out the signal handling code on Windows

*fingers crossed*

This might fix the Window bots, but I really don't know...

llvm-svn: 300636

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities library
Eric Fiselier [Wed, 19 Apr 2017 00:56:32 +0000 (00:56 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities library

llvm-svn: 300635

7 years ago[DataLayout] Removed default value from a variable that isn't used without being...
Craig Topper [Wed, 19 Apr 2017 00:31:38 +0000 (00:31 +0000)]
[DataLayout] Removed default value from a variable that isn't used without being overwritten. Make variable an enum instead of an int to avoid a cast later. NFC

llvm-svn: 300634

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in the string library.
Eric Fiselier [Wed, 19 Apr 2017 00:28:44 +0000 (00:28 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the string library.

llvm-svn: 300633

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros in the numeric tests and headers
Eric Fiselier [Wed, 19 Apr 2017 00:23:45 +0000 (00:23 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in the numeric tests and headers

llvm-svn: 300632

7 years ago[XRay][tools] Fix yaml matching to be more permissive
Dean Michael Berris [Wed, 19 Apr 2017 00:10:09 +0000 (00:10 +0000)]
[XRay][tools] Fix yaml matching to be more permissive

Account for a potentially empty function name.

Follow-up to D32153.

llvm-svn: 300631

7 years agoAllow suppressing host and target info in VersionPrinter
Xin Tong [Wed, 19 Apr 2017 00:03:36 +0000 (00:03 +0000)]
Allow suppressing host and target info in VersionPrinter

Summary:
VersionPrinter by default outputs information about the Host CPU
and Default target. Printing this information requires linking in
a large amount of data, such as supported target triples as C
strings, which in turn bloats the binary size.

Enable a new CMake option LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO
which controls printing of the host and target info. This allows
the target triple names to be dead-code stripped. This is a nice
win for LLVM clients that wish to minimize their binary size, such
as graphics drivers.

By default this is ON, so there is no change in the default behavior.
Clients who wish to suppress this printing can do so by setting this
option to off via CMake.

A test app on Linux that uses ParseCommandLineOptions() shows a binary
size reduction of 23KB (from 149K to 126K) for a Release build, and 24KB
(from 135K to 111K) in a MinSizeRel build.

Reviewers: klimek, beanz, bogner, chandlerc, compnerd

Reviewed By: compnerd

Patch by pammon (Peter Ammon) !

Subscribers: llvm-commits

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

llvm-svn: 300630

7 years ago[AVR] Fix the build
Dylan McKay [Tue, 18 Apr 2017 23:53:10 +0000 (23:53 +0000)]
[AVR] Fix the build

'PointerSize' was renamed to 'CodePointerSize'.

llvm-svn: 300629

7 years agoUse less temporary AttributeLists NFC
Reid Kleckner [Tue, 18 Apr 2017 23:50:03 +0000 (23:50 +0000)]
Use less temporary AttributeLists NFC

llvm-svn: 300628

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-features> macro usage in regex
Eric Fiselier [Tue, 18 Apr 2017 23:42:15 +0000 (23:42 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-features> macro usage in regex

llvm-svn: 300627

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library
Eric Fiselier [Tue, 18 Apr 2017 23:38:41 +0000 (23:38 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library

llvm-svn: 300626

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithm
Eric Fiselier [Tue, 18 Apr 2017 23:26:47 +0000 (23:26 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithm

llvm-svn: 300625

7 years ago[XRay][tools] Add option to llvm-xray extract to symbolize functions
Dean Michael Berris [Tue, 18 Apr 2017 23:23:54 +0000 (23:23 +0000)]
[XRay][tools] Add option to llvm-xray extract to symbolize functions

Summary:
This allows us to, if the symbol names are available in the binary, be
able to provide the function name in the YAML output.

Reviewers: dblaikie, pelikan

Subscribers: llvm-commits

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

llvm-svn: 300624

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros for std::initializer_list
Eric Fiselier [Tue, 18 Apr 2017 23:09:36 +0000 (23:09 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros for std::initializer_list

llvm-svn: 300623

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros in thread.
Eric Fiselier [Tue, 18 Apr 2017 23:05:08 +0000 (23:05 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in thread.

llvm-svn: 300622

7 years ago[ConstantRange] Optimize APInt creation in getSignedMax/getSignedMin.
Craig Topper [Tue, 18 Apr 2017 23:02:39 +0000 (23:02 +0000)]
[ConstantRange] Optimize APInt creation in getSignedMax/getSignedMin.

We were creating an APInt at the top of these methods that isn't always returned. For ranges wider than 64-bits this results in an allocation and deallocation when its not used.

In getSignedMax we were creating Upper-1 to use in a compare and then creating it again for a return value. The compiler is unable to determine that these can be shared. So help it out and create the Upper-1 in a temporary that can be reused.

This provides a little compile time improvement.

llvm-svn: 300621

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in std::unordered_map and std::unordered_multimap
Eric Fiselier [Tue, 18 Apr 2017 22:50:56 +0000 (22:50 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in std::unordered_map and std::unordered_multimap

This completes the cleanup of the containers, at least within the tests.

llvm-svn: 300620

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and std::unordere...
Eric Fiselier [Tue, 18 Apr 2017 22:37:32 +0000 (22:37 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and std::unordered_multiset

llvm-svn: 300619

7 years agoDefine HAVE_SIGACTION to 1 in Xcode build
Chris Bieneman [Tue, 18 Apr 2017 22:37:00 +0000 (22:37 +0000)]
Define HAVE_SIGACTION to 1 in Xcode build

This is needed to make the Xcode project build since it doesn't have auto-generated Config header.

llvm-svn: 300618

7 years ago[x86] add tests for potential andn optimization; NFC
Sanjay Patel [Tue, 18 Apr 2017 22:36:59 +0000 (22:36 +0000)]
[x86] add tests for potential andn optimization; NFC

llvm-svn: 300617

7 years ago[coff] fix test for msvclto
Bob Haarman [Tue, 18 Apr 2017 22:29:36 +0000 (22:29 +0000)]
[coff] fix test for msvclto

llvm-svn: 300616

7 years agoInclude time.h, and fix a Darwin warning
Chris Bieneman [Tue, 18 Apr 2017 22:11:13 +0000 (22:11 +0000)]
Include time.h, and fix a Darwin warning

This is a little more cleanup from r300579.

llvm-svn: 300615

7 years agoFix crash in AttributeList::addAttributes, add test
Reid Kleckner [Tue, 18 Apr 2017 22:10:18 +0000 (22:10 +0000)]
Fix crash in AttributeList::addAttributes, add test

llvm-svn: 300614

7 years agoAdd a getPointerOperandType() helper to LoadInst and StoreInst; NFC
Sanjoy Das [Tue, 18 Apr 2017 22:00:54 +0000 (22:00 +0000)]
Add a getPointerOperandType() helper to LoadInst and StoreInst; NFC

I will use this in a later change.

llvm-svn: 300613

7 years ago[coff] use newlines instead of spaces as separators in msvclto response file
Bob Haarman [Tue, 18 Apr 2017 22:00:29 +0000 (22:00 +0000)]
[coff] use newlines instead of spaces as separators in msvclto response file

Summary:
Fixes PR32689: /msvclto creates response files with lines
that are too long for msvc's linker (LNK1170).

Reviewers: hans, rnk, ruiu

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 300612

7 years ago[modules-ts] Fold together -x c++ and -x c++-module at -cc1 level.
Richard Smith [Tue, 18 Apr 2017 21:55:37 +0000 (21:55 +0000)]
[modules-ts] Fold together -x c++ and -x c++-module at -cc1 level.

The driver needs to know whether it's building a module interface or
implementation unit because it affects which outputs it produces and how it
builds the command pipeline. But the frontend doesn't need to know and should
not care: all it needs to know is what action it is being asked to perform on
the input.

(This is in preparation for permitting -emit-obj to be used on a module
interface unit to produce object code without going via a "full" PCM file.)

llvm-svn: 300611

7 years agoFix Windows bot failure
Chris Bieneman [Tue, 18 Apr 2017 21:47:50 +0000 (21:47 +0000)]
Fix Windows bot failure

timespec is not available on Windows, and we should use size_t instead of nfds_t.

llvm-svn: 300610

7 years agoDo not warn about whitespace between ??/ trigraph and newline in line comments if...
Richard Smith [Tue, 18 Apr 2017 21:45:04 +0000 (21:45 +0000)]
Do not warn about whitespace between ??/ trigraph and newline in line comments if trigraphs are disabled in the current language.

llvm-svn: 300609

7 years ago[MemoryBuiltins] Add isMallocOrCallocLikeFn so BasicAA can check for both at the...
Craig Topper [Tue, 18 Apr 2017 21:43:46 +0000 (21:43 +0000)]
[MemoryBuiltins] Add isMallocOrCallocLikeFn so BasicAA can check for both at the same time

BasicAA wants to know if a function is either a malloc or calloc like function. Currently we have to check both separately. This means both calls check if its an intrinsic, query TLI, check the nobuiltin attribute, scan the AllocationFnData, etc.

This patch adds a isMallocOrCallocLikeFn so we can go through all of the checks once per call.

This also changes the one other location I saw that called both together.

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

llvm-svn: 300608

7 years ago[LoopReroll] Prefer hasNUses/hasNUses or more as they're cheaper. NFCI.
Davide Italiano [Tue, 18 Apr 2017 21:42:21 +0000 (21:42 +0000)]
[LoopReroll] Prefer hasNUses/hasNUses or more as they're cheaper. NFCI.

llvm-svn: 300607

7 years agoFixing error on Android build (-Werror)
Chris Bieneman [Tue, 18 Apr 2017 21:35:26 +0000 (21:35 +0000)]
Fixing error on Android build (-Werror)

This is fallout from r300579.

llvm-svn: 300606

7 years agoRemoving unused include
Chris Bieneman [Tue, 18 Apr 2017 21:23:55 +0000 (21:23 +0000)]
Removing unused include

This is causing the Windows bot failures.

llvm-svn: 300605

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue.
Eric Fiselier [Tue, 18 Apr 2017 21:23:18 +0000 (21:23 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue.

llvm-svn: 300604

7 years agoDAG: Make mayBeEmittedAsTailCall parameter const
Matt Arsenault [Tue, 18 Apr 2017 21:16:46 +0000 (21:16 +0000)]
DAG: Make mayBeEmittedAsTailCall parameter const

llvm-svn: 300603

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.
Eric Fiselier [Tue, 18 Apr 2017 21:16:26 +0000 (21:16 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.

llvm-svn: 300602

7 years ago[sanitizer] Define lsan-x86 in tests for both i386 and i686.
Evgeniy Stepanov [Tue, 18 Apr 2017 21:10:50 +0000 (21:10 +0000)]
[sanitizer] Define lsan-x86 in tests for both i386 and i686.

llvm-svn: 300601

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimap
Eric Fiselier [Tue, 18 Apr 2017 21:08:06 +0000 (21:08 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimap

llvm-svn: 300600

7 years agoImplement suspended thread register count for darwin
Francis Ricci [Tue, 18 Apr 2017 21:05:11 +0000 (21:05 +0000)]
Implement suspended thread register count for darwin

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 300599

7 years agoRemove mips64 defines from darwin-specific file
Francis Ricci [Tue, 18 Apr 2017 21:05:09 +0000 (21:05 +0000)]
Remove mips64 defines from darwin-specific file

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits, arichardson

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

llvm-svn: 300598

7 years agoFix typo
Matt Arsenault [Tue, 18 Apr 2017 20:59:46 +0000 (20:59 +0000)]
Fix typo

llvm-svn: 300597

7 years agoAMDGPU: Make MFI fields private
Matt Arsenault [Tue, 18 Apr 2017 20:59:40 +0000 (20:59 +0000)]
AMDGPU: Make MFI fields private

llvm-svn: 300596

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multiset
Eric Fiselier [Tue, 18 Apr 2017 20:58:03 +0000 (20:58 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multiset

llvm-svn: 300595

7 years agoPR30508: Downgrade error to warning if the umbrella folder doesn't exist.
Vassil Vassilev [Tue, 18 Apr 2017 20:57:29 +0000 (20:57 +0000)]
PR30508: Downgrade error to warning if the umbrella folder doesn't exist.

Patch by Yuka Takahashi (D32119)!

llvm-svn: 300594

7 years agoDon't use abort_on_error for lsan darwin test suite
Francis Ricci [Tue, 18 Apr 2017 20:56:59 +0000 (20:56 +0000)]
Don't use abort_on_error for lsan darwin test suite

Summary:
This option is disabled by our other test suites, and will cause
failures when unit tests abort instead of failing with an error code.
Will also prevent the test suite from being too slow.

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 300593

7 years agoAllow for setting of global platform-specific lsan options in the test suite
Francis Ricci [Tue, 18 Apr 2017 20:56:56 +0000 (20:56 +0000)]
Allow for setting of global platform-specific lsan options in the test suite

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 300592

7 years agoThe SubjectMatchRule enum should not be used as a DenseMap key to avoid
Alex Lorenz [Tue, 18 Apr 2017 20:54:23 +0000 (20:54 +0000)]
The SubjectMatchRule enum should not be used as a DenseMap key to avoid
UBSAN 'invalid value' failures

The commit r300556 introduced a UBSAN issue that was caught by
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap. The DenseMap
failed to create an empty/tombstone value as the empty/tombstone values for the
SubjectMatchRule enum were not valid enum constants.

llvm-svn: 300591

7 years ago[CMake] Adding configure-time check for sigaction
Chris Bieneman [Tue, 18 Apr 2017 20:49:09 +0000 (20:49 +0000)]
[CMake] Adding configure-time check for sigaction

Hopefully this will fix the netbsd bot that I broke...

llvm-svn: 300590

7 years agoWriting multi-platform code is hard...
Chris Bieneman [Tue, 18 Apr 2017 20:49:05 +0000 (20:49 +0000)]
Writing multi-platform code is hard...

Fixing another error from r300579.

llvm-svn: 300589

7 years ago[clang-tidy] Address a few late comments.
Haojian Wu [Tue, 18 Apr 2017 20:47:34 +0000 (20:47 +0000)]
[clang-tidy] Address a few late comments.

llvm-svn: 300588

7 years agoFix broken windows build.
Chris Bieneman [Tue, 18 Apr 2017 20:37:05 +0000 (20:37 +0000)]
Fix broken windows build.

This is not ideal, but it should get the bot going again. I'll need to revisit this if we want to get signal handling working on Windows.

llvm-svn: 300587

7 years ago[MemoryBuiltins] Use ImmutableCallSite instead of CallSite to remove a const_cast...
Craig Topper [Tue, 18 Apr 2017 20:17:23 +0000 (20:17 +0000)]
[MemoryBuiltins] Use ImmutableCallSite instead of CallSite to remove a const_cast and const correct. NFCI

llvm-svn: 300585

7 years agoNewGVN: Fix memory congruence verification. The return true should be a return false...
Daniel Berlin [Tue, 18 Apr 2017 20:15:47 +0000 (20:15 +0000)]
NewGVN: Fix memory congruence verification. The return true should be a return false. Merge the appropriate if statements so it doesn't happen again.

llvm-svn: 300584

7 years ago[X86] Keep EXTRACT_VECTOR_ELT result type as f128 for Android x86_64.
Chih-Hung Hsieh [Tue, 18 Apr 2017 20:15:18 +0000 (20:15 +0000)]
[X86] Keep EXTRACT_VECTOR_ELT result type as f128 for Android x86_64.

Android x86_64 target uses f128 type and stores f128 values in %xmm* registers.
SoftenFloatRes_EXTRACT_VECTOR_ELT should not convert result value
from f128 to i128.

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

llvm-svn: 300583