platform/upstream/llvm.git
8 years agoIfConversion: Improve doxygen comments
Matthias Braun [Wed, 17 Aug 2016 02:51:57 +0000 (02:51 +0000)]
IfConversion: Improve doxygen comments

llvm-svn: 278893

8 years ago[Inliner] Add a flag to disable manual alloca merging in the Inliner.
Chandler Carruth [Wed, 17 Aug 2016 02:40:23 +0000 (02:40 +0000)]
[Inliner] Add a flag to disable manual alloca merging in the Inliner.

This is off for now while testing can take place to make sure that in
fact we do sufficient stack coloring to fully obviate the manual alloca
array merging.

Some context on why we should be using stack coloring rather than
merging allocas in this way:

LLVM relies very heavily on analyzing pointers as coming from different
allocas in order to make aliasing decisions. These are some of the most
powerful aliasing signals available in LLVM. So merging allocas is an
extremely destructive operation on the LLVM IR -- it takes away highly
valuable and hard to reconstruct information.

As a consequence, inlined functions which happen to have array allocas
that this pattern matches will fail to be properly interleaved unless
SROA manages to hoist everything to an SSA register. Instead, the
inliner will have added an unnecessary dependence that one inlined
function execute after the other because they will have been rewritten
to refer to the same memory.

All that said, folks will reasonably want some time to experiment here
and make sure there are no significant regressions. A flag should give
us an easy knob to test.

For more context, see the thread here:
http://lists.llvm.org/pipermail/llvm-dev/2016-July/103277.html
http://lists.llvm.org/pipermail/llvm-dev/2016-August/103285.html

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

llvm-svn: 278892

8 years agoAdd missing close brace to fix Windows bots. Oops :(
Richard Smith [Wed, 17 Aug 2016 02:22:39 +0000 (02:22 +0000)]
Add missing close brace to fix Windows bots. Oops :(

llvm-svn: 278891

8 years agoSome missing usage of TargetParser. NFC.
Zijiao Ma [Wed, 17 Aug 2016 02:13:33 +0000 (02:13 +0000)]
Some missing usage of TargetParser. NFC.

llvm-svn: 278890

8 years ago[ELF] Set MAXPAGESIZE to 2MiB on x86-64 to match bfd and gold.
Michael J. Spencer [Wed, 17 Aug 2016 02:10:51 +0000 (02:10 +0000)]
[ELF] Set MAXPAGESIZE to 2MiB on x86-64 to match bfd and gold.

The FreeBSD kernel relies on this behavior to not overwrite the boot loader.

llvm-svn: 278889

8 years agoSome places that could using TargetParser in LLVM. NFC.
Zijiao Ma [Wed, 17 Aug 2016 02:08:28 +0000 (02:08 +0000)]
Some places that could using TargetParser in LLVM. NFC.

llvm-svn: 278888

8 years agoADT: Add some missing coverage for iplist::splice
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 02:08:08 +0000 (02:08 +0000)]
ADT: Add some missing coverage for iplist::splice

These splices are interesting because they involve swapping two nodes in
the same list.  There are two ways to do this.  Assuming:

    A -> B -> [Sentinel]

You can either:
- splice B before A, with:        L.splice(A,       L, B) or
- splice A before Sentinel, with: L.splice(L.end(), L, A) to create:

    B -> A -> [Sentinel]

These two swapping-splices are somewhat interesting corner cases for
maintaining the list invariants.  The tests pass even with my new ilist
implementation, but I had some doubts about the latter when I was
looking at weird UB effects.  Since I can't find equivalent explicit
test coverage elsewhere it seems prudent to commit.

llvm-svn: 278887

8 years agoScalar: Avoid dereferencing end() in IndVarSimplify
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 01:54:41 +0000 (01:54 +0000)]
Scalar: Avoid dereferencing end() in IndVarSimplify

IndVarSimplify::sinkUnusedInvariants calls
BasicBlock::getFirstInsertionPt on the ExitBlock and moves instructions
before it.  This can return end(), so it's not safe to dereference.  Add
an iterator-based overload to Instruction::moveBefore to avoid the UB.

llvm-svn: 278886

8 years ago[Docs] Fix post-review comments on MemorySSA's docs.
George Burgess IV [Wed, 17 Aug 2016 01:50:54 +0000 (01:50 +0000)]
[Docs] Fix post-review comments on MemorySSA's docs.

Thanks to Sean Silva for bringing these up. :)

llvm-svn: 278885

8 years agoIPO: Swap || operands to avoid dereferencing end()
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 01:23:58 +0000 (01:23 +0000)]
IPO: Swap || operands to avoid dereferencing end()

IsOperandBundleUse conveniently indicates  whether
std::next(F->arg_begin(),UseIndex) will get to (or past) end().  Check
it first to avoid dereferencing end().

llvm-svn: 278884

8 years agoScalar: Avoid dereferencing end() in InductiveRangeCheckElimination
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 01:16:17 +0000 (01:16 +0000)]
Scalar: Avoid dereferencing end() in InductiveRangeCheckElimination

BasicBlock::Create isn't designed to take iterators (which might be
end()), but pointers (which might be nullptr).  Fix the UB that was
converting end() to a BasicBlock* by calling BasicBlock::getNextNode()
in the first place.

llvm-svn: 278883

