oota-llvm.git
9 years agoDo not use dyn_cast<> after isa<>
Mehdi Amini [Sun, 23 Aug 2015 00:27:57 +0000 (00:27 +0000)]
Do not use dyn_cast<> after isa<>

Reported by coverity.

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

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

9 years ago[WinEH] Require token linkage in EH pad/ret signatures
Joseph Tremoulet [Sun, 23 Aug 2015 00:26:33 +0000 (00:26 +0000)]
[WinEH] Require token linkage in EH pad/ret signatures

Summary:
WinEHPrepare is going to require that cleanuppad and catchpad produce values
of token type which are consumed by any cleanupret or catchret exiting the
pad.  This change updates the signatures of those operators to require/enforce
that the type produced by the pads is token type and that the rets have an
appropriate argument.

The catchpad argument of a `CatchReturnInst` must be a `CatchPadInst` (and
similarly for `CleanupReturnInst`/`CleanupPadInst`).  To accommodate that
restriction, this change adds a notion of an operator constraint to both
LLParser and BitcodeReader, allowing appropriate sentinels to be constructed
for forward references and appropriate error messages to be emitted for
illegal inputs.

Also add a verifier rule (noted in LangRef) that a catchpad with a catchpad
predecessor must have no other predecessors; this ensures that WinEHPrepare
will see the expected linear relationship between sibling catches on the
same try.

Lastly, remove some superfluous/vestigial casts from instruction operand
setters operating on BasicBlocks.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

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

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

9 years agoUpdate test case so it passes the verifier
David Blaikie [Sat, 22 Aug 2015 22:38:44 +0000 (22:38 +0000)]
Update test case so it passes the verifier

Some debug info was drastically out of date, from the days where we used
to emit a list of length one (with a single null entry) rather than an
empty list (or, more recently, no list at all) for list fields that have
no elements.

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

9 years agoVerifier: Don't crash on null entries in debug info retained types list
David Blaikie [Sat, 22 Aug 2015 22:36:40 +0000 (22:36 +0000)]
Verifier: Don't crash on null entries in debug info retained types list

There was already a good error path for this. Added a test for it & made
a minor code change to ensure the error path was actually reached,
rather than crashing before we got that far.

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

9 years ago[llvm-readobj] Test --macho-data-in-code option.
Davide Italiano [Sat, 22 Aug 2015 20:30:56 +0000 (20:30 +0000)]
[llvm-readobj] Test --macho-data-in-code option.

As added bonus this converts an existing test from macho-dump to
llvm-readobj. Only 66 to go.

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

9 years ago[NVPTX] Allow undef value as global initializer
Jingyue Wu [Sat, 22 Aug 2015 05:40:26 +0000 (05:40 +0000)]
[NVPTX] Allow undef value as global initializer

Summary:
__shared__ variable may now emit undef value as initializer, do not
throw error on that.

Test Plan: test/CodeGen/NVPTX/global-addrspace.ll

Patch by Xuetian Weng

Reviewers: jholewinski, tra, jingyue

Subscribers: llvm-commits, jholewinski

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

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

9 years ago[CMake] add_llvm_external_project: Just warn about nonexistent directories.
NAKAMURA Takumi [Sat, 22 Aug 2015 05:11:02 +0000 (05:11 +0000)]
[CMake] add_llvm_external_project: Just warn about nonexistent directories.

These entries were generated accidentally.

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

9 years ago[CMake] Make LLVM_EXTERNAL_*_SOURCE_DIR consistent against older buildsites.
NAKAMURA Takumi [Sat, 22 Aug 2015 04:53:52 +0000 (04:53 +0000)]
[CMake] Make LLVM_EXTERNAL_*_SOURCE_DIR consistent against older buildsites.

If corresponding in-tree subdirectory exists, just ignore LLVM_EXTERNAL* stuff.
Otherwise, set LLVM_TOOL_*_BUILD ON/OFF properly according to LLVM_EXTERNAL_*.

This makes easier to walk among old revisions *without* deleteing CMakeCache.txt.

Before r242059, LLVM_EXTERNAL_* was working like;

  if(EXISTS ${*_SOURCE_DIR}/CMakeLists.txt)
    set(*_BUILD ON CACHE)
    if(*_BUILD is ON)
      add_subdirectory(*_SOURCE_DIR)
    endif()
  endif()

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

9 years agoLTO: Maintain target triple, FeatureStr and CGOptLevel in the module or LTOCodeGenerator.
Peter Collingbourne [Sat, 22 Aug 2015 02:25:53 +0000 (02:25 +0000)]
LTO: Maintain target triple, FeatureStr and CGOptLevel in the module or LTOCodeGenerator.

This makes it easier to create new TargetMachines on demand.

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

9 years agoAMDGPU: Allow specifying different opcode on VI for SMRD/SMEM
Matt Arsenault [Sat, 22 Aug 2015 00:54:31 +0000 (00:54 +0000)]
AMDGPU: Allow specifying different opcode on VI for SMRD/SMEM

Although the basic s_load_* instructions happen to use the same
opcode, some of the special case SMRD instructions have
different opcodes.

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

9 years agoAMDGPU: Improve accuracy of instruction rates for some FP instructions
Matt Arsenault [Sat, 22 Aug 2015 00:50:41 +0000 (00:50 +0000)]
AMDGPU: Improve accuracy of instruction rates for some FP instructions

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

9 years agoAMDGPU: Use DFS to avoid second loop over function
Matt Arsenault [Sat, 22 Aug 2015 00:43:38 +0000 (00:43 +0000)]
AMDGPU: Use DFS to avoid second loop over function

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

9 years agoAMDGPU: Make sure to run verifier after SIFixSGPRLiveRanges
Matt Arsenault [Sat, 22 Aug 2015 00:19:34 +0000 (00:19 +0000)]
AMDGPU: Make sure to run verifier after SIFixSGPRLiveRanges

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

