oota-llvm.git
9 years agoDo not assert on first non-prologue instruction being a CFI directive.
Michael Kuperstein [Thu, 8 Oct 2015 07:48:49 +0000 (07:48 +0000)]
Do not assert on first non-prologue instruction being a CFI directive.

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

9 years ago[SystemZ] SystemZElimCompare pass improved.
Jonas Paulsson [Thu, 8 Oct 2015 07:40:23 +0000 (07:40 +0000)]
[SystemZ] SystemZElimCompare pass improved.

Compare elimination extended to recognize load-and-test instructions used
for comparison and eliminate them the same way as with compare instructions.

Test case fp-cmp-05.ll updated to expect optimized results now also for z13.

The order of instruction shortening and compare elimination passes have been
changed so that opcodes do not have to be handled in both passes.

Reviewed by Ulrich Weigand.

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

9 years ago[SystemZ] Bugfix: check CC reg liveness in SystemZShortenInst.
Jonas Paulsson [Thu, 8 Oct 2015 07:40:19 +0000 (07:40 +0000)]
[SystemZ] Bugfix: check CC reg liveness in SystemZShortenInst.

The following instruction shortening transformations would introduce a
definition of the CC reg, so therefore liveness of CC reg must be checked:

WFADB -> ADBR
WFSDB -> SDBR

Also add the CC reg implicit def operand to the MI in case of change of opcode.

Reviewed by Ulrich Weigand.

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

9 years ago [SystemZ] Use load-and-test for fp compare with 0 if vector support is present.
Jonas Paulsson [Thu, 8 Oct 2015 07:40:16 +0000 (07:40 +0000)]
 [SystemZ] Use load-and-test for fp compare with 0 if vector support is present.

Since the LTxBRCompare instructions can't be used with vector registers, a
normal load-and-test instruction (with a modelled def operand) is used instead.

Reviewed by Ulrich Weigand.

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

9 years ago[SystemZ] More minor fixing in SystemZElimCompare.cpp
Jonas Paulsson [Thu, 8 Oct 2015 07:40:11 +0000 (07:40 +0000)]
[SystemZ] More minor fixing in SystemZElimCompare.cpp

Don't use subreg indices since they are not used after regalloc.

Reviewed by Ulrich Weigand.

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

9 years ago[SystemZ] Minor fixes in SystemZElimCompare.cpp
Jonas Paulsson [Thu, 8 Oct 2015 07:39:55 +0000 (07:39 +0000)]
[SystemZ] Minor fixes in SystemZElimCompare.cpp

Reviewed by Ulrich Weigand.

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

9 years agoUse range-based for loops. NFC.
Craig Topper [Thu, 8 Oct 2015 06:06:42 +0000 (06:06 +0000)]
Use range-based for loops. NFC.

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

9 years ago[SCEV] Check `Pred` first in isKnownPredicateViaSplitting
Sanjoy Das [Thu, 8 Oct 2015 03:46:00 +0000 (03:46 +0000)]
[SCEV] Check `Pred` first in isKnownPredicateViaSplitting

Comparing `Pred` with `ICmpInst::ICMP_ULT` is cheaper that memory access
-- do that check before loading / storing `ProvingSplitPredicate`.

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

9 years ago[SCEV] Use `auto *` instead of `auto`; NFCI
Sanjoy Das [Thu, 8 Oct 2015 03:45:58 +0000 (03:45 +0000)]
[SCEV] Use `auto *` instead of `auto`; NFCI

(As prescribed by the coding style document)

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

9 years agoRevert "Handle inline stacks in gcov-encoded sample profiles."
Diego Novillo [Thu, 8 Oct 2015 01:17:26 +0000 (01:17 +0000)]
Revert "Handle inline stacks in gcov-encoded sample profiles."

This reverts commit r249644.

The buildbots are failing the new test I added. Investigating.

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

9 years ago[libFuzzer] fix 32-bit build
Kostya Serebryany [Thu, 8 Oct 2015 00:59:25 +0000 (00:59 +0000)]
[libFuzzer] fix 32-bit build

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

9 years agoHandle inline stacks in gcov-encoded sample profiles.
Diego Novillo [Thu, 8 Oct 2015 00:39:11 +0000 (00:39 +0000)]
Handle inline stacks in gcov-encoded sample profiles.

This patch adds support for reading sample profiles with inline stacks.
Inline stacks in a profile are generated when the sampled binary has
samples in inlined functions.

For instance, if main() calls foo() and foo() calls bar(), and bar() is
inlined into foo() and foo() inlined into main(), the profile may look
something like:

main total:364084 head:0
  [ ... ]
  2.3: _Z3fool total:243786
    1: 60149
    1.2: 38568
    1.4: 46511
    1.7: _Z3bari total:98558
      1.1: 52672
      1.2: 45886

At line 2, discriminator 3, main() calls foo(). In turn, foo() calls
bar() at line 1, discriminator 7.

In the textual format, this stacking of inline calls is represented
with indentation.

With this change, LLVM can now read sample profile files generated by
the create_gcov tool from https://github.com/google/autofdo.

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

9 years agoCodeGen: print and verify after TargetPassConfig::insertPass by default
Justin Bogner [Thu, 8 Oct 2015 00:36:22 +0000 (00:36 +0000)]
CodeGen: print and verify after TargetPassConfig::insertPass by default

