Commit Graph

109727 Commits

Author SHA1 Message Date
David Blaikie
b1494f18ec And... fix the build some more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221036 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 01:15:24 +00:00
David Blaikie
a49cbece54 Just iterate the DwarfCompileUnits rather than trying to filter them out of the list of all units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221034 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 01:11:19 +00:00
David Blaikie
bf29eb3ad1 Add '*' to auto variable that is a pointer, as per the coding conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221033 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 01:03:39 +00:00
Diego Novillo
9657de5f22 Add show and merge tools for sample PGO profiles.
Summary:
This patch extends the 'show' and 'merge' commands in llvm-profdata to handle
sample PGO formats. Using the 'merge' command it is now possible to convert
one sample PGO format to another.

The only format that is currently not working is 'gcc'. I still need to
implement support for it in lib/ProfileData.

The changes in the sample profile support classes are needed for the
merge operation.

Reviewers: bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 00:56:55 +00:00
David Blaikie
e542d91ee5 Add DwarfCompileUnit::getSkeleton that returns DwarfCompileUnit* to avoid having to cast from DwarfUnit* on every call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221031 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 00:50:34 +00:00
Adrian Prantl
a4e1564971 Temporarily revert r220777 to sort out build bot breakage.
"[x86] Simplify vector selection if condition value type matches vselect value type and true value is all ones or false value is all zeros."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221028 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 00:26:59 +00:00
Duncan P. N. Exon Smith
b2187ede9e IR: MDNode => Value: Instruction::getAllMetadata()
Change `Instruction::getAllMetadata()` to modify a vector of `Value`
instead of `MDNode` and update call sites.  This is part of PR21433.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221027 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 00:26:42 +00:00
Duncan P. N. Exon Smith
3a84a6377c IR: MDNode => Value: Instruction::getMetadata()
Change `Instruction::getMetadata()` to return `Value` as part of
PR21433.

Update most callers to use `Instruction::getMDNode()`, which wraps the
result in a `cast_or_null<MDNode>`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221024 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 00:10:31 +00:00
Duncan P. N. Exon Smith
9ed44978ef IR: MDNode => Value: Add Instruction::getMDNode()
Add `Instruction::getMDNode()` that casts to `MDNode` before changing
`Instruction::getMetadata()` to return `Value`.  This avoids adding
`cast_or_null<MDNode>` boiler-plate throughout the code.

Part of PR21433.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221023 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 23:58:04 +00:00
Reid Kleckner
8d2e511d3b Revert "R600: Add missing file to CMakeLists.txt"
This reverts commit r220998.

It should've been reverted with the other change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221021 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 23:39:10 +00:00
Reid Kleckner
a5607fb841 Revert "R600: Make sure to inline all internal functions"
This reverts commit r220996.

It introduced layering violations causing link errors in many
configurations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221020 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 23:35:26 +00:00
Reid Kleckner
e1a4787d5d Work around bugs in MSVC "14" CTP 3's conversion logic
It appears to ignore or find ambiguous MachineInstrBuilder's conversion
operators that allow conversion to MachineInstr* and
MachineBasicBlock::bundle_iterator.

As a workaround, add an explicit way to get the MachineInstr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 23:19:46 +00:00
Rafael Espindola
9f86b43215 Refactor duplicated code in liking GlobalValues.
There is quiet a bit of logic that is common to any GlobalValue but was
duplicated for Functions, GlobalVariables and GlobalAliases.

While at it, merge visibility even when comdats are used, fixing pr21415.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221014 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 23:10:07 +00:00
Reid Kleckner
fc46c68310 Define LLVM_NOEXCEPT with MSVC 14 CTP 3 or newer
We have to use _MSC_FULL_VER here as CTP 2 and earlier didn't define
noexcept to my knowledge.

Fixes build error in lib/Support/Error.cpp when inheriting from
std::error_category, which has a noexcept virtual method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221013 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 23:02:40 +00:00
Reid Kleckner
57c911e4ab Suppress MSVC's equivalent of -Wshadow warnings
IMO we need to clean up some of these, but the member variable one
(C4458) has false positives on static methods.  It is currently firing
on Twine, which has a static method like:
  struct Twine {
    uintptr_t LHS, RHS;
    static void staticMethod() {
      // warning C4458: declaration of 'LHS' hides class member
      uintptr_t LHS;
      ...
    }
  };

