oota-llvm.git
8 years agoAMDGPU: Fix ctlz combine for sub 32-bit types
Matt Arsenault [Mon, 11 Jan 2016 17:02:06 +0000 (17:02 +0000)]
AMDGPU: Fix ctlz combine for sub 32-bit types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257353 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Pattern match ffbh pattern to instruction.
Matt Arsenault [Mon, 11 Jan 2016 17:02:00 +0000 (17:02 +0000)]
AMDGPU: Pattern match ffbh pattern to instruction.

The hardware instruction's output on 0 is -1 rather than 32.
Eliminate a test and select to -1. This removes an extra instruction
from the compatability function with HSAIL's firstbit instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257352 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LLI] Remove dependence on RemoteTarget.cpp from ChildTarget's Makefile.
Lang Hames [Mon, 11 Jan 2016 17:00:31 +0000 (17:00 +0000)]
[LLI] Remove dependence on RemoteTarget.cpp from ChildTarget's Makefile.

RemoteTarget.cpp was removed in r257343.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257351 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ORC] Pacify MSVC by adding explicit move construction/assignment to
Lang Hames [Mon, 11 Jan 2016 16:56:24 +0000 (16:56 +0000)]
[ORC] Pacify MSVC by adding explicit move construction/assignment to
OrcRemoteTargetServer::Allocator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257350 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ORC] Change 'auto' to 'std::error_code' to try to coax GCC builder into
Lang Hames [Mon, 11 Jan 2016 16:52:11 +0000 (16:52 +0000)]
[ORC] Change 'auto' to 'std::error_code' to try to coax GCC builder into
providing a more helpful error diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257349 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Custom lower i64 ctlz
Matt Arsenault [Mon, 11 Jan 2016 16:50:29 +0000 (16:50 +0000)]
AMDGPU: Custom lower i64 ctlz

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257348 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMips: Remove lowerSELECT_CC
Matt Arsenault [Mon, 11 Jan 2016 16:44:48 +0000 (16:44 +0000)]
Mips: Remove lowerSELECT_CC

This is the same as the default expansion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257346 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLegalizeDAG: Expand ctlz with ctlz_zero_undef if legal
Matt Arsenault [Mon, 11 Jan 2016 16:37:46 +0000 (16:37 +0000)]
LegalizeDAG: Expand ctlz with ctlz_zero_undef if legal

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257345 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Remove dead target dag combine
Matt Arsenault [Mon, 11 Jan 2016 16:37:40 +0000 (16:37 +0000)]
AMDGPU: Remove dead target dag combine

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257344 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LLI] Replace the LLI remote-JIT support with the new ORC remote-JIT components.
Lang Hames [Mon, 11 Jan 2016 16:35:55 +0000 (16:35 +0000)]
[LLI] Replace the LLI remote-JIT support with the new ORC remote-JIT components.

The new ORC remote-JITing support provides a superset of the old code's
functionality, so we can replace the old stuff. As a bonus, a couple of
previously XFAILed tests have started passing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257343 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r257164 - it has caused spec2k6 failures in LTO mode
Silviu Baranga [Mon, 11 Jan 2016 16:19:38 +0000 (16:19 +0000)]
Revert r257164 - it has caused spec2k6 failures in LTO mode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257340 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Never select JAL for calls to an absolute immediate address.
Daniel Sanders [Mon, 11 Jan 2016 15:57:46 +0000 (15:57 +0000)]
[mips] Never select JAL for calls to an absolute immediate address.

Summary:
It actually takes an offset into the current PC-region.

This fixes the 'expr' command in lldb.

Reviewers: vkalintiris, jaydeep, bhushan

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257339 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Add check for nullptr in getFixupNoBits
Krzysztof Parzyszek [Mon, 11 Jan 2016 15:51:53 +0000 (15:51 +0000)]
[Hexagon] Add check for nullptr in getFixupNoBits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257338 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Add implicit uses of GP to GP-relative loads and stores
Krzysztof Parzyszek [Mon, 11 Jan 2016 15:49:58 +0000 (15:49 +0000)]
[Hexagon] Add implicit uses of GP to GP-relative loads and stores

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257337 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Mark D14 and GP as reserved registers
Krzysztof Parzyszek [Mon, 11 Jan 2016 15:47:41 +0000 (15:47 +0000)]
[Hexagon] Mark D14 and GP as reserved registers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257336 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Reduce complexity of the LEA optimization pass, by Andrey Turetsky.
Alexey Bataev [Mon, 11 Jan 2016 11:52:29 +0000 (11:52 +0000)]
[X86] Reduce complexity of the LEA optimization pass, by Andrey Turetsky.
In the OptimizeLEA pass keep instructions' positions in the basic block saved and use them for calculation of the distance between two instructions instead of std::distance. This reduces complexity of the pass from O(n^3) to O(n^2) and thus the compile time.
Differential Revision: http://reviews.llvm.org/D15692

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257328 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[BranchFolding] Set correct mem refs (2nd try)
Junmo Park [Mon, 11 Jan 2016 07:15:38 +0000 (07:15 +0000)]
[BranchFolding] Set correct mem refs (2nd try)