8 years agoIf possible, set the stack rlimit to at least 8MiB on cc1 startup, and work
Richard Smith [Wed, 17 Aug 2016 01:05:07 +0000 (01:05 +0000)]
If possible, set the stack rlimit to at least 8MiB on cc1 startup, and work
around a Linux kernel bug where the actual amount of available stack may be a
*lot* lower than the rlimit.

GCC also sets a higher stack rlimit on startup, but it goes all the way to
64MiB. We can increase this limit if it proves necessary.

The kernel bug is as follows: Linux kernels prior to version 4.1 may choose to
map the process's heap as little as 128MiB before the process's stack for a PIE
binary, even in a 64-bit virtual address space. This means that allocating more
than 128MiB before you reach the process's stack high water mark can lead to
crashes, even if you don't recurse particularly deeply.

We work around the kernel bug by touching a page deep within the stack (after
ensuring that we know how big it is), to preallocate virtual address space for
the stack so that the kernel doesn't allow the brk() area to wander into it,
when building clang as a Linux PIE binary.

llvm-svn: 278882

8 years agoObjCARC: Don't increment or dereference end() when scanning args
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 01:02:18 +0000 (01:02 +0000)]
ObjCARC: Don't increment or dereference end() when scanning args

When there's only one argument and it doesn't match one of the known
functions, return ARCInstKind::CallOrUser rather than falling through
to the two argument case.  The old behaviour both incremented past and
dereferenced end().

llvm-svn: 278881

8 years agoARM: Avoid dereferencing end() in ARMFrameLowering::emitPrologue
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 00:53:04 +0000 (00:53 +0000)]
ARM: Avoid dereferencing end() in ARMFrameLowering::emitPrologue

llvm::tryFoldSPUpdateIntoPushPop assumes its arguments are valid
MachineInstrs.  Update ARMFrameLowering::emitPrologue to respect that;
when LastPush==end(), it can't possibly be a push instruction anyway.

llvm-svn: 278880

8 years agoCodeGen: Avoid dereferencing end() in OptimizePHIs::OptimizeBB
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 00:43:59 +0000 (00:43 +0000)]
CodeGen: Avoid dereferencing end() in OptimizePHIs::OptimizeBB

llvm-svn: 278879

8 years agoHexagon: Avoid dereferencing end() in HexagonInstrInfo::InsertBranch
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 00:34:00 +0000 (00:34 +0000)]
Hexagon: Avoid dereferencing end() in HexagonInstrInfo::InsertBranch

llvm-svn: 278878

8 years ago[Docs] Add initial MemorySSA documentation.
George Burgess IV [Wed, 17 Aug 2016 00:17:29 +0000 (00:17 +0000)]
[Docs] Add initial MemorySSA documentation.

Patch partially by Danny.

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

llvm-svn: 278875

8 years agoAMDGPU: Avoid looking for the DebugLoc in end()
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 00:06:43 +0000 (00:06 +0000)]
AMDGPU: Avoid looking for the DebugLoc in end()

The end() iterator isn't a safe thing to dereference.  Pass the DebugLoc
into EmitFetchClause and EmitALUClause to avoid it.

llvm-svn: 278873

8 years agoSimplifyCFG: Avoid dereferencing end()
Duncan P. N. Exon Smith [Tue, 16 Aug 2016 23:57:56 +0000 (23:57 +0000)]
SimplifyCFG: Avoid dereferencing end()

When comparing a User* to a BasicBlock::iterator in
passingValueIsAlwaysUndefined, don't dereference the iterator in case it
is end().

llvm-svn: 278872

8 years agoRevert "Write the TPI stream from a PDB to Yaml."
Justin Bogner [Tue, 16 Aug 2016 23:37:10 +0000 (23:37 +0000)]
Revert "Write the TPI stream from a PDB to Yaml."

This is hitting a "use of undeclared identifier 'skipPadding' error
locally and on some bots.

This reverts r278869.

llvm-svn: 278871

8 years agoCodeGen: Avoid dereferencing end() when unconstifying iterators
Duncan P. N. Exon Smith [Tue, 16 Aug 2016 23:34:07 +0000 (23:34 +0000)]
CodeGen: Avoid dereferencing end() when unconstifying iterators

Rather than doing a funny dance that relies on dereferencing end() not
crashing, add some API to MachineInstrBundleIterator to get a non-const
version of the iterator.

llvm-svn: 278870

8 years agoWrite the TPI stream from a PDB to Yaml.
Zachary Turner [Tue, 16 Aug 2016 23:28:54 +0000 (23:28 +0000)]
Write the TPI stream from a PDB to Yaml.

Reviewed By: ruiu, rnk
Differential Revision: https://reviews.llvm.org/D23226

llvm-svn: 278869

8 years agoIntroduce LLVM_FALLTHROUGH, which expands to the C++17 attribute.
Justin Bogner [Tue, 16 Aug 2016 23:24:13 +0000 (23:24 +0000)]
Introduce LLVM_FALLTHROUGH, which expands to the C++17 attribute.

This allows you to annotate switch case fallthrough in a better way
than a "// FALLTHROUGH" comment. Eventually it would be nice to turn
on -Wimplicit-fallthrough, if we can get the code base clean.

llvm-svn: 278868