We should fix up clang's -Wshadow and clean it up, and then we can
re-enable some of these MSVC warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221012 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 22:55:57 +00:00
David Blaikie
54a86b37dd Sink some of DwarfDebug::collectDeadVariables down into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221010 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 22:30:30 +00:00
Michael Zolotukhin
cf19403e39 Correctly update dom-tree after loop vectorizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221009 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 22:28:03 +00:00
David Blaikie
021153f536 Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221005 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 21:57:02 +00:00
Tom Stellard
03fb370534 R600: Add IPO to the list of required libraries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221004 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 21:52:08 +00:00
Lang Hames
7b8ba81502 [Object] Modify OwningBinary's interface to separate inspection from ownership.
The getBinary and getBuffer method now return ordinary pointers of appropriate
const-ness. Ownership is transferred by calling takeBinary(), which returns a
pair of the Binary and a MemoryBuffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221003 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 21:37:49 +00:00
Tom Stellard
7dd15e65fb R600: Add missing file to CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220998 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 20:56:36 +00:00
Tom Stellard
b5c86504a0 R600: Don't promote allocas when one of the users is a ptrtoint instruction
We need to figure out how to track ptrtoint values all the
way until result is converted back to a pointer in order
to correctly rewrite the pointer type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220997 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 20:52:04 +00:00
Tom Stellard
5d6cee5e65 R600: Make sure to inline all internal functions
Function calls aren't supported yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220996 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 20:52:02 +00:00
Duncan P. N. Exon Smith
da8d5586be IR: Instruction::setMetadata() should use cast_or_null
Not sure why this assertion didn't fire locally [1], but in r220994
`Instruction::setMetadata()` should be using `cast_or_null`.

[1]: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/12327

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220995 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 20:28:04 +00:00
Duncan P. N. Exon Smith
815275f5de IR: MDNode => Value: Instruction::setMetadata()
Change `Instruction::setMetadata()` API to accept `Value` instead of
`MDNode`.  Part of PR21433.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220994 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 20:13:11 +00:00
Bill Schmidt
2d32816a45 [PowerPC] Initial VSX intrinsic support, with min/max for vector double
Now that we have initial support for VSX, we can begin adding
intrinsics for programmer access to VSX instructions.  This patch adds
basic support for VSX intrinsics in general, and tests it by
implementing intrinsics for minimum and maximum for the vector double
data type.

The LLVM portion of this is quite straightforward.  There is a
companion patch for Clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220988 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 19:19:07 +00:00
Chad Rosier
b9ce924135 [AArch64] Check Dest Register Liveness in CondOpt pass.
Our internal test reveals such case should not be transformed:

  cmp x17, #3
  b.lt .LBB10_15
  ...
  subs x12, x12, #1
  b.gt .LBB10_1

where x12 is a liveout, becomes:

  cmp x17, #2
  b.le .LBB10_15
  ...
  subs x12, x12, #2
  b.ge .LBB10_1

Unable to provide test case as it's difficult to reproduce on community branch.

http://reviews.llvm.org/D6048
Patch by Zhaoshi Zheng <zhaoshiz@codeaurora.org>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220987 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 19:02:38 +00:00
Kostya Serebryany
854432d7e5 [asan] do not treat inline asm calls as indirect calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220985 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 18:38:23 +00:00
Quentin Colombet
9b6ca9304c [CodeGenPrepare] Move extractelement close to store if they can be combined.
This patch adds an optimization in CodeGenPrepare to move an extractelement
right before a store when the target can combine them.
The optimization may promote any scalar operations to vector operations in the
way to make that possible.


** Context **

Some targets use different register files for both vector and scalar operations.
This means that transitioning from one domain to another may incur copy from one
register file to another. These copies are not coalescable and may be expensive.
For example, according to the scheduling model, on cortex-A8 a vector to GPR
move is 20 cycles.


** Motivating Example **