This is a recommit of r257253 which was reverted in r257270.
Previous testcase can make failure on some targets due to using opt with O3 option.

Original Summary:
Merge MBBICommon and MBBI's MMOs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257317 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ORC] Move ORC RPC helper classes that rely on partial specialization into a
Lang Hames [Mon, 11 Jan 2016 05:44:39 +0000 (05:44 +0000)]
[ORC] Move ORC RPC helper classes that rely on partial specialization into a
non-template base class.

Hopefully this should fix the issues with the windows bots arrising from
r257305.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257316 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TableGen] Allow asm writer to use up to 3 OpInfo tables instead of 2. This allows...
Craig Topper [Mon, 11 Jan 2016 05:13:41 +0000 (05:13 +0000)]
[TableGen] Allow asm writer to use up to 3 OpInfo tables instead of 2. This allows x86 to use 56 total bits made up of a 32-bit, 16-bit, and 8-bit table. Previously we were using 64 total bits.

This saves 14K from the x86 table size. And saves space on other targets as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257315 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TableGen] Remove unnecessary 0 terminator from an array that only existed to prevent...
Craig Topper [Mon, 11 Jan 2016 05:13:38 +0000 (05:13 +0000)]
[TableGen] Remove unnecessary 0 terminator from an array that only existed to prevent ending an array with a comma. But that's perfectly legal and not something we need to prevent. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257314 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix examples corresponding to r257302.
NAKAMURA Takumi [Mon, 11 Jan 2016 05:04:20 +0000 (05:04 +0000)]
Fix examples corresponding to r257302.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257313 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Remove the empty class definitions in RPCUtils.h in the hope of working
Lang Hames [Mon, 11 Jan 2016 04:04:20 +0000 (04:04 +0000)]
[Orc] Remove the empty class definitions in RPCUtils.h in the hope of working
around MSVC's C2783 error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257312 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMove all decls in coverage namespace into CoverageMapping.h/NFC
Xinliang David Li [Mon, 11 Jan 2016 03:54:18 +0000 (03:54 +0000)]
Move all decls in coverage namespace into CoverageMapping.h/NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257311 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoOrc] Drop PageSize member from Orc architecture support class in favour of
Lang Hames [Mon, 11 Jan 2016 02:41:17 +0000 (02:41 +0000)]
Orc] Drop PageSize member from Orc architecture support class in favour of
Process::getPageSize() - the former is redundant.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257310 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Remove the FPRPCChannel class from RPCChannel.h - it requires unistd.h,
Lang Hames [Mon, 11 Jan 2016 02:15:12 +0000 (02:15 +0000)]
[Orc] Remove the FPRPCChannel class from RPCChannel.h - it requires unistd.h,
which was removed in r257306.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257309 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TableGen] Remove a few spaces from AsmMatcher output. NFC
Craig Topper [Mon, 11 Jan 2016 02:11:36 +0000 (02:11 +0000)]
[TableGen] Remove a few spaces from AsmMatcher output. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257308 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Include the IndirectionUtils header in OrcRemoteTargetClient.
Lang Hames [Mon, 11 Jan 2016 01:59:35 +0000 (01:59 +0000)]
[Orc] Include the IndirectionUtils header in OrcRemoteTargetClient.

This should fix the modules builder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257307 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Remote the <unistd> include introduced in r257305 - it's not needed, and
Lang Hames [Mon, 11 Jan 2016 01:55:19 +0000 (01:55 +0000)]
[Orc] Remote the <unistd> include introduced in r257305 - it's not needed, and
broke the windows bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257306 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Add support for remote JITing to the ORC API.
Lang Hames [Mon, 11 Jan 2016 01:40:11 +0000 (01:40 +0000)]
[Orc] Add support for remote JITing to the ORC API.

This patch adds utilities to ORC for managing a remote JIT target. It consists
of:

1. A very primitive RPC system for making calls over a byte-stream.  See
RPCChannel.h, RPCUtils.h.

2. An RPC API defined in the above system for managing memory, looking up
symbols, creating stubs, etc. on a remote target. See OrcRemoteTargetRPCAPI.h.

3. An interface for creating high-level JIT components (memory managers,
callback managers, stub managers, etc.) that operate over the RPC API. See
OrcRemoteTargetClient.h.

4. A helper class for building servers that can handle the RPC calls. See
OrcRemoteTargetServer.h.

The system is designed to work neatly with the existing ORC components and
functionality. In particular, the ORC callback API (and consequently the
CompileOnDemandLayer) is supported, enabling lazy compilation of remote code.