In r224059, we started verifying after addPass, but missed doing so on
insertPass. There isn't a good reason for the discrepancy, and
skipping the verifier in these cases causes bugs.

This also exposes a verifier error that was introduced in r249087, but
the verifier doesn't run until after the register coalescer, when the
issue happens to have been resolved. I've skipped the verifier after
SIFixSGPRLiveRangesID to avoid the failures for now and will follow up
with Matt for a proper fix.

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

9 years ago[WinEH] Add missing test case for llvm.eh.exceptioncode
Reid Kleckner [Wed, 7 Oct 2015 23:55:06 +0000 (23:55 +0000)]
[WinEH] Add missing test case for llvm.eh.exceptioncode

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

9 years ago[WinEH] Fix 32-bit funclet epilogues in the presence of dynamic allocas
Reid Kleckner [Wed, 7 Oct 2015 23:55:01 +0000 (23:55 +0000)]
[WinEH] Fix 32-bit funclet epilogues in the presence of dynamic allocas

In particular, passing non-trivially copyable objects by value on win32
uses a dynamic alloca (inalloca). We would clobber ESP in the epilogue
and end up returning to outer space.

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

9 years agoStop linking all target libraries in llvm-nm and llvm-objdump.
Pete Cooper [Wed, 7 Oct 2015 22:39:17 +0000 (22:39 +0000)]
Stop linking all target libraries in llvm-nm and llvm-objdump.

llvm-nm only needs the target to parse module level assembly in bitcode.  It doesn't need a disassembler or codegen.

llvm-objdump needs to be able to disassemble a file, but doesn't need asm parsers or codegen.

This reduces the sizes of these tools by a few MB each, depending on how many backends are linked in.

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

9 years ago[Orc] Enable user supplied partitioning functors in the CompileOnDemand layer.
Lang Hames [Wed, 7 Oct 2015 21:53:41 +0000 (21:53 +0000)]
[Orc] Enable user supplied partitioning functors in the CompileOnDemand layer.

Previously the CompileOnDemand layer always created single-function partitions.
In theory this new API allows for more interesting partitions, though this has
not been well tested yet.

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

9 years ago[WinEH] Refer to filter funclets using their symbol-table symbol
David Majnemer [Wed, 7 Oct 2015 21:34:00 +0000 (21:34 +0000)]
[WinEH] Refer to filter funclets using their symbol-table symbol

The relocation for the filter funclet will be against a symbol table
entry for a function instead of the section, making it easier to
understand what is going on.

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

9 years ago[RS4GC] Use AssertingVH for RematerializedValueMapTy, NFCI
Sanjoy Das [Wed, 7 Oct 2015 21:32:35 +0000 (21:32 +0000)]
[RS4GC] Use AssertingVH for RematerializedValueMapTy, NFCI

Reviewers: reames, swaroop.sridhar

Subscribers: llvm-commits

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

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

9 years ago[WinEH] Undo the effect of r249578 for 32-bit
Reid Kleckner [Wed, 7 Oct 2015 21:13:15 +0000 (21:13 +0000)]
[WinEH] Undo the effect of r249578 for 32-bit

The __CxxFrameHandler3 tables for 32-bit are supposed to hold stack
offsets relative to EBP, not ESP. I blindly updated the win-catchpad.ll
test case, and immediately noticed that 32-bit catching stopped working.

While I'm at it, move the frame index to frame offset WinEH table logic
out of PEI.  PEI shouldn't have to know about WinEHFuncInfo. I realized
we can calculate frame index offsets just fine from the table printer.

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

9 years ago[WinEH] Remove unreachable blocks before preparation
David Majnemer [Wed, 7 Oct 2015 21:08:25 +0000 (21:08 +0000)]
[WinEH] Remove unreachable blocks before preparation

We remove unreachable blocks because it is pointless to consider them
for coloring.  However, we still had stale pointers to these blocks in
some data structures after we removed them from the function.

Instead, remove the unreachable blocks before attempting to do anything
with the function.

This fixes PR25099.

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

9 years agoSupport: Stop using iplist in Recycler
Duncan P. N. Exon Smith [Wed, 7 Oct 2015 20:49:09 +0000 (20:49 +0000)]
Support: Stop using iplist in Recycler

Recycler just needs a singly-linked list, and it takes less (and
simpler) code to hand-roll one of those than to build up the equivalent
`iplist_traits`.  In theory, this should speed things up a bit too, but
this is really just a drive-by cleanup so I haven't measured.

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

9 years agogit-clang-format r249548.
Rafael Espindola [Wed, 7 Oct 2015 20:32:24 +0000 (20:32 +0000)]
git-clang-format r249548.

Sorry for missing this the first time.

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

9 years ago[mips][FastISel] Factor out common code from switch statement. NFC
Vasileios Kalintiris [Wed, 7 Oct 2015 20:06:30 +0000 (20:06 +0000)]
[mips][FastISel] Factor out common code from switch statement. NFC

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

9 years agoIR: Create SymbolTableList wrapper around iplist, NFC
Duncan P. N. Exon Smith [Wed, 7 Oct 2015 20:05:10 +0000 (20:05 +0000)]
IR: Create SymbolTableList wrapper around iplist, NFC

Create `SymbolTableList`, a wrapper around `iplist` for lists that
automatically manage a symbol table.  This commit reduces a ton of code
duplication between the six traits classes that were used previously.

As a drive by, reduce the number of template parameters from 2 to 1 by
using a SymbolTableListParentType metafunction (I originally had this as
a separate commit, but it touched most of the same lines so I squashed
them).