9 years agoAMDGPU: Improve debug printing in SIFixSGPRLiveRanges
Matt Arsenault [Sat, 22 Aug 2015 00:19:25 +0000 (00:19 +0000)]
AMDGPU: Improve debug printing in SIFixSGPRLiveRanges

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

9 years agoAMDGPU: Move CI instructions into CIInstructions.td
Matt Arsenault [Sat, 22 Aug 2015 00:16:34 +0000 (00:16 +0000)]
AMDGPU: Move CI instructions into CIInstructions.td

There are still a couple of CI patterns left in SIInstructions.

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

9 years agoAMDGPU: Minor cleanups to help with f16 support
Matt Arsenault [Fri, 21 Aug 2015 23:49:51 +0000 (23:49 +0000)]
AMDGPU: Minor cleanups to help with f16 support

The main change is inverting the condition for the
operand class classes so that VT.Size == 16 uses VGPR_32
instead of 64.

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

9 years agoImprove the determinism of MergeFunctions
JF Bastien [Fri, 21 Aug 2015 23:27:24 +0000 (23:27 +0000)]
Improve the determinism of MergeFunctions

Summary:

Merge functions previously relied on unsigned comparisons of pointer values to
order functions. This caused observable non-determinism in the compiler for
large bitcode programs. Basically, opt -mergefuncs program.bc | md5sum produces
different hashes when run repeatedly on the same machine. Differing output was
observed on three large bitcodes, but it was less frequent on the smallest file.
It is possible that this only manifests on the large inputs, hence remaining
undetected until now.

This patch fixes this by removing (almost, see below) all places where
comparisons between pointers are used to order functions. Most of these changes
are local, but the comparison of global values requires assigning an identifier
to each local in the order it is visited. This is very similar to the way the
comparison function identifies Value*'s defined within a function. Because the
order of visiting the functions and their subparts is deterministic, the
identifiers assigned to the globals will be as well, and the order of functions
will be deterministic.

With these changes, there is no more observed non-determinism. There is also
only minor slowdowns (negligible to 4%) compared to the baseline, which is
likely a result of the fact that global comparisons involve hash lookups and not
just pointer comparisons.

The one caveat so far is that programs containing BlockAddress constants can
still be non-deterministic. It is not clear what the right solution is here. In
particular, even if the global numbers are used to order by function, we still
need a way to order the BasicBlock*'s. Unfortunately, we cannot just bail out
and fail to order the functions or consider them equal, because we require a
total order over functions. Note that programs with BlockAddress constants are
relatively rare, so the impact of leaving this in is minor as long as this pass
is opt-in.

Author: jrkoenig

Reviewers: nlewycky, jfb, dschuff

Subscribers: jevinskie, llvm-commits, chapuni

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

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

9 years ago[LAA] Hold bounds via ValueHandles during SCEV expansion
Adam Nemet [Fri, 21 Aug 2015 23:19:57 +0000 (23:19 +0000)]
[LAA] Hold bounds via ValueHandles during SCEV expansion

SCEV expansion can invalidate previously expanded values.  For example
in SCEVExpander::ReuseOrCreateCast, if we already have the requested
cast value but it's not at the desired location, a new cast is inserted
and the old cast will be invalidated.

Therefore, when expanding the bounds for the pointers, a later entry can
invalidate the IR value for an earlier one.  The fix is to store a value
handle rather than the value itself.

The newly added test has a more detailed description of how the bug
triggers.

This bug can have a negative but potentially highly variable performance
impact in Loop Distribution.  Because one of the bound values was
invalidated and is an undef expression now, InstCombine is free to
transform the array overlap check:

   Start0 <= End1 && Start1 <= End0

into:

   Start0 <= End1

So depending on the runtime location of the arrays, we would detect a
conflict and fall back on the original loop of the versioned loop.

Also tested compile time with SPEC2006 LTO bc files.

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

9 years agoStandardized 'failed' to 'Failed' in LoopVectorizationRequirements.
Tyler Nowicki [Fri, 21 Aug 2015 23:03:24 +0000 (23:03 +0000)]
Standardized 'failed' to 'Failed' in LoopVectorizationRequirements.

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

9 years agoMIRLangRef: Add 'MIR Testing Guide' section.
Alex Lorenz [Fri, 21 Aug 2015 22:58:33 +0000 (22:58 +0000)]
MIRLangRef: Add 'MIR Testing Guide' section.

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

9 years agoLTO: Change signature of LTOCodeGenerator::setCodePICModel() to take a Reloc::Model.
Peter Collingbourne [Fri, 21 Aug 2015 22:57:17 +0000 (22:57 +0000)]
LTO: Change signature of LTOCodeGenerator::setCodePICModel() to take a Reloc::Model.

This allows us to remove a bunch of code in LTOCodeGenerator and llvm-lto
and has the side effect of improving error handling in the libLTO C API.

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

9 years agoAMDGPU/SI: Better handle s_wait insertion
Tom Stellard [Fri, 21 Aug 2015 22:47:27 +0000 (22:47 +0000)]
AMDGPU/SI: Better handle s_wait insertion

We can wait on either VM, EXP or LGKM.
The waits are independent.

Without this patch, a wait inserted because of one of them
would also wait for all the previous others.
This patch makes s_wait only wait for the ones we need for the next
instruction.

Here's an example of subtle perf reduction this patch solves:

This is without the patch:

buffer_load_format_xyzw v[8:11], v0, s[44:47], 0 idxen
buffer_load_format_xyzw v[12:15], v0, s[48:51], 0 idxen
s_load_dwordx4 s[44:47], s[8:9], 0xc
s_waitcnt lgkmcnt(0)
buffer_load_format_xyzw v[16:19], v0, s[52:55], 0 idxen
s_load_dwordx4 s[48:51], s[8:9], 0x10
s_waitcnt vmcnt(1)
buffer_load_format_xyzw v[20:23], v0, s[44:47], 0 idxen