Assuming this doesn't trigger any builder failures, a follow-up patch will be
committed which tests these utilities by using them to replace LLI's existing
remote-JITing demo code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257305 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX-512] Remove another extra space from the Intel syntax asm strings.
Craig Topper [Mon, 11 Jan 2016 01:03:40 +0000 (01:03 +0000)]
[AVX-512] Remove another extra space from the Intel syntax asm strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257304 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX-512] Fix test case update missed in r257299.
Craig Topper [Mon, 11 Jan 2016 00:56:48 +0000 (00:56 +0000)]
[AVX-512] Fix test case update missed in r257299.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257303 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Rename OrcTargetSupport to OrcArchitectureSupport to avoid confusion with
Lang Hames [Mon, 11 Jan 2016 00:56:15 +0000 (00:56 +0000)]
[Orc] Rename OrcTargetSupport to OrcArchitectureSupport to avoid confusion with
the upcoming remote-target support classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257302 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX-512] Remove more superfluous spaces from asm strings.
Craig Topper [Mon, 11 Jan 2016 00:44:58 +0000 (00:44 +0000)]
[AVX-512] Remove more superfluous spaces from asm strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257301 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX-512] Remove unused Round and Itinerary from the maskable_cmp multiclasses. They...
Craig Topper [Mon, 11 Jan 2016 00:44:56 +0000 (00:44 +0000)]
[AVX-512] Remove unused Round and Itinerary from the maskable_cmp multiclasses. They weren't used and there were extra spaces in the asm string to prepare for the concatenations of the round string that wasn't ever used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257300 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX-512] Make spacing between comma and {sae} operand consistent in asm strings.
Craig Topper [Mon, 11 Jan 2016 00:44:52 +0000 (00:44 +0000)]
[AVX-512] Make spacing between comma and {sae} operand consistent in asm strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257299 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Remove extra spaces from MPX instruction asm strings.
Craig Topper [Mon, 11 Jan 2016 00:44:46 +0000 (00:44 +0000)]
[X86] Remove extra spaces from MPX instruction asm strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257298 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Add error codes and a new std::error_category for remote-jit errors.
Lang Hames [Mon, 11 Jan 2016 00:34:13 +0000 (00:34 +0000)]
[Orc] Add error codes and a new std::error_category for remote-jit errors.

These will be used by an upcoming patch that adds remote-jit support utilities
to ORC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257297 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RuntimeDyld] Add a notifyObjectLoaded method to RuntimeDyld::MemoryManager.
Lang Hames [Sun, 10 Jan 2016 23:59:41 +0000 (23:59 +0000)]
[RuntimeDyld] Add a notifyObjectLoaded method to RuntimeDyld::MemoryManager.

This is a more generic version of the MCJITMemoryManager::notifyObjectLoaded
method: It provides only a RuntimeDyld reference (rather than an
ExecutionEngine), and so can be used with ORC JIT stacks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257296 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMove coveragemap_error enum into coverage namespace and InstrProf.h /NFC
Xinliang David Li [Sun, 10 Jan 2016 21:56:33 +0000 (21:56 +0000)]
Move coveragemap_error enum into coverage namespace and InstrProf.h /NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257295 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RuntimeDyld] Add alignment arguments to the reserveAllocationSpace method of
Lang Hames [Sun, 10 Jan 2016 18:51:50 +0000 (18:51 +0000)]
[RuntimeDyld] Add alignment arguments to the reserveAllocationSpace method of
RuntimeDyld::MemoryManager.

The RuntimeDyld::MemoryManager::reserveAllocationSpace method is called when
object files are loaded, and gives clients a chance to pre-allocate memory for
all segments. Previously only the size of each segment (code, ro-data, rw-data)
was supplied but not the alignment. This hasn't caused any problems so far, as
most clients allocate via the MemoryBlock interface which returns page-aligned
blocks. Adding alignment arguments enables finer grained allocation while still
satisfying alignment restrictions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257294 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SectionMemoryManager] Don't just drop the RO free list
Keno Fischer [Sun, 10 Jan 2016 18:17:12 +0000 (18:17 +0000)]
[SectionMemoryManager] Don't just drop the RO free list

In r255760, I optimized the SectionMemoryManager to make better use
of virtual memory on platforms where the allocation granularity was
bigger than the protection granularity. As part of this, fixing up
the free list became more complicated and was moved into
`applyMemoryGroupPermissions`. Unfortunately, I forgot to actually
remove the call that drops the free list for RO memory (I did
remove the corresponding one for RX memory), defeating the whole
optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257293 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSpeed up LiveDebugValues
Daniel Berlin [Sun, 10 Jan 2016 18:08:32 +0000 (18:08 +0000)]
Speed up LiveDebugValues

Summary:
Use proper dataflow ordering to speed convergence.
This will converge the testcase on bug 26055 in 2 iterations.

(data structures speedups to come to make even that faster)

Reviewers: kcc, samsonov, echristo, dblaikie, tvvikram

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257292 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoOrcJITTests//ObjectLinkingLayerTest.cpp: Appease msc18's C2327. It seems definition...
NAKAMURA Takumi [Sun, 10 Jan 2016 15:56:49 +0000 (15:56 +0000)]
OrcJITTests//ObjectLinkingLayerTest.cpp: Appease msc18's C2327. It seems definition of nested class would confuse the context.

  llvm\unittests\ExecutionEngine\Orc\ObjectLinkingLayerTest.cpp(115) : error C2327: 'llvm::OrcExecutionTest::TM' : is not a type name, static, or enumerator
  llvm\unittests\ExecutionEngine\Orc\ObjectLinkingLayerTest.cpp(115) : error C2065: 'TM' : undeclared identifier

