platform/upstream/llvm.git
7 years agoteach LIT how to detect the glibc version
Eric Fiselier [Sat, 4 Mar 2017 01:29:51 +0000 (01:29 +0000)]
teach LIT how to detect the glibc version

llvm-svn: 296942

7 years agoMove UUID from Core -> Utility.
Zachary Turner [Sat, 4 Mar 2017 01:28:55 +0000 (01:28 +0000)]
Move UUID from Core -> Utility.

llvm-svn: 296941

7 years agoFix PR25874 - Detect features required for cxa_thread_atexit_test.pass.cpp
Eric Fiselier [Sat, 4 Mar 2017 01:26:41 +0000 (01:26 +0000)]
Fix PR25874 - Detect features required for cxa_thread_atexit_test.pass.cpp

llvm-svn: 296940

7 years agoWholeProgramDevirt: Add any unsuccessful llvm.type.checked.load devirtualizations...
Peter Collingbourne [Sat, 4 Mar 2017 01:23:30 +0000 (01:23 +0000)]
WholeProgramDevirt: Add any unsuccessful llvm.type.checked.load devirtualizations to the list of llvm.type.test users.

Any unsuccessful llvm.type.checked.load devirtualizations will be translated
into uses of llvm.type.test, so we need to add the resulting llvm.type.test
intrinsics to the function summaries so that the LowerTypeTests pass will
export them.

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

llvm-svn: 296939

7 years agoFix the macOS build all the way after r296909.
Jim Ingham [Sat, 4 Mar 2017 01:15:24 +0000 (01:15 +0000)]
Fix the macOS build all the way after r296909.

llvm-svn: 296938

7 years ago[scan-build-py] create decorator for compiler wrapper methods
Laszlo Nagy [Sat, 4 Mar 2017 01:08:05 +0000 (01:08 +0000)]
[scan-build-py] create decorator for compiler wrapper methods

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

llvm-svn: 296937

7 years agoTurn on -Wunused-function and cleanup occurances
Eric Fiselier [Sat, 4 Mar 2017 01:02:35 +0000 (01:02 +0000)]
Turn on -Wunused-function and cleanup occurances

llvm-svn: 296936

7 years agoNewGVN: Be consistent in what order we compare operands for swapping.
Daniel Berlin [Sat, 4 Mar 2017 00:44:43 +0000 (00:44 +0000)]
NewGVN: Be consistent in what order we compare operands for swapping.
NFC.

llvm-svn: 296935

7 years ago[MISched] Remove unused arguments. NFC.
Eli Friedman [Sat, 4 Mar 2017 00:42:55 +0000 (00:42 +0000)]
[MISched] Remove unused arguments. NFC.

llvm-svn: 296934

7 years ago[x86] check for commuted add pattern to find ADC/SBB
Sanjay Patel [Sat, 4 Mar 2017 00:18:31 +0000 (00:18 +0000)]
[x86] check for commuted add pattern to find ADC/SBB

llvm-svn: 296933

7 years ago[ODRHash] Add support for detecting different method properties.
Richard Trieu [Sat, 4 Mar 2017 00:08:58 +0000 (00:08 +0000)]
[ODRHash] Add support for detecting different method properties.

Now print diagnostics for static, virtual, inline, volatile, and const
differences in methods.  Also use DeclarationName instead of IdentifierInfo
for additional robustness in diagnostic printing.

llvm-svn: 296932

7 years ago[x86] add test to show failed recognition of commuted pattern; NFC
Sanjay Patel [Sat, 4 Mar 2017 00:06:37 +0000 (00:06 +0000)]
[x86] add test to show failed recognition of commuted pattern; NFC

llvm-svn: 296931

7 years agoFix DataExtractor failures.
Zachary Turner [Fri, 3 Mar 2017 23:52:09 +0000 (23:52 +0000)]
Fix DataExtractor failures.

Some code that doesn't get compiled on Windows had some references
that needed updating, and I missed those.

llvm-svn: 296930

7 years agoRestrict test arch-specific-libdir.c to Linux
Pirama Arumuga Nainar [Fri, 3 Mar 2017 23:48:15 +0000 (23:48 +0000)]
Restrict test arch-specific-libdir.c to Linux

Summary: This fails on Windows due to dependence on path separators.

Reviewers: rnk, srhines

Subscribers: llvm-commits

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

llvm-svn: 296929

7 years agoRegAllocGreedy: Follow-up to r296722
Matthias Braun [Fri, 3 Mar 2017 23:27:20 +0000 (23:27 +0000)]
RegAllocGreedy: Follow-up to r296722

We can now end up in situations where we initiate LiveIntervalUnion
queries with different SubRanges against the same register unit, so the
assert() no longer holds in all cases. Just recalculate now when we know
the cache is out of date.

llvm-svn: 296928

7 years agoAdd arch-specific directory to search path
Pirama Arumuga Nainar [Fri, 3 Mar 2017 23:20:49 +0000 (23:20 +0000)]
Add arch-specific directory to search path

Summary:

This change adds an arch-specific subdirectory in <ResourceDir>/lib/<OS>
to the linker search path.  This path also gets added as '-rpath' for
native compilation if a runtime is linked in as a shared object.  This
allows arch-specific libraries to be installed alongside clang.

Reviewers: danalbert, cbergstrom, javed.absar

Subscribers: srhines

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

llvm-svn: 296927

7 years agoRevert r296865 "[ARM] fpscr read/write intrinsics not aware of each other"
Hans Wennborg [Fri, 3 Mar 2017 23:19:31 +0000 (23:19 +0000)]
Revert r296865 "[ARM] fpscr read/write intrinsics not aware of each other"

It caused PR32134: "Cannot select: intrinsic %llvm.arm.get.fpscr".

llvm-svn: 296926

7 years agoFix Darwin failures introduced in r296909
Tim Hammerquist [Fri, 3 Mar 2017 23:17:29 +0000 (23:17 +0000)]
Fix Darwin failures introduced in r296909

llvm-svn: 296925

7 years agoFixed repo.py to not send git errors to stderr.
Sean Callanan [Fri, 3 Mar 2017 23:13:30 +0000 (23:13 +0000)]
Fixed repo.py to not send git errors to stderr.

Some repos are not git repos, so git is expected
to fail.  These errors should not go to stderr,
because Xcode interprets them as failures.

llvm-svn: 296924

7 years agoGlobalISel: constrain G_INSERT to inserting just one value per instruction.
Tim Northover [Fri, 3 Mar 2017 23:05:47 +0000 (23:05 +0000)]
GlobalISel: constrain G_INSERT to inserting just one value per instruction.

It's much easier to reason about single-value inserts and no-one was actually
using the variadic variants before.

llvm-svn: 296923

7 years agoRemove the buildit and testit scripts; they haven't been supported in years
Eric Fiselier [Fri, 3 Mar 2017 22:47:45 +0000 (22:47 +0000)]
Remove the buildit and testit scripts; they haven't been supported in years

llvm-svn: 296922

7 years agoGlobalISel: add merge/unmerge nodes for legalization.
Tim Northover [Fri, 3 Mar 2017 22:46:09 +0000 (22:46 +0000)]
GlobalISel: add merge/unmerge nodes for legalization.

These are simplified variants of the current G_SEQUENCE and G_EXTRACT, which
assume the individual parts will be contiguous, homogeneous, and occupy the
entirity of the larger register. This makes reasoning about them much easer
since you only have to look at the first register being merged and the result
to know what the instruction is doing.

I intend to gradually replace all uses of the more complicated sequence/extract
with these (or single-element insert/extracts), and then remove the older
variants. For now we start with legalization.

llvm-svn: 296921

7 years agoAdd a script to dump out all project inter-dependencies.
Zachary Turner [Fri, 3 Mar 2017 22:40:46 +0000 (22:40 +0000)]
Add a script to dump out all project inter-dependencies.

llvm-svn: 296920

7 years agoFix hash requirements check in __hash_table.
Eric Fiselier [Fri, 3 Mar 2017 22:35:58 +0000 (22:35 +0000)]
Fix hash requirements check in __hash_table.

r296565 attempted to add better diagnostics when an unordered container
is instantiated with a hash that doesn't meet the Hash requirements.

However I mistakenly checked the wrong set of requirements. Specifically
it checked if the hash met the requirements for specializations of
std::hash. However these requirements are stricter than the generic
Hash requirements.

This patch fixes the assertions to only check the Hash requirements.

llvm-svn: 296919

7 years ago[x86] refactor combineAddOrSubToADCOrSBB(); NFCI
Sanjay Patel [Fri, 3 Mar 2017 22:35:11 +0000 (22:35 +0000)]
[x86] refactor combineAddOrSubToADCOrSBB(); NFCI

The comments were wrong, and this is not an obvious transform.
This hopefully makes it clearer that we're missing the commuted
patterns for adds. It's less clear that this is actually a good
transform for all micro-arch.

This is prep work for trying to clean up the current adc/sbb
codegen because it's definitely not happening optimally.

llvm-svn: 296918

7 years agoSilence a warning, NFC
Krzysztof Parzyszek [Fri, 3 Mar 2017 22:21:02 +0000 (22:21 +0000)]
Silence a warning, NFC

llvm-svn: 296917

7 years ago[PGO] Text format profile reader needs to clear the value profile
Rong Xu [Fri, 3 Mar 2017 21:56:34 +0000 (21:56 +0000)]
[PGO] Text format profile reader needs to clear the value profile

Summary:
Reset the ValueData for each function to avoid using the ones in
the previous function.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits, xur

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

llvm-svn: 296916

7 years agoDetect the existence of pthread_{s,g}etname_np in libpthread on Linux
Krzysztof Parzyszek [Fri, 3 Mar 2017 21:53:12 +0000 (21:53 +0000)]
Detect the existence of pthread_{s,g}etname_np in libpthread on Linux

Older Linux distributions may not have those functions.

llvm-svn: 296915

7 years agoFix Threading path when LLVM_ENABLE_THREADS=0.
Zachary Turner [Fri, 3 Mar 2017 21:49:38 +0000 (21:49 +0000)]
Fix Threading path when LLVM_ENABLE_THREADS=0.

