oota-llvm.git
9 years agoAMDGPU/SI: use S_AND for i1 trunc
Marek Olsak [Thu, 29 Oct 2015 15:05:03 +0000 (15:05 +0000)]
AMDGPU/SI: use S_AND for i1 trunc

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

9 years ago[mips] wrong opcode for ll/sc instructions on mipsr6 when -integrated-as is used
Zoran Jovanovic [Thu, 29 Oct 2015 14:40:19 +0000 (14:40 +0000)]
[mips] wrong opcode for ll/sc instructions on mipsr6 when -integrated-as is used

Summary:
This commit resolves wrong opcodes for ll and sc instructions for r6 architecutres, which were generated in method MipsTargetLowering::emitAtomicBinary.

Author: Jelena.Losic

Reviewers: dsanders

Subscribers: dsanders, llvm-commits

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

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

9 years agoRecognize that ARM1176JZ[F]-S support TrustZone
Artyom Skrobov [Thu, 29 Oct 2015 13:56:19 +0000 (13:56 +0000)]
Recognize that ARM1176JZ[F]-S support TrustZone

Summary:
ARMv6KZ cores were set up incorrectly in ARM.td; also, the SMI mnemonic
(the old name for SMC, as defined in ARMv6KZ) wasn't supported.

Reviewers: jmolloy, rengolin

Subscribers: aemerson, rengolin, llvm-commits

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

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

9 years ago[sanitizer] [msan] Unify aarch64 mapping
Adhemerval Zanella [Thu, 29 Oct 2015 13:02:30 +0000 (13:02 +0000)]
[sanitizer] [msan] Unify aarch64 mapping

This patch unify the 39-bit and 42-bit mapping for aarch64 to use only
one instrumentation algorithm.  This removes compiler flag
SANITIZER_AARCH64_VMA requirement for MSAN on aarch64.

The mapping to use now is for 39 and 42-bits:

    0x00000000000ULL-0x01000000000ULL  MappingDesc::INVALID
    0x01000000000ULL-0x02000000000ULL  MappingDesc::SHADOW
    0x02000000000ULL-0x03000000000ULL  MappingDesc::ORIGIN
    0x03000000000ULL-0x04000000000ULL  MappingDesc::SHADOW
    0x04000000000ULL-0x05000000000ULL  MappingDesc::ORIGIN
    0x05000000000ULL-0x06000000000ULL  MappingDesc::APP
    0x06000000000ULL-0x07000000000ULL  MappingDesc::INVALID
    0x07000000000ULL-0x08000000000ULL  MappingDesc::APP

And only for 42-bits:

    0x08000000000ULL-0x09000000000ULL  MappingDesc::INVALID
    0x09000000000ULL-0x0A000000000ULL  MappingDesc::SHADOW
    0x0A000000000ULL-0x0B000000000ULL  MappingDesc::ORIGIN
    0x0B000000000ULL-0x0F000000000ULL  MappingDesc::INVALID
    0x0F000000000ULL-0x10000000000ULL  MappingDesc::APP
    0x10000000000ULL-0x11000000000ULL  MappingDesc::INVALID
    0x11000000000ULL-0x12000000000ULL  MappingDesc::APP
    0x12000000000ULL-0x17000000000ULL  MappingDesc::INVALID
    0x17000000000ULL-0x18000000000ULL  MappingDesc::SHADOW
    0x18000000000ULL-0x19000000000ULL  MappingDesc::ORIGIN
    0x19000000000ULL-0x20000000000ULL  MappingDesc::INVALID
    0x20000000000ULL-0x21000000000ULL  MappingDesc::APP
    0x21000000000ULL-0x26000000000ULL  MappingDesc::INVALID
    0x26000000000ULL-0x27000000000ULL  MappingDesc::SHADOW
    0x27000000000ULL-0x28000000000ULL  MappingDesc::ORIGIN
    0x28000000000ULL-0x29000000000ULL  MappingDesc::SHADOW
    0x29000000000ULL-0x2A000000000ULL  MappingDesc::ORIGIN
    0x2A000000000ULL-0x2B000000000ULL  MappingDesc::APP
    0x2B000000000ULL-0x2C000000000ULL  MappingDesc::INVALID
    0x2C000000000ULL-0x2D000000000ULL  MappingDesc::SHADOW
    0x2D000000000ULL-0x2E000000000ULL  MappingDesc::ORIGIN
    0x2E000000000ULL-0x2F000000000ULL  MappingDesc::APP
    0x2F000000000ULL-0x39000000000ULL  MappingDesc::INVALID
    0x39000000000ULL-0x3A000000000ULL  MappingDesc::SHADOW
    0x3A000000000ULL-0x3B000000000ULL  MappingDesc::ORIGIN
    0x3B000000000ULL-0x3C000000000ULL  MappingDesc::APP
    0x3C000000000ULL-0x3D000000000ULL  MappingDesc::INVALID
    0x3D000000000ULL-0x3E000000000ULL  MappingDesc::SHADOW
    0x3E000000000ULL-0x3F000000000ULL  MappingDesc::ORIGIN
    0x3F000000000ULL-0x40000000000ULL  MappingDesc::APP

And although complex it provides a better memory utilization that
previous one.

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

9 years agoFix use-after-free. Thanks ASAN for giving me a detailed report :-).
Daniel Jasper [Thu, 29 Oct 2015 12:49:37 +0000 (12:49 +0000)]
Fix use-after-free. Thanks ASAN for giving me a detailed report :-).

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

9 years ago[mips] Check the register class before replacing materializations of zero with $zero...
Vasileios Kalintiris [Thu, 29 Oct 2015 10:17:16 +0000 (10:17 +0000)]
[mips] Check the register class before replacing materializations of zero with $zero in microMIPS.

