platform/upstream/llvm.git
9 years agoSSAUpdater: Use range-based for. NFC.
Benjamin Kramer [Thu, 19 Feb 2015 20:04:02 +0000 (20:04 +0000)]
SSAUpdater: Use range-based for. NFC.

llvm-svn: 229908

9 years agoRemove unused argument from emitInlineAsmStart.
Eric Christopher [Thu, 19 Feb 2015 19:52:25 +0000 (19:52 +0000)]
Remove unused argument from emitInlineAsmStart.

llvm-svn: 229907

9 years ago[objc-arc] Convert the bodies of ARCInstKind predicates into covered switches.
Michael Gottesman [Thu, 19 Feb 2015 19:51:36 +0000 (19:51 +0000)]
[objc-arc] Convert the bodies of ARCInstKind predicates into covered switches.

This is much better than the previous manner of just using
short-curcuiting booleans from:

1. A "naive" efficiency perspective: we do not have to rely on the
compiler to change the short circuiting boolean operations into a
switch.
2. An understanding perspective by making the implicit behavior of
negative predicates explicit.
3. A maintainability perspective through the covered switch flag making
it easy to know where to update code when adding new ARCInstKinds.

llvm-svn: 229906

9 years ago[objc-arc] Change the InstructionClass to be an enum class called ARCInstKind.
Michael Gottesman [Thu, 19 Feb 2015 19:51:32 +0000 (19:51 +0000)]
[objc-arc] Change the InstructionClass to be an enum class called ARCInstKind.

I also renamed ObjCARCUtil.cpp -> ARCInstKind.cpp. That file only contained
items related to ARCInstKind anyways.

llvm-svn: 229905

9 years agoChecking if TARGET_OS_IPHONE is defined isn't good enough for 10.7 and earlier.
Chris Bieneman [Thu, 19 Feb 2015 19:50:52 +0000 (19:50 +0000)]
Checking if TARGET_OS_IPHONE is defined isn't good enough for 10.7 and earlier.

Older versions of the TargetConditionals header always defined TARGET_OS_IPHONE to something (0 or 1), so we need to test not only for the existence but also if it is 1.

This resolves PR22631.

llvm-svn: 229904

9 years ago[Hexagon] Moving more functions off of HexagonMCInst and in to HexagonMCInstrInfo.
Colin LeMahieu [Thu, 19 Feb 2015 19:49:27 +0000 (19:49 +0000)]
[Hexagon] Moving more functions off of HexagonMCInst and in to HexagonMCInstrInfo.

llvm-svn: 229903

9 years agoCodeGen: Weak reference temporaries belong in a COMDAT
David Majnemer [Thu, 19 Feb 2015 19:35:18 +0000 (19:35 +0000)]
CodeGen: Weak reference temporaries belong in a COMDAT

llvm-svn: 229902

9 years agoAdd -stack-select-frame command (MI)
Ilia K [Thu, 19 Feb 2015 19:26:52 +0000 (19:26 +0000)]
Add -stack-select-frame command (MI)

Summary:
Add -stack-select-frame command + test.

All tests pass on OS X.

Reviewers: abidh, emaste, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, emaste, clayborg, abidh

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

llvm-svn: 229901

9 years agoCodeGen: static constexpr data members should have a linkonce_odr init
David Majnemer [Thu, 19 Feb 2015 19:25:17 +0000 (19:25 +0000)]
CodeGen: static constexpr data members should have a linkonce_odr init

Classes can be defined in multiple translation units.  This means that
the static constexpr data members should have identical initializers in
all translation units.  Implement this by giving the reference temporary
linkonce_odr linkage.

llvm-svn: 229900

9 years ago[LoopAccesses] Change LAA:getInfo to return a constant reference
Adam Nemet [Thu, 19 Feb 2015 19:15:21 +0000 (19:15 +0000)]
[LoopAccesses] Change LAA:getInfo to return a constant reference

As expected, this required a few more const-correctness fixes.

Based on Hal's feedback on D7684.

llvm-svn: 229899

9 years ago[LoopAccesses] Add -analyze support
Adam Nemet [Thu, 19 Feb 2015 19:15:19 +0000 (19:15 +0000)]
[LoopAccesses] Add -analyze support

The LoopInfo in combination with depth_first is used to enumerate the
loops.

Right now -analyze is not yet complete.  It only prints the result of
the analysis, the report and the run-time checks.  Printing the unsafe
depedences will require a bit more reshuffling which I'd like to do in a
follow-on to this patchset.  Unsafe dependences are currently checked
via -debug-only=loop-accesses in the new test.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229898

9 years ago[LoopAccesses] Split out LoopAccessReport from VectorizerReport
Adam Nemet [Thu, 19 Feb 2015 19:15:15 +0000 (19:15 +0000)]
[LoopAccesses] Split out LoopAccessReport from VectorizerReport

The only difference between these two is that VectorizerReport adds a
vectorizer-specific prefix to its messages.  When LAA is used in the
vectorizer context the prefix is added when we promote the
LoopAccessReport into a VectorizerReport via one of the constructors.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229897

9 years ago[LoopAccesses] Add missing const to APIs in VectorizationReport
Adam Nemet [Thu, 19 Feb 2015 19:15:13 +0000 (19:15 +0000)]
[LoopAccesses] Add missing const to APIs in VectorizationReport

When I split out LoopAccessReport from this, I need to create some temps
so constness becomes necessary.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229896