llvm-svn: 296914

7 years agoun-Xfail Fuzzer test that decided to pass on Green Dragon
Mehdi Amini [Fri, 3 Mar 2017 21:28:05 +0000 (21:28 +0000)]
un-Xfail Fuzzer test that decided to pass on Green Dragon

It may be flacky, I'll turn it into unsupported if it fails again.

llvm-svn: 296913

7 years agoMC: De-duplicate the object streamer implementations of EmitFileDirective into MCObje...
Peter Collingbourne [Fri, 3 Mar 2017 21:22:06 +0000 (21:22 +0000)]
MC: De-duplicate the object streamer implementations of EmitFileDirective into MCObjectStreamer. NFCI.

llvm-svn: 296912

7 years ago[ObjectYAML] [DWARF] Abstract DWARF Initial Length values
Chris Bieneman [Fri, 3 Mar 2017 21:11:55 +0000 (21:11 +0000)]
[ObjectYAML] [DWARF] Abstract DWARF Initial Length values

In the DWARF 4 Spec section 7.2.2, data in many DWARF sections, and some DWARF structures start with "Initial Length Values", which are a 32-bit length, and an optional 64-bit length if the 32 bit value == UINT32_MAX.

This patch abstracts the Initial Length type in YAML, and extends its use to all the DWARF structures that are supported in the DWARFYAML code that have Initial Length values.

llvm-svn: 296911

7 years agoIsolate Target-specific functionality of DataExtractor.
Zachary Turner [Fri, 3 Mar 2017 20:57:05 +0000 (20:57 +0000)]
Isolate Target-specific functionality of DataExtractor.

In an effort to move the various DataBuffer / DataExtractor
classes from Core -> Utility, we have to separate the low-level
functionality from the higher level functionality.  Only a
few functions required anything other than reading/writing
raw bytes, so those functions are separated out into a
more appropriate area.  Specifically, Dump() and DumpHexBytes()
are moved into free functions in Core/DumpDataExtractor.cpp,
and GetGNUEHPointer is moved into a static function in the
only file that it's referenced from.

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

llvm-svn: 296910

7 years agoMove Log from Core -> Utility.
Zachary Turner [Fri, 3 Mar 2017 20:56:28 +0000 (20:56 +0000)]
Move Log from Core -> Utility.

All references to Host and Core have been removed, so this
class can now safely be lowered into Utility.

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

llvm-svn: 296909

7 years ago[x86] regenerate checks; NFC
Sanjay Patel [Fri, 3 Mar 2017 20:48:54 +0000 (20:48 +0000)]
[x86] regenerate checks; NFC

llvm-svn: 296908

7 years agoLTO: Hash the set of imported symbols for each module.
Peter Collingbourne [Fri, 3 Mar 2017 20:25:30 +0000 (20:25 +0000)]
LTO: Hash the set of imported symbols for each module.