Summary:
The microMIPS register class GPRMM16 does not contain the $zero register.
However, MipsSEDAGToDAGISel::replaceUsesWithZeroReg() would replace uses
of the $dst register:

  [d]addiu, $dst, $zero, 0

with the $zero register, without checking for membership in the register
class of the target machine operand.

Reviewers: dsanders

Subscribers: llvm-commits, dsanders

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

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

9 years ago[MachineVerifier] Analyze MachineMemOperands for mem-to-mem moves.
Jonas Paulsson [Thu, 29 Oct 2015 08:28:35 +0000 (08:28 +0000)]
[MachineVerifier] Analyze MachineMemOperands for mem-to-mem moves.

Since the verifier will give false reports if it incorrectly thinks MI is
loading or storing using an FI, it is necessary to scan memoperands and
find out how the FI is used in the instruction. This should be relatively
rare.

Needed to make CodeGen/SystemZ/spill-01.ll pass, which now runs with this flag.

Reviewed by Quentin Colombet.

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

9 years agoOrcJITTests: Update libdeps corresponding to r251604.
NAKAMURA Takumi [Thu, 29 Oct 2015 06:40:04 +0000 (06:40 +0000)]
OrcJITTests: Update libdeps corresponding to r251604.

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

9 years agoRevert the revision 251592 as it fails a test on some platforms.
Cong Hou [Thu, 29 Oct 2015 05:35:22 +0000 (05:35 +0000)]
Revert the revision 251592 as it fails a test on some platforms.

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

9 years agoRevert "ScheduleDAGInstrs: Remove IsPostRA flag"
Matthias Braun [Thu, 29 Oct 2015 05:06:41 +0000 (05:06 +0000)]
Revert "ScheduleDAGInstrs: Remove IsPostRA flag"

It broke 3 arm testcases.

This reverts commit r251608.

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

9 years agoFix an unused variable warning which broke the clang-cmake-mips builder
Philip Reames [Thu, 29 Oct 2015 04:21:49 +0000 (04:21 +0000)]
Fix an unused variable warning which broke the clang-cmake-mips builder

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

9 years ago[WebAssembly] Update opcode name format for conversions
JF Bastien [Thu, 29 Oct 2015 04:10:52 +0000 (04:10 +0000)]
[WebAssembly] Update opcode name format for conversions

Summary:
Conversion opcode name format should be f64.convert_u/i64 not f64_convert_u

Author: s3ththompson
Reviewers: jfb
Subscribers: sunfish, jfb, llvm-commits, dschuff
Differential Revision: http://reviews.llvm.org/D14160

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

9 years ago[PGO] Do not emit runtime hook user function for Linux
Xinliang David Li [Thu, 29 Oct 2015 04:08:31 +0000 (04:08 +0000)]
[PGO] Do not emit runtime hook user function for Linux

Clang driver now injects -u<hook_var> flag in the linker
command line, in which case user function is not needed
any more.

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

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

9 years agoMachineScheduler: Fix typo in debug message
Matthias Braun [Thu, 29 Oct 2015 03:57:28 +0000 (03:57 +0000)]
MachineScheduler: Fix typo in debug message

Maybe I just missed the humor there ;-)

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

9 years agoScheduleDAGInstrs: Remove IsPostRA flag
Matthias Braun [Thu, 29 Oct 2015 03:57:24 +0000 (03:57 +0000)]
ScheduleDAGInstrs: Remove IsPostRA flag

This was a layering violation in ScheduleDAGInstrs (and
MachineSchedulerBase) they both shouldn't know directly whether they are
used by the PostMachineScheduler or the MachineScheduler.

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

9 years agoMachineScheduler: Use ranged for and slightly simplify the code
Matthias Braun [Thu, 29 Oct 2015 03:57:17 +0000 (03:57 +0000)]
MachineScheduler: Use ranged for and slightly simplify the code

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

9 years ago[LVI/CVP] Teach LVI about range metadata
Philip Reames [Thu, 29 Oct 2015 03:57:17 +0000 (03:57 +0000)]
[LVI/CVP] Teach LVI about range metadata

Somewhat shockingly for an analysis pass which is computing constant ranges, LVI did not understand the ranges provided by range metadata.

As part of this change, I included a change to CVP primarily because doing so made it much easier to write small self contained test cases. CVP was previously only handling the non-local operand case, but given that LVI can sometimes figure out information about instructions standalone, I don't see any reason to restrict this.  There could possibly be a compile time impact from this, but I suspect it should be minimal.  If anyone has an example which substaintially regresses, please let me know.  I could restrict the block local handling to ICmps feeding Terminator instructions if needed.

Note that this patch continues a somewhat bad practice in LVI. In many cases, we know facts about values, and separate context sensitive facts about values. LVI makes no effort to distinguish and will frequently cache the same value fact repeatedly for different contexts. I would like to change this, but that's a large enough change that I want it to go in separately with clear documentation of what's changing. Other examples of this include the non-null handling, and arguments.

As a meta comment: the entire motivation of this change was being able to write smaller (aka reasonable sized) test cases for a future patch teaching LVI about select instructions.

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

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

9 years ago[Orc] Add missing file for r251604.
Lang Hames [Thu, 29 Oct 2015 03:53:42 +0000 (03:53 +0000)]
[Orc] Add missing file for r251604.

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

9 years ago[Orc] Add support for RuntimeDyld::setProcessAllSections.
Lang Hames [Thu, 29 Oct 2015 03:52:58 +0000 (03:52 +0000)]
[Orc] Add support for RuntimeDyld::setProcessAllSections.

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