9 years ago[LoopAccesses] Add canAnalyzeLoop
Adam Nemet [Thu, 19 Feb 2015 19:15:10 +0000 (19:15 +0000)]
[LoopAccesses] Add canAnalyzeLoop

This allows the analysis to be attempted with any loop.  This feature
will be used with -analysis.  (LV only requests the analysis on loops
that have already satisfied these tests.)

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229895

9 years ago[LoopAccesses] Change debug messages from LV to LAA
Adam Nemet [Thu, 19 Feb 2015 19:15:07 +0000 (19:15 +0000)]
[LoopAccesses] Change debug messages from LV to LAA

Also add pass name as an argument to VectorizationReport::emitAnalysis.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229894

9 years ago[LoopAccesses] Create the analysis pass
Adam Nemet [Thu, 19 Feb 2015 19:15:04 +0000 (19:15 +0000)]
[LoopAccesses] Create the analysis pass

This is a function pass that runs the analysis on demand.  The analysis
can be initiated by querying the loop access info via LAA::getInfo.  It
either returns the cached info or runs the analysis.

Symbolic stride information continues to reside outside of this analysis
pass. We may move it inside later but it's not a priority for me right
now.  The idea is that Loop Distribution won't support run-time stride
checking at least initially.

This means that when querying the analysis, symbolic stride information
can be provided optionally.  Whether stride information is used can
invalidate the cache entry and rerun the analysis.  Note that if the
loop does not have any symbolic stride, the entry should be preserved
across Loop Distribution and LV.

Since currently the only user of the pass is LV, I just check that the
symbolic stride information didn't change when using a cached result.

On the LV side, LoopVectorizationLegality requests the info object
corresponding to the loop from the analysis pass.  A large chunk of the
diff is due to LAI becoming a pointer from a reference.

A test will be added as part of the -analyze patch.

Also tested that with AVX, we generate identical assembly output for the
testsuite (including the external testsuite) before and after.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229893

9 years ago[LoopAccesses] Cache the result of canVectorizeMemory
Adam Nemet [Thu, 19 Feb 2015 19:15:00 +0000 (19:15 +0000)]
[LoopAccesses] Cache the result of canVectorizeMemory

LAA will be an on-demand analysis pass, so we need to cache the result
of the analysis.  canVectorizeMemory is renamed to analyzeLoop which
computes the result.  canVectorizeMemory becomes the query function for
the cached result.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229892

9 years ago[LoopAccesses] Stash the report from the analysis rather than emitting it
Adam Nemet [Thu, 19 Feb 2015 19:14:56 +0000 (19:14 +0000)]
[LoopAccesses] Stash the report from the analysis rather than emitting it

The transformation passes will query this and then emit them as part of
their own report.  The currently only user LV is modified to do just
that.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229891

9 years ago[LoopAccesses] Make VectorizerParams global + fix for cyclic dep
Adam Nemet [Thu, 19 Feb 2015 19:14:52 +0000 (19:14 +0000)]
[LoopAccesses] Make VectorizerParams global + fix for cyclic dep

As LAA is becoming a pass, we can no longer pass the params to its
constructor.  This changes the command line flags to have external
storage.  These can now be accessed both from LV and LAA.

VectorizerParams is moved out of LoopAccessInfo in order to shorten the
code to access it.

This commits also has the fix (D7731) to the break dependence cycle
between the analysis and vector libraries.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229890

9 years agoRevert "Reformat."
Adam Nemet [Thu, 19 Feb 2015 19:14:34 +0000 (19:14 +0000)]
Revert "Reformat."

This reverts commit r229651.

I'd like to ultimately revert r229650 but this reformat stands in the
way.  I'll reformat the affected files once the the loop-access pass is
fully committed.

llvm-svn: 229889

9 years ago[orcjit] Include CMake support for the fully_lazy example and fix the build
David Blaikie [Thu, 19 Feb 2015 19:06:04 +0000 (19:06 +0000)]
[orcjit] Include CMake support for the fully_lazy example and fix the build

Not sure if/how to make the CMake build use C++14 for the examples, so
let's stick to C++11 for now.

llvm-svn: 229888

9 years agoMake the _mm256_insert_epi64 definition more consistent
Filipe Cabecinhas [Thu, 19 Feb 2015 19:00:33 +0000 (19:00 +0000)]
Make the _mm256_insert_epi64 definition more consistent

Use long long for the epi64 argument, like the other intrinsics.
NFC since this is only defined in 64-bit mode, not in 32-bit.

Fix suggested by H. J. Lu!

llvm-svn: 229886

9 years ago[Hexagon] Creating HexagonMCInstrInfo namespace as landing zone for static functions...
Colin LeMahieu [Thu, 19 Feb 2015 19:00:00 +0000 (19:00 +0000)]
[Hexagon] Creating HexagonMCInstrInfo namespace as landing zone for static functions detached from HexagonMCInst.

llvm-svn: 229885

9 years agoFix grammar in documentation.
Eric Christopher [Thu, 19 Feb 2015 18:46:25 +0000 (18:46 +0000)]
Fix grammar in documentation.

Patch by Ralph Campbell!

llvm-svn: 229884

9 years agoUpdate and remove a few calls to TargetMachine::getSubtargetImpl
Eric Christopher [Thu, 19 Feb 2015 18:46:23 +0000 (18:46 +0000)]
Update and remove a few calls to TargetMachine::getSubtargetImpl
out of the asm printer.

llvm-svn: 229883