This set may affect code generation and is sensitive to link order (and
possibly in the future to the linker's choice of prevailing symbol), so we
need to include it.

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

llvm-svn: 296907

7 years ago[Windows] Remove the #include <eh.h> hack.
Zachary Turner [Fri, 3 Mar 2017 20:21:59 +0000 (20:21 +0000)]
[Windows] Remove the #include <eh.h> hack.

Prior to MSVC 2015 we had to manually include this header any
time we were going to include <thread> or <future> due to a
bug in MSVC's STL implementation.  This has been fixed in MSVC
for some time now, and we require VS 2015 minimum, so we can
remove this across all subprojects.

llvm-svn: 296906

7 years agoRegisterCoalescer: Simplify subrange splitting code; NFC
Matthias Braun [Fri, 3 Mar 2017 19:05:34 +0000 (19:05 +0000)]
RegisterCoalescer: Simplify subrange splitting code; NFC

- Use slightly better variable names / compute in a more direct way.

llvm-svn: 296905

7 years agoTeach lit to expand glob expressions.
Zachary Turner [Fri, 3 Mar 2017 18:55:24 +0000 (18:55 +0000)]
Teach lit to expand glob expressions.

This will enable removing hacks throughout the codebase
in clang and compiler-rt that feed multiple inputs to a
testing utility by globbing, all of which are either disabled
on Windows currently or using xargs / find hacks.

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

llvm-svn: 296904

7 years agoFix a compiler warning
Sanjoy Das [Fri, 3 Mar 2017 18:53:09 +0000 (18:53 +0000)]
Fix a compiler warning

llvm-svn: 296903

7 years agoAdd missing #includes for FreeBSD.
Zachary Turner [Fri, 3 Mar 2017 18:38:22 +0000 (18:38 +0000)]
Add missing #includes for FreeBSD.

llvm-svn: 296902

7 years agoMake TargetInstrInfo::isPredicable take a const reference, NFC
Krzysztof Parzyszek [Fri, 3 Mar 2017 18:30:54 +0000 (18:30 +0000)]
Make TargetInstrInfo::isPredicable take a const reference, NFC

llvm-svn: 296901

7 years ago[sancov] better input parameters validation
Mike Aizatsky [Fri, 3 Mar 2017 18:22:20 +0000 (18:22 +0000)]
[sancov] better input parameters validation

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

llvm-svn: 296900

7 years agoTry again to appease the FreeBSD bot.
Zachary Turner [Fri, 3 Mar 2017 18:21:04 +0000 (18:21 +0000)]
Try again to appease the FreeBSD bot.

The actual logic was wrong, not just the type conversion.
This should get it correct.

llvm-svn: 296899

7 years ago[LoopUnrolling] Peel loops with invariant backedge Phi input
Sanjoy Das [Fri, 3 Mar 2017 18:19:15 +0000 (18:19 +0000)]
[LoopUnrolling] Peel loops with invariant backedge Phi input

Summary:
If a loop contains a Phi node which has an invariant input from back
edge, it is profitable to peel such loops (rather than unroll them) to
use the advantage that this Phi is always invariant starting from 2nd
iteration. After the 1st iteration is peeled, other optimizations can
potentially simplify calculations with this invariant.

Patch by Max Kazantsev!

Reviewers: sanjoy, apilipenko, igor-laevsky, anna, mkuper, reames

Reviewed By: mkuper

Subscribers: mkuper, mzolotukhin, llvm-commits

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

llvm-svn: 296898

7 years ago[LoopUnrolling] Re-prioritize Peeling and Partial unrolling
Sanjoy Das [Fri, 3 Mar 2017 18:19:10 +0000 (18:19 +0000)]
[LoopUnrolling] Re-prioritize Peeling and Partial unrolling

Summary:
In current implementation the loop peeling happens after trip-count based partial unrolling and may
sometimes not happen at all due to it (for example, if trip count is known, but UP.Partial = false). This
is generally bad, the more than there are some situations where peeling is profitable even if the partial
unrolling is disabled.

This patch is a NFC which reorders peeling and partial unrolling application and prepares the code for
implementation of the said optimizations.

Patch by Max Kazantsev!

Reviewers: sanjoy, anna, reames, apilipenko, igor-laevsky, mkuper

Reviewed By: mkuper

Subscribers: mkuper, llvm-commits, mzolotukhin

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

llvm-svn: 296897

7 years agoReland 4: [analyzer] NFC: Update test infrastructure to support multiple constraint...
Dominic Chen [Fri, 3 Mar 2017 18:02:02 +0000 (18:02 +0000)]
Reland 4: [analyzer] NFC: Update test infrastructure to support multiple constraint managers

Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952.

Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin

Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits

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

llvm-svn: 296895

7 years ago[x86] clean up materializeSBB(); NFCI
Sanjay Patel [Fri, 3 Mar 2017 17:58:39 +0000 (17:58 +0000)]
[x86] clean up materializeSBB(); NFCI

This is producing SBB where it is obviously not necessary, so it needs to be limited.

llvm-svn: 296894

7 years agoTry to appease the FreeBSD bots.
Zachary Turner [Fri, 3 Mar 2017 17:56:14 +0000 (17:56 +0000)]
Try to appease the FreeBSD bots.

pthread_self() returns a pthread_t, but we were setting it to
an int.  It seems the cast to int when calling sysctl is still
the correct thing to do, though.

llvm-svn: 296892

7 years agoDon't bring in llvm/Support/thread.h in Threading.cpp
Zachary Turner [Fri, 3 Mar 2017 17:39:24 +0000 (17:39 +0000)]
Don't bring in llvm/Support/thread.h in Threading.cpp

Doing so defines the type llvm::thread.  On FreeBSD, we need
to call a macro which references its own ::thread type, which
causes an ambiguity due to ADL when inside of the llvm namespace.

Since we don't even need this unless LLVM_ENABLE_THREADS == 1,
we don't even need this type anyway, as it is always equal to
std::thread, so we can just use that directly.

llvm-svn: 296891

7 years agoAdd #include for unistd.h on Linux.
Zachary Turner [Fri, 3 Mar 2017 17:24:55 +0000 (17:24 +0000)]
Add #include for unistd.h on Linux.

llvm-svn: 296890

7 years agoFix libc++ test to pass in C++03 mode
Mehdi Amini [Fri, 3 Mar 2017 17:24:29 +0000 (17:24 +0000)]
Fix libc++ test to pass in C++03 mode

Was hitting: "error: scalar initializer cannot be empty"

llvm-svn: 296889

7 years ago[clang-tidy] Yet another docs fixes
Piotr Padlewski [Fri, 3 Mar 2017 17:16:11 +0000 (17:16 +0000)]
[clang-tidy] Yet another docs fixes

llvm-svn: 296888

7 years ago[Support] Provide access to current thread name/thread id.
Zachary Turner [Fri, 3 Mar 2017 17:15:17 +0000 (17:15 +0000)]
[Support] Provide access to current thread name/thread id.

Applications often need the current thread id when making
system calls, and some operating systems provide the notion
of a thread name, which can be useful in enabling better
diagnostics when debugging or logging.

This patch adds an accessor for the thread id, and "best effort"
getters and setters for the thread name.  Since this is
non critical functionality, no error is returned to indicate
that a platform doesn't support thread names.

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

llvm-svn: 296887

7 years agoUse APInt::setBits instead of OR'ing in a separate APInt::getBitsSet call
Simon Pilgrim [Fri, 3 Mar 2017 17:03:52 +0000 (17:03 +0000)]
Use APInt::setBits instead of OR'ing in a separate APInt::getBitsSet call

llvm-svn: 296886

7 years agoAndroid.rules: fix building on mac
Pavel Labath [Fri, 3 Mar 2017 17:03:46 +0000 (17:03 +0000)]
Android.rules: fix building on mac

realpath is not available as an executable on mac. I give up, I am just
going to leave the path with ..'s in it.

llvm-svn: 296885

7 years ago[Analyzer] Terminate analysis on OpenMP code instead of assertion crash
Aleksei Sidorin [Fri, 3 Mar 2017 16:58:53 +0000 (16:58 +0000)]
[Analyzer] Terminate analysis on OpenMP code instead of assertion crash

* ExprEngine assumes that OpenMP statements should never appear in CFG.
  However, current CFG doesn't know anything about OpenMP and passes
  such statements as CFG nodes causing "UNREACHABLE executed!" crashes.
  Since there is no OpenMP implementation in ExprEngine or CFG,
  we stop the analysis on OpenMP statements to avoid crashes.

This fixes PR31835.

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

llvm-svn: 296884

7 years ago[x86] regenerate checks; NFC
Sanjay Patel [Fri, 3 Mar 2017 16:58:51 +0000 (16:58 +0000)]
[x86] regenerate checks; NFC

llvm-svn: 296883

7 years agoUse APInt::getLowBitsSet instead of APInt::getBitsSet for lower bit mask creation
Simon Pilgrim [Fri, 3 Mar 2017 16:56:33 +0000 (16:56 +0000)]
Use APInt::getLowBitsSet instead of APInt::getBitsSet for lower bit mask creation

llvm-svn: 296882

7 years ago[x86] regenerate checks; NFC
Sanjay Patel [Fri, 3 Mar 2017 16:45:57 +0000 (16:45 +0000)]
[x86] regenerate checks; NFC

llvm-svn: 296881

7 years ago[x86] regenerate checks; NFC
Sanjay Patel [Fri, 3 Mar 2017 16:42:43 +0000 (16:42 +0000)]
[x86] regenerate checks; NFC

llvm-svn: 296880

7 years agoUse APInt::getOneBitSet instead of APInt::getBitsSet for sign bit mask creation
Simon Pilgrim [Fri, 3 Mar 2017 16:35:57 +0000 (16:35 +0000)]
Use APInt::getOneBitSet instead of APInt::getBitsSet for sign bit mask creation

Avoids all the unnecessary extra bitrange creation/shift stages.

llvm-svn: 296879

7 years ago[compiler-rt][asan] Turn on ASAN unittests for win64.
Etienne Bergeron [Fri, 3 Mar 2017 16:35:46 +0000 (16:35 +0000)]
[compiler-rt][asan] Turn on ASAN unittests for win64.

Summary:
Asan is now working on windows 64-bit.
This patch is turning on the unittest.

Reviewers: rnk

Reviewed By: rnk

Subscribers: kubamracek, dberris, beanz, mgorny, llvm-commits, chrisha

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

llvm-svn: 296878

7 years ago[x86] regenerate checks; NFC
Sanjay Patel [Fri, 3 Mar 2017 16:34:35 +0000 (16:34 +0000)]
[x86] regenerate checks; NFC

llvm-svn: 296877

7 years agoAndroid.rules: fix building on windows
Pavel Labath [Fri, 3 Mar 2017 16:29:56 +0000 (16:29 +0000)]
Android.rules: fix building on windows

$(realpath), which I guess is a make builtin, gives strange results on
Windows. $(shell realpath) invokes the gnuwin external binary, which
works correctly.

llvm-svn: 296876

7 years ago[x86] fix formatting; NFC
Sanjay Patel [Fri, 3 Mar 2017 15:17:41 +0000 (15:17 +0000)]
[x86] fix formatting; NFC

llvm-svn: 296875

7 years agoUse APInt::getHighBitsSet instead of APInt::getBitsSet for upper bit mask creation
Simon Pilgrim [Fri, 3 Mar 2017 14:37:57 +0000 (14:37 +0000)]
Use APInt::getHighBitsSet instead of APInt::getBitsSet for upper bit mask creation

llvm-svn: 296874

7 years ago[AMDGPU][MC] Fix for Bug 30829 + LIT tests
Dmitry Preobrazhensky [Fri, 3 Mar 2017 14:31:06 +0000 (14:31 +0000)]
[AMDGPU][MC] Fix for Bug 30829 + LIT tests

Added code to check constant bus restrictions for VOP formats (only one SGPR value or literal-constant may be used by the instruction).
Note that the same checks are performed by SIInstrInfo::verifyInstruction (used by lowering code).
Added LIT tests.

llvm-svn: 296873

7 years agoRevert "Re-apply "[GVNHoist] Move GVNHoist to function simplification part of pipeline.""
Benjamin Kramer [Fri, 3 Mar 2017 14:27:53 +0000 (14:27 +0000)]
Revert "Re-apply "[GVNHoist] Move GVNHoist to function simplification part of pipeline.""

This reverts commit r296759. Miscompiles bash.

llvm-svn: 296872

7 years agoUse APInt::getOneBitSet instead of APInt::getBitsSet for sign bit mask creation
Simon Pilgrim [Fri, 3 Mar 2017 14:25:46 +0000 (14:25 +0000)]
Use APInt::getOneBitSet instead of APInt::getBitsSet for sign bit mask creation

Avoids all the unnecessary extra bitrange creation/shift stages.

llvm-svn: 296871

7 years agotest: shorten test trace file names
Pavel Labath [Fri, 3 Mar 2017 13:49:38 +0000 (13:49 +0000)]
test: shorten test trace file names

Make sure we don't generate extremely long file names for test trace log
file, as this can cause path-too-long errors. As the compilers in the
android ndk are deeply nested, it's very easy to trigger these.

I chose to output at most 4 path components -- this should keep the full
path for common cases like /usr/bin/gcc with room to spare, and should
be enough to uniquely identify the compiler for more deeply nested
cases.

llvm-svn: 296870

7 years agotestsuite/android: build test executables with the android ndk directly
Pavel Labath [Fri, 3 Mar 2017 13:49:34 +0000 (13:49 +0000)]
testsuite/android: build test executables with the android ndk directly

Summary:
This teaches the test makefiles about the Android NDK, so we are able to
run the tests without first going through the make_standalone_toolchain
script. The motivation for this is the ability to run both libc++ and
libstdc++ tests together, which previously was not possible because
make_standalone_toolchain bakes in the STL to use during toolchain
creation time. The support for this is not present yet -- this change
only make sure we don't regress for existing funcionality (gcc w/
libstdc++). Clang and libc++ support will be added later.