8 years ago[InstCombine] add tests for fold with no coverage and missing vector fold
Sanjay Patel [Tue, 16 Aug 2016 23:18:42 +0000 (23:18 +0000)]
[InstCombine] add tests for fold with no coverage and missing vector fold

llvm-svn: 278867

8 years agoCodegen: Don't tail-duplicate blocks with un-analyzable fallthrough.
Kyle Butt [Tue, 16 Aug 2016 22:56:14 +0000 (22:56 +0000)]
Codegen: Don't tail-duplicate blocks with un-analyzable fallthrough.

If AnalyzeBranch can't analyze a block and it is possible to
fallthrough, then duplicating the block doesn't make sense, as only one
block can be the layout predecessor for the un-analyzable fallthrough.

Submitted wit a test case, but NOTE: the test case doesn't currently
fail. However, the test case fails with D20505 and would have saved me
some time debugging.

llvm-svn: 278866

8 years ago[InstCombine] clean up foldICmpAddConstant(); NFCI
Sanjay Patel [Tue, 16 Aug 2016 22:34:42 +0000 (22:34 +0000)]
[InstCombine] clean up foldICmpAddConstant(); NFCI

1. Fix variable names
2. Add local variables to reduce code
3. Fix code comments
4. Add early exit to reduce indentation
5. Remove 'else' after if -> return
6. Hoist common predicate

llvm-svn: 278864

8 years ago[AMDGPU] Remove duplicate initialization of SIDebuggerInsertNops pass
Konstantin Zhuravlyov [Tue, 16 Aug 2016 22:30:11 +0000 (22:30 +0000)]
[AMDGPU] Remove duplicate initialization of SIDebuggerInsertNops pass

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

llvm-svn: 278863

8 years ago[CMake] Workflow improvements to PGO generation
Chris Bieneman [Tue, 16 Aug 2016 22:16:29 +0000 (22:16 +0000)]
[CMake] Workflow improvements to PGO generation

This patch adds a few new convenience options used by the PGO CMake cache to setup options on bootstrap stages. The new options are:

PGO_INSTRUMENT_LTO - Builds the instrumented and final builds with LTO
PGO_BUILD_CONFIGURATION - Accepts a CMake cache script that can be used for complex configuration of the stage2-instrumented and stage2 builds.

The patch also includes a fix for bootstrap dependencies so that the instrumented LTO tools don't get used when building the final stage, and it adds distribution targets to the passthrough.

llvm-svn: 278862

8 years agoEmit debug info for dynamic classes if they are imported from a DLL.
Adrian McCarthy [Tue, 16 Aug 2016 22:11:18 +0000 (22:11 +0000)]
Emit debug info for dynamic classes if they are imported from a DLL.

With -debug-info-kind=limited, we omit debug info for dynamic classes that live in other TUs. This reduces duplicate type information. When statically linked, the type information comes together. But if your binary has a class derived from a base in a DLL, the base class info is not available to the debugger.

The decision is made in shouldOmitDefinition (CGDebugInfo.cpp). Per a suggestion from rnk, I've tweaked the decision so that we do include definitions for classes marked as DLL imports. This should be a relatively small number of classes, so we don't pay a large price for duplication of the type info, yet it should cover most cases on Windows.

Essentially this makes debug info for DLLs independent, but we still assume that all TUs within the same DLL will be consistently built with (or without) debug info and the debugger will be able to search across the debug info within that scope to resolve any declarations into definitions, etc.

llvm-svn: 278861

8 years agoPreserve the assumption cache more often
David Majnemer [Tue, 16 Aug 2016 22:07:32 +0000 (22:07 +0000)]
Preserve the assumption cache more often

We were clearing it out in LoopUnswitch and InlineFunction instead of
attempting to preserve it.

llvm-svn: 278860

8 years ago[InstCombine] use m_APInt to allow icmp (sub X, Y), C folds for splat constant vectors
Sanjay Patel [Tue, 16 Aug 2016 21:53:19 +0000 (21:53 +0000)]
[InstCombine] use m_APInt to allow icmp (sub X, Y), C folds for splat constant vectors

llvm-svn: 278859

8 years agoCodeGen: Don't dereference end() in MachineBasicBlock::CorrectExtraCFGEdges
Duncan P. N. Exon Smith [Tue, 16 Aug 2016 21:46:03 +0000 (21:46 +0000)]
CodeGen: Don't dereference end() in MachineBasicBlock::CorrectExtraCFGEdges

The current MachineBasicBlock might be the last block, so FallThru may
be past the end().  Use getNextNode(), which will convert to nullptr,
rather than &*++, which is invalid if we reach the end().

llvm-svn: 278858

8 years ago[x86] Allow merging multiple instances of an immediate within a basic block for code...
Sanjay Patel [Tue, 16 Aug 2016 21:35:16 +0000 (21:35 +0000)]
[x86] Allow merging multiple instances of an immediate within a basic block for code size savings, for 64-bit constants.

This patch handles 64-bit constants which can be encoded as 32-bit immediates.

It extends the functionality added by https://reviews.llvm.org/D11363 for 32-bit constants to 64-bit constants.

Patch by Sunita Marathe!

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

llvm-svn: 278857

8 years ago[libFuzzer] minor speed improvement
Kostya Serebryany [Tue, 16 Aug 2016 21:28:05 +0000 (21:28 +0000)]
[libFuzzer] minor speed improvement