9 years ago[fuzzer] split main() into FuzzerDriver() that takes a callback as a parameter and...
Kostya Serebryany [Thu, 19 Feb 2015 18:45:37 +0000 (18:45 +0000)]
[fuzzer] split main() into FuzzerDriver() that takes a callback as a parameter and a tiny main() in a separate file

llvm-svn: 229882

9 years agoAssume the original file is created before release in LockFileManager
Ben Langmuir [Thu, 19 Feb 2015 18:22:35 +0000 (18:22 +0000)]
Assume the original file is created before release in LockFileManager

This is true in clang, and let's us remove the problematic code that
waits around for the original file and then times out if it doesn't get
created in short order.  This caused any 'dead' lock file or legitimate
time out to cause a cascade of timeouts in any processes waiting on the
same lock (even if they only just showed up).

llvm-svn: 229881

9 years ago[fuzzer] properly annotate fallthrough, add one more entry to FAQ
Kostya Serebryany [Thu, 19 Feb 2015 18:21:12 +0000 (18:21 +0000)]
[fuzzer] properly annotate fallthrough, add one more entry to FAQ

llvm-svn: 229880

9 years ago[REFACTOR] Simplify the SCoP detection interface a bit
Johannes Doerfert [Thu, 19 Feb 2015 18:11:50 +0000 (18:11 +0000)]
[REFACTOR] Simplify the SCoP detection interface a bit

llvm-svn: 229879

9 years agoFactor out common URL handling code in PlatformRemoteGDBServer
Pavel Labath [Thu, 19 Feb 2015 18:10:55 +0000 (18:10 +0000)]
Factor out common URL handling code in PlatformRemoteGDBServer

Summary:
this also gets rid of a compiler warning in release builds by using a dynamically allocated
buffer. Therefore, a size assertion is not necessary (and probably should have been an error in
the first place).

Reviewers: tberghammer

Subscribers: lldb-commits

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

llvm-svn: 229878

9 years ago[NFC] Generalize getIslCompatibleName interface.
Johannes Doerfert [Thu, 19 Feb 2015 18:09:39 +0000 (18:09 +0000)]
[NFC] Generalize getIslCompatibleName interface.

llvm-svn: 229877

9 years ago Prevent LLGS from crashing when exiting - make NativeProcessLinux to wait until...
Oleksiy Vyalov [Thu, 19 Feb 2015 17:58:04 +0000 (17:58 +0000)]
 Prevent LLGS from crashing when exiting - make NativeProcessLinux to wait until ThreadStateCoordinator is fully stopped before entering ~NativeProcessLinux.

http://reviews.llvm.org/D7692

llvm-svn: 229875

9 years ago[Hexagon] Removing static variable holding MCInstrInfo.
Colin LeMahieu [Thu, 19 Feb 2015 17:38:39 +0000 (17:38 +0000)]
[Hexagon] Removing static variable holding MCInstrInfo.

llvm-svn: 229872

9 years agoLSR: Move set instead of copying. NFC.
Benjamin Kramer [Thu, 19 Feb 2015 17:19:43 +0000 (17:19 +0000)]
LSR: Move set instead of copying. NFC.

llvm-svn: 229871

9 years agoadd X86 load folding tests for unary math ops
Sanjay Patel [Thu, 19 Feb 2015 16:59:11 +0000 (16:59 +0000)]
add X86 load folding tests for unary math ops

X86 load folding is fragile; eg, the tests here
don't work without AVX even though they should. This
is because we have a mix of tablegen patterns that have
been added over time, and we have a load folding table
used by the peephole optimizer that has to be kept in
sync with the ever-changing ISA and tablegen defs.

llvm-svn: 229870

9 years agoAdded module map coverage support, extracted from module-map-checker.
John Thompson [Thu, 19 Feb 2015 16:47:27 +0000 (16:47 +0000)]
Added module map coverage support, extracted from module-map-checker.

llvm-svn: 229869

9 years agoFix usage of m_bThreadInvalid in -thread-info (MI)
Ilia K [Thu, 19 Feb 2015 16:33:16 +0000 (16:33 +0000)]
Fix usage of m_bThreadInvalid in -thread-info (MI)

llvm-svn: 229868

9 years agoDrop left over code from FinalRead statement removal.
Tobias Grosser [Thu, 19 Feb 2015 16:24:57 +0000 (16:24 +0000)]
Drop left over code from FinalRead statement removal.

We removed FinalRead statements in r152319.

llvm-svn: 229867

9 years agoMake basic_streambuf::xsputn write characters in chunks whenever possible, instead...
Marshall Clow [Thu, 19 Feb 2015 16:17:46 +0000 (16:17 +0000)]
Make basic_streambuf::xsputn write characters in chunks whenever possible, instead of one at a time. References PR#10193

llvm-svn: 229866

9 years agoclang-format: [js] Support ES6 module exports.
Daniel Jasper [Thu, 19 Feb 2015 16:14:18 +0000 (16:14 +0000)]
clang-format: [js] Support ES6 module exports.

Patch by Martin Probst, thank you!

llvm-svn: 229865

9 years agoAvoid conversion to float when creating ConstantDataArray/ConstantDataVector.
Rafael Espindola [Thu, 19 Feb 2015 16:08:20 +0000 (16:08 +0000)]
Avoid conversion to float when creating ConstantDataArray/ConstantDataVector.

Patch by Raoux, Thomas F!

llvm-svn: 229864

9 years agoclang-format: [js] Support ES6 module imports.
Daniel Jasper [Thu, 19 Feb 2015 16:07:32 +0000 (16:07 +0000)]
clang-format: [js] Support ES6 module imports.