I've checked that the mips android targets compile after this change,
but I have no way of checking whether this breaks anything. If you are
reading this and it broke you, let me know.

Reviewers: tberghammer, danalbert

Subscribers: srhines, lldb-commits

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

llvm-svn: 296869

7 years agoMade GetClangTargetCPU() const.
Pavel Labath [Fri, 3 Mar 2017 13:35:49 +0000 (13:35 +0000)]
Made GetClangTargetCPU() const.

Summary:
It does not change members or call non-const members.
HostInfo::GetArchitecture() returns a const object ref (maybe others?),
which can't access the non-const function.

Reviewers: labath, eugene

Reviewed By: labath, eugene

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D30515
Author: Jason Majors <jmajors@google.com>

llvm-svn: 296868

7 years ago[clang-tidy] Fix modernize-use-emplace docs
Piotr Padlewski [Fri, 3 Mar 2017 12:42:22 +0000 (12:42 +0000)]
[clang-tidy] Fix modernize-use-emplace docs

llvm-svn: 296867

7 years agoFix Wdocumentation warning
Simon Pilgrim [Fri, 3 Mar 2017 12:09:11 +0000 (12:09 +0000)]
Fix Wdocumentation warning

llvm-svn: 296866

7 years ago[ARM] fpscr read/write intrinsics not aware of each other
Ranjeet Singh [Fri, 3 Mar 2017 11:40:07 +0000 (11:40 +0000)]
[ARM] fpscr read/write intrinsics not aware of each other