I'm in the process of trying to remove the UB in `createSentinel()` (see
the FIXMEs I added for `ilist_embedded_sentinel_traits` and
`ilist_half_embedded_sentinel_traits`).  My eventual goal is to separate
the list logic into a base class layer that knows nothing about (and
isn't templated on) the downcasted nodes -- removing the need to invoke
UB -- but for now I'm just trying to get a handle on all the current use
cases (and cleaning things up as I see them).

Besides these six SymbolTable lists, there are two others that use the
addNode/removeNode/transferNodes() hooks: the `MachineInstruction` and
`MachineBasicBlock` lists.  Ideally there'll be a way to factor these
hooks out of the low-level API entirely, but I'm not quite there yet.

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

9 years ago[IRBuilder] Add gc.statepoint related methods to IRBuilder
Sanjoy Das [Wed, 7 Oct 2015 19:52:12 +0000 (19:52 +0000)]
[IRBuilder] Add gc.statepoint related methods to IRBuilder

Summary:
This adds some more routines to `IRBuilder` around creating calls and
invokes to `gc.statepoint`.  These will be used later.

Reviewers: reames, swaroop.sridhar

Subscribers: sanjoy, llvm-commits

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

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

9 years ago[mips][FastISel] Use ternary operator to select opcode. NFC
Vasileios Kalintiris [Wed, 7 Oct 2015 19:43:31 +0000 (19:43 +0000)]
[mips][FastISel] Use ternary operator to select opcode. NFC

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

9 years ago[WinEH] Set NoModuleLevelChanges in clone flags
Joseph Tremoulet [Wed, 7 Oct 2015 19:29:56 +0000 (19:29 +0000)]
[WinEH] Set NoModuleLevelChanges in clone flags

Summary:
This is necessary to keep the cloner from making bogus copies of debug
metadata attached to the IR it is cloning.
Also, avoid running RemapInstruction over all instructions in the common
case that no cloning was performed.

Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: llvm-commits

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

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

9 years agoUse SpecificBumpPtrAllocator to simplify the MCSeciton destruction.
Rafael Espindola [Wed, 7 Oct 2015 19:08:19 +0000 (19:08 +0000)]
Use SpecificBumpPtrAllocator to simplify the MCSeciton destruction.

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

9 years ago[X86]Update test to use FileCheck.
Kevin B. Smith [Wed, 7 Oct 2015 18:21:41 +0000 (18:21 +0000)]
[X86]Update test to use FileCheck.
Updates this test to use FileCheck and a single llc invocation rather than
3 llc invocations and grep.

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

9 years agoRevert "Revert "This patch builds on top of D13378 to handle constant condition.""
Mehdi Amini [Wed, 7 Oct 2015 18:14:25 +0000 (18:14 +0000)]
Revert "Revert "This patch builds on top of D13378 to handle constant condition.""

This reverts commit r249528 and reapply r249431. The fix for the
fallout has been commited in r249575.

From: Mehdi Amini <mehdi.amini@apple.com>

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

9 years ago[mips][FastISel] Simple refactoring of MipsFastISel::emitLogicalOP(). NFC.
Vasileios Kalintiris [Wed, 7 Oct 2015 18:14:24 +0000 (18:14 +0000)]
[mips][FastISel] Simple refactoring of MipsFastISel::emitLogicalOP(). NFC.

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

9 years ago[AArch64] Fold a floating-point divide by power of two into fp conversion.
Chad Rosier [Wed, 7 Oct 2015 17:51:37 +0000 (17:51 +0000)]
[AArch64] Fold a floating-point divide by power of two into fp conversion.

Part of http://reviews.llvm.org/D13442

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

9 years ago[WinEH] Fix two minor issues in __CxxFrameHandler3 tables
Reid Kleckner [Wed, 7 Oct 2015 17:49:32 +0000 (17:49 +0000)]
[WinEH] Fix two minor issues in __CxxFrameHandler3 tables

There was an off-by-one bug in ip2state tables which manifested when one
call immediately preceded the try-range of the next. The return address
of the previous call would appear to be within the try range of the next
scope, resulting in extra destructors or catches running.

We also computed the wrong offset for catch parameter stack objects. The
offset should be from RSP, not from RBP.

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

9 years agoAMDGPU: Fix missing implicit m0 uses on movrel instructions
Matt Arsenault [Wed, 7 Oct 2015 17:46:32 +0000 (17:46 +0000)]
AMDGPU: Fix missing implicit m0 uses on movrel instructions

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

9 years ago[AArch64] Fold a floating-point multiply by power of two into fp conversion.
Chad Rosier [Wed, 7 Oct 2015 17:39:18 +0000 (17:39 +0000)]
[AArch64] Fold a floating-point multiply by power of two into fp conversion.

Part of http://reviews.llvm.org/D13442

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

9 years ago[IndVars] Preserve LCSSA in `eliminateIdentitySCEV`
Sanjoy Das [Wed, 7 Oct 2015 17:38:31 +0000 (17:38 +0000)]
[IndVars] Preserve LCSSA in `eliminateIdentitySCEV`

Summary:
After r249211, SCEV can see through some LCSSA phis.  Add a
`replacementPreservesLCSSAForm` check before replacing uses of these phi
nodes with a simplified use of the induction variable to avoid breaking
LCSSA.

Fixes 25047.

Depends on D13460.

Reviewers: atrick, hfinkel

Subscribers: llvm-commits

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

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

9 years ago[SCEV] Use some C++11'ism, NFC
Sanjoy Das [Wed, 7 Oct 2015 17:38:25 +0000 (17:38 +0000)]
[SCEV] Use some C++11'ism, NFC

Summary:

Subscribers: llvm-commits

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

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

9 years ago[ARM] Promote helper function to SelectionDAG.
Chad Rosier [Wed, 7 Oct 2015 17:28:58 +0000 (17:28 +0000)]
[ARM] Promote helper function to SelectionDAG.

I'll be using the function in a similar combine for AArch64.  The helper was
also improved to handle undef values.

Part of http://reviews.llvm.org/D13442

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

9 years agoTest commit access. Fixed comment to have correct input parameter name and
Kevin B. Smith [Wed, 7 Oct 2015 17:24:25 +0000 (17:24 +0000)]
Test commit access. Fixed comment to have correct input parameter name and
period termination.

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

9 years ago[WinEH] Update CoreCLR EH for catchpad MBBs
Joseph Tremoulet [Wed, 7 Oct 2015 17:16:25 +0000 (17:16 +0000)]
[WinEH] Update CoreCLR EH for catchpad MBBs

Summary:
Set the pad MBB as a funclet entry for CoreCLR as well as MSVCCXX, and
update state numbering to put the catchpad block rather than its normal
successor into the unwind map.

Reviewers: majnemer

Subscribers: llvm-commits

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

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

9 years ago[ARM] Use correct half-precision functions in EABI mode
Oliver Stannard [Wed, 7 Oct 2015 16:58:49 +0000 (16:58 +0000)]
[ARM] Use correct half-precision functions in EABI mode

The ARM RTABI defines the half- to single-precision float conversion functions
with an __aeabi prefix, but libgcc only has them with a __gnu prefix. Therefore
we need to emit the __aeabi version when compiling with an eabi or eabihf
triple, and the __gnu version with a gnueabi or gnueabihf triple.

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

9 years agoMove test back to Generic now it's fixed the right way (thanks Eric!)
David Blaikie [Wed, 7 Oct 2015 16:26:28 +0000 (16:26 +0000)]
Move test back to Generic now it's fixed the right way (thanks Eric!)

I knee-jerk tried to fix this in completely the wrong way - it's not an
CPU limitation, but an OS/object file type one, so moving it
into a CPU-specific classification didn't help at all.

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

9 years ago[ARM] Prevent PerformVDIVCombine from combining a vcvt/vdiv with 8 lanes.
Chad Rosier [Wed, 7 Oct 2015 16:15:40 +0000 (16:15 +0000)]
[ARM] Prevent PerformVDIVCombine from combining a vcvt/vdiv with 8 lanes.

This would result in a crash since the vcvt used does not support v8i32 types.

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

9 years agoTeach computeKnownBits to use new align attribute/metadata
Artur Pilipenko [Wed, 7 Oct 2015 16:01:18 +0000 (16:01 +0000)]
Teach computeKnownBits to use new align attribute/metadata

Reviewed By: reames

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

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

9 years ago[ARM][AArch64] Only lower to interleaved load/store if the target has NEON
Jeroen Ketema [Wed, 7 Oct 2015 14:53:29 +0000 (14:53 +0000)]
[ARM][AArch64] Only lower to interleaved load/store if the target has NEON

Without an additional check for NEON, the compiler crashes during
legalization of NEON ldN/stN.

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

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

9 years agoUse non virtual destructors for sections.
Rafael Espindola [Wed, 7 Oct 2015 13:46:06 +0000 (13:46 +0000)]
Use non virtual destructors for sections.

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

9 years ago[ARM] Push more complex check down to reduce compile time. NFC.
Chad Rosier [Wed, 7 Oct 2015 13:40:44 +0000 (13:40 +0000)]
[ARM] Push more complex check down to reduce compile time. NFC.

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

9 years agoDon't repeat names in comments and don't indent in namespaces. NFC.
Rafael Espindola [Wed, 7 Oct 2015 13:38:49 +0000 (13:38 +0000)]
Don't repeat names in comments and don't indent in namespaces. NFC.

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

9 years agoRevert: r249536 - Testing commit access with a trival whitespace change.
Scott Egerton [Wed, 7 Oct 2015 10:57:06 +0000 (10:57 +0000)]
Revert: r249536 - Testing commit access with a trival whitespace change.

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

9 years agoTesting commit access with a trival whitespace change.
Scott Egerton [Wed, 7 Oct 2015 10:49:49 +0000 (10:49 +0000)]
Testing commit access with a trival whitespace change.

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

9 years agoRevert "This patch builds on top of D13378 to handle constant condition."
James Molloy [Wed, 7 Oct 2015 09:03:34 +0000 (09:03 +0000)]
Revert "This patch builds on top of D13378 to handle constant condition."

This reverts commit r249431. This caused failures in sqlite3: http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/14453

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

9 years ago[EarlyCSE] Fix handling of target memory intrinsics for CSE'ing loads.
Arnaud A. de Grandmaison [Wed, 7 Oct 2015 07:41:29 +0000 (07:41 +0000)]
[EarlyCSE] Fix handling of target memory intrinsics for CSE'ing loads.

Summary:
Some target intrinsics can access multiple elements, using the pointer as a
base address (e.g. AArch64 ld4). When trying to CSE such instructions,
it must be checked the available value comes from a compatible instruction
because the pointer is not enough to discriminate whether the value is
correct.

Reviewers: ssijaric

Subscribers: mcrosier, llvm-commits, aemerson

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

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

9 years ago[X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before calls
Michael Kuperstein [Wed, 7 Oct 2015 07:01:31 +0000 (07:01 +0000)]
[X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before calls

When outgoing function arguments are passed using push instructions, and EH
is enabled, we may need to indicate to the stack unwinder that the stack
pointer was adjusted before the call.

This should fix the exception handling issues in PR24792.

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

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

9 years agoAVX512: Change encoding of vpshuflw and vpshufhw instructions. Implement WIG as W0...
Igor Breger [Wed, 7 Oct 2015 06:31:18 +0000 (06:31 +0000)]
AVX512: Change encoding of vpshuflw and vpshufhw instructions. Implement WIG as W0 and not W1, like all other instruction have been implemented.
Add encoding tests.

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

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

9 years ago[RS4GC] Remove an unnecessary assert & related variables
Sanjoy Das [Wed, 7 Oct 2015 02:39:27 +0000 (02:39 +0000)]
[RS4GC] Remove an unnecessary assert & related variables

I don't think this assert adds much value, and removing it and related
variables avoids an "unused variable" warning in release builds.

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

9 years ago[OperandBundles] Add an accessor to get an operand bundle by tag
Sanjoy Das [Wed, 7 Oct 2015 02:39:24 +0000 (02:39 +0000)]
[OperandBundles] Add an accessor to get an operand bundle by tag

Not used at the moment, but will be used in a later change to
RewriteStatepointsForGC.

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

9 years ago[OperandBundles] Remove a useless accessor from OperandBundleUser
Sanjoy Das [Wed, 7 Oct 2015 02:39:21 +0000 (02:39 +0000)]
[OperandBundles] Remove a useless accessor from OperandBundleUser

Since the `const` version of `getOperandBundle` returns a value of the
same type as the non-`const` version, the non-`const` version is
redundant.

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

9 years ago[RS4GC] Cosmetic cleanup, NFC
Sanjoy Das [Wed, 7 Oct 2015 02:39:18 +0000 (02:39 +0000)]
[RS4GC] Cosmetic cleanup, NFC

Summary:
A series of cosmetic cleanup changes to RewriteStatepointsForGC:

  - Rename variables to LLVM style
  - Remove some redundant asserts
  - Remove an unsued `Pass *` parameter
  - Remove unnecessary variables
  - Use C++11 idioms where applicable
  - Pass CallSite by value, not reference

Reviewers: reames, swaroop.sridhar

Subscribers: llvm-commits, sanjoy

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

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

9 years agoRemove the comdat-ness from the testcase as it won't lower properly
Eric Christopher [Wed, 7 Oct 2015 01:52:33 +0000 (01:52 +0000)]
Remove the comdat-ness from the testcase as it won't lower properly
on darwin with it since darwin doesn't have comdat and it isn't
necessary for the testcase.

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

9 years agoAMDGPU: Add comment for VOP2b operand class
Matt Arsenault [Wed, 7 Oct 2015 01:36:00 +0000 (01:36 +0000)]
AMDGPU: Add comment for VOP2b operand class

Because of the constant bus requirement, it is never legal to
use a literal constant for these instructions despite the encoding
allowing it. This was already doing the right thing, but note why.

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

9 years agoUpdate test to use FileCheck and clean up run lines to match the
Eric Christopher [Wed, 7 Oct 2015 01:21:49 +0000 (01:21 +0000)]
Update test to use FileCheck and clean up run lines to match the
expected behavior.

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

9 years agoAMDGPU: Properly register passes
Matt Arsenault [Wed, 7 Oct 2015 00:42:53 +0000 (00:42 +0000)]
AMDGPU: Properly register passes

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

9 years agoAMDGPU: Use explicit register size indirect pseudos
Matt Arsenault [Wed, 7 Oct 2015 00:42:51 +0000 (00:42 +0000)]
AMDGPU: Use explicit register size indirect pseudos

This stops using an unknown reg class operand.

Currently build_vector selection has a broken looking check
where it tries to use a VGPR reg class and an SGPR one if it
sees an SGPR use.

With the source operand has an explicit VGPR class,
illegal copies will be inserted that SIFixSGPRCopies will take care
of normally later, which will allow removing the weird check
of build_vector users. Without this, when removed v_movrels_b32 would
still be emitted even though all of the values were only stored in
SGPRs.

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

9 years agoAMDGPU: Remove inferRegClassFromUses / inferRegClassFromDefs
Matt Arsenault [Wed, 7 Oct 2015 00:42:31 +0000 (00:42 +0000)]
AMDGPU: Remove inferRegClassFromUses / inferRegClassFromDefs

I'm not sure why this would be necessary, and no tests fail with
them removed. Looking at the uses is suspect as well because
the use reg classes will likely change when the users are moved
as a result of moving this instruction.

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

9 years ago[SEH] Add llvm.eh.exceptioncode intrinsic
Reid Kleckner [Wed, 7 Oct 2015 00:27:33 +0000 (00:27 +0000)]
[SEH] Add llvm.eh.exceptioncode intrinsic

This will support the Clang __exception_code intrinsic.

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

9 years agoInstCombine: Fold comparisons between unguessable allocas and other pointers
Hans Wennborg [Wed, 7 Oct 2015 00:20:07 +0000 (00:20 +0000)]
InstCombine: Fold comparisons between unguessable allocas and other pointers

This will allow us to optimize code such as:

  int f(int *p) {
    int x;
    return p == &x;
  }

as well as:

  int *allocate(void);
  int f() {
    int x;
    int *p = allocate();
    return p == &x;
  }

The folding can only be done under certain circumstances. Even though p and &x
cannot alias, the comparison must still return true if the pointer
representations are equal. If a user successfully generates a p that's a
correct guess for &x, comparison should return true even though p is an invalid
pointer.

This patch argues that if the address of the alloca isn't observable outside the
function, the function can act as-if the address is impossible to guess from the
outside. The tricky part is keeping the act consistent: if we fold p == &x to
false in one place, we must make sure to fold any other comparisons based on
those pointers similarly. To ensure that, we only fold when &x is involved
exactly once in comparison instructions.

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

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

9 years agoMove test to X86-specific due to some IR invalid on other targets
David Blaikie [Wed, 7 Oct 2015 00:17:31 +0000 (00:17 +0000)]
Move test to X86-specific due to some IR invalid on other targets

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

9 years agoDebugInfo: Include the decl_line/decl_file in subprogram definitions if they differ...
David Blaikie [Wed, 7 Oct 2015 00:04:16 +0000 (00:04 +0000)]
DebugInfo: Include the decl_line/decl_file in subprogram definitions if they differ from those in the declaration

This is handy for some AutoFDO stuff, and seems like a minor improvement
to correctness (otherwise a debug info consumer might think the decl
line/file of the def was the same as that of the declaration - though
what a consumer might use that for, I'm not sure - maybe "list <func>"
would've misbehaved with the old behavior?) and at a minor cost (in my
experiment, with fission, without type units, without compression, 0.01%
growth in debug info in the executable/objects, 0.02% growth in the .dwo
files).

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

9 years ago[WinEH] Create a separate MBB for funclet prologues
David Majnemer [Tue, 6 Oct 2015 23:31:59 +0000 (23:31 +0000)]
[WinEH] Create a separate MBB for funclet prologues

Our current emission strategy is to emit the funclet prologue in the
CatchPad's normal destination.  This is problematic because
intra-funclet control flow to the normal destination is not erroneous
and results in us reevaluating the prologue if said control flow is
taken.

Instead, use the CatchPad's location for the funclet prologue.  This
correctly models our desire to have unwind edges evaluate the prologue
but edges to the normal destination result in typical control flow.

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

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

9 years agoFix Clang-tidy modernize-use-nullptr warnings in source directories and generated...
Hans Wennborg [Tue, 6 Oct 2015 23:24:35 +0000 (23:24 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings in source directories and generated files; other minor cleanups.

Patch by Eugene Zelenko!

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

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

9 years ago[Orc] Teach the CompileOnDemand layer to clone aliases.
Lang Hames [Tue, 6 Oct 2015 22:55:05 +0000 (22:55 +0000)]
[Orc] Teach the CompileOnDemand layer to clone aliases.

This allows modules containing aliases to be lazily jit'd. Previously these
failed with missing symbol errors because the aliases weren't cloned from the
original module.

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

9 years agoIR: Use auto for iterators, NFC
Duncan P. N. Exon Smith [Tue, 6 Oct 2015 22:37:47 +0000 (22:37 +0000)]
IR: Use auto for iterators, NFC

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

9 years agoFix two bugs in llvm-objdump’s printing of Objective-C meta data
Kevin Enderby [Tue, 6 Oct 2015 22:27:08 +0000 (22:27 +0000)]
Fix two bugs in llvm-objdump’s printing of Objective-C meta data
from malformed Mach-O files that caused crashes.

We recently got about 700 malformed Mach-O files which we have
been using the improve the robustness of tools that deal with reading
data from object files.  These resulted in about 20 small bug fixes to
the darwin based tools.

The goal here is to also improve the robustness of llvm-objdump and
this is the first two fixes.  In talking with Tim Northover the approach
we thought might be best is to:

1) Only include tests for the malformed Mach-O files that cause crashes
(not all 700+ tests).
2) The test should only contain the command line option that caused the
crash and not all the others that don’t matter.
3) There should be only one line for the FileCheck that is past the point
of the crash if possible and if possible indicates the malformation.

Again the goal is to fix crashes and not so much care about how the
printing of malformed data comes out.

Tim also suggested if we really wanted to add test cases for all 700+
malformed Mach-O files putting them in the regression tests might be
an option.  But many of these do not cause crashes.

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

9 years agoIR: Remove unnecessary TraitsClass typedef, NFC
Duncan P. N. Exon Smith [Tue, 6 Oct 2015 22:14:06 +0000 (22:14 +0000)]
IR: Remove unnecessary TraitsClass typedef, NFC

No classes are specializing the symbol table traits, so no need to look
through a typedef for class API.  Make a few more functions private
since only SymbolTableListTraits should be using them.

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

9 years agoCodeGen: s/protected:/private:/ in MachineBasicBlock, NFC
Duncan P. N. Exon Smith [Tue, 6 Oct 2015 21:48:31 +0000 (21:48 +0000)]
CodeGen: s/protected:/private:/ in MachineBasicBlock, NFC

Nothing inherits from `MachineBasicBlock`, so this should have no real
functionality change.  Just makes the code easier to understand.

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

9 years ago[IndVars] Don't break dominance in `eliminateIdentitySCEV`
Sanjoy Das [Tue, 6 Oct 2015 21:44:49 +0000 (21:44 +0000)]
[IndVars] Don't break dominance in `eliminateIdentitySCEV`

Summary:
After r249211, `getSCEV(X) == getSCEV(Y)` does not guarantee that X and
Y are related in the dominator tree, even if X is an operand to Y (I've
included a toy example in comments, and a real example as a test case).

This commit changes `SimplifyIndVar` to require a `DominatorTree`.  I
don't think this is a problem because `ScalarEvolution` requires it
anyway.

Fixes PR25051.

Depends on D13459.

Reviewers: atrick, hfinkel

Subscribers: joker.eph, llvm-commits, sanjoy

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

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

9 years ago[IndVars] Extract out eliminateIdentitySCEV, NFC
Sanjoy Das [Tue, 6 Oct 2015 21:44:39 +0000 (21:44 +0000)]
[IndVars] Extract out eliminateIdentitySCEV, NFC

Summary:
Reflow a comment while at it.

Subscribers: llvm-commits

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

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

9 years agoIR: Remove unnecessary specialization of getSymTab(), NFC
Duncan P. N. Exon Smith [Tue, 6 Oct 2015 21:31:07 +0000 (21:31 +0000)]
IR: Remove unnecessary specialization of getSymTab(), NFC

The only specializations of `getSymTab()` were identical to the default
defined in `SymbolTableListTraits::getSymTab()`.  Remove the
specializations, and stop treating it like a configuration point.  Just
to be sure no one else accesses this, make it private.

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

9 years agoAMDGPU/SI: Remove calling convention assertion from LowerFormalArguments()
Tom Stellard [Tue, 6 Oct 2015 21:16:34 +0000 (21:16 +0000)]
AMDGPU/SI: Remove calling convention assertion from LowerFormalArguments()

Summary:
We currently ignore the calling convention, so there is no real reason to
assert on the calling convention of functions.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

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

9 years ago[ARM] Minor refactoring. NFC.
Chad Rosier [Tue, 6 Oct 2015 20:58:42 +0000 (20:58 +0000)]
[ARM] Minor refactoring. NFC.

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

9 years ago[ARM] Minor refactoring. NFC.
Chad Rosier [Tue, 6 Oct 2015 20:51:26 +0000 (20:51 +0000)]
[ARM] Minor refactoring. NFC.

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

9 years ago[ARM] Minor refactoring. NFC.
Chad Rosier [Tue, 6 Oct 2015 20:45:45 +0000 (20:45 +0000)]
[ARM] Minor refactoring. NFC.

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

9 years ago[Function] Clean up {prefix,prologue} data routines (NFC)
Vedant Kumar [Tue, 6 Oct 2015 20:31:57 +0000 (20:31 +0000)]
[Function] Clean up {prefix,prologue} data routines (NFC)

Factor out some common code used to get+set function prefix/prologue
data. This may come in handy if we ever decide to store personality
functions in the same way we store prefix/prologue data.

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

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

9 years ago[WinEH] Implement state numbering for CoreCLR
Joseph Tremoulet [Tue, 6 Oct 2015 20:30:33 +0000 (20:30 +0000)]
[WinEH] Implement state numbering for CoreCLR

Summary:
Assign one state number per handler/funclet, tracking parent state,
handler type, and catch type token.
State numbers are arranged such that ancestors have lower state numbers
than their descendants.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: pgavlin, AndyAyers, llvm-commits

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

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

9 years ago[WinEH] Recognize CoreCLR personality function
Joseph Tremoulet [Tue, 6 Oct 2015 20:28:16 +0000 (20:28 +0000)]
[WinEH] Recognize CoreCLR personality function

Summary:
 - Add CoreCLR to if/else ladders and switches as appropriate.
 - Rename isMSVCEHPersonality to isFuncletEHPersonality to better
   reflect what it captures.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: pgavlin, AndyAyers, llvm-commits

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

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

9 years ago[ARM] Minor refactoring to improve readability. NFC.
Chad Rosier [Tue, 6 Oct 2015 20:23:42 +0000 (20:23 +0000)]
[ARM] Minor refactoring to improve readability. NFC.

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

9 years agoExtend known bits to understand @llvm.bswap
Philip Reames [Tue, 6 Oct 2015 20:20:45 +0000 (20:20 +0000)]
Extend known bits to understand @llvm.bswap

This is a cleaned up patch from the one written by John Regehr based on the findings of the Souper superoptimizer.

When writing tests, I was surprised to find that instsimplify apparently doesn't know how to collapse bit test sequences based purely on known bits. This required me to split my tests across both instsimplify and instcombine.

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

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

9 years agoFix pr25040 - Handle vectors of i1s in recently added implication code
Philip Reames [Tue, 6 Oct 2015 19:00:02 +0000 (19:00 +0000)]
Fix pr25040 - Handle vectors of i1s in recently added implication code

As mentioned in the bug, I'd missed the presence of a getScalarType in the caller of the new implies method. As a result, when we ended up with a implication over two vectors, we'd trip an assert and crash.

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

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

9 years agoIR: Use typedefs for getSublistAccess(), NFC
Duncan P. N. Exon Smith [Tue, 6 Oct 2015 18:33:43 +0000 (18:33 +0000)]
IR: Use typedefs for getSublistAccess(), NFC

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

9 years ago[Hexagon] Remove ZeroOrMore from option flags
Krzysztof Parzyszek [Tue, 6 Oct 2015 18:29:36 +0000 (18:29 +0000)]
[Hexagon] Remove ZeroOrMore from option flags

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

9 years ago[ARM] Simplify tests and make checks more rigid. NFC.
Chad Rosier [Tue, 6 Oct 2015 17:54:12 +0000 (17:54 +0000)]
[ARM] Simplify tests and make checks more rigid. NFC.

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

9 years agoThis patch builds on top of D13378 to handle constant condition.
Mehdi Amini [Tue, 6 Oct 2015 17:19:20 +0000 (17:19 +0000)]
This patch builds on top of D13378 to handle constant condition.

With this patch, clang -O3 optimizes correctly providing > 1000x speedup on this artificial benchmark):

for (a=0; a<n; a++)
    for (b=0; b<n; b++)
        for (c=0; c<n; c++)
            for (d=0; d<n; d++)
                for (e=0; e<n; e++)
                    for (f=0; f<n; f++)
                        x++;
From test-suite/SingleSource/Benchmarks/Shootout/nestedloop.c

Reviewers: sanjoyd

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

9 years agoAMDGPU/SI: Add 64-bit versions of v_nop and v_clrexcp
Tom Stellard [Tue, 6 Oct 2015 15:57:53 +0000 (15:57 +0000)]
AMDGPU/SI: Add 64-bit versions of v_nop and v_clrexcp

Summary:
The assembly printing of these is still missing the encoding size
suffix, but this will be fixed in a later commit.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

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

9 years ago[Hexagon] Add an early if-conversion pass
Krzysztof Parzyszek [Tue, 6 Oct 2015 15:49:14 +0000 (15:49 +0000)]
[Hexagon] Add an early if-conversion pass

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

9 years ago[mips][microMIPS] Fix an issue with selecting sqrt instruction in LLVM backend
Daniel Sanders [Tue, 6 Oct 2015 15:17:25 +0000 (15:17 +0000)]
[mips][microMIPS] Fix an issue with selecting sqrt instruction in LLVM backend

Summary:
This fixes 7 tests during fast LLVM test-suite run:
* MultiSource/Benchmarks/McCat/18-imp/imp
* MultiSource/Applications/oggenc/oggenc
* MultiSource/Benchmarks/MallocBench/gs/gs
* MultiSource/Benchmarks/MiBench/automotive-susan/automotive-susan
* MultiSource/Benchmarks/VersaBench/beamformer/beamformer
* MultiSource/Benchmarks/MiBench/consumer-lame/consumer-lame
* MultiSource/Benchmarks/Bullet/bullet

Error message was in the form of:
fatal error: error in backend: Cannot select: 0x95c3288: f32 = fsqrt 0x95c0190 [ORD=9] [ID=18]
  0x95c0190: f32 = fadd 0x95bef30, 0x95c4d00 [ORD=8] [ID=17]
    0x95bef30: f32 = fmul 0x95c4988, 0x95c4988 [ORD=5] [ID=16]
...

There was problem with selecting sqrt instruction in LLVM backend.

To fix the issue changes are made in TableGen definition for sqrt instruction in MipsInstrFPU.td and new test file sqrt.ll is added to LLVM regression tests.

Patch by Zlatko Buljan

Reviewers: zoran.jovanovic, hvarga, dsanders

Subscribers: llvm-commits, petarj

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

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

9 years agoRevert r249123 - [mips][microMIPS] Fix an issue with selecting sqrt instruction in...
Daniel Sanders [Tue, 6 Oct 2015 15:13:16 +0000 (15:13 +0000)]
Revert r249123 - [mips][microMIPS] Fix an issue with selecting sqrt instruction in LLVM backend

The author was not credited and most of the commit message is missing. Will re-commit with this fixed.

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

9 years ago[EarlyCSE] Constify ParseMemoryInst methods (NFC).
Arnaud A. de Grandmaison [Tue, 6 Oct 2015 13:35:30 +0000 (13:35 +0000)]
[EarlyCSE] Constify ParseMemoryInst methods (NFC).

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

9 years agoMake sure the CastInst is valid before trying to create it
Filipe Cabecinhas [Tue, 6 Oct 2015 12:37:54 +0000 (12:37 +0000)]
Make sure the CastInst is valid before trying to create it

Bug found with afl-fuzz.

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

9 years ago[InstCombine] Teach SimplifyDemandedVectorElts how to handle ConstantVector select...
Andrea Di Biagio [Tue, 6 Oct 2015 10:34:53 +0000 (10:34 +0000)]
[InstCombine] Teach SimplifyDemandedVectorElts how to handle ConstantVector select masks with ConstantExpr elements (PR24922)

If the mask of a select instruction is a ConstantVector, method
SimplifyDemandedVectorElts iterates over the mask elements to identify which
values are selected from the select inputs.

Before this patch, method SimplifyDemandedVectorElts always used method
Constant::isNullValue() to check if a value in the mask was zero. Unfortunately
that method always returns false when called on a ConstantExpr.

This patch fixes the problem in SimplifyDemandedVectorElts by adding an explicit
check for ConstantExpr values. Now, if a value in the mask is a ConstantExpr, we
avoid calling isNullValue() on it.

Fixes PR24922.

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

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