9 years ago[InstSimplify] sgt on i1s also encodes implication
Philip Reames [Thu, 29 Oct 2015 03:19:10 +0000 (03:19 +0000)]
[InstSimplify] sgt on i1s also encodes implication

Follow on to http://reviews.llvm.org/D13074, implementing something pointed out by Sanjoy. His truth table from his comment on that bug summarizes things well:
LHS | RHS | LHS >=s RHS | LHS implies RHS
0 | 0 | 1 (0 >= 0) | 1
0 | 1 | 1 (0 >= -1) | 1
1 | 0 | 0 (-1 >= 0) | 0
1 | 1 | 1 (-1 >= -1) | 1

The key point is that an "i1 1" is the value "-1", not "1".

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

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

9 years ago[SimplifyCFG] Constant fold a branch implied by it's incoming edge
Philip Reames [Thu, 29 Oct 2015 03:11:49 +0000 (03:11 +0000)]
[SimplifyCFG] Constant fold a branch implied by it's incoming edge

The most common use case is when eliminating redundant range checks in an example like the following:
c = a[i+1] + a[i];

Note that all the smarts of the transform (the implication engine) is already in ValueTracking and is tested directly through InstructionSimplify.

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

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

9 years ago[SimplifyLibCalls] Factor out common unsafe-math checks.
Davide Italiano [Thu, 29 Oct 2015 02:58:44 +0000 (02:58 +0000)]
[SimplifyLibCalls] Factor out common unsafe-math checks.

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

9 years agoRemove CRLF line endings.
Benjamin Kramer [Thu, 29 Oct 2015 02:33:05 +0000 (02:33 +0000)]
Remove CRLF line endings.

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

9 years agoTweak test check pattern to fix bot failure.
Diego Novillo [Thu, 29 Oct 2015 02:15:02 +0000 (02:15 +0000)]
Tweak test check pattern to fix bot failure.

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

9 years agoAdd a flag vectorizer-maximize-bandwidth in loop vectorizer to enable using larger...
Cong Hou [Thu, 29 Oct 2015 01:28:44 +0000 (01:28 +0000)]
Add a flag vectorizer-maximize-bandwidth in loop vectorizer to enable using larger vectorization factor.

To be able to maximize the bandwidth during vectorization, this patch provides a new flag vectorizer-maximize-bandwidth. When it is turned on, the vectorizer will determine the vectorization factor (VF) using the smallest instead of widest type in the loop. To avoid increasing register pressure too much, estimates of the register usage for different VFs are calculated so that we only choose a VF when its register usage doesn't exceed the number of available registers.

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

9 years ago[PowerPC] Recurse through constants when looking for TLS globals
Hal Finkel [Wed, 28 Oct 2015 23:43:00 +0000 (23:43 +0000)]
[PowerPC] Recurse through constants when looking for TLS globals

We cannot form ctr-based loops around function calls, including calls to
__tls_get_addr used for PIC TLS variables. References to such TLS variables,
however, might be buried within constant expressions, and so we need to search
the entire constant expression to be sure that no references to such TLS
variables exist.

Fixes PR25256, reported by Eric Schweitz. This is a slightly-modified version
of the patch suggested by Eric in the bug report, and a test case I created.

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

9 years ago[PowerPC] Don't return unsupported register classes for asm constraints
Hal Finkel [Wed, 28 Oct 2015 23:03:45 +0000 (23:03 +0000)]
[PowerPC] Don't return unsupported register classes for asm constraints

As a follow-up to r251566, do the same for the other optionally-supported
register classes (mostly for vector registers). Don't return an unavailable
register class (which would cause an assert later), but fail cleanly when
provided an unsupported inline asm constraint.

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

9 years agoARM: add watchOS default version support function.
Tim Northover [Wed, 28 Oct 2015 22:57:14 +0000 (22:57 +0000)]
ARM: add watchOS default version support function.

It's useful for Clang's Driver faff.

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

9 years agoARM: add support for WatchOS's compact unwind information.
Tim Northover [Wed, 28 Oct 2015 22:56:36 +0000 (22:56 +0000)]
ARM: add support for WatchOS's compact unwind information.

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

9 years agoARM: teach backend about WatchOS and TvOS libcalls.
Tim Northover [Wed, 28 Oct 2015 22:51:16 +0000 (22:51 +0000)]
ARM: teach backend about WatchOS and TvOS libcalls.

The most substantial changes are again for watchOS: libcalls are hard-float if
needed and sincos has a different calling convention.

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

9 years agoARM: add backend support for the ABI used in WatchOS
Tim Northover [Wed, 28 Oct 2015 22:46:43 +0000 (22:46 +0000)]
ARM: add backend support for the ABI used in WatchOS

At the LLVM level this ABI is essentially a minimal modification of AAPCS to
support 16-byte alignment for vector types and the stack.

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

9 years agoARM: support .watchos_version_min and .tvos_version_min.
Tim Northover [Wed, 28 Oct 2015 22:36:05 +0000 (22:36 +0000)]
ARM: support .watchos_version_min and .tvos_version_min.

These MachO file directives are used by linkers and other tools to provide
compatibility information, much like the existing .ios_version_min and
.macosx_version_min.

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

9 years agoSamplePGO - Add flag to check sampling coverage.
Diego Novillo [Wed, 28 Oct 2015 22:30:25 +0000 (22:30 +0000)]
SamplePGO - Add flag to check sampling coverage.

This adds the flag -mllvm -sample-profile-check-coverage=N to the
SampleProfile pass. N is the percent of input sample records that the
user expects to apply.  If the pass does not use N% (or more) of the
sample records in the input, it emits a warning.