The s_waitcnt vmcnt(1) is useless.
The reason it is added is because the last
buffer_load_format_xyzw needs s[44:47], which was issued
by the first s_load_dwordx4. It waits for all VM
before that call to have finished.

Internally after every instruction, 3 counters (for VM, EXP and LGTM)
are updated after every instruction. For example buffer_load_format_xyzw
will
increase the VM counter, and s_load_dwordx4 the LGKM one.

Without the patch, for every defined register,
the current 3 counters are stored, and are used to know
how long to wait when an instruction needs the register.

Because of that, the s[44:47] counter includes that to use the register
you need to wait for the previous buffer_load_format_xyzw.

Instead this patch stores only the counters that matter for the
register,
and puts zero for the other ones, since we don't need any wait for them.

Patch by: Axel Davy

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

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

9 years agoRe-apply r245635, "[InstCombine] Transform A & (L - 1) u< L --> L != 0"
Sanjoy Das [Fri, 21 Aug 2015 22:22:37 +0000 (22:22 +0000)]
Re-apply r245635, "[InstCombine] Transform A & (L - 1) u< L --> L != 0"

The original checkin was buggy, this change has a fix.

Original commit message:

[InstCombine] Transform A & (L - 1) u< L --> L != 0

Summary:

This transform is never a pessimization at the IR level (since it
replaces an `icmp` with another), and has potentiall payoffs:

 1. It may make the `icmp` fold away or become loop invariant.
 2. It may make the `A & (L - 1)` computation dead.

This shows up in Java, in range checks generated by array accesses of
the form `a[i & (a.length - 1)]`.

Reviewers: reames, majnemer

Subscribers: llvm-commits

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

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

9 years agoRange-for-ify some things in GlobalMerge
David Blaikie [Fri, 21 Aug 2015 22:19:06 +0000 (22:19 +0000)]
Range-for-ify some things in GlobalMerge

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

9 years ago[opaque pointer types] Fix a few easy places in GlobalMerge that were accessing value...
David Blaikie [Fri, 21 Aug 2015 22:00:44 +0000 (22:00 +0000)]
[opaque pointer types] Fix a few easy places in GlobalMerge that were accessing value types through pointee types

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

9 years agoMIR Serialization: Serialize the pointer IR expression values in the machine
Alex Lorenz [Fri, 21 Aug 2015 21:54:12 +0000 (21:54 +0000)]
MIR Serialization: Serialize the pointer IR expression values in the machine
memory operands.

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

9 years ago[ARM] Fix MachO CPU Subtype selection
Vedant Kumar [Fri, 21 Aug 2015 21:52:48 +0000 (21:52 +0000)]
[ARM] Fix MachO CPU Subtype selection

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

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

9 years agoMIRParser: Split the 'parseIRConstant' method into two methods. NFC.
Alex Lorenz [Fri, 21 Aug 2015 21:48:22 +0000 (21:48 +0000)]
MIRParser: Split the 'parseIRConstant' method into two methods. NFC.

One variant of this method can be reused when parsing the quoted IR pointer
expressions in the machine memory operands.

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

9 years ago[opaque pointer types] Push the passing of value types up from Function/GlobalVariabl...
David Blaikie [Fri, 21 Aug 2015 21:35:28 +0000 (21:35 +0000)]
[opaque pointer types] Push the passing of value types up from Function/GlobalVariable to GlobalObject

(coming next, pushing this up into GlobalValue, so it can store the
value type directly)

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

9 years ago[PowerPC] PPCVSXFMAMutate should not segfault on undef input registers
Hal Finkel [Fri, 21 Aug 2015 21:34:24 +0000 (21:34 +0000)]
[PowerPC] PPCVSXFMAMutate should not segfault on undef input registers

When PPCVSXFMAMutate would look at the input addend register, it would get its
input value number. This would fail, however, if the register was undef,
causing a segfault. Don't segfault (just skip such FMA instructions).

Fixes the test case from PR24542 (although that may have been over-reduced).

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

9 years agoAsmParser: Save and restore the parsing state for types using SlotMapping.
Alex Lorenz [Fri, 21 Aug 2015 21:32:39 +0000 (21:32 +0000)]
AsmParser: Save and restore the parsing state for types using SlotMapping.

This commit extends the 'SlotMapping' structure and includes mappings for named
and numbered types in it. The LLParser is extended accordingly to fill out
those mappings at the end of module parsing.

This information is useful when we want to parse standalone constant values
at a later stage using the 'parseConstantValue' method. The constant values
can be constant expressions, which can contain references to types. In order
to parse such constant values, we have to restore the internal named and
numbered mappings for the types in LLParser, otherwise the parser will report
a parsing error. Therefore, this commit also introduces a new method called
'restoreParsingState' to LLParser, which uses the slot mappings to restore
some of its internal parsing state.

This commit is required to serialize constant value pointers in the machine
memory operands for the MIR format.

Reviewers: Duncan P. N. Exon Smith

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

9 years ago[LVI] Use a SmallVector instead of SmallPtrSet. NFC
Bruno Cardoso Lopes [Fri, 21 Aug 2015 21:18:26 +0000 (21:18 +0000)]
[LVI] Use a SmallVector instead of SmallPtrSet. NFC

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

9 years agoMIRLangRef: Describe the syntax for the immediate operands, register values,
Alex Lorenz [Fri, 21 Aug 2015 21:17:01 +0000 (21:17 +0000)]
MIRLangRef: Describe the syntax for the immediate operands, register values,
register operands and register flags.

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

9 years agoMIR Serialization: Print MCSymbol operands.
Alex Lorenz [Fri, 21 Aug 2015 21:12:44 +0000 (21:12 +0000)]
MIR Serialization: Print MCSymbol operands.

This commit allows the MIR printer to print the MCSymbol machine operands.
Unfortunately they can't be parsed at this time. I will create a bug that will
track the fact that the MCSymbol operands can't be parsed yet.

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