Patch by Martin Probst.

llvm-svn: 229863

9 years agoclang-format: [js] Do not fall through for JS structural elements.
Daniel Jasper [Thu, 19 Feb 2015 16:03:16 +0000 (16:03 +0000)]
clang-format: [js] Do not fall through for JS structural elements.

Patch by Martin Probst. Thank you.

llvm-svn: 229862

9 years agoDemote vectors to arrays. No functionality change.
Benjamin Kramer [Thu, 19 Feb 2015 15:26:17 +0000 (15:26 +0000)]
Demote vectors to arrays. No functionality change.

llvm-svn: 229861

9 years ago[ASan/Win] Thread sanitizer common interface through asan_win_dll_thunk.cc
Timur Iskhodzhanov [Thu, 19 Feb 2015 15:25:26 +0000 (15:25 +0000)]
[ASan/Win] Thread sanitizer common interface through asan_win_dll_thunk.cc

llvm-svn: 229860

9 years ago[x86] Delete still more piles of complex code now that we have a good
Chandler Carruth [Thu, 19 Feb 2015 15:21:57 +0000 (15:21 +0000)]
[x86] Delete still more piles of complex code now that we have a good
systematic lowering of v8i16.

This required a slight strategy shift to prefer unpack lowerings in more
places. While this isn't a cut-and-dry win in every case, it is in the
overwhelming majority. There are only a few places where the old
lowering would probably be a touch faster, and then only by a small
margin.

In some cases, this is yet another significant improvement.

llvm-svn: 229859

9 years ago[Sanitizers] Move the common sanitizer interface from sanitizer_internal_defs.h to...
Timur Iskhodzhanov [Thu, 19 Feb 2015 15:15:33 +0000 (15:15 +0000)]
[Sanitizers] Move the common sanitizer interface from sanitizer_internal_defs.h to a new sanitizer_interface_internal.h file

Reviewed at http://reviews.llvm.org/D7758

llvm-svn: 229858

9 years agoAdd -stack-info-frame command (MI)
Ilia K [Thu, 19 Feb 2015 15:14:17 +0000 (15:14 +0000)]
Add -stack-info-frame command (MI)

Summary:
Add -stack-info-frame command + test.

All tests pass on OS X.

Reviewers: emaste, clayborg, abidh

Reviewed By: abidh

Subscribers: lldb-commits, clayborg, emaste, abidh

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

llvm-svn: 229857

9 years ago[x86] Teach the unpack lowering how to lower with an initial unpack in
Chandler Carruth [Thu, 19 Feb 2015 15:06:13 +0000 (15:06 +0000)]
[x86] Teach the unpack lowering how to lower with an initial unpack in
addition to lowering to trees rooted in an unpack.

This saves shuffles and or registers in many various ways, lets us
handle another class of v4i32 shuffles pre SSE4.1 without domain
crosses, etc.

llvm-svn: 229856

9 years agoPruned some unneeded code and comments.
John Thompson [Thu, 19 Feb 2015 14:31:48 +0000 (14:31 +0000)]
Pruned some unneeded code and comments.

llvm-svn: 229855

9 years agoAdd missing comments to member variables
Tobias Grosser [Thu, 19 Feb 2015 14:28:36 +0000 (14:28 +0000)]
Add missing comments to member variables

Reported-by: Johannes Doerfert
llvm-svn: 229854

9 years ago[x86] Dramatically improve v8i16 shuffle lowering by not using its
Chandler Carruth [Thu, 19 Feb 2015 14:08:24 +0000 (14:08 +0000)]
[x86] Dramatically improve v8i16 shuffle lowering by not using its
terribly complex partial blend logic.

This code path was one of the more complex and bug prone when it first
went in and it hasn't faired much better. Ultimately, with the simpler
basis for unpack lowering and support bit-math blending, this is
completely obsolete. In the worst case without this we generate
different but equivalent instructions. However, in many cases we
generate much better code. This is especially true when blends or pshufb
is available.

This does expose one (minor) weakness of the unpack lowering that I'll
try to address.

In case you were wondering, this is actually a big part of what I've
been trying to pull off in the recent string of commits.

llvm-svn: 229853

9 years agoFIX PR 18432, default args, friends & late-parsed members.
Nathan Sidwell [Thu, 19 Feb 2015 14:03:22 +0000 (14:03 +0000)]
FIX PR 18432, default args, friends & late-parsed members.

Sema::MergeCXXFunctionDecl: propagate hasUnparsedDefaultArg to new decl.

Parser::HandleMemberFunctionDeclDelays: check hasUnparsedDefaultArg
flag.

Parser::ParseLexedMethodDeclaration: handle inherited unparsed default
arg case.

llvm-svn: 229852

9 years ago[x86] Remove the final fallback in the v8i16 lowering that isn't really
Chandler Carruth [Thu, 19 Feb 2015 13:56:49 +0000 (13:56 +0000)]
[x86] Remove the final fallback in the v8i16 lowering that isn't really
needed, and significantly improve the SSSE3 path.

This makes the new strategy much more clear. If we can blend, we just go
with that. If we can't blend, we try to permute into an unpack so
that we handle cases where the unpack doing the blend also simplifies
the shuffle. If that fails and we've got SSSE3, we now call into
factored-out pshufb lowering code so that we leverage the fact that
pshufb can set up a blend for us while shuffling. This generates great
code, especially because we *know* we don't have a fast blend at this
point. Finally, we fall back on decomposing into permutes and blends
because we do at least have a bit-math-based blend if we need to use
that.