This is useful to detect some forms of stale profiles. If the code has
drifted enough from the original profile, there will be records that do
not match the IR anymore.

This will not detect cases where a sample profile record for line L is
referring to some other instructions that also used to be at line L.

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

9 years ago[PowerPC] Cleanly reject asm crbit constraint with -crbits
Hal Finkel [Wed, 28 Oct 2015 22:25:52 +0000 (22:25 +0000)]
[PowerPC] Cleanly reject asm crbit constraint with -crbits

When crbits are disabled, cleanly reject the constraint (return the register
class only to cause an assert later).

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

9 years agoRevert "r251451 - [AliasSetTracker] Use mod/ref information for UnknownInstr"
Hal Finkel [Wed, 28 Oct 2015 22:13:41 +0000 (22:13 +0000)]
Revert "r251451 - [AliasSetTracker] Use mod/ref information for UnknownInstr"

It looks like this broke the stage 2 builder:
  http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto/6989/

Original commit message:

AliasSetTracker does not need to convert the access mode to ModRefAccess if the
new visited UnknownInst has only 'REF' modrefinfo to existing pointers in the
sets.

Patch by Andrew Zhogin!

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

9 years ago[Orc] Remove the 'takeOwnershipOfBuffers' kludge.
Lang Hames [Wed, 28 Oct 2015 22:10:27 +0000 (22:10 +0000)]
[Orc] Remove the 'takeOwnershipOfBuffers' kludge.

Keno Fischer fixed the underlying issue that necessitated this in r236341.

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

9 years ago[SCEV] Compute max backedge count for loops with "shift ivs"
Sanjoy Das [Wed, 28 Oct 2015 21:27:14 +0000 (21:27 +0000)]
[SCEV] Compute max backedge count for loops with "shift ivs"

This teaches SCEV to compute //max// backedge taken counts for loops
like

    for (int i = k; i != 0; i >>>= 1)
      whatever();

SCEV yet cannot represent the exact backedge count for these loops, and
this patch does not change that.  This is really geared towards teaching
SCEV that loops like the above are *not* infinite.

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

9 years ago[JumpThreading] Use dominating conditions to prove implications
Sanjoy Das [Wed, 28 Oct 2015 21:27:08 +0000 (21:27 +0000)]
[JumpThreading] Use dominating conditions to prove implications

Summary:
If P branches to Q conditional on C and Q branches to R conditional on
C' and C => C' then the branch conditional on C' can be folded to an
unconditional branch.

Reviewers: reames

Subscribers: llvm-commits

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

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

9 years ago[Orc] Require target support for host before running execution unit tests.
Lang Hames [Wed, 28 Oct 2015 20:08:51 +0000 (20:08 +0000)]
[Orc] Require target support for host before running execution unit tests.

Orc unit tests that execute code shouldn't run if the compiler doesn't have
target support for the host machine.

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

9 years ago[PowerPC] Fix CodeGen/PowerPC/crbit-asm.ll test for -O1
Hal Finkel [Wed, 28 Oct 2015 19:58:02 +0000 (19:58 +0000)]
[PowerPC] Fix CodeGen/PowerPC/crbit-asm.ll test for -O1

Add the crbits processor feature so that the test can be run at -O1, etc.
regardless of the default crbits setting.

Fixes PR23778.

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

9 years ago[PGO] RawProf Reader code cleanup
Xinliang David Li [Wed, 28 Oct 2015 19:34:04 +0000 (19:34 +0000)]
[PGO] RawProf Reader code cleanup

Add a couple of helper methods to make the primary
raw profile reader interface's implementation more
readable. It also hides more format details. This
patch has no functional change.

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

9 years ago[CMake] Disable adding the test suite as a projects subdirectory
Chris Bieneman [Wed, 28 Oct 2015 18:36:56 +0000 (18:36 +0000)]
[CMake] Disable adding the test suite as a projects subdirectory

This will never work as an add_subdirectory call, so we should just make sure it doesn't happen. To do this properly we'll need to add it under clang similar to the external compiler-rt.

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

9 years ago[X86] A small fix in X86/X86TargetTransformInfo.cpp: check a value type is simple...
Cong Hou [Wed, 28 Oct 2015 18:15:46 +0000 (18:15 +0000)]
[X86] A small fix in X86/X86TargetTransformInfo.cpp: check a value type is simple before calling getSimpleVT().

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

9 years ago[AliasAnalysis] Take into account readnone attribute for the function arguments
Igor Laevsky [Wed, 28 Oct 2015 17:54:48 +0000 (17:54 +0000)]
[AliasAnalysis] Take into account readnone attribute for the function arguments

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

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

9 years agoWebAssembly: disable some loop-idiom recognition
JF Bastien [Wed, 28 Oct 2015 17:50:23 +0000 (17:50 +0000)]
WebAssembly: disable some loop-idiom recognition

memset/memcpy aren't fully supported yet. We should invert this test
once they are supported.

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

9 years agoSamplePGO - Clear per-function data after applying a profile.
Diego Novillo [Wed, 28 Oct 2015 17:40:22 +0000 (17:40 +0000)]
SamplePGO - Clear per-function data after applying a profile.

The pass was keeping around a lot of per-function data (visited blocks,
edges, dominance, etc) that is just taking up memory for no reason. In
fact, from function to function it could potentially confuse the
propagator since some maps are indexed by line offsets which can be
common between functions.

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

9 years ago[AliasAnalysis] Take into account readonly attribute for the function arguments
Igor Laevsky [Wed, 28 Oct 2015 16:42:00 +0000 (16:42 +0000)]
[AliasAnalysis] Take into account readonly attribute for the function arguments