FYI, "this->TM" was valid even before moving class SectionMemoryManagerWrapper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257290 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Another stab at fixing the PointerEmbeddedInt build for MSVC.
Benjamin Kramer [Sun, 10 Jan 2016 14:27:26 +0000 (14:27 +0000)]
[ADT] Another stab at fixing the PointerEmbeddedInt build for MSVC.

MSVC18 seems to have other problems here, just hardcode uintptr_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257289 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Unbreak PointerEmbeddedInt build with MSVC.
Benjamin Kramer [Sun, 10 Jan 2016 14:06:29 +0000 (14:06 +0000)]
[ADT] Unbreak PointerEmbeddedInt build with MSVC.

MSVC seems to have problems looking up Value inside of the template. Not
really sure whether that's a bug there or Clang and GCC being too
permissive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257288 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoOptimized instruction sequence for sitofp operation on X86-32
Elena Demikhovsky [Sun, 10 Jan 2016 09:41:22 +0000 (09:41 +0000)]
Optimized instruction sequence for sitofp operation on X86-32
Optimized sitofp i64 %x to double. The current sequence

movl %ecx, 8(%esp)
movl %edx, 12(%esp)
fildll 8(%esp)

is replaced with:

movd %ecx, %xmm0
movd %edx, %xmm1
punpckldq %xmm1, %xmm0
movq %xmm0, 8(%esp)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257285 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Add an abstraction for embedding an integer within a pointer-like
Chandler Carruth [Sun, 10 Jan 2016 09:40:13 +0000 (09:40 +0000)]
[ADT] Add an abstraction for embedding an integer within a pointer-like
type.

This makes it easy and safe to use a set of flags as one elmenet of
a tagged union with pointers. There is quite a bit of code that has
historically done this by casting arbitrary integers to "pointers" and
assuming that this was safe and reliable. It is neither, and has started
to rear its head by triggering safety asserts in various abstractions
like PointerLikeTypeTraits when the integers chosen are invariably poor
choices for *some* platform and *some* situation. Not to mention the
(hopefully unlikely) prospect of one of these integers actually getting
allocated!

With this, it will be straightforward to build type safe abstractions
like this without being error prone. The abstraction itself is also
remarkably simple thanks to the implicit conversion.

This use case and pattern was also independently created by the folks
working on Swift, and they're going to incrementally add any missing
functionality they find.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257284 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX512] add PRORVQ and PRORVD Intrinsic
Michael Zuckerman [Sun, 10 Jan 2016 09:16:41 +0000 (09:16 +0000)]
[AVX512] add PRORVQ and PRORVD Intrinsic

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257283 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Add a sum type abstraction for pointer-like types.
Chandler Carruth [Sun, 10 Jan 2016 08:48:23 +0000 (08:48 +0000)]
[ADT] Add a sum type abstraction for pointer-like types.

This is a much more general and powerful form of PointerUnion. It
provides a reasonably complete sum type (from type theory) for
pointer-like types. It has several significant advantages over the
existing PointerUnion infrastructure:

1) It allows more than two pointer types to participate without awkward
   nesting structures.
2) It directly exposes the tag so that it is convenient to write
   switches over the possible members.
3) It can re-use the same type for multiple tag values, something that
   has been worked around by either abusing PointerIntPair or defining
   nonce types and doing unsafe pointer casting.
4) It supports customization of the PointerLikeTypeTraits used for
   specific member types. This means it could (in theory) be used even
   with types that are over-aligned on allocation to expose larger
   numbers of bits to the tag.

All in all, I think it is at least complimentary to the existing
infrastructure, and a strict improvement for some use cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257282 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Remove 'reinterpreted as a pointer' from some Twine comments. Integers have...
Craig Topper [Sun, 10 Jan 2016 08:27:13 +0000 (08:27 +0000)]
[ADT] Remove 'reinterpreted as a pointer' from some Twine comments. Integers have been stored directly in a union for some time. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257281 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd test for r257279.
David Majnemer [Sun, 10 Jan 2016 07:13:33 +0000 (07:13 +0000)]
Add test for r257279.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257280 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[JumpThreading] Don't forget to report that the IR changed
David Majnemer [Sun, 10 Jan 2016 07:13:04 +0000 (07:13 +0000)]
[JumpThreading] Don't forget to report that the IR changed

JumpThreading's runOnFunction is supposed to return true if it made any
changes.  JumpThreading has a call to removeUnreachableBlocks which may
result in changes to the IR but runOnFunction didn't appropriate account
for this possibility, leading to badness.

While we are here, make sure to call LazyValueInfo::eraseBlock in
removeUnreachableBlocks;  JumpThreading preserves LVI.