The intrinsics __builtin_arm_get_fpscr and __builtin_arm_set_fpscr read and
write to the fpscr (Floating-Point Status and Control Register) register.

A bug exists in the __builtin_arm_get_fpscr intrinsic definition in llvm which
treats this intrinsic as a IntroNoMem which means it's not a memory access and
doesn't have any other side-effects. Having this property on this intrinsic
means that various optimizations can be done on this such as common
sub-expression elimination with other reads. This can cause issues if there has
been write to this register, e.g.

void foo(int *p) {
     p[0] = __builtin_arm_get_fpscr();
     __builtin_arm_set_fpscr(1);
     p[1] = __builtin_arm_get_fpscr();
}

in the above example the second read is currently CSE'd into the first read,
this is because llvm isn't aware that the write done by __builtin_arm_set_fpscr
effects the same register that __builtin_arm_get_fpscr reads from, to fix this
problem I've removed the property IntrNoMem so that __builtin_arm_get_fpscr is
treated as a memory access.

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

llvm-svn: 296865

7 years ago[clang-tidy] Format code around applied fixes
Alexander Kornienko [Fri, 3 Mar 2017 11:16:34 +0000 (11:16 +0000)]
[clang-tidy] Format code around applied fixes

Summary:
Add -format option (disabled by default for now) to trigger formatting
of replacements.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: kimgr, malcolm.parsons, JDevlieghere, cfe-commits

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

llvm-svn: 296864

