OSDN Git Service
Rafael Espindola [Fri, 31 Oct 2014 23:10:07 +0000 (23:10 +0000)]
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
Reid Kleckner [Fri, 31 Oct 2014 23:02:40 +0000 (23:02 +0000)]
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
Reid Kleckner [Fri, 31 Oct 2014 22:55:57 +0000 (22:55 +0000)]
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
David Blaikie [Fri, 31 Oct 2014 22:30:30 +0000 (22:30 +0000)]
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
Michael Zolotukhin [Fri, 31 Oct 2014 22:28:03 +0000 (22:28 +0000)]
Correctly update dom-tree after loop vectorizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221009
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 31 Oct 2014 21:57:02 +0000 (21:57 +0000)]
Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221005
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 31 Oct 2014 21:52:08 +0000 (21:52 +0000)]
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
Lang Hames [Fri, 31 Oct 2014 21:37:49 +0000 (21:37 +0000)]
[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
Tom Stellard [Fri, 31 Oct 2014 20:56:36 +0000 (20:56 +0000)]
R600: Add missing file to CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220998
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 31 Oct 2014 20:52:04 +0000 (20:52 +0000)]
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
Tom Stellard [Fri, 31 Oct 2014 20:52:02 +0000 (20:52 +0000)]
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
Duncan P. N. Exon Smith [Fri, 31 Oct 2014 20:28:04 +0000 (20:28 +0000)]
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
Duncan P. N. Exon Smith [Fri, 31 Oct 2014 20:13:11 +0000 (20:13 +0000)]
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
Bill Schmidt [Fri, 31 Oct 2014 19:19:07 +0000 (19:19 +0000)]
[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
Chad Rosier [Fri, 31 Oct 2014 19:02:38 +0000 (19:02 +0000)]
[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
Kostya Serebryany [Fri, 31 Oct 2014 18:38:23 +0000 (18:38 +0000)]
[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
Quentin Colombet [Fri, 31 Oct 2014 17:52:53 +0000 (17:52 +0000)]
[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
Kostya Serebryany [Fri, 31 Oct 2014 17:11:27 +0000 (17:11 +0000)]
[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
Justin Bogner [Fri, 31 Oct 2014 17:10:02 +0000 (17:10 +0000)]
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
David Blaikie [Fri, 31 Oct 2014 17:02:30 +0000 (17:02 +0000)]
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
Rafael Espindola [Fri, 31 Oct 2014 16:52:30 +0000 (16:52 +0000)]
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
David Blaikie [Fri, 31 Oct 2014 16:45:36 +0000 (16:45 +0000)]
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
Rafael Espindola [Fri, 31 Oct 2014 16:08:17 +0000 (16:08 +0000)]
Mark a few variables const. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220964
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 31 Oct 2014 15:27:16 +0000 (15:27 +0000)]
[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
Chad Rosier [Fri, 31 Oct 2014 15:17:36 +0000 (15:17 +0000)]
[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
Bradley Smith [Fri, 31 Oct 2014 11:40:32 +0000 (11:40 +0000)]
[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
Ulrich Weigand [Fri, 31 Oct 2014 10:33:14 +0000 (10:33 +0000)]
[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
Peter Zotov [Fri, 31 Oct 2014 09:19:03 +0000 (09:19 +0000)]
[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
Peter Zotov [Fri, 31 Oct 2014 09:05:36 +0000 (09:05 +0000)]
[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
Rafael Espindola [Fri, 31 Oct 2014 05:54:15 +0000 (05:54 +0000)]
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
David Majnemer [Fri, 31 Oct 2014 05:07:00 +0000 (05:07 +0000)]
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
Rafael Espindola [Fri, 31 Oct 2014 05:04:16 +0000 (05:04 +0000)]
merge tests for constant linking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220951
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 31 Oct 2014 04:46:38 +0000 (04:46 +0000)]
Move definition closer to use. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220949
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Fri, 31 Oct 2014 02:35:34 +0000 (02:35 +0000)]
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
NAKAMURA Takumi [Fri, 31 Oct 2014 00:54:20 +0000 (00:54 +0000)]
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
Ahmed Bougacha [Thu, 30 Oct 2014 23:46:50 +0000 (23:46 +0000)]
[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
Hans Wennborg [Thu, 30 Oct 2014 23:10:01 +0000 (23:10 +0000)]
Speculative fix for Windows build after r220932
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220936
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 30 Oct 2014 22:37:58 +0000 (22:37 +0000)]
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
NAKAMURA Takumi [Thu, 30 Oct 2014 22:28:46 +0000 (22:28 +0000)]
llvm/test/Transforms/SampleProfile/syntax.ll: Relax MISSING-FILE not to
check locale-aware message catalog.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220934
91177308-0d34-0410-b5e6-
96231b3b80d8
Louis Gerbarg [Thu, 30 Oct 2014 22:21:03 +0000 (22:21 +0000)]
Fix incorrect invariant check in DAG Combine
Earlier this summer I fixed an issue where we were incorrectly combining
multiple loads that had different constraints such alignment, invariance,
temporality, etc. Apparently in one case I made copt paste error and swapped
alignment and invariance.
Tests included.
rdar://
18816719
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220933
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 30 Oct 2014 22:07:09 +0000 (22:07 +0000)]
Removing the static initializer in ManagedStatic.cpp by using llvm_call_once to initialize the ManagedStatic mutex.
Summary:
This patch adds an llvm_call_once which is a wrapper around std::call_once on platforms where it is available and devoid of bugs. The patch also migrates the ManagedStatic mutex to be allocated using llvm_call_once.
These changes are philosophically equivalent to the changes added in r219638, which were reverted due to a hang on Win32 which was the result of a bug in the Windows implementation of std::call_once.
Reviewers: aaron.ballman, chapuni, chandlerc, rnk
Reviewed By: rnk
Subscribers: majnemer, llvm-commits
Differential Revision: http://reviews.llvm.org/D5922
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220932
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 30 Oct 2014 20:57:49 +0000 (20:57 +0000)]
llvm-cov: Follow LLVM naming conventions
This renames a few things that are using an unusual naming convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220929
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 30 Oct 2014 20:51:24 +0000 (20:51 +0000)]
llvm-cov: Don't manually parse an option for no reason
We're using cl::opt here, but for some reason we're reading out one
particular option by hand instead. This makes -help and the like
behave rather poorly, so let's not do it this way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220928
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Oct 2014 20:50:23 +0000 (20:50 +0000)]
Fix the merging of the constantness of declarations.
The langref says:
LLVM explicitly allows declarations of global variables to be marked
constant, even if the final definition of the global is not. This
capability can be used to enable slightly better optimization of the
program, but requires the language definition to guarantee that
optimizations based on the ‘constantness’ are valid for the
translation units that do not include the definition.
Given that definition, when merging two declarations, we have to drop
constantness if of of them is not marked contant, since the Module
without the constant marker might not have the necessary guarantees.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220927
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 30 Oct 2014 20:29:48 +0000 (20:29 +0000)]
llvm-cov: Very basic top level help
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220926
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 30 Oct 2014 20:25:19 +0000 (20:25 +0000)]
Add handling for range metadata in ValueTracking isKnownNonZero
If we load from a location with range metadata, we can use information about the ranges of the loaded value for optimization purposes. This helps to remove redundant checks and canonicalize checks for other optimization passes. This particular patch checks whether a value is known to be non-zero from the range metadata.
Currently, these tests are against InstCombine. In theory, all of these should be InstSimplify since we're not inserting any new instructions. Moving the code may follow in a separate change.
Reviewed by: Hal
Differential Revision: http://reviews.llvm.org/D5947
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220925
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Oct 2014 20:23:59 +0000 (20:23 +0000)]
Update test to pass .ll to llvm-link and use Inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220924
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 30 Oct 2014 20:20:11 +0000 (20:20 +0000)]
PR21408: Workaround the appearance of duplicate variables due to problems when inlining two calls to the same function from the same call site.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220923
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Thu, 30 Oct 2014 20:19:19 +0000 (20:19 +0000)]
Fix comment spelling and tidy diagnostic call in profile reader.
No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220922
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Thu, 30 Oct 2014 19:26:42 +0000 (19:26 +0000)]
lit: PR21417: don't try to update OCAMLPATH if LibDir is empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220919
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Thu, 30 Oct 2014 18:48:41 +0000 (18:48 +0000)]
Fix Twine corruption problem with diagnostics.
This fixes the autobuilders I broke with a recent patch. Thanks echristo
and dblaikie for beating me with a clue stick.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220918
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Thu, 30 Oct 2014 18:00:06 +0000 (18:00 +0000)]
Add profile writing capabilities for sampling profiles.
Summary:
This patch finishes up support for handling sampling profiles in both
text and binary formats. The new binary format uses uleb128 encoding to
represent numeric values. This makes profiles files about 25% smaller.
The profile writer class can write profiles in the existing text and the
new binary format. In subsequent patches, I will add the capability to
read (and perhaps write) profiles in the gcov format used by GCC.
Additionally, I will be adding support in llvm-profdata to manipulate
sampling profiles.
There was a bit of refactoring needed to separate some code that was in
the reader files, but is actually common to both the reader and writer.
The new test checks that reading the same profile encoded as text or
raw, produces the same results.
Reviewers: bogner, dexonsmith
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6000
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220915
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 30 Oct 2014 17:05:44 +0000 (17:05 +0000)]
ARM: test default values for TAG_CPU_unaligned_access attribute.
It should be on for every target that supports unaligned accesses (e.g. not
v6m).
Patch by Charlie Turner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220912
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Thu, 30 Oct 2014 14:56:02 +0000 (14:56 +0000)]
[Mips] Add new Mips specific e_flags.
No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220910
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Thu, 30 Oct 2014 14:21:47 +0000 (14:21 +0000)]
[AVX512] Added VBROADCAST{SS/SD} encoding for VL subset.
Refactored through AVX512_maskable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220908
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 30 Oct 2014 13:22:57 +0000 (13:22 +0000)]
[dfsan] New calling convention for custom functions with variadic arguments.
Summary:
The previous calling convention prevented custom functions from being able
to access argument labels unless it knew how many variadic arguments there
were, and of which type. This restriction made it impossible to correctly
model functions in the printf family, as it is legal to pass more arguments
than required to those functions. We now pass arguments in the following order:
non-vararg arguments
labels for non-vararg arguments
[if vararg function, pointer to array of labels for vararg arguments]
[if non-void function, pointer to label for return value]
vararg arguments
Differential Revision: http://reviews.llvm.org/D6028
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220906
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Thu, 30 Oct 2014 08:30:12 +0000 (08:30 +0000)]
[OCaml] Expose LLVMCloneModule.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220903
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Thu, 30 Oct 2014 08:30:08 +0000 (08:30 +0000)]
[OCaml] Expose LLVM{Get,Set}DLLStorageClass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220902
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Thu, 30 Oct 2014 08:30:01 +0000 (08:30 +0000)]
[OCaml] Test code emission in Llvm_target.
Prior to this commit, the Llvm_target tests (ab)used
the Llvm_executionengine as a mechanism to initialize at least some
target. This needlessly restricted tests to builds which can emit
code for their host architecture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220901
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Thu, 30 Oct 2014 08:29:57 +0000 (08:29 +0000)]
[OCaml] Enable backtraces in tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220900
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Thu, 30 Oct 2014 08:29:45 +0000 (08:29 +0000)]
[OCaml] [autoconf] Migrate to ocamlfind.
This commit updates the OCaml bindings and tests to use ocamlfind.
The bindings are migrated in order to use ctypes, which are now
required for MCJIT-backed Llvm_executionengine.
The tests are migrated in order to use OUnit and to verify that
the distributed META.llvm allows to build working executables.
Every OCaml toolchain invocation is now chained through ocamlfind,
which (in theory) allows to cross-compile the OCaml bindings.
The configure script now checks for ctypes (>= 0.2.3) and
OUnit (>= 2). The code depending on these libraries will be added
later. The configure script does not check the package versions
in order to keep changes less invasive.
Additionally, OCaml bindings will now be automatically enabled
if ocamlfind is detected on the system, rather than ocamlc, as it
was before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220899
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Thu, 30 Oct 2014 08:29:29 +0000 (08:29 +0000)]
[OCaml] De-duplicate llvm_raise and llvm_string_of_message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220898
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Oct 2014 00:38:54 +0000 (00:38 +0000)]
Enable the slp vectorizer in the gold plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220887
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Oct 2014 00:11:24 +0000 (00:11 +0000)]
Enable the loop vectorizer in the gold plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220886
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 29 Oct 2014 23:54:45 +0000 (23:54 +0000)]
Replace also-emit-llvm with save-temps.
The also-emit-llvm option only supported getting the IR before optimizations.
This patch replaces it with a more generic save-temps option that saves the IR
both before and after optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220885
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 29 Oct 2014 23:44:35 +0000 (23:44 +0000)]
Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220884
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 29 Oct 2014 23:05:12 +0000 (23:05 +0000)]
llvm/test/Transforms/LoopRotate/nosimplifylatch.ll: Fix possibly mis-repeatedly-pasted test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220880
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Wed, 29 Oct 2014 21:28:24 +0000 (21:28 +0000)]
Run clang-format on tools/llvm-objdump/MachODump.cpp . No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220875
91177308-0d34-0410-b5e6-
96231b3b80d8
Yi Jiang [Wed, 29 Oct 2014 20:20:33 +0000 (20:20 +0000)]
Test Case for r220872:Do not simplifyLatch for loops where hoisting increments couldresult in extra live range interferance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220873
91177308-0d34-0410-b5e6-
96231b3b80d8
Yi Jiang [Wed, 29 Oct 2014 20:19:47 +0000 (20:19 +0000)]
Do not simplifyLatch for loops where hoisting increments couldresult in extra live range interferance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220872
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Wen Voung [Wed, 29 Oct 2014 18:37:13 +0000 (18:37 +0000)]
Fix getRelocationValueString to return the symbol name for EM_386.
Summary: This helps llvm-objdump -r to print out the symbol name along
with the relocation type on x86. Adjust existing tests from checking
for "Unknown" to check for the symbol now.
Test Plan: Adjusted test/Object tests.
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5987
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220866
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Wed, 29 Oct 2014 17:29:38 +0000 (17:29 +0000)]
Enable display of compiler diagnostics in clang-tidy by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220863
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Wed, 29 Oct 2014 15:43:02 +0000 (15:43 +0000)]
[AVX512] Implemented AVX512VL FP bnary packed instructions (VADDP*, VSUBP*, VMULP*, VDIVP*, VMAXP*, VMINP*)
Refactored through AVX512_maskable
Added encoding tests for them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220858
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 29 Oct 2014 15:23:11 +0000 (15:23 +0000)]
Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220857
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 29 Oct 2014 09:18:49 +0000 (09:18 +0000)]
Fix build with CMake if LLVM_USE_INTEL_JITEVENTS option is enabled
* Added LLVM libraries required for IntelJITEvents to LLVMBuild.txt.
* Removed 'jit' library from llvm-jitlistener.
* Added support for OptionalLibraries to llvm-build cmake files generator.
Patch by aleksey.a.bader@intel.com
Differential Revision: http://reviews.llvm.org/D5646
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220848
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 29 Oct 2014 08:16:18 +0000 (08:16 +0000)]
[OCaml] Expose Llvm.parse_command_line_options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220847
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 29 Oct 2014 08:16:14 +0000 (08:16 +0000)]
[OCaml] Expose Llvm_target.TargetMachine.add_analysis_passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220846
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 29 Oct 2014 08:16:06 +0000 (08:16 +0000)]
[OCaml] If compiled without --enable-shared, hide packages from toplevel.
Pretend they do not exist using exists_if. This is better than
the current situation, which is the error:
Error: The external function `llvm_global_succ' is not available
but still somewhat confusing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220845
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 29 Oct 2014 08:16:01 +0000 (08:16 +0000)]
[OCaml] Expose Llvm_bitwriter.write_bitcode_to_memory_buffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220844
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 29 Oct 2014 08:15:54 +0000 (08:15 +0000)]
[OCaml] Drop support for 3.12.1 and earlier.
In practice this means:
* Always using -g flag.
* Embedding -cclib -lstdc++ into the corresponding cma/cmxa file.
This also moves -lstdc++ in a single place.
* Using caml_named_value instead of a homegrown mechanism.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220843
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 29 Oct 2014 08:15:21 +0000 (08:15 +0000)]
[OCaml] Synchronize transformations with LLVM-C.
Also, rearrange the functions in a way that allows to quickly
compare C headers and .mli/glue files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220842
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 29 Oct 2014 08:08:21 +0000 (08:08 +0000)]
macho-symbolized-disassembly.test: Don't check C++ demangler unconditionally.
For example, MS PSDK is not expected to have <cxxabi.h>.
You should introduce the new feature in lit.cfg corresponding to HAVE_CXXABI_H if you would like to test demangler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220840
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 29 Oct 2014 06:31:11 +0000 (06:31 +0000)]
test: tweak inlined-allocs test
Remove pointless checks for storage of uninteresting values. Ensure that we
perform basic alias analysis to make the test more correct. Finally, apply a
stylistic change to the test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220839
91177308-0d34-0410-b5e6-
96231b3b80d8
Seo Sanghyeon [Wed, 29 Oct 2014 05:20:39 +0000 (05:20 +0000)]
VMCore was renamed to IR long time ago
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220838
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Tue, 28 Oct 2014 23:39:46 +0000 (23:39 +0000)]
Update llvm-objdump’s Mach-O symbolizer code to demangle C++ names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220833
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 28 Oct 2014 23:31:13 +0000 (23:31 +0000)]
[OCaml] PR5595: Pass LDFLAGS to tests via -cclib.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220832
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 28 Oct 2014 22:45:25 +0000 (22:45 +0000)]
[OCaml] PR14083, PR9606: Only pick *.odoc files from current build target.
When several build targets, e.g. Debug+Asserts and Release+Asserts
are present, ocamldoc complains of duplicate interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220831
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 28 Oct 2014 22:39:42 +0000 (22:39 +0000)]
[OCaml] Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220829
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 28 Oct 2014 22:39:36 +0000 (22:39 +0000)]
[OCaml] PR9719, PR14727: Make tests run without ocamlopt.
Previously, tests hardcoded ocamlopt and cmxa, which broke builds on
machines without ocamlopt. Instead, they now fall back to ocamlc.
As a side effect this fixes PR14727, which was caused by a crude hack
that replaced gcc with g++ everywhere in the ocamlopt native compiler
path and passes it back using -cc. Now the tests use the same
technique as META, i.e. -cclib -lstdc++. It might be more fragile
than using g++ explicitly, but it will break when the installed
package will also break, which is good.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220828
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 28 Oct 2014 19:47:02 +0000 (19:47 +0000)]
[OCaml] PR19859: Add functions to query and modify branches.
Patch by Gabriel Radanne <drupyog@zoho.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220818
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 28 Oct 2014 19:46:56 +0000 (19:46 +0000)]
[C API] PR19859: Add functions to query and modify branches.
Patch by Gabriel Radanne <drupyog@zoho.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220817
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 28 Oct 2014 19:46:52 +0000 (19:46 +0000)]
[OCaml] PR19859: Add tests for reading the values of numeric constants.
Patch by Gabriel Radanne <drupyog@zoho.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220816
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 28 Oct 2014 19:46:48 +0000 (19:46 +0000)]
[OCaml] PR19859: Add Llvm.{fcmp_predicate,float_of_const}.
Patch by Gabriel Radanne <drupyog@zoho.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220815
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 28 Oct 2014 19:46:44 +0000 (19:46 +0000)]
[C API] PR19859: Add LLVMGetFCmpPredicate and LLVMConstRealGetDouble.
Patch by Gabriel Radanne <drupyog@zoho.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220814
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Tue, 28 Oct 2014 18:27:37 +0000 (18:27 +0000)]
Transforms: reapply SVN r219899
This restores the commit from SVN r219899 with an additional change to ensure
that the CodeGen is correct for the case that was identified as being incorrect
(originally PR7272).
In the case that during inlining we need to synthesize a value on the stack
(i.e. for passing a value byval), then any function involving that alloca must
be stripped of its tailness as the restriction that it does not access the
parent's stack no longer holds. Unfortunately, a single alloca can cause a
rippling effect through out the inlining as the value may be aliased or may be
mutated through an escaped external call. As such, we simply track if an alloca
has been introduced in the frame during inlining, and strip any tail calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220811
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Tue, 28 Oct 2014 18:22:41 +0000 (18:22 +0000)]
[AVX512] Fix VSQRT packed instructions internal names.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220808
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Tue, 28 Oct 2014 18:15:20 +0000 (18:15 +0000)]
[AVX512] Extended avx512_sqrt_packed (sqrt instructions) to VL subset.
Refactored through AVX512_maskable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220806
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Tue, 28 Oct 2014 16:37:13 +0000 (16:37 +0000)]
[AVX-512] Expanded rsqrt/rcp instructions to VL subset.
Refactored multiclass through AVX512_maskable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220783
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Tue, 28 Oct 2014 16:17:14 +0000 (16:17 +0000)]
[AVX512] Removed special case for cmp instructions in getVectorMaskingNode. Now cmp intrinsics lower as other intrinsics through VSELECT, and then VSELECT tranforms to AND in PerformSELECTCombine.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220779
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Tue, 28 Oct 2014 15:59:40 +0000 (15:59 +0000)]
[x86] Simplify vector selection if condition value type matches vselect value type and true value is all ones or false value is all zeros.
This transformation worked if selector is produced by SETCC, however SETCC is needed only if we consider to swap operands. So I replaced SETCC check for this case.
Added tests for vselect of <X x i1> values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220777
91177308-0d34-0410-b5e6-
96231b3b80d8