This fixes PR26096.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257279 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix a control flow problem in commit rL257277.
Chen Li [Sun, 10 Jan 2016 06:13:32 +0000 (06:13 +0000)]
Fix a control flow problem in commit rL257277.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257278 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.
Chen Li [Sun, 10 Jan 2016 05:48:01 +0000 (05:48 +0000)]
[SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.

Summary:
This is a fix of D13718. D13718 was committed but then reverted because of the following bug:
https://llvm.org/bugs/show_bug.cgi?id=25299

This patch fixes the issue shown in the bug.

Reviewers: majnemer, reames

Subscribers: jevinskie, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257277 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LangRef] Move catchpad to "Other Operators" (NFC)
Joseph Tremoulet [Sun, 10 Jan 2016 04:46:10 +0000 (04:46 +0000)]
[LangRef] Move catchpad to "Other Operators" (NFC)

It is no longer a terminator, so should no longer be grouped with them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257276 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Fix catchpad pred verification
Joseph Tremoulet [Sun, 10 Jan 2016 04:32:03 +0000 (04:32 +0000)]
[WinEH] Fix catchpad pred verification

Summary:
The code was simply ensuring that the catchpad's pred is its catchswitch,
which was letting cases slip through where the flow edge was the unwind
edge of the catchswitch rather than one of its catch clauses.

Reviewers: andrew.w.kaylor, rnk, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257275 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Disallow cyclic unwinds
Joseph Tremoulet [Sun, 10 Jan 2016 04:31:05 +0000 (04:31 +0000)]
[WinEH] Disallow cyclic unwinds

Summary:
Funclet-based EH personalities/tables likely can't handle these, and they
can't be generated at source, so make them officially illegal in IR as
well.

Reviewers: andrew.w.kaylor, rnk, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257274 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Verify consistent funclet unwind exits
Joseph Tremoulet [Sun, 10 Jan 2016 04:30:02 +0000 (04:30 +0000)]
[WinEH] Verify consistent funclet unwind exits

Summary:
A funclet EH pad may be exited by an unwind edge, which may be a
cleanupret exiting its cleanuppad, an invoke exiting a funclet, or an
unwind out of a nested funclet transitively exiting its parent.  Funclet
EH personalities require all such exceptional exits from a given funclet to
have the same unwind destination, and EH preparation / state numbering /
table generation implicitly depends on this.  Formalize it as a rule of
the IR in the LangRef and verifier.

Reviewers: rnk, majnemer, andrew.w.kaylor

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257273 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Verify unwind edges against EH pad tree
Joseph Tremoulet [Sun, 10 Jan 2016 04:28:38 +0000 (04:28 +0000)]
[WinEH] Verify unwind edges against EH pad tree

Summary:
Funclet EH personalities require a tree-like nesting among funclets
(enforced by the ParentPad linkage in the IR), and also require that
unwind edges conform to certain rules with respect to the tree:
 - An unwind edge may exit 0 or more ancestor pads
 - An unwind edge must enter exactly one EH pad, which must be distinct
   from any exited pads
 - A cleanupret's edge must exit its cleanuppad

Describe these rules in the LangRef, and enforce them in the verifier.

Reviewers: rnk, majnemer, andrew.w.kaylor

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257272 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDon't use random class variables across functions
Daniel Berlin [Sun, 10 Jan 2016 03:25:42 +0000 (03:25 +0000)]
Don't use random class variables across functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257271 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[BranchFolding] Set correct mem refs"
Michael Zolotukhin [Sat, 9 Jan 2016 23:53:16 +0000 (23:53 +0000)]
Revert "[BranchFolding] Set correct mem refs"

This reverts commit 1ff11017d2669b933b29fcbb6451cfcda34ad693.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257270 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Fix MSVC build errors due to r257265 by adding explicit move construction
Lang Hames [Sat, 9 Jan 2016 22:05:08 +0000 (22:05 +0000)]
[Orc] Fix MSVC build errors due to r257265 by adding explicit move construction
and assignment to LogicalDylibResources.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257269 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "Teach the CMake build system to run lit's test suite. These can be run"
Dan Liew [Sat, 9 Jan 2016 21:42:57 +0000 (21:42 +0000)]
Revert "Teach the CMake build system to run lit's test suite. These can be run"

This reverts r257221.

This caused several build bot failures

* It looks like some of the tests don't work correctly under Windows
* It looks like the lit per test timeout tests fail

So I'm reverting for now. Once the above failures are fixed running
lit's tests can be enabled again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257268 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][AVX] Match broadcast loads through a bitcast
Simon Pilgrim [Sat, 9 Jan 2016 20:59:39 +0000 (20:59 +0000)]
[X86][AVX] Match broadcast loads through a bitcast

AVX1 v8i32/v4i64 shuffles are bitcasted to v8f32/v4f64, this patch peeks through any bitcast to check for a load node to allow broadcasts to occur.

This is a re-commit of r257055 after r257264 fixed 32-bit broadcast loads of i64 scalars.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257266 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Enable user-supplied memory managers in the CompileOnDemand layer.
Lang Hames [Sat, 9 Jan 2016 20:55:18 +0000 (20:55 +0000)]
[Orc] Enable user-supplied memory managers in the CompileOnDemand layer.