In getArgModRefInfo we consider all arguments as having MRI_ModRef.
However for arguments marked with readonly attribute we can return
more precise answer - MRI_Ref.

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

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

9 years agoTypo.
Chad Rosier [Wed, 28 Oct 2015 15:08:33 +0000 (15:08 +0000)]
Typo.

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

9 years agoReapply: [LIR] Add support for creating memsets from loops with a negative stride.
Chad Rosier [Wed, 28 Oct 2015 14:38:49 +0000 (14:38 +0000)]
Reapply: [LIR] Add support for creating memsets from loops with a negative stride.

The simple fix is to prevent forming memcpy from loops with a negative stride.

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

9 years ago[GlobalOpt] Add newlines to DEBUG messages
James Molloy [Wed, 28 Oct 2015 14:30:53 +0000 (14:30 +0000)]
[GlobalOpt] Add newlines to DEBUG messages

I think these were affected by a change way back when to stop printing newlines in Value::dump() by default. This change simply allows the debug output to be readable.

NFC.

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

9 years ago[ARM] Allow SP in rGPR, starting from ARMv8
Artyom Skrobov [Wed, 28 Oct 2015 13:58:36 +0000 (13:58 +0000)]
[ARM] Allow SP in rGPR, starting from ARMv8

Summary:
This patch handles assembly and disassembly, but not codegen, as of yet.

Additionally, it fixes a bug whereby SP and PC as shifted-reg operands
were treated as predictable in ARMv7 Thumb; and it enables the tests
for invalid and unpredictable instructions to run on both ARMv7 and ARMv8.

Reviewers: jmolloy, rengolin

Subscribers: aemerson, rengolin, llvm-commits

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

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

9 years agoPut global classes into the appropriate namespace.
Benjamin Kramer [Wed, 28 Oct 2015 13:54:36 +0000 (13:54 +0000)]
Put global classes into the appropriate namespace.

Most of the cases belong into an anonymous namespace. No
functionality change intended.

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

9 years agoRevert "[LIR] Add support for creating memsets from loops with a negative stride."
Chad Rosier [Wed, 28 Oct 2015 13:54:09 +0000 (13:54 +0000)]
Revert "[LIR] Add support for creating memsets from loops with a negative stride."

This reverts commit r251512.  This is causing LNT/chomp to fail.

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

9 years ago[LIR] Add support for creating memsets from loops with a negative stride.
Chad Rosier [Wed, 28 Oct 2015 12:55:34 +0000 (12:55 +0000)]
[LIR] Add support for creating memsets from loops with a negative stride.

http://reviews.llvm.org/D14125

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

9 years agoAdd newline to test. NFC.
Chad Rosier [Wed, 28 Oct 2015 12:30:08 +0000 (12:30 +0000)]
Add newline to test. NFC.

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

9 years ago[mips][microMIPS] Implement PAUSE, RDHWR, RDPGPR, SDBBP, SSNOP, SYNC, SYNCI and WAIT...
Hrvoje Varga [Wed, 28 Oct 2015 11:04:29 +0000 (11:04 +0000)]
[mips][microMIPS] Implement PAUSE, RDHWR, RDPGPR, SDBBP, SSNOP, SYNC, SYNCI and WAIT instructions
Differential Revision: http://reviews.llvm.org/D12628

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

9 years ago[Orc] Remove unnecessary semicolon. NFC.
Vasileios Kalintiris [Wed, 28 Oct 2015 11:02:01 +0000 (11:02 +0000)]
[Orc] Remove unnecessary semicolon. NFC.

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

9 years ago[GlobalsAA] An indirect global that is initialized is not fair game
James Molloy [Wed, 28 Oct 2015 10:41:29 +0000 (10:41 +0000)]
[GlobalsAA] An indirect global that is initialized is not fair game

When checking if an indirect global (a global with pointer type) is only assigned by allocation functions, first check if the global is itself initialized. If it is, it's not only assigned by allocation functions.

This fixes PR25309. Thanks to David Majnemer for reducing the test case!

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

9 years agoOrcJITTests: Prune unused libdeps.
NAKAMURA Takumi [Wed, 28 Oct 2015 09:59:50 +0000 (09:59 +0000)]
OrcJITTests: Prune unused libdeps.

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

9 years agoOrcJITTests: Update libdeps.
NAKAMURA Takumi [Wed, 28 Oct 2015 09:37:09 +0000 (09:37 +0000)]
OrcJITTests: Update libdeps.

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

9 years ago[X86] Make some for loops over MVTs more explicit (and shorter) by just mentioning...
Craig Topper [Wed, 28 Oct 2015 05:48:32 +0000 (05:48 +0000)]
[X86] Make some for loops over MVTs more explicit (and shorter) by just mentioning all the relevant types in an initializer list. NFC

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

9 years agoRevert r251492 "[IndVarSimplify] Rewrite loop exit values with their
Chen Li [Wed, 28 Oct 2015 05:15:51 +0000 (05:15 +0000)]
Revert r251492 "[IndVarSimplify] Rewrite loop exit values with their
initial values from loop preheader", because it broke some bots.

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

9 years agoFix a -Wpessimizing-move warning.
Craig Topper [Wed, 28 Oct 2015 04:54:46 +0000 (04:54 +0000)]
Fix a -Wpessimizing-move warning.

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

9 years agoUse range-based for loops and use initializer list to remove a small static array...
Craig Topper [Wed, 28 Oct 2015 04:53:27 +0000 (04:53 +0000)]
Use range-based for loops and use initializer list to remove a small static array. NFC

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