llvm-svn: 278856

8 years ago[InstCombine] fix variable names to match formula comments; NFC
Sanjay Patel [Tue, 16 Aug 2016 21:26:10 +0000 (21:26 +0000)]
[InstCombine] fix variable names to match formula comments; NFC

llvm-svn: 278855

8 years ago[LoopUnroll] Don't clear out the AssumptionCache on each loop
David Majnemer [Tue, 16 Aug 2016 21:09:46 +0000 (21:09 +0000)]
[LoopUnroll] Don't clear out the AssumptionCache on each loop

Clearing out the AssumptionCache can cause us to rescan the entire
function for assumes.  If there are many loops, then we are scanning
over the entire function many times.

Instead of clearing out the AssumptionCache, register all cloned
assumes.

llvm-svn: 278854

8 years agoRevert "Enhance SCEV to compute the trip count for some loops with unknown stride."
Reid Kleckner [Tue, 16 Aug 2016 21:02:04 +0000 (21:02 +0000)]
Revert "Enhance SCEV to compute the trip count for some loops with unknown stride."

This reverts commit r278731. It caused http://crbug.com/638314

llvm-svn: 278853

8 years agoRevert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
Francis Ricci [Tue, 16 Aug 2016 20:52:22 +0000 (20:52 +0000)]
Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"

This reverts commit dbb6e905684e2e9488887b26c02ee8881849f09f.

llvm-svn: 278852

8 years ago[OpenCL] AMDGPU: Add extensions cl_amd_media_ops and cl_amd_media_ops2
Yaxun Liu [Tue, 16 Aug 2016 20:49:49 +0000 (20:49 +0000)]
[OpenCL] AMDGPU: Add extensions cl_amd_media_ops and cl_amd_media_ops2

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

llvm-svn: 278851

8 years ago[CMake] Fixing typo in Info.plist generation
Chris Bieneman [Tue, 16 Aug 2016 20:49:49 +0000 (20:49 +0000)]
[CMake] Fixing typo in Info.plist generation

This is causing an error in the generation of the clang info plist.

llvm-svn: 278850

8 years ago[CMake] [Apple Cache] Set CLANG_VENDOR_UTI for Apple builds
Chris Bieneman [Tue, 16 Aug 2016 20:44:58 +0000 (20:44 +0000)]
[CMake] [Apple Cache] Set CLANG_VENDOR_UTI for Apple builds

This is just a minor update to the Apple packaging configuration.

llvm-svn: 278849