Previously the CompileOnDemand layer was hard-coded to use a new
SectionMemoryManager for each function when it was called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257265 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][AVX] Add support for i64 broadcast loads on 32-bit targets
Simon Pilgrim [Sat, 9 Jan 2016 19:59:27 +0000 (19:59 +0000)]
[X86][AVX] Add support for i64 broadcast loads on 32-bit targets

Added 32-bit AVX1/AVX2 broadcast tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257264 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc][RuntimeDyld] Prevent duplicate calls to finalizeMemory on shared memory
Lang Hames [Sat, 9 Jan 2016 19:50:40 +0000 (19:50 +0000)]
[Orc][RuntimeDyld] Prevent duplicate calls to finalizeMemory on shared memory
managers.

Prior to this patch, recursive finalization (where finalization of one
RuntimeDyld instance triggers finalization of another instance on which the
first depends) could trigger memory access failures: When the inner (dependent)
RuntimeDyld instance and its memory manager are finalized, memory allocated
(but not yet relocated) by the outer instance is locked, and relocation in the
outer instance fails with a memory access error.

This patch adds a latch to the RuntimeDyld::MemoryManager base class that is
checked by a new method: RuntimeDyld::finalizeWithMemoryManagerLocking, ensuring
that shared memory managers are only finalized by the outermost RuntimeDyld
instance.

This allows ORC clients to supply the same memory manager to multiple calls to
addModuleSet. In particular it enables the use of user-supplied memory managers
with the CompileOnDemandLayer which must reuse the supplied memory manager for
each function that is lazily compiled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257263 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[JumpThreading] Use range-based for loops.
Benjamin Kramer [Sat, 9 Jan 2016 18:43:01 +0000 (18:43 +0000)]
[JumpThreading] Use range-based for loops.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257262 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TRE] Simplify code with range-based loops and std::find.
Benjamin Kramer [Sat, 9 Jan 2016 17:35:29 +0000 (17:35 +0000)]
[TRE] Simplify code with range-based loops and std::find.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257261 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[BranchFolding] Set correct mem refs
Junmo Park [Sat, 9 Jan 2016 07:30:13 +0000 (07:30 +0000)]
[BranchFolding] Set correct mem refs

Merge MBBICommon and MBBI's MMOs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257253 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RS4GC] Update and simplify handling of Constants in findBaseDefiningValueOfVector().
Manuel Jacob [Sat, 9 Jan 2016 04:02:16 +0000 (04:02 +0000)]
[RS4GC] Update and simplify handling of Constants in findBaseDefiningValueOfVector().

Summary:
This is analogous to r256079, which removed an overly strong assertion, and
r256812, which simplified the code by replacing three conditionals by one.

Reviewers: reames

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257250 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] debug prints in tracing
Kostya Serebryany [Sat, 9 Jan 2016 03:46:08 +0000 (03:46 +0000)]
[libFuzzer] debug prints in tracing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257249 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] change the way trace-based mutations are applied. Instead of a custom...
Kostya Serebryany [Sat, 9 Jan 2016 03:08:58 +0000 (03:08 +0000)]
[libFuzzer] change the way trace-based mutations are applied. Instead of a custom code just rely on the automatically created dictionary

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257248 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RS4GC] Unify two asserts. NFC.
Manuel Jacob [Sat, 9 Jan 2016 03:08:49 +0000 (03:08 +0000)]
[RS4GC] Unify two asserts.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257247 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] don't limit memcmp tracing with 8 bytes
Kostya Serebryany [Sat, 9 Jan 2016 01:39:55 +0000 (01:39 +0000)]
[libFuzzer] don't limit memcmp tracing with 8 bytes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257245 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[rs4gc] Optionally directly relocated vector of pointers
Philip Reames [Sat, 9 Jan 2016 01:31:13 +0000 (01:31 +0000)]
[rs4gc] Optionally directly relocated vector of pointers

This patch teaches rewrite-statepoints-for-gc to relocate vector-of-pointers directly rather than trying to split them. This builds on the recent lowering/IR changes to allow vector typed gc.relocates.

The motivation for this is that we recently found a bug in the vector splitting code where depending on visit order, a vector might not be relocated at some safepoint. Specifically, the bug is that the splitting code wasn't updating the side tables (live vector) of other safepoints. As a result, a vector which was live at two safepoints might not be updated at one of them. However, if you happened to visit safepoints in post order over the dominator tree, everything worked correctly. Weirdly, it turns out that post order is actually an incredibly common order to visit instructions in in practice. Frustratingly, I have not managed to write a test case which actually hits this. I can only reproduce it in large IR files produced by actual applications.

Rather than continue to make this code more complicated, we can remove all of the complexity by just representing the relocation of the entire vector natively in the IR.