7 years ago[SLP] Fixes the bug due to absence of in order uses of scalars which needs to be...
Mohammad Shahid [Fri, 3 Mar 2017 10:02:47 +0000 (10:02 +0000)]
[SLP] Fixes the bug due to absence of in order uses of scalars which needs to be available
for VectorizeTree() API.This API uses it for proper mask computation to be used in shufflevector IR.
The fix is to compute the mask for out of order memory accesses while building the vectorizable tree
instead of actual vectorization of vectorizable tree.It also needs to recompute the proper Lane for
external use of vectorizable scalars based on shuffle mask.

Reviewers: mkuper

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

Change-Id: Ide8773ce0ad3562f3cf4d1a0ad0f487e2f60ce5d
llvm-svn: 296863

7 years ago[SDAG] Revert r296476 (and r296486, r296668, r296690).
Chandler Carruth [Fri, 3 Mar 2017 10:02:25 +0000 (10:02 +0000)]
[SDAG] Revert r296476 (and r296486, r296668, r296690).

This patch causes compile times for some patterns to explode. I have
a (large, unreduced) test case that slows down by more than 20x and
several test cases slow down by 2x. I'm sending some of the test cases
directly to Nirav and following up with more details in the review log,
but this should unblock anyone else hitting this.

llvm-svn: 296862

7 years ago[PowerPC] Enable -fomit-frame-pointer by default for PPC
Nemanja Ivanovic [Fri, 3 Mar 2017 09:49:17 +0000 (09:49 +0000)]
[PowerPC] Enable -fomit-frame-pointer by default for PPC

As is the case on platforms like Mips, X86 and SystemZ, the -fomit-frame-pointer
should be enabled by default on PPC when optimizing at -O1 and above. This
brings the behaviour of LLVM on PPC in line with GCC.

Committing on behalf of Hiroshi Inoue.

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

llvm-svn: 296861

7 years agoFix a typo in the comments. Patch by marktwtn from https://github.com/llvm-mirror...
Sylvestre Ledru [Fri, 3 Mar 2017 09:36:04 +0000 (09:36 +0000)]
Fix a typo in the comments. Patch by marktwtn from https://github.com/llvm-mirror/llvm/pull/16/files

llvm-svn: 296860

7 years ago[X86] Generate VZEROUPPER for Skylake-avx512.
Amjad Aboud [Fri, 3 Mar 2017 09:03:24 +0000 (09:03 +0000)]
[X86] Generate VZEROUPPER for Skylake-avx512.
VZEROUPPER should not be issued on Knights Landing (KNL), but on Skylake-avx512 it should be.

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

llvm-svn: 296859

7 years ago[clang-tidy] google-readability-casting: don't use constructor call syntax for const...
Alexander Kornienko [Fri, 3 Mar 2017 08:18:49 +0000 (08:18 +0000)]
[clang-tidy] google-readability-casting: don't use constructor call syntax for const types

llvm-svn: 296858

7 years ago[AArch64AsmParser] rewrite of function parseSysAlias
Sjoerd Meijer [Fri, 3 Mar 2017 08:12:47 +0000 (08:12 +0000)]
[AArch64AsmParser] rewrite of function parseSysAlias

This is a cleanup/rewrite of the parseSysAlias function. It was not using the
tablegen instruction descriptions, but was “manually” matching the mnemonics
and recreating the operands whereas all this information is already in
tablegen; all this code has been replaced with calls to lookupXYZByName
tablegen calls.

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

llvm-svn: 296857

7 years ago[GlobalISel][X86] Support float/double and vector types.
Igor Breger [Fri, 3 Mar 2017 08:06:46 +0000 (08:06 +0000)]
[GlobalISel][X86] Support float/double and vector types.

Summary: [GlobalISel][X86] Add support for f32/f64 and vector types in RegisterBank and InstructionSelector.

Reviewers: delena, zvi

Reviewed By: zvi

Subscribers: dberris, rovka, llvm-commits, kristof.beyls

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

llvm-svn: 296856

7 years agoRemove some dead code in FileSpec.
Zachary Turner [Fri, 3 Mar 2017 06:14:38 +0000 (06:14 +0000)]
Remove some dead code in FileSpec.

This in turn triggered some fallout where other files had
been transitively picking up includes that they needed from
FileSpec.h, so I've fixed those up as well.

llvm-svn: 296855

7 years agoClean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCES
Eric Fiselier [Fri, 3 Mar 2017 03:43:25 +0000 (03:43 +0000)]
Clean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCES

llvm-svn: 296854

7 years ago[tests] Specify the dependence to NVPTX backend for Polly ACC test cases
Tobias Grosser [Fri, 3 Mar 2017 03:38:50 +0000 (03:38 +0000)]
[tests] Specify the dependence to NVPTX backend for Polly ACC test cases

Some Polly ACC test cases fail without a working NVPTX backend. We explicitly
specify this dependence in REQUIRES. Alternatively, we could have only marked
polly-acc as supported in case the NVPTX backend is available, but as we might
use other backends in the future, this does not seem to be the best choice.

For this to work, we also need to make the 'targets_to_build' information
available.

Suggested-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 296853

7 years ago[test] Do not emit binary data to output
Tobias Grosser [Fri, 3 Mar 2017 03:24:34 +0000 (03:24 +0000)]
[test] Do not emit binary data to output