Let us consider an example:
define void @foo(<2 x i32>* %addr1, i32* %dest) {
 %in1 = load <2 x i32>* %addr1, align 8
 %extract = extractelement <2 x i32> %in1, i32 1
 %out = or i32 %extract, 1
 store i32 %out, i32* %dest, align 4
 ret void
}

As it is, this IR generates the following assembly on armv7:
  vldr  d16, [r0]            @vector load  
  vmov.32 r0, d16[1]  @ cross-register-file copy: 20 cycles
  orr r0, r0, #1           @ scalar bitwise or
  str r0, [r1]               @ scalar store
  bx  lr

Whereas we could generate much faster code:
  vldr  d16, [r0]               @ vector load
  vorr.i32  d16, #0x1     @ vector bitwise or
  vst1.32 {d16[1]}, [r1:32] @ vector extract + store
  bx  lr

Half of the computation made in the vector is useless, but this allows to get
rid of the expensive cross-register-file copy.


** Proposed Solution **

To avoid this cross-register-copy penalty, we promote the scalar operations to
vector operations. The penalty will be removed if we manage to promote the whole
chain of computation in the vector domain.
Currently, we do that only when the chain of computation ends by a store and the
target is able to combine an extract with a store.

Stores are the most likely candidates, because other instructions produce values
that would need to be promoted and so, extracted as some point[1]. Moreover,
this is customary that targets feature stores that perform a vector extract (see
AArch64 and X86 for instance).

The proposed implementation relies on the TargetTransformInfo to decide whether
or not it is beneficial to promote a chain of computation in the vector domain.
Unfortunately, this interface is rather inaccurate for this level of details and
although this optimization may be beneficial for X86 and AArch64, the inaccuracy
will lead to the optimization being too aggressive.
Basically in TargetTransformInfo, everything that is legal has a cost of 1,
whereas, even if a vector type is legal, usually a vector operation is slightly
more expensive than its scalar counterpart. That will lead to too many
promotions that may not be counter balanced by the saving of the
cross-register-file copy. For instance, on AArch64 this penalty is just 4
cycles.

For now, the optimization is just enabled for ARM prior than v8, since those
processors have a larger penalty on cross-register-file copies, and the scope is
limited to basic blocks. Because of these two factors, we limit the effects of
the inaccuracy. Indeed, I did not want to build up a fancy cost model with block
frequency and everything on top of that.

[1] We can imagine targets that can combine an extractelement with  other
instructions than just stores. If we want to go into that direction, the current
interfaces must be augmented and, moreover, I think this becomes a global isel
problem.

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

<rdar://problem/14170854>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220978 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 17:52:53 +00:00
Kostya Serebryany
96076957ac [asan] fix caller-calee instrumentation to emit new cache for every call site
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220973 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 17:11:27 +00:00
Justin Bogner
e05a7e111e Remove the wrongly named and now empty Ocaml directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220971 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 17:10:02 +00:00
David Blaikie
c700c4d161 Update the non-pthreads fallback for RWMutex on Unix
Tested this by #if 0'ing out the pthreads implementation, which
indicated that this fallback was not currently compiling successfully
and applying this patch resolves that.

Patch by Andy Chien.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220969 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 17:02:30 +00:00
Rafael Espindola
07c3753e14 Unify and update link-messages.ll and redefinition.ll. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220968 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 16:52:30 +00:00
David Blaikie
7d26b99189 Correct assert text from r220923
Noticed in post-commit review by Adrian Prantl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220967 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 16:45:36 +00:00
Rafael Espindola
2105bd06af Mark a few variables const. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220964 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 16:08:17 +00:00
NAKAMURA Takumi
65e4532b78 [CMake] llvm/examples: Update libdeps for unoptimized builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220962 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 15:27:16 +00:00
Chad Rosier
66d3a86a9a [AArch64] CondOpt pass is missing FCMP instructions when searching backward for
a CMP which defines the flags used by B.CC.

http://reviews.llvm.org/D6047
Patch by Zhaoshi Zheng <zhaoshiz@codeaurora.org>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220961 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 15:17:36 +00:00
Bradley Smith
8cff277de2 [SCEV] Improve Scalar Evolution's use of no {un,}signed wrap flags
In a case where we have a no {un,}signed wrap flag on the increment, if
RHS - Start is constant then we can avoid inserting a max operation bewteen
the two, since we can statically determine which is greater.