This pretty significantly improves some of the v8i16 code paths. We
never need to form pshufb for the single-input shuffles because we have
effective target-specific combines to form it there, but we were missing
its effectiveness in the blends.

llvm-svn: 229851

9 years ago[analyzer] Different handling of alloca().
Anton Yartsev [Thu, 19 Feb 2015 13:36:20 +0000 (13:36 +0000)]
[analyzer] Different handling of alloca().

+ separate bug report for "Free alloca()" error to be able to customize checkers responsible for this error.
+ Muted "Free alloca()" error for NewDelete checker that is not responsible for c-allocated memory, turned on for unix.MismatchedDeallocator checker.
+ RefState for alloca() - to be able to detect usage of zero-allocated memory by upcoming ZeroAllocDereference checker.
+ AF_Alloca family to handle alloca() consistently - keep proper family in RefState, handle 'alloca' by getCheckIfTracked() facility, etc.
+ extra tests.

llvm-svn: 229850

9 years ago[x86] Simplify the pre-SSSE3 v16i8 lowering significantly by decomposing
Chandler Carruth [Thu, 19 Feb 2015 13:15:12 +0000 (13:15 +0000)]
[x86] Simplify the pre-SSSE3 v16i8 lowering significantly by decomposing
them into permutes and a blend with the generic decomposition logic.

This works really well in almost every case and lets the code only
manage the expansion of a single input into two v8i16 vectors to perform
the actual shuffle. The blend-based merging is often much nicer than the
pack based merging that this replaces. The only place where it isn't we
end up blending between two packs when we could do a single pack. To
handle that case, just teach the v2i64 lowering to handle these blends
by digging out the operands.

With this we're down to only really random permutations that cause an
explosion of instructions.

llvm-svn: 229849

9 years ago[Mach-O] Rename enum typename for consistency. NFC
Jean-Daniel Dupas [Thu, 19 Feb 2015 12:38:54 +0000 (12:38 +0000)]
[Mach-O] Rename enum typename for consistency. NFC

Typename shouldn't mix camel case and underscore.
Thanks to Rui for the remark.

llvm-svn: 229848

9 years ago[x86] Remove the insanely over-aggressive unpack lowering strategy for
Chandler Carruth [Thu, 19 Feb 2015 12:10:37 +0000 (12:10 +0000)]
[x86] Remove the insanely over-aggressive unpack lowering strategy for
v16i8 shuffles, and replace it with new facilities.

This uses precise patterns to match exact unpacks, and the new
generalized unpack lowering only when we detect a case where we will
have to shuffle both inputs anyways and they terminate in exactly
a blend.

This fixes all of the blend horrors that I uncovered by always lowering
blends through the vector shuffle lowering. It also removes *sooooo*
much of the crazy instruction sequences required for v16i8 lowering
previously. Much cleaner now.

The only "meh" aspect is that we sometimes use pshufb+pshufb+unpck when
it would be marginally nicer to use pshufb+pshufb+por. However, the
difference there is *tiny*. In many cases its a win because we re-use
the pshufb mask. In others, we get to avoid the pshufb entirely. I've
left a FIXME, but I'm dubious we can really do better than this. I'm
actually pretty happy with this lowering now.

For SSE2 this exposes some horrors that were really already there. Those
will have to fixed by changing a different path through the v16i8
lowering.

llvm-svn: 229846

9 years ago[mips][microMIPS] Make usage of AND16, OR16 and XOR16 by code generator
Jozef Kolek [Thu, 19 Feb 2015 11:51:32 +0000 (11:51 +0000)]
[mips][microMIPS] Make usage of AND16, OR16 and XOR16 by code generator

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

llvm-svn: 229845

9 years ago[x86] The SELECT x86 DAG combine also does legalization. It used to rely
Chandler Carruth [Thu, 19 Feb 2015 11:43:37 +0000 (11:43 +0000)]
[x86] The SELECT x86 DAG combine also does legalization. It used to rely
on things not being marked as either custom or legal, but we now do
custom lowering of more VSELECT nodes. To cope with this, manually
replicate the legality tests here. These have to stay in sync with the
set of tests used in the custom lowering of VSELECT.

Ideally, we wouldn't do any of this combine-based-legalization when we
have an actual custom legalization step for VSELECT, but I'm not going
to be able to rewrite all of that today.

I don't have a test case for this currently, but it was found when
compiling a number of the test-suite benchmarks. I'll try to reduce
a test case and add it.

This should at least fix the test-suite fallout on build bots.

llvm-svn: 229844

9 years agoSilence unused variable warnings in release builds
Pavel Labath [Thu, 19 Feb 2015 11:41:12 +0000 (11:41 +0000)]
Silence unused variable warnings in release builds

llvm-svn: 229843

9 years agoAdd few simple tests to check statepoint placement for invoke instructions.
Igor Laevsky [Thu, 19 Feb 2015 11:39:04 +0000 (11:39 +0000)]
Add few simple tests to check statepoint placement for invoke instructions.
Differential Revision: http://reviews.llvm.org/D7535

llvm-svn: 229842

9 years agoReverting r229831 due to multiple ARM/PPC/MIPS build-bot failures.
Michael Kuperstein [Thu, 19 Feb 2015 11:38:11 +0000 (11:38 +0000)]
Reverting r229831 due to multiple ARM/PPC/MIPS build-bot failures.

llvm-svn: 229841