9 years agoLine endings fix.
Simon Pilgrim [Fri, 21 Aug 2015 21:09:51 +0000 (21:09 +0000)]
Line endings fix.

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

9 years ago[x86] enable machine combiner reassociations for 256-bit vector min/max
Sanjay Patel [Fri, 21 Aug 2015 21:04:21 +0000 (21:04 +0000)]
[x86] enable machine combiner reassociations for 256-bit vector min/max

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

9 years agoremove 'FeatureSlowUAMem' from AMD CPUs based on 10H micro-arch or later
Sanjay Patel [Fri, 21 Aug 2015 20:39:17 +0000 (20:39 +0000)]
remove 'FeatureSlowUAMem' from AMD CPUs based on 10H micro-arch or later

See discussion in D12154 ( http://reviews.llvm.org/D12154 ), AMD Software
Optimization Guides for 10H/12H/15H/16H, and Agner Fog's experimental data.

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

9 years ago[llvm-readobj] Add support for MachO DataInCodeDataCommand.
Davide Italiano [Fri, 21 Aug 2015 20:28:30 +0000 (20:28 +0000)]
[llvm-readobj] Add support for MachO DataInCodeDataCommand.

Example output:

File: <stdin>
Format: Mach-O arm
Arch: arm
AddressSize: 32bit
DataInCode {
  Data offset: 300
  Data size: 32
  Data Regions [
    DICE {
      Index: 0
      Offset: 0
      Length: 4
      Kind: 1
    }
    DICE {
      Index: 1
      Offset: 4
      Length: 4
      Kind: 4
    }
    DICE {
      Index: 2
      Offset: 8
      Length: 2
      Kind: 3
    }
    DICE {
      Index: 3
      Offset: 10
      Length: 1
      Kind: 2
    }
  ]
}

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

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

9 years agoAdd comment as follow up to r245712
David Blaikie [Fri, 21 Aug 2015 20:18:39 +0000 (20:18 +0000)]
Add comment as follow up to r245712

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

9 years ago[x86] invert logic for attribute 'FeatureFastUAMem'
Sanjay Patel [Fri, 21 Aug 2015 20:17:26 +0000 (20:17 +0000)]
[x86] invert logic for attribute 'FeatureFastUAMem'

This is a 'no functional change intended' patch. It removes one FIXME, but adds several more.

Motivation: the FeatureFastUAMem attribute may be too general. It is used to determine if any
sized misaligned memory access under 32-bytes is 'fast'. From the added FIXME comments, however,
you can see that we're not consistent about this. Changing the name of the attribute makes it
clearer to see the logic holes.

Changing this to a 'slow' attribute also means we don't have to add an explicit 'fast' attribute
to new chips; fast unaligned accesses have been standard for several generations of CPUs now.

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

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

9 years ago[opaque pointer type]: Pass explicit pointee type when building a constant GEP.
David Blaikie [Fri, 21 Aug 2015 20:16:51 +0000 (20:16 +0000)]
[opaque pointer type]: Pass explicit pointee type when building a constant GEP.

Gets a bit tricky in the ValueMapper, of course - not sure if we should
just expose a list of explicit types for each Value so that the
ValueMapper can be neutral to these special cases (it's OK for things
like load, where the explicit type is the result type - but when that's
not the case, it means plumbing through another "special" type... )

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

9 years agollvm-lto: Re-order code.
Peter Collingbourne [Fri, 21 Aug 2015 19:09:42 +0000 (19:09 +0000)]
llvm-lto: Re-order code.

This saves us from needing to asave a pointer, and will be needed for an
upcoming ownership change.

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

9 years agoFilter libraries that are not installed out of CMake exports (currently
Dan Liew [Fri, 21 Aug 2015 18:10:57 +0000 (18:10 +0000)]
Filter libraries that are not installed out of CMake exports (currently
gtest and gtest_main) when generating ``Makefile.llvmbuild``.

Libraries that are not installed should not be exported because they
won't be available from an install tree.  Rather than filtering out the
gtest libraries in cmake/modules/Makefile, simply teach llvm-build to
filter out libraries that will not be installed from its generated list
of exported libraries.

Note that LLVMBUILD_LIB_DEPS_* are used during our own CMake build
process so we cannot filter LLVMBUILD_LIB_DEPS_gtest* out in llvm-build.
We must leave this gtest filter logic in cmake/modules/Makefile.

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

9 years agollvm-build: Adopt generation of LLVM_LIBS_TO_EXPORT. Patch by
Dan Liew [Fri, 21 Aug 2015 18:10:55 +0000 (18:10 +0000)]
llvm-build: Adopt generation of LLVM_LIBS_TO_EXPORT. Patch by
Brad King.

Move `LLVM_LIBS_TO_EXPORT` over to Makefile.llvmbuild and generate it
from `llvm-build` using the same logic used to export the dependencies
of these libraries.  This avoids depending on `llvm-config`.

This refactoring was originally motivated by issue #24154 due to commit
r243297 (Fix `llvm-config` to emit the linker flag for the combined
shared object, 2015-07-27) changing the output of `llvm-config --libs`
to not have the individual libraries when we configure with
`--enable-shared`.  That change was reverted by r244108 but this
refactoring makes sense on its own anyway.

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

9 years agollvm-build: Factor out duplicate cmake export listing. Patch by
Dan Liew [Fri, 21 Aug 2015 18:10:51 +0000 (18:10 +0000)]
llvm-build: Factor out duplicate cmake export listing. Patch by
Brad King.

The write_cmake_fragment and write_cmake_exports_fragment methods share
some logic for selecting libraries that CMake needs to know about.
Factor it out into a helper to avoid duplication.

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

9 years ago[x86] enable machine combiner reassociations for 128-bit vector min/max
Sanjay Patel [Fri, 21 Aug 2015 18:06:49 +0000 (18:06 +0000)]
[x86] enable machine combiner reassociations for 128-bit vector min/max

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

9 years agoRemove an unnecessary use of pointee types introduced in r194220
David Blaikie [Fri, 21 Aug 2015 17:37:41 +0000 (17:37 +0000)]
Remove an unnecessary use of pointee types introduced in r194220

David Majnemer (the original author) believes this to be an impossible
condition to reach anyway, and no test cases cover this so we'll go with
that.

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

9 years agoDisable Visual C++ 2013 Debug mode assert on null pointer in some STL algorithms,
Yaron Keren [Fri, 21 Aug 2015 17:31:03 +0000 (17:31 +0000)]
Disable Visual C++ 2013 Debug mode assert on null pointer in some STL algorithms,
such as std::equal on the third argument. This reverts previous workarounds.

Predefining _DEBUG_POINTER_IMPL disables Visual C++ 2013 headers from defining
it to a function performing the null pointer check. In practice, it's not that
bad since any function actually using the nullptr will seg fault. The other
iterator sanity checks remain enabled in the headers.

Reviewed by Aaron Ballmanþ and Duncan P. N. Exon Smith.

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

9 years agoMIRLangRef: Describe the syntax for machine instruction names and flags.
Alex Lorenz [Fri, 21 Aug 2015 17:26:38 +0000 (17:26 +0000)]
MIRLangRef: Describe the syntax for machine instruction names and flags.

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

9 years agosave some testing time; get rid of the non-SSE chips in this test
Sanjay Patel [Fri, 21 Aug 2015 17:16:51 +0000 (17:16 +0000)]
save some testing time; get rid of the non-SSE chips in this test

It doesn't matter what slow/fast unaligned attribute the old chips
have - they can't use anything more than 4-byte stores.

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

9 years ago[APFloat] Remove else after return and replace loop with std::equal. NFC.
Benjamin Kramer [Fri, 21 Aug 2015 16:44:52 +0000 (16:44 +0000)]
[APFloat] Remove else after return and replace loop with std::equal. NFC.

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

9 years agoFix typo - symetric -> symmetric.
Eric Christopher [Fri, 21 Aug 2015 16:23:39 +0000 (16:23 +0000)]
Fix typo - symetric -> symmetric.

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

9 years agoadd a test case to check the fast-unaligned-mem attribute per CPU
Sanjay Patel [Fri, 21 Aug 2015 16:08:26 +0000 (16:08 +0000)]
add a test case to check the fast-unaligned-mem attribute per CPU

This will confirm that the patch in D12154 is actually NFC.
It will also confirm that the proposed changes for the AMD chips
are behaving as expected.

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

9 years ago[DAGCombiner] Fold together mul and shl when both are by a constant
John Brawn [Fri, 21 Aug 2015 10:48:17 +0000 (10:48 +0000)]
[DAGCombiner] Fold together mul and shl when both are by a constant

This is intended to improve code generation for GEPs, as the index value is
shifted by the element size and in GEPs of multi-dimensional arrays the index
of higher dimensions is multiplied by the lower dimension size.

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

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

9 years agoRevert r245635, "[InstCombine] Transform A & (L - 1) u< L --> L != 0"
NAKAMURA Takumi [Fri, 21 Aug 2015 07:46:07 +0000 (07:46 +0000)]
Revert r245635, "[InstCombine] Transform A & (L - 1) u< L --> L != 0"

It caused miscompilation in clang.

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

9 years agoTest Commit: Reformats 2 lines in LangRef.rst
Mohammad Shahid [Fri, 21 Aug 2015 05:31:07 +0000 (05:31 +0000)]
Test Commit: Reformats 2 lines in LangRef.rst

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

9 years agoLinker: Remove empty destructor.
Peter Collingbourne [Fri, 21 Aug 2015 04:51:24 +0000 (04:51 +0000)]
Linker: Remove empty destructor.

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

9 years agoLTO: Simplify ownership of LTOCodeGenerator::TargetMach.
Peter Collingbourne [Fri, 21 Aug 2015 04:45:57 +0000 (04:45 +0000)]
LTO: Simplify ownership of LTOCodeGenerator::TargetMach.

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

9 years agoLTO: Simplify ownership of LTOCodeGenerator::CodegenOptions.
Peter Collingbourne [Fri, 21 Aug 2015 04:45:55 +0000 (04:45 +0000)]
LTO: Simplify ownership of LTOCodeGenerator::CodegenOptions.

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

9 years ago[Sparc] Support user-specified stack object overalignment.
James Y Knight [Fri, 21 Aug 2015 04:17:56 +0000 (04:17 +0000)]
[Sparc] Support user-specified stack object overalignment.

Note: I do not implement a base pointer, so it's still impossible to
have dynamic realignment AND dynamic alloca in the same function.

This also moves the code for determining the frame index reference
into getFrameIndexReference, where it belongs, instead of inline in
eliminateFrameIndex.

[Begin long-winded screed]

Now, stack realignment for Sparc is actually a silly thing to support,
because the Sparc ABI has no need for it -- unlike the situation on
x86, the stack is ALWAYS aligned to the required alignment for the CPU
instructions: 8 bytes on sparcv8, and 16 bytes on sparcv9.

However, LLVM unfortunately implements user-specified overalignment
using stack realignment support, so for now, I'm going to go along
with that tradition. GCC instead treats objects which have alignment
specification greater than the maximum CPU-required alignment for the
target as a separate block of stack memory, with their own virtual
base pointer (which gets aligned). Doing it that way avoids needing to
implement per-target support for stack realignment, except for the
targets which *actually* have an ABI-specified stack alignment which
is too small for the CPU's requirements.

Further unfortunately in LLVM, the default canRealignStack for all
targets effectively returns true, despite that implementing that is
something a target needs to do specifically. So, the previous behavior
on Sparc was to silently ignore the user's specified stack
alignment. Ugh.

Yet MORE unfortunate, if a target actually does return false from
canRealignStack, that also causes the user-specified alignment to be
*silently ignored*, rather than emitting an error.

(I started looking into fixing that last, but it broke a bunch of
tests, because LLVM actually *depends* on having it silently ignored:
some architectures (e.g. non-linux i386) have smaller stack alignment
than spilled-register alignment. But, the fact that a register needs
spilling is not known until within the register allocator. And by that
point, the decision to not reserve the frame pointer has been frozen
in place. And without a frame pointer, stack realignment is not
possible. So, canRealignStack() returns false, and
needsStackRealignment() then returns false, assuming everyone can just
go on their merry way assuming the alignment requirements were
probably just suggestions after-all. Sigh...)

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

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

9 years agoTransformUtils: Introduce module splitter.
Peter Collingbourne [Fri, 21 Aug 2015 02:48:20 +0000 (02:48 +0000)]
TransformUtils: Introduce module splitter.

The module splitter splits a module into linkable partitions. It will
be used to implement parallel LTO code generation.

This initial version of the splitter does not attempt to deal with the
somewhat subtle symbol visibility issues around module splitting. These
will be dealt with in a future change.

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

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

9 years agoSparcAsmParser.cpp: Appease msc x86.
NAKAMURA Takumi [Fri, 21 Aug 2015 01:12:19 +0000 (01:12 +0000)]
SparcAsmParser.cpp: Appease msc x86.

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

9 years agoAArch64: Fix testcase of r245640
Matthias Braun [Fri, 21 Aug 2015 00:23:19 +0000 (00:23 +0000)]
AArch64: Fix testcase of r245640

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

9 years ago[SLP] Add one more test case for propagating 'nontemporal' attributes.
Michael Zolotukhin [Fri, 21 Aug 2015 00:08:39 +0000 (00:08 +0000)]
[SLP] Add one more test case for propagating 'nontemporal' attributes.

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

9 years agodelete more dead code from this testcase.
Adrian Prantl [Fri, 21 Aug 2015 00:02:04 +0000 (00:02 +0000)]
delete more dead code from this testcase.

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

9 years agoFurther reduce the IR in this testcase based on a further reduction
Adrian Prantl [Thu, 20 Aug 2015 23:59:39 +0000 (23:59 +0000)]
Further reduce the IR in this testcase based on a further reduction
of the original source by David Blaikie (thanks!).

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

9 years agoAArch64: Fix cmp;ccmp ordering
Matthias Braun [Thu, 20 Aug 2015 23:33:34 +0000 (23:33 +0000)]
AArch64: Fix cmp;ccmp ordering

When producing conditional compare sequences for or operations we need
to negate the operands and the finally tested flags. The thing is if we negate
the finally tested flags this equals a logical negation of all previously
emitted expressions. There was a case missing where we have to order OR
expressions so they get emitted first.

This fixes http://llvm.org/PR24459

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

9 years agoAArch64: Do not create CCMP on multiple users.
Matthias Braun [Thu, 20 Aug 2015 23:33:31 +0000 (23:33 +0000)]
AArch64: Do not create CCMP on multiple users.

Create CMP;CCMP sequences from and/or trees does not gain us anything if
the and/or tree is materialized to a GP register anyway. While most of
the code already checked for hasOneUse() there was one important case
missing.

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

9 years ago[InstSimplify] add nuw %x, C2 must be at least C2
David Majnemer [Thu, 20 Aug 2015 23:01:41 +0000 (23:01 +0000)]
[InstSimplify] add nuw %x, C2 must be at least C2

Use the fact that add nuw always creates a larger bit pattern when
trying to simplify comparisons.

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

9 years ago[WebAssembly] Mark more operators as Expand.
Dan Gohman [Thu, 20 Aug 2015 22:57:13 +0000 (22:57 +0000)]
[WebAssembly] Mark more operators as Expand.

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

9 years ago[InstCombine] Transform A & (L - 1) u< L --> L != 0
Sanjoy Das [Thu, 20 Aug 2015 22:31:55 +0000 (22:31 +0000)]
[InstCombine] Transform A & (L - 1) u< L --> L != 0

Summary:
This transform is never a pessimization at the IR level (since it
replaces an `icmp` with another), and has potentiall payoffs:

 1. It may make the `icmp` fold away or become loop invariant.
 2. It may make the `A & (L - 1)` computation dead.

This shows up in Java, in range checks generated by array accesses of
the form `a[i & (a.length - 1)]`.

Reviewers: reames, majnemer

Subscribers: llvm-commits

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

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

9 years ago[SLP] Propagate 'nontemporal' attribute into vectorized instructions.
Michael Zolotukhin [Thu, 20 Aug 2015 22:28:15 +0000 (22:28 +0000)]
[SLP] Propagate 'nontemporal' attribute into vectorized instructions.

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

9 years ago[LoopVectorize] Propagate 'nontemporal' attribute into vectorized instructions.
Michael Zolotukhin [Thu, 20 Aug 2015 22:27:38 +0000 (22:27 +0000)]
[LoopVectorize] Propagate 'nontemporal' attribute into vectorized instructions.

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

9 years agoRename Instruction::dropUnknownMetadata() to dropUnknownNonDebugMetadata()
Adrian Prantl [Thu, 20 Aug 2015 22:00:30 +0000 (22:00 +0000)]
Rename Instruction::dropUnknownMetadata() to dropUnknownNonDebugMetadata()
and make it always preserve debug locations, since all callers wanted this
behavior anyway.

This is addressing a post-commit review feedback for r245589.

NFC (inside the LLVM tree).

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

9 years ago[X86] Look for scalar through one bitcast when lowering to VBROADCAST.
Ahmed Bougacha [Thu, 20 Aug 2015 21:02:39 +0000 (21:02 +0000)]
[X86] Look for scalar through one bitcast when lowering to VBROADCAST.

Fixes PR23464: one way to use the broadcast intrinsics is:

  _mm256_broadcastw_epi16(_mm_cvtsi32_si128(*(int*)src));

We don't currently fold this, but now that we use native IR for
the intrinsics (r245605), we can look through one bitcast to find
the broadcast scalar.

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

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

9 years ago[X86] Add some broadcast-from-memory tests.
Ahmed Bougacha [Thu, 20 Aug 2015 20:59:41 +0000 (20:59 +0000)]
[X86] Add some broadcast-from-memory tests.

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

9 years ago[NVPTX] truncating 64-bit to 32-bit is free
Jingyue Wu [Thu, 20 Aug 2015 20:59:02 +0000 (20:59 +0000)]
[NVPTX] truncating 64-bit to 32-bit is free

Summary:
Add an LSR test that exercises isTruncateFree. Without this change, LSR creates
another indvar representing the truncated value.

Reviewers: jholewinski, eliben

Subscribers: jholewinski, llvm-commits

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

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

9 years ago[X86] Replace avx2 broadcast intrinsics with native IR.
Ahmed Bougacha [Thu, 20 Aug 2015 20:36:19 +0000 (20:36 +0000)]
[X86] Replace avx2 broadcast intrinsics with native IR.

Since r245605, the clang headers don't use these anymore.
r245165 updated some of the tests already; update the others, add
an autoupgrade, remove the intrinsics, and cleanup the definitions.

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

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

9 years ago[asan] Add ASAN support for AArch64 42-bit VMA
Adhemerval Zanella [Thu, 20 Aug 2015 18:30:40 +0000 (18:30 +0000)]
[asan] Add ASAN support for AArch64 42-bit VMA

This patch adds support for asan on aarch64-linux with 42-bit VMA
(current default config for 64K pagesize kernels).  The support is
enabled by defining the SANITIZER_AARCH64_VMA to 42 at build time
for both clang/llvm and compiler-rt.  The default VMA is 39 bits.

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

9 years ago[ValueTracking] computeOverflowForSignedAdd and isKnownNonNegative
Jingyue Wu [Thu, 20 Aug 2015 18:27:04 +0000 (18:27 +0000)]
[ValueTracking] computeOverflowForSignedAdd and isKnownNonNegative

Summary:
Refactor, NFC

Extracts computeOverflowForSignedAdd and isKnownNonNegative from NaryReassociate to ValueTracking in case
others need it.

Reviewers: reames

Subscribers: majnemer, llvm-commits

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

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

9 years ago[LVI] Avoid iterator invalidation in LazyValueInfoCache::threadEdge
Bruno Cardoso Lopes [Thu, 20 Aug 2015 18:24:54 +0000 (18:24 +0000)]
[LVI] Avoid iterator invalidation in LazyValueInfoCache::threadEdge

Do that by copying out the elements to another SmallPtrSet.
Follow up from r245309.

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

9 years agoFix a bug that caused SimplifyCFG to drop DebugLocs.
Adrian Prantl [Thu, 20 Aug 2015 18:24:02 +0000 (18:24 +0000)]
Fix a bug that caused SimplifyCFG to drop DebugLocs.

Instruction::dropUnknownMetadata(KnownSet) is supposed to preserve all
metadata in KnownSet, but the condition for DebugLocs was inverted.

Most users of dropUnknownMetadata() actually worked around this by not
adding LLVMContext::MD_dbg to their list of KnowIDs.
This is now made explicit.

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

9 years agoFix a debug location handling bug in GVN.
Adrian Prantl [Thu, 20 Aug 2015 18:23:56 +0000 (18:23 +0000)]
Fix a debug location handling bug in GVN.
Caught by the famous "DebugLoc describes the currect SubProgram" assertion.

When GVN is removing a nonlocal load it updates the debug location of the
SSA value it replaced the load with with the one of the load. In the
testcase this actually overwrites a valid debug location with an empty one.

In reality GVN has to make an arbitrary choice between two equally valid
debug locations. This patch changes to behavior to only update the
location if the value doesn't already have a debug location.

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

9 years ago[LVer] Fix FIXME: hide addPHINodes, NFC
Adam Nemet [Thu, 20 Aug 2015 17:22:29 +0000 (17:22 +0000)]
[LVer] Fix FIXME: hide addPHINodes, NFC

Since Ashutosh made findDefsUsedOutsideOfLoop public, we can clean this
up.

Now clients that don't compute DefsUsedOutsideOfLoop can just call
versionLoop() and computing DefsUsedOutsideOfLoop will happen
implicitly.  With that there is no reason to expose addPHINodes anymore.

Ashutosh, you can now drop the calls to findDefsUsedOutsideOfLoop and
addPHINodes in LVerLICM and things should just work.

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

9 years ago[ARM] Don't try and custom lower a vNi64 SETCC.
James Molloy [Thu, 20 Aug 2015 16:33:44 +0000 (16:33 +0000)]
[ARM] Don't try and custom lower a vNi64 SETCC.

It won't go well. We've already marked 64-bit SETCCs as non-Custom, but it's just possible that a SETCC has a legal result type but an illegal operand type. If this happens, bail out before we create unselectable nodes.

Fixes PR24292. I tried to create a testcase but in 99% of cases we can't trigger this - not surprising that this bug has been latent since 2009.

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

9 years agoFix symbol value computation when part of the expression is weak.
Rafael Espindola [Thu, 20 Aug 2015 16:18:30 +0000 (16:18 +0000)]
Fix symbol value computation when part of the expression is weak.

This matches the behaviour of the gnu assembler and is part of
fixing pr24486.

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

9 years ago[Sparc]: correct the 'set' synthetic instruction
Douglas Katzman [Thu, 20 Aug 2015 16:16:16 +0000 (16:16 +0000)]
[Sparc]: correct the 'set' synthetic instruction

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

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

9 years agoOptimize bitwise even/odd test (-x&1 -> x&1) to not use negation.
Balaram Makam [Thu, 20 Aug 2015 15:35:00 +0000 (15:35 +0000)]
Optimize bitwise even/odd test (-x&1 -> x&1) to not use negation.

Summary: We know that -x & 1 is equivalent to x & 1, avoid using negation for testing if a negative integer is even or odd.

Reviewers: majnemer

Subscribers: junbuml, mssimpso, gberry, mcrosier, llvm-commits

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

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

9 years ago[mips][microMIPS] Add microMIPS32r6 and microMIPS64r6 tests for existing 16-bit ADDIU...
Zoran Jovanovic [Thu, 20 Aug 2015 11:51:49 +0000 (11:51 +0000)]
[mips][microMIPS] Add microMIPS32r6 and microMIPS64r6 tests for existing 16-bit ADDIUR1SP, ADDIUR2, ADDIUS5 and ADDIUSP instructions
Differential Revision: http://reviews.llvm.org/D10955

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

9 years ago[X86] Fix FBLD and FBSTP
Marina Yatsina [Thu, 20 Aug 2015 11:51:24 +0000 (11:51 +0000)]
[X86] Fix FBLD and FBSTP

FBLD and FBSTP should receive TBYTE because it is defined as
FBLD m80
FBSTP m80

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

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

9 years ago[X86] Fix bug in COMISD and COMISS definition in td files
Marina Yatsina [Thu, 20 Aug 2015 11:21:36 +0000 (11:21 +0000)]
[X86] Fix bug in COMISD and COMISS definition in td files

COMISD should receive QWORD because it is defined as
 (V)COMISD xmm1, xmm2/m64

COMISS should receive DWORD because it is defined as
 (V)COMISS xmm1, xmm2/m32

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

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

9 years agoMake helper functions static. NFC.
Benjamin Kramer [Thu, 20 Aug 2015 09:57:22 +0000 (09:57 +0000)]
Make helper functions static. NFC.

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

9 years ago[X86] Fix the (shl (and (setcc_c), c1), c2) -> (and setcc_c, (c1 << c2)) fold
David Majnemer [Thu, 20 Aug 2015 09:00:56 +0000 (09:00 +0000)]
[X86] Fix the (shl (and (setcc_c), c1), c2) -> (and setcc_c, (c1 << c2)) fold

We didn't check for the necessary preconditions before folding a
mask/shift into a single mask.

This fixes PR24516.

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

9 years agoRevert "[DSE] Enable removal of lifetime intrinsics in terminating blocks"
Bjorn Steinbrink [Thu, 20 Aug 2015 08:58:47 +0000 (08:58 +0000)]
Revert "[DSE] Enable removal of lifetime intrinsics in terminating blocks"

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

9 years ago[DSE] Enable removal of lifetime intrinsics in terminating blocks
Bjorn Steinbrink [Thu, 20 Aug 2015 08:25:28 +0000 (08:25 +0000)]
[DSE] Enable removal of lifetime intrinsics in terminating blocks

Usually DSE is not supposed to remove lifetime intrinsics, but it's
actually ok to remove them for dead objects in terminating blocks,
because they convey no extra information there. Until we hit a lifetime
start that cannot be removed, that is. Because from that point on the
lifetime intrinsics become interesting again, e.g. for stack coloring.

Reviewers: reames

Subscribers: llvm-commits

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

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

9 years ago[ARC] Pull the ObjC ARC components that really serve the role of
Chandler Carruth [Thu, 20 Aug 2015 08:06:03 +0000 (08:06 +0000)]
[ARC] Pull the ObjC ARC components that really serve the role of
analyses into LLVM's Analysis library rather than having them in
a Transforms library.

This is motivated by the need to have the core AliasAnalysis
infrastructure be aware of the ObjCARCAliasAnalysis. However, it also
seems like a nice and clean separation. Everything was very easy to move
and this doesn't create much clutter in the analysis library IMO.

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

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

9 years ago[PowerPC] Fix value type on XVCMPEQDP for v2f64 comparisons
Hal Finkel [Thu, 20 Aug 2015 03:02:02 +0000 (03:02 +0000)]
[PowerPC] Fix value type on XVCMPEQDP for v2f64 comparisons

XVCMPEQDP is used for VSX v2f64 equality comparisons, but the value type needs
to be v2i64 (as that's the corresponding SETCC type).

Fixes PR24225.

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

9 years ago[PowerPC] Fix the int2fp(fp2int(x)) DAGCombine to ignore ppc_fp128
Hal Finkel [Thu, 20 Aug 2015 01:18:20 +0000 (01:18 +0000)]
[PowerPC] Fix the int2fp(fp2int(x)) DAGCombine to ignore ppc_fp128

This DAGCombine was creating custom SDAG nodes with an illegal ppc_fp128
operand type because it was triggering on f64/f32 int2fp(fp2int(ppc_fp128 x)),
but shouldn't (it should only apply to f32/f64 types). The result was a crash.

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

9 years agoMIR Serialization: Use the global value syntax for global value memory operands.
Alex Lorenz [Thu, 20 Aug 2015 00:20:03 +0000 (00:20 +0000)]
MIR Serialization: Use the global value syntax for global value memory operands.

This commit modifies the serialization syntax so that the global IR values in
machine memory operands use the global value '@<name>' syntax instead of the
current '%ir.<name>' syntax.

The unnamed global IR values are handled by this commit as well, as the
existing global value parsing method can parse the unnamed globals already.

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

9 years agoMIR Serialization: Change syntax for the call entry pseudo source values.
Alex Lorenz [Thu, 20 Aug 2015 00:12:57 +0000 (00:12 +0000)]
MIR Serialization: Change syntax for the call entry pseudo source values.

The global IR values in machine memory operands should use the global value
'@<name>' syntax instead of the current '%ir.<name>' syntax.

However, the global value call entry pseudo source values use the global value
syntax already. Therefore, the syntax for the call entry pseudo source values
has to be changed so that the global values and call entry global value PSVs
can be parsed without ambiguities.

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