At the moment, the new functionality is hidden behind a flag. To use this code, you need to pass "-rs4gc-split-vector-values=0". Once I have a chance to stress test with this option and get feedback from other users, my plan is to flip the default and remove the original splitting code. I would just remove it now, but given the rareness of the bug, I figured it was better to leave it in place until the new approach has been stress tested.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257244 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] refactor the way we collect cmp traces (don't use std::vector, don't...
Kostya Serebryany [Sat, 9 Jan 2016 00:38:40 +0000 (00:38 +0000)]
[libFuzzer] refactor the way we collect cmp traces (don't use std::vector, don't limit with 8 bytes)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257239 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agofixing type.
Mike Aizatsky [Sat, 9 Jan 2016 00:31:56 +0000 (00:31 +0000)]
fixing type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257238 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agollvm/lib/DebugInfo/Symbolize/DIPrinter.cpp: Fix build in -m32. 1L is incompatible...
NAKAMURA Takumi [Sat, 9 Jan 2016 00:28:50 +0000 (00:28 +0000)]
llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp: Fix build in -m32. 1L is incompatible to int64_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257237 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-symbolizer] -print-source-context-lines option to print source code around...
Mike Aizatsky [Sat, 9 Jan 2016 00:14:35 +0000 (00:14 +0000)]
[llvm-symbolizer] -print-source-context-lines option to print source code around the line.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257236 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agodon't repeat variable/function names in comments; NFC
Sanjay Patel [Fri, 8 Jan 2016 23:04:05 +0000 (23:04 +0000)]
don't repeat variable/function names in comments; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257227 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agorangify; NFCI
Sanjay Patel [Fri, 8 Jan 2016 22:59:42 +0000 (22:59 +0000)]
rangify; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257226 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PGO] Introducing version mask macro/NFC
Xinliang David Li [Fri, 8 Jan 2016 22:55:16 +0000 (22:55 +0000)]
[PGO] Introducing version mask macro/NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257224 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTeach the CMake build system to run lit's test suite. These can be run
Dan Liew [Fri, 8 Jan 2016 22:36:22 +0000 (22:36 +0000)]
Teach the CMake build system to run lit's test suite. These can be run
directy with ``make check-lit`` and are run as part of
``make check-all``.

In principle we should run lit's testsuite before testing LLVM using lit
so that any problems with lit get discovered before testing LLVM so we
can bail out early.  However this implementation (``check-all`` runs all
tests together) seemed simpler and will still report failing lit tests.

Note that the tests and the configured ``lit.site.cfg`` have to be
copied into the build directory to avoid polluting the source tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257221 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Replace a static member variable in HexagonCVIResource (NFC)
Tobias Edler von Koch [Fri, 8 Jan 2016 22:07:25 +0000 (22:07 +0000)]
[Hexagon] Replace a static member variable in HexagonCVIResource (NFC)

This creates one instance of TUL per HexagonShuffler, which avoids thread-safety
issues with future changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257215 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agovariable names start with an upper case letter; NFC
Sanjay Patel [Fri, 8 Jan 2016 22:05:03 +0000 (22:05 +0000)]
variable names start with an upper case letter; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257213 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DAGCombiner] don't dereference an operand that doesn't exist (PR26070)
Sanjay Patel [Fri, 8 Jan 2016 19:53:24 +0000 (19:53 +0000)]
[DAGCombiner] don't dereference an operand that doesn't exist (PR26070)

The bug was introduced with changes for x86-64 fp128:
http://reviews.llvm.org/rL254653

I don't know why an x86 change is here, so I'll follow up in:
http://reviews.llvm.org/D15134

Should fix:
https://llvm.org/bugs/show_bug.cgi?id=26070

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257200 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[JumpThreading] Split select that has constant conditions coming from the PHI node
Haicheng Wu [Fri, 8 Jan 2016 19:39:39 +0000 (19:39 +0000)]
[JumpThreading] Split select that has constant conditions coming from the PHI node

Look for PHI/Select in the same BB of the form

bb:
  %p = phi [false, %bb1], [true, %bb2], [false, %bb3], [true, %bb4], ...
  %s = select p, trueval, falseval

And expand the select into a branch structure. This later enables
jump-threading over bb in this pass.

Using the similar approach of SimplifyCFG::FoldCondBranchOnPHI(), unfold
select if the associated PHI has at least one constant.  If the unfolded
select is not jump-threaded, it will be folded again in the later
optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257198 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLiveInterval: Adapt commen to the LI->LR change.
Matthias Braun [Fri, 8 Jan 2016 19:25:31 +0000 (19:25 +0000)]
LiveInterval: Adapt commen to the LI->LR change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257196 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMinor fix -- use the right version enum/NFC
Xinliang David Li [Fri, 8 Jan 2016 19:21:32 +0000 (19:21 +0000)]
Minor fix -- use the right version enum/NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257194 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTest commit access - add a blank line in comment.
Tim Shen [Fri, 8 Jan 2016 19:20:23 +0000 (19:20 +0000)]
Test commit access - add a blank line in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257192 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLoopInfo: Simplify ownership of Loop objects
Justin Bogner [Fri, 8 Jan 2016 19:08:53 +0000 (19:08 +0000)]
LoopInfo: Simplify ownership of Loop objects