9 years ago[IndVarSimplify] Rewrite loop exit values with their initial values from loop preheader
Chen Li [Wed, 28 Oct 2015 04:45:47 +0000 (04:45 +0000)]
[IndVarSimplify] Rewrite loop exit values with their initial values from loop preheader

Summary:
This patch adds support to check if a loop has loop invariant conditions which lead to loop exits. If so, we know that if the exit path is taken, it is at the first loop iteration. If there is an induction variable used in that exit path whose value has not been updated, it will keep its initial value passing from loop preheader. We can therefore rewrite the exit value with
its initial value. This will help remove phis created by LCSSA and enable other optimizations like loop unswitch.

Reviewers: sanjoy

Subscribers: llvm-commits

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

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

9 years ago[PGO] Indexed Prof Reader refactoring (NFC)
Xinliang David Li [Wed, 28 Oct 2015 04:20:31 +0000 (04:20 +0000)]
[PGO] Indexed Prof Reader refactoring (NFC)

Change InstrProfReaderIndex from typedef into a wrapper
class with helper methods. This makes the index profile
reader code more readable. It also hides the implementation
detail of the index format and make it more flexible to allow
support different (or more than one) format in the future.

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

9 years agoRemove templates from CostTableLookup functions. All instantiations had the same...
Craig Topper [Wed, 28 Oct 2015 04:02:12 +0000 (04:02 +0000)]
Remove templates from CostTableLookup functions. All instantiations had the same type.

This also lets us remove the versions of the functions that took a statically sized array as we can rely on ArrayRef implicit conversion now.

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

9 years ago[PowerPC] Replace cntlz[.] with cntlzw[.]
Hal Finkel [Wed, 28 Oct 2015 03:26:45 +0000 (03:26 +0000)]
[PowerPC] Replace cntlz[.] with cntlzw[.]

cntlz is the old POWER mnemonic. cntlzw is the PowerPC mnemonic.

This change fixes an issue when -no-integrated-as: The opcode cntlz is
unrecognized by gas

Alias the POWER mnemonic cntlz[.] to the PowerPC mnemonic cntlzw[.]
This is done for because the POWER cntlz mnemonic has be used by LLVM for
a very long time. We need to make sure that assembly programs
that are using the cntlz[.] do not break with this change.

Change PowerPC tests to reflect the insn change from cntlz to cntlzw.
Add assembly test to verify cntlz[.] is encoded correctly.

Patch by Tom Rix!

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

9 years ago[ValueTracking] Expose `implies` via ValueTracking, NFC
Sanjoy Das [Wed, 28 Oct 2015 03:20:19 +0000 (03:20 +0000)]
[ValueTracking] Expose `implies` via ValueTracking, NFC

Summary: This will allow a later patch to `JumpThreading` use this functionality.

Reviewers: reames

Subscribers: llvm-commits

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

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

9 years ago[ValueTracking] Use !range metadata more aggressively in KnownBits
Sanjoy Das [Wed, 28 Oct 2015 03:20:15 +0000 (03:20 +0000)]
[ValueTracking] Use !range metadata more aggressively in KnownBits

Summary:
Teach `computeKnownBitsFromRangeMetadata` to use `!range` metadata more
aggressively.

Reviewers: majnemer, nlewycky, jingyue

Subscribers: llvm-commits

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

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

9 years ago[SelectionDAG] Don't inspect !range metadata for extended loads
Sanjoy Das [Wed, 28 Oct 2015 03:20:10 +0000 (03:20 +0000)]
[SelectionDAG] Don't inspect !range metadata for extended loads

Summary:
Don't call `computeKnownBitsFromRangeMetadata` for extended loads --
this can cause a mismatch between the width of the !range metadata and
the width of the APInt's accumulating `KnownZero` (and `KnownOne` in the
future).  This isn't a problem now, but will be after a future change.

Note: this can be made more aggressive in the future.

Reviewers: nlewycky

Subscribers: llvm-commits

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

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

9 years ago[GVN] Make a test case more robust
Sanjoy Das [Wed, 28 Oct 2015 03:20:05 +0000 (03:20 +0000)]
[GVN] Make a test case more robust

The singleton !range metadata gets simplified more aggressively after a
later change, so change the !range metadata to contain more than one
element.

While at it, turn some `; CHECK` s to `; CHECK-LABEL:` s.

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

9 years ago[Orc] Disable Orc C API unit tests on non-Darwin while I investigate more
Lang Hames [Wed, 28 Oct 2015 03:12:51 +0000 (03:12 +0000)]
[Orc] Disable Orc C API unit tests on non-Darwin while I investigate more
builder failures.

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

9 years ago[Orc] Re-add C bindings for the Orc APIs, with a fix to remove the union that
Lang Hames [Wed, 28 Oct 2015 02:40:04 +0000 (02:40 +0000)]
[Orc] Re-add C bindings for the Orc APIs, with a fix to remove the union that
was causing builder failures.

The bindings were originally added in r251472, and reverted in r251473 due to
the builder failures.

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

9 years agolit/TestRunner.py: Factor variable subsitution into an own function; NFCI
Matthias Braun [Wed, 28 Oct 2015 02:36:45 +0000 (02:36 +0000)]
lit/TestRunner.py: Factor variable subsitution into an own function; NFCI

This is a clearer separation of concerns and makes it easier to reuse
the function.

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

9 years agolit/TestRunner.py: Factor out Substitution construction; NFC
Matthias Braun [Wed, 28 Oct 2015 02:36:42 +0000 (02:36 +0000)]
lit/TestRunner.py: Factor out Substitution construction; NFC

This is a clearer separation of concerns and makes it easier to reuse
the functions.

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