9 years agoImplement invoke statepoint verification.
Igor Laevsky [Thu, 19 Feb 2015 11:28:47 +0000 (11:28 +0000)]
Implement invoke statepoint verification.
Differential Revision: http://reviews.llvm.org/D7366

llvm-svn: 229840

9 years agoSpelling correction.
Yaron Keren [Thu, 19 Feb 2015 11:21:11 +0000 (11:21 +0000)]
Spelling correction.

llvm-svn: 229839

9 years agoAdd invoke related functionality into StatepointSite classes.
Igor Laevsky [Thu, 19 Feb 2015 11:02:11 +0000 (11:02 +0000)]
Add invoke related functionality into StatepointSite classes.
Differential Revision: http://reviews.llvm.org/D7364

llvm-svn: 229838

9 years agoAVX-512: Full implementation for VRNDSCALESS/SD instructions and intrinsics.
Elena Demikhovsky [Thu, 19 Feb 2015 10:48:04 +0000 (10:48 +0000)]
AVX-512: Full implementation for VRNDSCALESS/SD instructions and intrinsics.

llvm-svn: 229837

9 years ago[x86] Add support for bit-wise blending and use it in the v8 and v16
Chandler Carruth [Thu, 19 Feb 2015 10:46:52 +0000 (10:46 +0000)]
[x86] Add support for bit-wise blending and use it in the v8 and v16
lowering paths. I'm going to be leveraging this to simplify a lot of the
overly complex lowering of v8 and v16 shuffles in pre-SSSE3 modes.

Sadly, this isn't profitable on v4i32 and v2i64. There, the float and
double blending instructions for pre-SSE4.1 are actually pretty good,
and we can't beat them with bit math. And once SSE4.1 comes around we
have direct blending support and this ceases to be relevant.

Also, some of the test cases look odd because the domain fixer
canonicalizes these to floating point domain. That's OK, it'll use the
integer domain when it matters and some day I may be able to update
enough of LLVM to canonicalize the other way.

This restores almost all of the regressions from teaching x86's vselect
lowering to always use vector shuffle lowering for blends. The remaining
problems are because the v16 lowering path is still doing crazy things.
I'll be re-arranging that strategy in more detail in subsequent commits
to finish recovering the performance here.

llvm-svn: 229836

9 years ago[x86,sdag] Two interrelated changes to the x86 and sdag code.
Chandler Carruth [Thu, 19 Feb 2015 10:36:19 +0000 (10:36 +0000)]
[x86,sdag] Two interrelated changes to the x86 and sdag code.

First, don't combine bit masking into vector shuffles (even ones the
target can handle) once operation legalization has taken place. Custom
legalization of vector shuffles may exist for these patterns (making the
predicate return true) but that custom legalization may in some cases
produce the exact bit math this matches. We only really want to handle
this prior to operation legalization.

However, the x86 backend, in a fit of awesome, relied on this. What it
would do is mark VSELECTs as expand, which would turn them into
arithmetic, which this would then match back into vector shuffles, which
we would then lower properly. Amazing.

Instead, the second change is to teach the x86 backend to directly form
vector shuffles from VSELECT nodes with constant conditions, and to mark
all of the vector types we support lowering blends as shuffles as custom
VSELECT lowering. We still mark the forms which actually support
variable blends as *legal* so that the custom lowering is bypassed, and
the legal lowering can even be used by the vector shuffle legalization
(yes, i know, this is confusing. but that's how the patterns are
written).

This makes the VSELECT lowering much more sensible, and in fact should
fix a bunch of bugs with it. However, as you'll see in the test cases,
right now what it does is point out the *hilarious* deficiency of the
new vector shuffle lowering when it comes to blends. Fortunately, my
very next patch fixes that. I can't submit it yet, because that patch,
somewhat obviously, forms the exact and/or pattern that the DAG combine
is matching here! Without this patch, teaching the vector shuffle
lowering to produce the right code infloops in the DAG combiner. With
this patch alone, we produce terrible code but at least lower through
the right paths. With both patches, all the regressions here should be
fixed, and a bunch of the improvements (like using 2 shufps with no
memory loads instead of 2 andps with memory loads and an orps) will
stay. Win!

There is one other change worth noting here. We had hilariously wrong
vectorization cost estimates for vselect because we fell through to the
code path that assumed all "expand" vector operations are scalarized.
However, the "expand" lowering of VSELECT is vector bit math, most
definitely not scalarized. So now we go back to the correct if horribly
naive cost of "1" for "not scalarized". If anyone wants to add actual
modeling of shuffle costs, that would be cool, but this seems an
improvement on its own. Note the removal of 16 and 32 "costs" for doing
a blend. Even in SSE2 we can blend in fewer than 16 instructions. ;] Of
course, we don't right now because of OMG bad code, but I'm going to fix
that. Next patch. I promise.

llvm-svn: 229835

9 years agoMake -fmodules-decluse and -fmodules-strict-decluse compatible options.
Daniel Jasper [Thu, 19 Feb 2015 09:56:13 +0000 (09:56 +0000)]
Make -fmodules-decluse and -fmodules-strict-decluse compatible options.

They don't actually influence the result of the module compilation.

llvm-svn: 229834

9 years ago[LSan][MIPS64] Enable LSan testing for mips64/mips64el
Mohit K. Bhakkad [Thu, 19 Feb 2015 09:14:43 +0000 (09:14 +0000)]
[LSan][MIPS64] Enable LSan testing for mips64/mips64el

Patch by Sagar Thakur

Reviewers: petarj, earthdok, kcc.