8 years ago[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Francis Ricci [Tue, 16 Aug 2016 20:39:10 +0000 (20:39 +0000)]
[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration

Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

Reviewers: samsonov, beanz, pcc, rnk

Subscribers: llvm-commits, kubabrecka, compnerd, dberris

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

llvm-svn: 278848

8 years agoTailDuplicator: Use range loops
Matt Arsenault [Tue, 16 Aug 2016 20:38:05 +0000 (20:38 +0000)]
TailDuplicator: Use range loops

llvm-svn: 278847

8 years ago[AArch64] Adjust the scheduling model for Exynos M1.
Evandro Menezes [Tue, 16 Aug 2016 20:35:01 +0000 (20:35 +0000)]
[AArch64] Adjust the scheduling model for Exynos M1.

Refine the model for the FP division unit.

llvm-svn: 278846

8 years ago[AArch64] Adjust the scheduling model for Exynos M1.
Evandro Menezes [Tue, 16 Aug 2016 20:34:58 +0000 (20:34 +0000)]
[AArch64] Adjust the scheduling model for Exynos M1.

Refine the model for the integer division unit.

llvm-svn: 278845

8 years agoAMDGPU: Remove excessive padding from ImmOp and RegOp.
Matt Arsenault [Tue, 16 Aug 2016 20:28:06 +0000 (20:28 +0000)]
AMDGPU: Remove excessive padding from ImmOp and RegOp.

The structs ImmOp and RegOp are in AArch64AsmParser.cpp (inside
anonymous namespace).
This diff changes the order of fields and removes the excessive padding
(8 bytes).

Patch by Alexander Shaposhnikov

llvm-svn: 278844

8 years agoFix an instance of -Wmicrosoft-enum-value by making the enum unsigned
Reid Kleckner [Tue, 16 Aug 2016 20:22:49 +0000 (20:22 +0000)]
Fix an instance of -Wmicrosoft-enum-value by making the enum unsigned

llvm-svn: 278843

8 years agoTry to work around an MSVC 2013 bug around defaulted default ctors
Reid Kleckner [Tue, 16 Aug 2016 20:20:56 +0000 (20:20 +0000)]
Try to work around an MSVC 2013 bug around defaulted default ctors

An UnresolvedSetIterator() is supposed to be zeroed out, but MSVC 2013
does not do that.

llvm-svn: 278842

8 years ago[BranchFolding] Change a test case of r278575.
Haicheng Wu [Tue, 16 Aug 2016 20:06:25 +0000 (20:06 +0000)]
[BranchFolding] Change a test case of r278575.

Rename the operands to make the test less brittle.

llvm-svn: 278841

8 years ago[MBP] do not reorder and move up loop latch block
Sjoerd Meijer [Tue, 16 Aug 2016 19:50:33 +0000 (19:50 +0000)]
[MBP] do not reorder and move up loop latch block

Do not reorder and move up a loop latch block before a loop header
when optimising for size because this will generate an extra
unconditional branch.

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

llvm-svn: 278840

8 years ago[libFuzzer] new experimental feature: value profiling. Profiles values that affect...
Kostya Serebryany [Tue, 16 Aug 2016 19:33:51 +0000 (19:33 +0000)]
[libFuzzer] new experimental feature: value profiling. Profiles values that affect control flow and treats new values as new coverage.

llvm-svn: 278839

8 years agoRemove excessive padding from LineNoCacheTy
Benjamin Kramer [Tue, 16 Aug 2016 19:20:10 +0000 (19:20 +0000)]
Remove excessive padding from LineNoCacheTy

The struct LineNoCacheTy is in SourceMgr.cpp inside anonymous namespace.
This diff changes the order of fields and removes the excessive padding
(8 bytes).

Patch by Alexander Shaposhnikov!

Differential revision: https://reviews.llvm.org/D23546

llvm-svn: 278838

8 years agoMake MDNode::intersect faster than O(n * m)
David Majnemer [Tue, 16 Aug 2016 18:48:37 +0000 (18:48 +0000)]
Make MDNode::intersect faster than O(n * m)

It is pretty easy to get it down to O(nlogn + mlogm).  This
implementation has the added benefit of automatically deduplicating
entries between the two sets.

llvm-svn: 278837

8 years agoDon't passively concatenate MDNodes
David Majnemer [Tue, 16 Aug 2016 18:48:34 +0000 (18:48 +0000)]
Don't passively concatenate MDNodes

I have audited all the callers of concatenate and none require duplicate
entries to service concatenation.
These duplicates serve no purpose but to needlessly embiggen the IR.

N.B. Layering getMostGenericAliasScope on top of concatenate makes it
O(nlogn + mlogm) instead of O(n*m).

llvm-svn: 278836

8 years agosanitizer_common: Fix warning
Matthias Braun [Tue, 16 Aug 2016 18:28:55 +0000 (18:28 +0000)]
sanitizer_common: Fix warning

Clang added warning that taking the address of a packed struct member
possibly yields an unaligned pointer. This case is benign because
the pointer gets casted to an uptr and not used for unaligned accesses.
Add an intermediate cast to char* until this warning is improved (see
also https://reviews.llvm.org/D20561)

llvm-svn: 278835

8 years ago[Driver] Remove break after return. NFCI.
Davide Italiano [Tue, 16 Aug 2016 18:23:44 +0000 (18:23 +0000)]
[Driver] Remove break after return. NFCI.

llvm-svn: 278834

8 years ago[StreamExecutor] Rename StreamExecutor to Executor
Jason Henline [Tue, 16 Aug 2016 18:18:32 +0000 (18:18 +0000)]
[StreamExecutor] Rename StreamExecutor to Executor

Summary: No functional changes just renaming this class for better readability.

Reviewers: jlebar

Subscribers: jprice, parallel_libs-commits

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

llvm-svn: 278833

8 years ago[Hexagon] Standardize next batch of pseudo instructions
Krzysztof Parzyszek [Tue, 16 Aug 2016 18:08:40 +0000 (18:08 +0000)]
[Hexagon] Standardize next batch of pseudo instructions

ALIGNA          PS_aligna
ALLOCA          PS_alloca
TFR_FI          PS_fi
TFR_FIA         PS_fia
TFR_PdFalse     PS_false
TFR_PdTrue      PS_true
VMULW           PS_vmulw
VMULW_ACC       PS_vmulw_acc

llvm-svn: 278832

8 years ago[Coroutines] Part 7: Split coroutine into subfunctions
Gor Nishanov [Tue, 16 Aug 2016 18:04:14 +0000 (18:04 +0000)]
[Coroutines] Part 7: Split coroutine into subfunctions

Summary:
This patch adds simple coroutine splitting logic to CoroSplit pass.

Documentation and overview is here: http://llvm.org/docs/Coroutines.html.

Upstreaming sequence (rough plan)
1.Add documentation. (https://reviews.llvm.org/D22603)
2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
...
7. Split coroutine into subfunctions <= we are here
8. Coroutine Frame Building algorithm
9. Handle coroutine with unwinds
10+. The rest of the logic

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 278830

8 years ago[StreamExecutor] Add basic Stream operations
Jason Henline [Tue, 16 Aug 2016 17:58:31 +0000 (17:58 +0000)]
[StreamExecutor] Add basic Stream operations

Summary: Add the Stream class and a few of the operations it supports.

Reviewers: jlebar, tra

Subscribers: jprice, parallel_libs-commits

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

llvm-svn: 278829

8 years ago[InstCombine] add helper functions for foldICmpWithConstant; NFCI
Sanjay Patel [Tue, 16 Aug 2016 17:54:36 +0000 (17:54 +0000)]
[InstCombine] add helper functions for foldICmpWithConstant; NFCI

Besides breaking up a 700 line function to improve readability,
this sinks the 'FIXME: ConstantInt' check into each helper. So
now we can independently break that restriction within any of the
helper functions.

As much as possible, the code was only {cut/paste/clang-format}'ed
to minimize risk (no functional changes intended), so several more
readability improvements are still possible.

llvm-svn: 278828

8 years ago[ObjC] Warn on unguarded use of partial declaration
Erik Pilkington [Tue, 16 Aug 2016 17:44:11 +0000 (17:44 +0000)]
[ObjC] Warn on unguarded use of partial declaration

This commit adds a traversal of the AST after Sema of a function that diagnoses
unguarded references to declarations that are partially available (based on
availability attributes). This traversal is only done when we would otherwise
emit -Wpartial-availability.

This commit is part of a feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

Differential revision: https://reviews.llvm.org/D23003

llvm-svn: 278826

8 years ago[libFuzzer] refactoring around PCMap, NFC
Kostya Serebryany [Tue, 16 Aug 2016 17:37:13 +0000 (17:37 +0000)]
[libFuzzer] refactoring around PCMap, NFC

llvm-svn: 278825

8 years ago[mips] Enforce compact branch restrictions
Simon Dardis [Tue, 16 Aug 2016 17:16:11 +0000 (17:16 +0000)]
[mips] Enforce compact branch restrictions

Check both operands for use of the $zero register which cannot be used with
a compact branch instruction.

Reviewers: dsanders, vkalintris

Differential Review: https://reviews.llvm.org/D23547

llvm-svn: 278824

8 years ago[Hexagon] Clean up some miscellaneous V60 intrinsics a bit
Krzysztof Parzyszek [Tue, 16 Aug 2016 17:14:44 +0000 (17:14 +0000)]
[Hexagon] Clean up some miscellaneous V60 intrinsics a bit

llvm-svn: 278823

8 years agoWhen the inline spiller rematerializes an instruction, take the debug location from...
Wolfgang Pieb [Tue, 16 Aug 2016 17:12:50 +0000 (17:12 +0000)]
When the inline spiller rematerializes an instruction, take the debug location from the instruction
that immediately follows the rematerialization point.

Patch by Andrea DiBiagio.

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

llvm-svn: 278822

8 years agoRemove a stale comment from the test, NFC.
Wei Mi [Tue, 16 Aug 2016 16:57:15 +0000 (16:57 +0000)]
Remove a stale comment from the test, NFC.

llvm-svn: 278821

8 years agoMove the Decorator, ThreadNameWithParenthesis, and DescribeThread to asan_description...
Filipe Cabecinhas [Tue, 16 Aug 2016 16:38:46 +0000 (16:38 +0000)]
Move the Decorator, ThreadNameWithParenthesis, and DescribeThread to asan_descriptions.{h,cc}

Summary:
Replacement for part of D23518
Code refactoring to allow us to move some more DescribeAddressIf* functions to work by getting the structured information, and then printing it.

Reviewers: kcc, samsonov

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 278820

8 years agoELF: ignored option -G may be joined with its argument
Ed Maste [Tue, 16 Aug 2016 16:26:46 +0000 (16:26 +0000)]
ELF: ignored option -G may be joined with its argument

llvm-svn: 278819

8 years ago[Asan] Unpoison red zones even if use-after-scope was disabled with runtime flag
Vitaly Buka [Tue, 16 Aug 2016 16:24:10 +0000 (16:24 +0000)]
[Asan] Unpoison red zones even if use-after-scope was disabled with runtime flag

Summary: PR27453

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 278818

8 years ago[InstCombine] use m_APInt in foldICmpWithConstant; NFCI
Sanjay Patel [Tue, 16 Aug 2016 16:08:11 +0000 (16:08 +0000)]
[InstCombine] use m_APInt in foldICmpWithConstant; NFCI

There's some formatting and pointer deref ugliness here that I intend to fix in
subsequent patches. The overall goal is to refactor the obnoxiously long switch
and incrementally remove the restriction to scalar types (allow folds for vector
splats). This patch introduces the use of m_APInt which means the RHSV reference
is now a pointer (and may have matched a vector splat), but the check of 'RHS'
remains, so vector folds are disallowed and no functional change is intended.

llvm-svn: 278816

8 years agoRemove most instances of REQUIRES: shell from the tools/extra tests
Reid Kleckner [Tue, 16 Aug 2016 16:07:46 +0000 (16:07 +0000)]
Remove most instances of REQUIRES: shell from the tools/extra tests

None of these tests actually require bash, they just have quoting bugs
when paths contain backslashes and colons. Fix them with the "%/T" lit
substitution variants.

llvm-svn: 278815

8 years agoRevert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms"
Reid Kleckner [Tue, 16 Aug 2016 16:04:14 +0000 (16:04 +0000)]
Revert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms"

This reverts commit r278783.  It breaks usage of _xgetbv on Windows.

llvm-svn: 278814

8 years ago[Hexagon] Standardize vector predicate load/store pseudo instructions
Krzysztof Parzyszek [Tue, 16 Aug 2016 15:43:54 +0000 (15:43 +0000)]
[Hexagon] Standardize vector predicate load/store pseudo instructions

- Remove unused instructions: LDriq_pred_vec_V6, STriq_pred_vec_V6, and
  the 128B counterparts.
- Rename:
    LDriq_pred_V6         PS_vloadrq_ai
    LDriq_pred_V6_128B    PS_vloadrq_ai_128B
    STriq_pred_V6         PS_vstorerq_ai
    STriq_pred_V6_128B    PS_vstorerq_ai_128B

llvm-svn: 278813

8 years agoReduce the number of allocations required for AST attributes. In test cases, the...
Aaron Ballman [Tue, 16 Aug 2016 14:48:39 +0000 (14:48 +0000)]
Reduce the number of allocations required for AST attributes. In test cases, the max resident memory changed from 65760k to 64476k which is 1.9% improvement. Allocations in grow_pod changed from 8847 to 4872 according to tcmalloc heap profiler. Overall running time remained the same.

Patch by Eugene Kosov

llvm-svn: 278812

8 years agoReorder stderr redirection in test command.
Samuel Antao [Tue, 16 Aug 2016 14:38:39 +0000 (14:38 +0000)]
Reorder stderr redirection in test command.

llvm-svn: 278811

8 years ago[AArch64][GlobalISel] Select G_MUL.
Ahmed Bougacha [Tue, 16 Aug 2016 14:37:46 +0000 (14:37 +0000)]
[AArch64][GlobalISel] Select G_MUL.

llvm-svn: 278810

8 years ago[GlobalISel] Fix G_MUL comment. NFC.
Ahmed Bougacha [Tue, 16 Aug 2016 14:37:43 +0000 (14:37 +0000)]
[GlobalISel] Fix G_MUL comment. NFC.

llvm-svn: 278809

8 years ago[AArch64][GlobalISel] Factor out unsupported binop check. NFC.
Ahmed Bougacha [Tue, 16 Aug 2016 14:37:40 +0000 (14:37 +0000)]
[AArch64][GlobalISel] Factor out unsupported binop check. NFC.

We're going to need it for G_MUL, and, if other targets end up using
something similar, we can easily put it in the generic selector.

llvm-svn: 278808

8 years ago[ADCE] Modify data structures to support removing control flow
David Callahan [Tue, 16 Aug 2016 14:31:51 +0000 (14:31 +0000)]
[ADCE] Modify data structures to support removing control flow

Summary:
This is part of a serious of patches to evolve ADCE.cpp to support
removing of unnecessary control flow.

This patch changes the data structures to hold liveness information to
support the additional information we will eventually need. In
particular we now have a notion of basic blocks being live because
they contain a live operations. This will eventually feed into control
dependence analysis of which branches are live. We cater to getting
from instructions to associated block information and from blocks to
information about their terminators.

This patch also changes the structure of the main loop of the
algorithm so that it alternates propagating liveness between
instructions and usign control dependence information to mark branches
live.

We force all terminators live for now until we add code to handlinge
removing control flow in a later patch.

No changes to effective behavior with this patch

Previous patches:

D23065 [ADCE] Refactor anticipating new functionality (NFC)
D23102 [ADCE] Refactoring for new functionality (NFC)

Reviewers: nadav, majnemer, mehdi_amini

Subscribers: freik, twoh, llvm-commits

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

llvm-svn: 278807

8 years agoAdd empty --gcc-toolchain empty to cuda-detect test.
Samuel Antao [Tue, 16 Aug 2016 14:31:39 +0000 (14:31 +0000)]
Add empty --gcc-toolchain empty to cuda-detect test.

Unless we overload the default gcc toolchain with an empty string
the system root used in the tests will be ignored if the user builds
clang  with a custom gcc toolchain.

llvm-svn: 278806

8 years ago[Pipeliner] Fix an asssert due to invalid Phi in the epilog
Brendon Cahoon [Tue, 16 Aug 2016 14:29:24 +0000 (14:29 +0000)]
[Pipeliner] Fix an asssert due to invalid Phi in the epilog

The pipeliner was generating an invalid Phi name for an operand
in the epilog block, which caused an assert in the live variable
analysis pass. The fix is to the code that generates new Phis
in the epilog block. In this case, there is an existing Phi that
needs to be reused rather than creating a new Phi instruction.

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

llvm-svn: 278805

8 years ago[AArch64][GlobalISel] Select (variable) shifts.
Ahmed Bougacha [Tue, 16 Aug 2016 14:02:47 +0000 (14:02 +0000)]
[AArch64][GlobalISel] Select (variable) shifts.

For now, no support for immediates.

llvm-svn: 278804

8 years ago[AArch64][GlobalISel] Robustize select tests. NFC.
Ahmed Bougacha [Tue, 16 Aug 2016 14:02:44 +0000 (14:02 +0000)]
[AArch64][GlobalISel] Robustize select tests. NFC.

Using the same register means nothing was checking for operand order.

llvm-svn: 278803

8 years ago[AArch64][GlobalISel] Select p0 G_FRAME_INDEX.
Ahmed Bougacha [Tue, 16 Aug 2016 14:02:42 +0000 (14:02 +0000)]
[AArch64][GlobalISel] Select p0 G_FRAME_INDEX.

And mark it as legal.

llvm-svn: 278802

8 years ago[GlobalISel] Mention pointers in LowLevelType.h. NFC.
Ahmed Bougacha [Tue, 16 Aug 2016 14:02:36 +0000 (14:02 +0000)]
[GlobalISel] Mention pointers in LowLevelType.h. NFC.

llvm-svn: 278801

8 years agoRevert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
Francis Ricci [Tue, 16 Aug 2016 13:58:56 +0000 (13:58 +0000)]
Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"

This reverts commit cd5fa595648378f38cdad8b07e18433639c28a9c.

llvm-svn: 278800

8 years ago[x86] Refactor a PowerPC specific ctlz/srl transformation (NFC).
Pierre Gousseau [Tue, 16 Aug 2016 13:53:53 +0000 (13:53 +0000)]
[x86] Refactor a PowerPC specific ctlz/srl transformation (NFC).

Following the discussion on D22038, this refactors a PowerPC specific setcc -> srl(ctlz) transformation so it can be used by other targets.

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

llvm-svn: 278799

8 years ago[X86][AVX] Fixed typo in zero element insertion
Simon Pilgrim [Tue, 16 Aug 2016 13:33:33 +0000 (13:33 +0000)]
[X86][AVX] Fixed typo in zero element insertion

llvm-svn: 278798

8 years ago[ELF] - Do not exit if -v is specified.
George Rimar [Tue, 16 Aug 2016 13:25:53 +0000 (13:25 +0000)]
[ELF] - Do not exit if -v is specified.

Previously lld showed version number and returned,
that is different from ld and PR28999.

Patch fixed that.

llvm-svn: 278797

8 years ago[Hexagon] Improve test to check for @PCREL, only run llc, not opt -> llc.
Ron Lieberman [Tue, 16 Aug 2016 13:10:09 +0000 (13:10 +0000)]
[Hexagon] Improve test to check for @PCREL, only run llc, not opt -> llc.

llvm-svn: 278796

8 years ago[MemorySanitizer] [MIPS] Changed memory mapping to support pie executable.
Sagar Thakur [Tue, 16 Aug 2016 12:55:38 +0000 (12:55 +0000)]
[MemorySanitizer] [MIPS] Changed memory mapping to support pie executable.

Reviewed by eugenis
Differential: D22994

llvm-svn: 278795

8 years ago[X86][SSE] Add support for combining v2f64 target shuffles to VZEXT_MOVL byte rotations
Simon Pilgrim [Tue, 16 Aug 2016 12:52:06 +0000 (12:52 +0000)]
[X86][SSE] Add support for combining v2f64 target shuffles to VZEXT_MOVL byte rotations

The combine was only matching v2i64 as it assumed lowering to MOVQ - but we have v2f64 patterns that match in a similar fashion

llvm-svn: 278794

8 years ago[MSAN][MIPS] Changed memory mapping to support pie executable.
Sagar Thakur [Tue, 16 Aug 2016 12:49:54 +0000 (12:49 +0000)]
[MSAN][MIPS] Changed memory mapping to support pie executable.

Reviewed by eugenis
Differential: D22993

llvm-svn: 278793

8 years ago[ScopInfo] Make scalars used by PHIs in non-affine regions available
Tobias Grosser [Tue, 16 Aug 2016 11:44:48 +0000 (11:44 +0000)]
[ScopInfo] Make scalars used by PHIs in non-affine regions available

Normally this is ensured when adding PHI nodes, but as PHI node dependences
do not need to be added in case all incoming blocks are within the same
non-affine region, this was missed.

This corrects an issue visible in LNT's sqlite3, in case invariant load hoisting
was disabled.

llvm-svn: 278792

8 years ago[clang-tidy] readability-implicit-bool-cast forgets to store its options.
Haojian Wu [Tue, 16 Aug 2016 11:15:05 +0000 (11:15 +0000)]
[clang-tidy] readability-implicit-bool-cast forgets to store its options.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 278791

8 years ago[X86][AVX512BW] Updated tests to demonstrate AVX512BW's inability to vectorize v64i8...
Simon Pilgrim [Tue, 16 Aug 2016 11:05:47 +0000 (11:05 +0000)]
[X86][AVX512BW] Updated tests to demonstrate AVX512BW's inability to vectorize v64i8 shifts

llvm-svn: 278790

8 years agoCorrect the upper bound for a CBZ/CBNZ branch target.
Prakhar Bahuguna [Tue, 16 Aug 2016 10:41:56 +0000 (10:41 +0000)]
Correct the upper bound for a CBZ/CBNZ branch target.

Summary:
Fix for the upper bound check that was causing a build failure.

Reviewers: olista01, rengolin, t.p.northover

Subscribers: llvm-commits

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

llvm-svn: 278789

8 years ago[Thumb] Validate branch target for CBZ/CBNZ instructions.
Prakhar Bahuguna [Tue, 16 Aug 2016 10:41:52 +0000 (10:41 +0000)]
[Thumb] Validate branch target for CBZ/CBNZ instructions.

Summary:
The assembler currently does not check the branch target for CBZ/CBNZ
instructions, which only permit branching forwards with a positive offset. This
adds validation for the branch target to ensure negative PC-relative offsets are
not encoded into the instruction, whether specified as a literal or as an
assembler symbol.

Reviewers: rengolin, t.p.northover

Subscribers: llvm-commits, rengolin

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

llvm-svn: 278788

8 years ago[X86][SSE] Add support for combining target shuffles to PALIGNR byte rotations
Simon Pilgrim [Tue, 16 Aug 2016 10:03:23 +0000 (10:03 +0000)]
[X86][SSE] Add support for combining target shuffles to PALIGNR byte rotations

llvm-svn: 278787