9 years agolit/TestRunner.py: Get execdir from test.getExecPath() instead of passing it around...
Matthias Braun [Wed, 28 Oct 2015 02:36:38 +0000 (02:36 +0000)]
lit/TestRunner.py: Get execdir from test.getExecPath() instead of passing it around; NFC

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

9 years agolit/TestRunner.py: Make parseIntegratedTestScriptCommands() keyword list a parameter...
Matthias Braun [Wed, 28 Oct 2015 02:36:35 +0000 (02:36 +0000)]
lit/TestRunner.py: Make parseIntegratedTestScriptCommands() keyword list a parameter; NFC

This allows the function to be easily reused and also simplifies the
code as the keyword list is next to the keyword handling now.

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

9 years ago[Orc] Revert the C bindngs commit, r251472, while I debug some builder failures.
Lang Hames [Wed, 28 Oct 2015 01:03:09 +0000 (01:03 +0000)]
[Orc] Revert the C bindngs commit, r251472, while I debug some builder failures.

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

9 years ago[Orc] Add experimental C bindings for Orc.
Lang Hames [Wed, 28 Oct 2015 00:28:26 +0000 (00:28 +0000)]
[Orc] Add experimental C bindings for Orc.

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

9 years agoAdd myself as the the code owner for the AVR backend
Dylan McKay [Wed, 28 Oct 2015 00:24:54 +0000 (00:24 +0000)]
Add myself as the the code owner for the AVR backend

Summary:
As I maintain the AVR backend and am currently in the process of migrating it in tree, it makes sense to add myself as the code owner.

Thoughts welcome!

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

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

9 years agoMake the SelectionDAG graph printer use SDNode::PersistentId labels.
James Y Knight [Tue, 27 Oct 2015 23:09:03 +0000 (23:09 +0000)]
Make the SelectionDAG graph printer use SDNode::PersistentId labels.

r248010 changed the -debug output to use short ids, but did not
similarly modify the graph printer. Change to be consistent, for ease of
cross-reference.

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

9 years agoBitcode: Fix more unsigned integer overflow bugs.
Peter Collingbourne [Tue, 27 Oct 2015 23:01:25 +0000 (23:01 +0000)]
Bitcode: Fix more unsigned integer overflow bugs.

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

9 years ago[SimplifyCFG] Don't DCE catchret because the successor is unreachable
David Majnemer [Tue, 27 Oct 2015 22:43:56 +0000 (22:43 +0000)]
[SimplifyCFG] Don't DCE catchret because the successor is unreachable

CatchReturnInst has side-effects: it runs a destructor.  This destructor
could conceivably run forever/call exit/etc. and should not be removed.

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

9 years ago[Bitcode] Fix accidental syntax errors in compatibility tests
Vedant Kumar [Tue, 27 Oct 2015 22:10:17 +0000 (22:10 +0000)]
[Bitcode] Fix accidental syntax errors in compatibility tests

We used automated tools to update our IR to its current syntax in commit
21f77df7(r247378). While it correctly updated the CHECK lines in our
compatibility tests, the IR should have remained untouched.  This commit
fixes the syntax errors.

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

9 years ago[X86][AVX512] Test UNPCK with non-sequential scalars
Simon Pilgrim [Tue, 27 Oct 2015 21:18:45 +0000 (21:18 +0000)]
[X86][AVX512] Test UNPCK with non-sequential scalars

Missing tests for r251297

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

9 years ago[IR] Limit bits used for CallingConv::ID, update tests
Vedant Kumar [Tue, 27 Oct 2015 21:17:06 +0000 (21:17 +0000)]
[IR] Limit bits used for CallingConv::ID, update tests

Use 10 bits to represent calling convention ID's instead of 13, and
update the bitcode compatibility tests accordingly. We now error-out in
the bitcode reader when we see bad calling conv ID's.

Thanks to rnk and dexonsmith for feedback!

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

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

9 years ago[AliasSetTracker] Use mod/ref information for UnknownInstr
Hal Finkel [Tue, 27 Oct 2015 20:37:04 +0000 (20:37 +0000)]
[AliasSetTracker] Use mod/ref information for UnknownInstr

AliasSetTracker does not need to convert the access mode to ModRefAccess if the
new visited UnknownInst has only 'REF' modrefinfo to existing pointers in the
sets.

Patch by Andrew Zhogin!

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

9 years agoUse the 'arcp' fast-math-flag when combining repeated FP divisors
Sanjay Patel [Tue, 27 Oct 2015 20:27:25 +0000 (20:27 +0000)]
Use the 'arcp' fast-math-flag when combining repeated FP divisors

This is a usage of the IR-level fast-math-flags now that they are propagated to SDNodes.
This was originally part of D8900.

Removing the global 'enable-unsafe-fp-math' checks will require auto-upgrade and
possibly other changes.

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

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

9 years ago[ScalarEvolutionExpander] PHI on a catchpad can be used on both edges
David Majnemer [Tue, 27 Oct 2015 19:48:28 +0000 (19:48 +0000)]
[ScalarEvolutionExpander] PHI on a catchpad can be used on both edges

A PHI on a catchpad might be used by both edges out of the catchpad,
feeding back into a loop.  In this case, just use the insertion point.
Anything more clever would require new basic blocks or PHI placement.

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

9 years ago[AArch64]Merge halfword loads into a 32-bit load
Jun Bum Lim [Tue, 27 Oct 2015 19:16:03 +0000 (19:16 +0000)]
[AArch64]Merge halfword loads into a 32-bit load

This recommits r250719, which caused a failure in SPEC2000.gcc
because of the incorrect insert point for the new wider load.

