Commit Graph

121055 Commits

Author SHA1 Message Date
Bruno Cardoso Lopes
8ccce34ac0 [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
2015-08-21 21:18:26 +00:00
Alex Lorenz
5e825f694d 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
2015-08-21 21:17:01 +00:00
Alex Lorenz
62b84e2724 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
2015-08-21 21:12:44 +00:00
Simon Pilgrim
6f86faedf0 Line endings fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245736 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 21:09:51 +00:00
Sanjay Patel
bf83737adb [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
2015-08-21 21:04:21 +00:00
Sanjay Patel
6113df3d73 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
2015-08-21 20:39:17 +00:00
Davide Italiano
241f716c4b [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
2015-08-21 20:28:30 +00:00
David Blaikie
5e8c2097ae Add comment as follow up to r245712
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245730 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 20:18:39 +00:00
Sanjay Patel
2071d7abd9 [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
2015-08-21 20:17:26 +00:00
David Blaikie
81e467d352 [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
2015-08-21 20:16:51 +00:00
Peter Collingbourne
d01f303c32 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
2015-08-21 19:09:42 +00:00
Dan Liew
299db164f5 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
2015-08-21 18:10:57 +00:00
Dan Liew
fe112c27a2 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
2015-08-21 18:10:55 +00:00
Dan Liew
71481ee8c0 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
2015-08-21 18:10:51 +00:00
Sanjay Patel
b730bdf4e9 [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
2015-08-21 18:06:49 +00:00
David Blaikie
996ace13c0 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
2015-08-21 17:37:41 +00:00
Yaron Keren
3f1c66ca7d 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
2015-08-21 17:31:03 +00:00
Alex Lorenz
ded00c79af 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
2015-08-21 17:26:38 +00:00
Sanjay Patel
c9cb569d1e 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
2015-08-21 17:16:51 +00:00
Benjamin Kramer
3ab981d84a [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
2015-08-21 16:44:52 +00:00
Eric Christopher
32ce343fe6 Fix typo - symetric -> symmetric.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 16:23:39 +00:00
Sanjay Patel
67f79f0519 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
2015-08-21 16:08:26 +00:00
John Brawn
19a3f63b54 [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
2015-08-21 10:48:17 +00:00
NAKAMURA Takumi
92c2acd055 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
2015-08-21 07:46:07 +00:00
Mohammad Shahid
903567ca99 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
2015-08-21 05:31:07 +00:00
Peter Collingbourne
e0d3c7ca6d Linker: Remove empty destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245672 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 04:51:24 +00:00
Peter Collingbourne
22df81e087 LTO: Simplify ownership of LTOCodeGenerator::TargetMach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245671 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 04:45:57 +00:00
Peter Collingbourne
ad3f32e4a5 LTO: Simplify ownership of LTOCodeGenerator::CodegenOptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245670 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 04:45:55 +00:00
James Y Knight
83b0a9bc74 [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
2015-08-21 04:17:56 +00:00
Peter Collingbourne
c1e784cb78 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
2015-08-21 02:48:20 +00:00
NAKAMURA Takumi
81fc7b208f SparcAsmParser.cpp: Appease msc x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245661 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 01:12:19 +00:00
Matthias Braun
7f0a6c950c AArch64: Fix testcase of r245640
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245647 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 00:23:19 +00:00
Michael Zolotukhin
3dc9abd7c5 [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
2015-08-21 00:08:39 +00:00
Adrian Prantl
6973889a62 delete more dead code from this testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245643 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 00:02:04 +00:00
Adrian Prantl
37d4cd87a1 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
2015-08-20 23:59:39 +00:00
Matthias Braun
57970eb1a0 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
2015-08-20 23:33:34 +00:00
Matthias Braun
05b3080b3c 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
2015-08-20 23:33:31 +00:00
David Majnemer
bdab9f9f82 [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
2015-08-20 23:01:41 +00:00
Dan Gohman
b4fce5a1c1 [WebAssembly] Mark more operators as Expand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245636 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-20 22:57:13 +00:00
Sanjoy Das
ba38902605 [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
2015-08-20 22:31:55 +00:00
Michael Zolotukhin
9cd73adba0 [SLP] Propagate 'nontemporal' attribute into vectorized instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-20 22:28:15 +00:00
Michael Zolotukhin
c23d147533 [LoopVectorize] Propagate 'nontemporal' attribute into vectorized instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245632 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-20 22:27:38 +00:00
Adrian Prantl
178fbb3654 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
2015-08-20 22:00:30 +00:00
Ahmed Bougacha
14fea5bf0d [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
2015-08-20 21:02:39 +00:00
Ahmed Bougacha
ed7eb85a5d [X86] Add some broadcast-from-memory tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-20 20:59:41 +00:00
Jingyue Wu
1670bbc481 [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
2015-08-20 20:59:02 +00:00
Ahmed Bougacha
ad0ddd8e01 [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
2015-08-20 20:36:19 +00:00
Adhemerval Zanella
dc4b9efc0f [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
2015-08-20 18:30:40 +00:00
Jingyue Wu
df4b7e6ed2 [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
2015-08-20 18:27:04 +00:00
Bruno Cardoso Lopes
4d9e28f082 [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
2015-08-20 18:24:54 +00:00