Subscribers:  samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits.

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

llvm-svn: 229833

9 years agotsan: fix PTRACE_ATTACH handling during stop-the-world
Dmitry Vyukov [Thu, 19 Feb 2015 09:02:29 +0000 (09:02 +0000)]
tsan: fix PTRACE_ATTACH handling during stop-the-world

If the thread receives a signal concurrently with PTRACE_ATTACH,
we can get notification about the signal before notification about stop.
In such case we need to forward the signal to the thread, otherwise
the signal will be missed (as we do PTRACE_DETACH with arg=0) and
any logic relying on signals will break. After forwarding we need to
continue to wait for stopping, because the thread is not stopped yet.
We do ignore delivery of SIGSTOP, because we want to make stop-the-world
as invisible as possible.

http://reviews.llvm.org/D7723

 --This line, and those below, will be ignored--
M    lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
M    test/tsan/signal_segv_handler.cc

llvm-svn: 229832

9 years agoUse std::bitset for SubtargetFeatures
Michael Kuperstein [Thu, 19 Feb 2015 09:01:04 +0000 (09:01 +0000)]
Use std::bitset for SubtargetFeatures

Previously, subtarget features were a bitfield with the underlying type being uint64_t.
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.

No functional change.

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

llvm-svn: 229831

9 years ago[LSan] [MIPS] adding support of LSan for mips64/mips64el arch
Mohit K. Bhakkad [Thu, 19 Feb 2015 07:30:39 +0000 (07:30 +0000)]
[LSan] [MIPS] adding support of LSan for mips64/mips64el arch

Patch by Sagar Thakur

Reviewers: petarj, earthdok, kcc.

Subscribers:  samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits.

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

llvm-svn: 229830

9 years agoMark DR1940 as implemented
David Majnemer [Thu, 19 Feb 2015 07:29:01 +0000 (07:29 +0000)]
Mark DR1940 as implemented

llvm-svn: 229829

9 years agoMark DR1947 as implemented
David Majnemer [Thu, 19 Feb 2015 07:28:57 +0000 (07:28 +0000)]
Mark DR1947 as implemented

llvm-svn: 229828

9 years agoMark DR1948 as implemented
David Majnemer [Thu, 19 Feb 2015 07:28:55 +0000 (07:28 +0000)]
Mark DR1948 as implemented

llvm-svn: 229827

9 years agoMark DR1994 as a duplicate of DR529
David Majnemer [Thu, 19 Feb 2015 07:28:52 +0000 (07:28 +0000)]
Mark DR1994 as a duplicate of DR529

llvm-svn: 229826

9 years agoMark DR1968 as implemented
David Majnemer [Thu, 19 Feb 2015 07:28:49 +0000 (07:28 +0000)]
Mark DR1968 as implemented

llvm-svn: 229825

9 years ago[Support/Timer] Make GetMallocUsage() aware of jemalloc.
Davide Italiano [Thu, 19 Feb 2015 07:27:14 +0000 (07:27 +0000)]
[Support/Timer] Make GetMallocUsage() aware of jemalloc.

Differential Revision: D7657
Reviewed by: shankarke, majnemer

llvm-svn: 229824

9 years agoCXXNameMangler::mangleUnresolvedPrefix(): Prune an obsolete \param, according to...
NAKAMURA Takumi [Thu, 19 Feb 2015 07:14:26 +0000 (07:14 +0000)]
CXXNameMangler::mangleUnresolvedPrefix(): Prune an obsolete \param, according to r229809. [-Wdocumentation]

llvm-svn: 229823

9 years agoItanium ABI: Don't pass nullptr to a bool argument
David Majnemer [Thu, 19 Feb 2015 05:51:14 +0000 (05:51 +0000)]
Itanium ABI: Don't pass nullptr to a bool argument

llvm-svn: 229822

9 years ago[Orc][Kaleidoscope] Fix typo in tutorial comment.
Lang Hames [Thu, 19 Feb 2015 05:33:30 +0000 (05:33 +0000)]
[Orc][Kaleidoscope] Fix typo in tutorial comment.

llvm-svn: 229821

9 years agoScopDetection: Only detect scops that have at least one read and one write
Tobias Grosser [Thu, 19 Feb 2015 05:31:07 +0000 (05:31 +0000)]
ScopDetection: Only detect scops that have at least one read and one write

Scops that only read seem generally uninteresting and scops that only write are
most likely initializations where there is also little to optimize.  To not
waste compile time we bail early.

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

llvm-svn: 229820

9 years agoProvide the same ABI regardless of NDEBUG
Dmitri Gribenko [Thu, 19 Feb 2015 05:30:16 +0000 (05:30 +0000)]
Provide the same ABI regardless of NDEBUG

For projects depending on LLVM, I find it very useful to combine a
release-no-asserts build of LLVM with a debug+asserts build of the dependent
project.  The motivation is that when developing a dependent project, you are
debugging that project itself, not LLVM.  In my usecase, a significant part of
the runtime is spent in LLVM optimization passes, so I would like to build LLVM
without assertions to get the best performance from this combination.

Currently, `lib/Support/Debug.cpp` changes the set of symbols it provides
depending on NDEBUG, while `include/llvm/Support/Debug.h` requires extra
symbols when NDEBUG is not defined.  Thus, it is not possible to enable
assertions in an external project that uses facilities of `Debug.h`.

This patch changes `Debug.cpp` and `Valgrind.cpp` to always define the symbols
that other code may depend on when #including LLVM headers without NDEBUG.