Convert two halfword loads into a single 32-bit word load with bitfield extract
instructions. For example :
  ldrh w0, [x2]
  ldrh w1, [x2, #2]
becomes
  ldr w0, [x2]
  ubfx w1, w0, #16, #16
  and  w0, w0, #ffff

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

9 years agoWhitespace.
NAKAMURA Takumi [Tue, 27 Oct 2015 19:02:52 +0000 (19:02 +0000)]
Whitespace.

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

9 years agoRevert r251291, "Loop Vectorizer - skipping "bitcast" before GEP"
NAKAMURA Takumi [Tue, 27 Oct 2015 19:02:36 +0000 (19:02 +0000)]
Revert r251291, "Loop Vectorizer - skipping "bitcast" before GEP"

It causes miscompilation of llvm/lib/ExecutionEngine/Interpreter/Execution.cpp.
See also PR25324.

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

9 years agoTidy a comment. NFC.
Diego Novillo [Tue, 27 Oct 2015 18:41:46 +0000 (18:41 +0000)]
Tidy a comment. NFC.

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

9 years agoCreate a new interface addSuccessorWithoutWeight(MBB*) in MBB to add successors when...
Cong Hou [Tue, 27 Oct 2015 17:59:36 +0000 (17:59 +0000)]
Create a new interface addSuccessorWithoutWeight(MBB*) in MBB to add successors when optimization is disabled.

When optimization is disabled, edge weights that are stored in MBB won't be used so that we don't have to store them. Currently, this is done by adding successors with default weight 0, and if all successors have default weights, the weight list will be empty. But that the weight list is empty doesn't mean disabled optimization (as is stated several times in MachineBasicBlock.cpp): it may also mean all successors just have default weights.

We should discourage using default weights when adding successors, because it is very easy for users to forget update the correct edge weights instead of using default ones (one exception is that the MBB only has one successor). In order to detect such usages, it is better to differentiate using default weights from the case when optimizations is disabled.

In this patch, a new interface addSuccessorWithoutWeight(MBB*) is created for when optimization is disabled. In this case, MBB will try to maintain an empty weight list, but it cannot guarantee this as for many uses of addSuccessor() whether optimization is disabled or not is not checked. But it can guarantee that if optimization is enabled, then the weight list always has the same size of the successor list.

Differential revision: http://reviews.llvm.org/D13963

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

9 years ago[SLP] Be more aggressive about reduction width selection.
Charlie Turner [Tue, 27 Oct 2015 17:59:03 +0000 (17:59 +0000)]
[SLP] Be more aggressive about reduction width selection.

Summary:
This change could be way off-piste, I'm looking for any feedback on whether it's an acceptable approach.

It never seems to be a problem to gobble up as many reduction values as can be found, and then to attempt to reduce the resulting tree. Some of the workloads I'm looking at have been aggressively unrolled by hand, and by selecting reduction widths that are not constrained by a vector register size, it becomes possible to profitably vectorize. My test case shows such an unrolling which SLP was not vectorizing (on neither ARM nor X86) before this patch, but with it does vectorize.

I measure no significant compile time impact of this change when combined with D13949 and D14063. There are also no significant performance regressions on ARM/AArch64 in SPEC or LNT.

The more principled approach I thought of was to generate several candidate tree's and use the cost model to pick the cheapest one. That seemed like quite a big design change (the algorithms seem very much one-shot), and would likely be a costly thing for compile time. This seemed to do the job at very little cost, but I'm worried I've misunderstood something!

Reviewers: nadav, jmolloy

Subscribers: mssimpso, llvm-commits, aemerson

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

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

9 years ago[SLP] Try a bit harder to find reduction PHIs
Charlie Turner [Tue, 27 Oct 2015 17:54:16 +0000 (17:54 +0000)]
[SLP] Try a bit harder to find reduction PHIs

Summary:
Currently, when the SLP vectorizer considers whether a phi is part of a reduction, it dismisses phi's whose incoming blocks are not the same as the block containing the phi. For the patterns I'm looking at, extending this rule to allow phis whose incoming block is a containing loop latch allows me to vectorize certain workloads.

There is no significant compile-time impact, and combined with D13949, no performance improvement measured in ARM/AArch64 in any of SPEC2000, SPEC2006 or LNT.

Reviewers: jmolloy, mcrosier, nadav

Subscribers: mssimpso, nadav, aemerson, llvm-commits

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

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

9 years ago[SLP] Treat SelectInsts as reduction values.
Charlie Turner [Tue, 27 Oct 2015 17:49:11 +0000 (17:49 +0000)]
[SLP] Treat SelectInsts as reduction values.

Summary:
Certain workloads, in particular sum-of-absdiff loops, can be vectorized using SLP if it can treat select instructions as reduction values.

The test case is a bit awkward. The AArch64 cost model needs some tuning to not be so pessimistic about selects. I've had to tweak the SLP threshold here.

Reviewers: jmolloy, mzolotukhin, spatel, nadav

Subscribers: nadav, mssimpso, aemerson, llvm-commits

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

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

9 years ago[Orc] Fix indentation.
Lang Hames [Tue, 27 Oct 2015 17:45:48 +0000 (17:45 +0000)]
[Orc] Fix indentation.

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

9 years agoFix SamplePGO segfault when debug info is missing.
Diego Novillo [Tue, 27 Oct 2015 17:37:00 +0000 (17:37 +0000)]
Fix SamplePGO segfault when debug info is missing.

When emitting a remark for a conditional branch annotation, the remark
uses the line location information of the conditional branch in the
message.  In some cases, that information is unavailable and the
optimization would segfaul. I'm still not sure whether this is a bug or
WAI, but the optimizer should not die because of this.

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