This allows us to unroll loops such as:

 void testcase3(int v) {
   for (int i=v; i<=v+1; ++i)
     f(i);
 }


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220960 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 11:40:32 +00:00
Ulrich Weigand
8a9c531e9a [PowerPC] Load BlockAddress values from the TOC in 64-bit SVR4 code
Since block address values can be larger than 2GB in 64-bit code, they
cannot be loaded simply using an @l / @ha pair, but instead must be
loaded from the TOC, just like GlobalAddress, ConstantPool, and
JumpTable values are.

The commit also fixes a bug in PPCLinuxAsmPrinter::doFinalization where
temporary labels could not be used as TOC values, since code would
attempt (and fail) to use GetOrCreateSymbol to create a symbol of the
same name as the temporary label.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220959 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 10:33:14 +00:00
Peter Zotov
42187d2c00 [OCaml] Ensure consistent naming.
Specifically:
  * Directories match module names.
  * Test names match module names.
  * The language is called "OCaml", not "Ocaml".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220958 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 09:19:03 +00:00
Peter Zotov
ced3d172f8 [OCaml] Rework Llvm_executionengine using ctypes.
Since JIT->MCJIT migration, most of the ExecutionEngine interface
became deprecated and/or broken. This especially affected the OCaml
bindings, as runFunction is no longer available, and unlike in C,
it is not possible to coerce a pointer to a function and call it
in OCaml.

In practice, LLVM 3.5 shipped completely unusable
Llvm_executionengine.

The GenericValue interface and runFunction were essentially
a poor man's FFI. As such, this interface was removed and instead
a dependency on ctypes >=0.3 added, which handled platform-specific
aspects of accessing data and calling functions.

The new interface does not expose JIT (which is a shim around MCJIT),
as well as the interpreter (which can't handle a lot of valid IR).

Llvm_executionengine.add_global_mapping is currently unusable
due to PR20656.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220957 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 09:05:36 +00:00
Rafael Espindola
130901ddf1 Move an input file to Inputs instead of using RUN: true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220953 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 05:54:15 +00:00
David Majnemer
a2715904e5 Object, COFF: Cleanup symbol type code, improve binutils compatibility
Do a better job classifying symbols.  This increases the consistency
between the COFF handling code and the ELF side of things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220952 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 05:07:00 +00:00
Rafael Espindola
534d9042b1 merge tests for constant linking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220951 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 05:04:16 +00:00
Rafael Espindola
062f4e40c3 Move definition closer to use. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220949 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 04:46:38 +00:00
Hao Liu
80021c5cf8 PR20557: Fix the bug that bogus cpu parameter crashes llc on AArch64 backend.
Initial patch by Oleg Ranevskyy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220945 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 02:35:34 +00:00
NAKAMURA Takumi
714a629ad8 Threading.h: Give named parameters to llvm::call_once(flag,UserFn). [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220941 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 00:54:20 +00:00
Ahmed Bougacha
107d77958d [SelectionDAG] When scalarizing trunc, don't assert for legal operands.
r212242 introduced a legalizer hook, originally to let AArch64 widen
v1i{32,16,8} rather than scalarize, because the legalizer expected, when
scalarizing the result of a conversion operation, to already have
scalarized the operands.  On AArch64, v1i64 is legal, so that commit
ensured operations such as v1i32 = trunc v1i64 wouldn't assert.

It did that by choosing to widen v1 types whenever possible.  However,
v1i1 types, for which there's no legal widened type, would still trigger
the assert.

This commit fixes that, by only scalarizing a trunc's result when the
operand has already been scalarized, and introducing an extract_elt
otherwise.  
This is similar to r205625.

Fixes PR20777.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220937 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 23:46:50 +00:00
Hans Wennborg
9eb0a09710 Speculative fix for Windows build after r220932
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220936 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 23:10:01 +00:00
Chris Bieneman
4b57390110 EXPORTED_SYMBOL_FILE using mingw and cmake
Summary: This is a fix for the command line syntax error while building LTO when using MinGW.

Patch By: jsroemer

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, beanz, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220935 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 22:37:58 +00:00