It's strange that LoopInfo mostly owns the Loop objects, but that it
defers deleting them to the loop pass manager. Instead, change the
oddly named "updateUnloop" to "markAsRemoved" and have it queue the
Loop object for deletion. We can't delete the Loop immediately when we
remove it, since we need its pointer identity still, so we'll mark the
object as "invalid" so that clients can see what's going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257191 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRBIT Instruction only available for ARMv6t2 and above.
Weiming Zhao [Fri, 8 Jan 2016 18:43:41 +0000 (18:43 +0000)]
RBIT Instruction only available for ARMv6t2 and above.

Summary:
r255334 matches bit-reverse pattern in InstCombine and generates calls to Instrinsic::bitreverse.

RBIT instruction is only available for ARMv6t2 and above. This patch has the intrinsic expanded during legalization for ARMv4 and ARMv5.

Patch by Z. Zheng <zhaoshiz@codeaurora.org>

Reviewers: apazos, jmolloy, weimingz

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257188 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDisable shrink-wrap for Thumb1
Weiming Zhao [Fri, 8 Jan 2016 18:37:43 +0000 (18:37 +0000)]
Disable shrink-wrap for Thumb1

Summary: In ARMConstantIslandPass, which runs after Shrink Wrap pass, long jumps will be fixed up as BL (tBfar) which depends on spilling LR in epilogue.  However, shrink-wrap may remove the LR, which causes issues when the function returns.

Reviewers: qcolombet, rengolin

Subscribers: aemerson, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257187 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove CloningDirector and associated code
Easwaran Raman [Fri, 8 Jan 2016 18:23:17 +0000 (18:23 +0000)]
Remove CloningDirector and associated code

With the removal of the old landing pad code in r249918, CloningDirector is not
 used anywhere else. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257185 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDo not ASSERTZEXT for i16 result of bitcast from f16 operand
Pirama Arumuga Nainar [Fri, 8 Jan 2016 17:46:05 +0000 (17:46 +0000)]
Do not ASSERTZEXT for i16 result of bitcast from f16 operand

Summary:
During legalization if i16, do not ASSERTZEXT the result of FP_TO_FP16.
Directly return an FP_TO_FP16 node with return type as the
promote-to-type of i16.

This patch also removes extraneous length check.  This legalization
should be valid even if integer and float types are of different
lengths.

This patch breaks a hard-float test for fp16 args.  The test is changed
to allow a vmov to zero-out the top bits, and also ensure that the
return value is in an FP register.

Reviewers: ab, jmolloy

Subscribers: srhines, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257184 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] CatchHandler which don't have catch objects in StackColoring
David Majnemer [Fri, 8 Jan 2016 17:24:47 +0000 (17:24 +0000)]
[WinEH] CatchHandler which don't have catch objects in StackColoring

StackColoring rewrites the frame indicies of operations involving
allocas if it can find that the life time of two objects do not overlap.
MSVC EH needs to be kept aware of this if happens in the event that a
catch object has moved around.  However, we represent the non-existance
of a catch object with a sentinel frame index (INT_MAX).  This sentinel
also happens to be the EmptyKey of the SlotRemap DenseMap.  Testing for
whether or not we need to translate the frame index fails in this case
because we call the count method on the DenseMap with the EmptyKey,
leading to assertions.  Instead, check if it is our sentinel value
before trying to look into the DenseMap.

This fixes PR26073.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257182 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ThinLTO] Use new in-place symbol changes for exporting module
Teresa Johnson [Fri, 8 Jan 2016 17:06:29 +0000 (17:06 +0000)]
[ThinLTO] Use new in-place symbol changes for exporting module

Due to the new in-place ThinLTO symbol handling support added in
r257174, we now invoke renameModuleForThinLTO on the current
module from within the FunctionImport pass.

Additionally, renameModuleForThinLTO no longer needs to return the
Module as it is performing the renaming in place on the one provided.

This commit will be immediately preceeded by a companion clang patch to
remove its invocation of renameModuleForThinLTO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257181 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoHow to close a review manually.
Paul Robinson [Fri, 8 Jan 2016 17:05:12 +0000 (17:05 +0000)]
How to close a review manually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257180 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ThinLTO] Enable in-place symbol changes for exporting module
Teresa Johnson [Fri, 8 Jan 2016 15:00:00 +0000 (15:00 +0000)]
[ThinLTO] Enable in-place symbol changes for exporting module

Summary:
Move ThinLTO global value processing functions out of ModuleLinker and
into a new ThinLTOGlobalProcessor class, which performs any necessary
linkage and naming changes on the given module in place.

As a result, renameModuleForThinLTO no longer needs to create a new
Module when performing any necessary local to global promotion on a
module that we are possibly exporting from during a ThinLTO backend
compilation.

During function importing the ThinLTO processing is still invoked from
the ModuleLinker (via the new class), as it needs to perform renaming and
linkage changes on the source module, e.g. in order to get the correct
renaming during local to global promotion.

Reviewers: joker.eph

Subscribers: davidxl, llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257174 91177308-0d34-0410-b5e6-96231b3b80d8