Suggested-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 296852

7 years agoFix sign-compare warning in test; Oddly this only appears on OS X
Eric Fiselier [Fri, 3 Mar 2017 02:02:07 +0000 (02:02 +0000)]
Fix sign-compare warning in test; Oddly this only appears on OS X

llvm-svn: 296851

7 years agoRevert r296730, "cmake: Configure the ThinLTO cache directory when using ELF lld...
Peter Collingbourne [Fri, 3 Mar 2017 02:00:22 +0000 (02:00 +0000)]
Revert r296730, "cmake: Configure the ThinLTO cache directory when using ELF lld or gold."

Causes a build failure on the clang-with-thin-lto-ubuntu bot.
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/2117/steps/build-stage3-compiler/logs/stdio

llvm-svn: 296850

7 years ago[msan] Test for _mm_getcsr and _mm_setcsr (r296848).
Evgeniy Stepanov [Fri, 3 Mar 2017 01:13:23 +0000 (01:13 +0000)]
[msan] Test for _mm_getcsr and _mm_setcsr (r296848).

llvm-svn: 296849

7 years ago[msan] Handle x86_sse_stmxcsr and x86_sse_ldmxcsr.
Evgeniy Stepanov [Fri, 3 Mar 2017 01:12:43 +0000 (01:12 +0000)]
[msan] Handle x86_sse_stmxcsr and x86_sse_ldmxcsr.

llvm-svn: 296848

7 years agoLiveDebugValues: Assume calls never clobber SP.
Adrian Prantl [Fri, 3 Mar 2017 01:08:25 +0000 (01:08 +0000)]
LiveDebugValues: Assume calls never clobber SP.

A call should never modify the stack pointer, but some backends are
not so sure about this and never list SP in the regmask. For the
purposes of LiveDebugValues we assume a call never clobbers SP. We
already have a similar workaround in DbgValueHistoryCalculator (which
we hopefully can retire soon).

This fixes the availabilty of local ASANified variables on AArch64.

rdar://problem/27757381

llvm-svn: 296847

7 years ago[ProfileData] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Fri, 3 Mar 2017 01:07:34 +0000 (01:07 +0000)]
[ProfileData] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 296846

7 years agoCodeGen: BlockPlacement: Precompute layout for chains of triangles.
Kyle Butt [Fri, 3 Mar 2017 01:00:22 +0000 (01:00 +0000)]
CodeGen: BlockPlacement: Precompute layout for chains of triangles.

For chains of triangles with small join blocks that can be tail duplicated, a
simple calculation of probabilities is insufficient. Tail duplication
can be profitable in 3 different ways for these cases:

1) The post-dominators marked 50% are actually taken 56% (This shrinks with
   longer chains)
2) The chains are statically correlated. Branch probabilities have a very
   U-shaped distribution.
   [http://nrs.harvard.edu/urn-3:HUL.InstRepos:24015805]
   If the branches in a chain are likely to be from the same side of the
   distribution as their predecessor, but are independent at runtime, this
   transformation is profitable. (Because the cost of being wrong is a small
   fixed cost, unlike the standard triangle layout where the cost of being
   wrong scales with the # of triangles.)
3) The chains are dynamically correlated. If the probability that a previous
   branch was taken positively influences whether the next branch will be
   taken
We believe that 2 and 3 are common enough to justify the small margin in 1.

The code pre-scans a function's CFG to identify this pattern and marks the edges
so that the standard layout algorithm can use the computed results.

llvm-svn: 296845

7 years ago[msan] Remove stale comments.
Evgeniy Stepanov [Fri, 3 Mar 2017 00:25:56 +0000 (00:25 +0000)]
[msan] Remove stale comments.

ClStoreCleanOrigin flag was removed back in 2014.

llvm-svn: 296844

7 years agoFix msc-version.c test to handle _MSC_VER=1910
Dave Bartolomeo [Fri, 3 Mar 2017 00:08:55 +0000 (00:08 +0000)]
Fix msc-version.c test to handle _MSC_VER=1910

Previously, VC++ has always set _MSC_VER to a four-digit value with the two least significant digits set to zero. Visual Studio 2017, however, sets _MSC_VER=1910, and we expect to update the least significant digit as we release major updates for VS 2017. This patch fixes the msc-version.c test to handle non-zero values in the two least significant digits of _MSC_VER.

llvm-svn: 296843

7 years agoAMDGPU: Fix missing dominator tree dependency
Matt Arsenault [Thu, 2 Mar 2017 23:50:51 +0000 (23:50 +0000)]
AMDGPU: Fix missing dominator tree dependency

llvm-svn: 296842

7 years agoRevert "Reland 3: [analyzer] NFC: Update test infrastructure to support multiple...
Dominic Chen [Thu, 2 Mar 2017 23:30:53 +0000 (23:30 +0000)]
Revert "Reland 3: [analyzer] NFC: Update test infrastructure to support multiple constraint managers"

This reverts commit ea36f1406e1f36bf456c3f3929839b024128e468.

llvm-svn: 296841