http://reviews.llvm.org/D7662

llvm-svn: 229819

9 years agoUpdate C++ implementation status page with recent changes w.r.t. to sized deallocation.
Larisse Voufo [Thu, 19 Feb 2015 04:34:13 +0000 (04:34 +0000)]
Update C++ implementation status page with recent changes w.r.t. to sized deallocation.

llvm-svn: 229818

9 years ago[MSVC] Improved lookup into dependent/non-dependent bases of dependent class
Alexey Bataev [Thu, 19 Feb 2015 04:28:23 +0000 (04:28 +0000)]
[MSVC] Improved lookup into dependent/non-dependent bases of dependent class
Patch improves lookup into dependendt bases of dependent class and adds lookup
into non-dependent bases.
Differential Revision: http://reviews.llvm.org/D7173

llvm-svn: 229817

9 years agoPECOFF: Fix base relocation for an absolute symbol.
Rui Ueyama [Thu, 19 Feb 2015 04:22:27 +0000 (04:22 +0000)]
PECOFF: Fix base relocation for an absolute symbol.

Previously we wrongly emitted a base relocation entry for an absolute symbol.
That made the loader to rewrite some instruction operands with wrong values
only when a DLL is not loaded at the default address. That caused a
misterious crash of some executable.

Absolute symbols will of course never change value wherever the binary is
loaded to memory. We shouldn't emit base relocations for absolute symbols.

llvm-svn: 229816

9 years agoRevert adding hostname to module hash
Ben Langmuir [Thu, 19 Feb 2015 04:03:57 +0000 (04:03 +0000)]
Revert adding hostname to module hash

I didn't realize how easily the hostname could change - for example just
changing wireless networks seems to prompt it in some cases.

Users can always set their own local module cache path to avoid this.

This reverts commits r228592, 228594, 228601 and 228613.
rdar://19287368

llvm-svn: 229815

9 years agoPECOFF: use llvm-readobj to dump .reloc section
Rui Ueyama [Thu, 19 Feb 2015 04:02:17 +0000 (04:02 +0000)]
PECOFF: use llvm-readobj to dump .reloc section

When this test was written, no llvm tool could print out contents
of base relocation section. Now llvm-readobj is able to dump it in
a text format. Use that tool to make this test readable.

llvm-svn: 229814

9 years agoInstrProf: Always emit a coverage region for the condition of an if
Justin Bogner [Thu, 19 Feb 2015 03:10:30 +0000 (03:10 +0000)]
InstrProf: Always emit a coverage region for the condition of an if

When tools like llvm-cov show regions, it's much easier to understand
what's happening if the condition of an if shows a counter as well as
the body.

llvm-svn: 229813

9 years agoFix a test case.
Larisse Voufo [Thu, 19 Feb 2015 03:03:23 +0000 (03:03 +0000)]
Fix a test case.

llvm-svn: 229812

9 years ago[Headers] Add tests for _mm256_insert_epi64 and fix its definition
Filipe Cabecinhas [Thu, 19 Feb 2015 03:02:33 +0000 (03:02 +0000)]
[Headers] Add tests for _mm256_insert_epi64 and fix its definition

Summary:
The definition for _mm256_insert_epi64 was taking an int, which would get
truncated before being inserted in the vector.

Original patch by Joshua Magee!

Reviewers: bruno, craig.topper

Subscribers: cfe-commits

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

llvm-svn: 229811

9 years agoMark more tuple tests as unsupported in C++98 && C++03
Eric Fiselier [Thu, 19 Feb 2015 02:44:09 +0000 (02:44 +0000)]
Mark more tuple tests as unsupported in C++98 && C++03

llvm-svn: 229810

9 years agoItanium ABI: Properly qualify the destructor-name
David Majnemer [Thu, 19 Feb 2015 02:16:16 +0000 (02:16 +0000)]
Itanium ABI: Properly qualify the destructor-name

We didn't have enough qualificaiton before the scope specifier and we
had too much qualification in the destructor name itself.

llvm-svn: 229809

9 years ago[libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.
Eric Fiselier [Thu, 19 Feb 2015 02:10:42 +0000 (02:10 +0000)]
[libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.

Summary: No declaration for the type `tuple` is given in c++03 or c++98 modes. Mark all tests that use the actual `tuple` type as UNSUPPORTED.

Reviewers: jroelofs, mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

llvm-svn: 229808

9 years ago[Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.
Lang Hames [Thu, 19 Feb 2015 01:32:43 +0000 (01:32 +0000)]
[Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.

The new JIT doesn't IRGen stubs until they're referenced.

llvm-svn: 229807

9 years ago[Orc] Fix a bug in the compile callback manager: trampoline ids need to be fixed
Lang Hames [Thu, 19 Feb 2015 01:31:25 +0000 (01:31 +0000)]
[Orc] Fix a bug in the compile callback manager: trampoline ids need to be fixed
up before returning them to the available pool.

llvm-svn: 229806

9 years agoRemove the local subtarget variable from the SystemZ asm printer
Eric Christopher [Thu, 19 Feb 2015 01:26:28 +0000 (01:26 +0000)]
Remove the local subtarget variable from the SystemZ asm printer
and update the two calls accordingly.

llvm-svn: 229805

9 years agoRemove a few more calls to TargetMachine::getSubtarget from the
Eric Christopher [Thu, 19 Feb 2015 01:10:55 +0000 (01:10 +0000)]
Remove a few more calls to TargetMachine::getSubtarget from the
R600 port.

llvm-svn: 229804