Zachary Turner [Mon, 16 Jun 2014 22:40:42 +0000 (22:40 +0000)]
Kill the LLVM global lock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211069
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 16 Jun 2014 22:40:29 +0000 (22:40 +0000)]
Remove some code churn.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211068
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 16 Jun 2014 22:40:17 +0000 (22:40 +0000)]
Remove some more code out into a separate CL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211067
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 16 Jun 2014 22:39:38 +0000 (22:39 +0000)]
Users of the llvm global mutex must now acquire it manually.
This allows the mutex to be acquired in a guarded, RAII fashion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211066
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Mon, 16 Jun 2014 22:05:47 +0000 (22:05 +0000)]
Add load/store functionality
Summary:
This patches allows non conversions like i1=i2; where both are global ints.
In addition, arithmetic and other things start to work since fast-isel will use
existing patterns for non fast-isel from tablegen files where applicable.
In addition i8, i16 will work in this limited context for assignment without the need
for sign extension (zero or signed). It does not matter how i8 or i16 are loaded (zero or sign extended)
since only the 8 or 16 relevant bits are used and clang will ask for sign extension before using them in
arithmetic. This is all made more complete in forthcoming patches.
for example:
int i, j=1, k=3;
void foo() {
i = j + k;
}
Keep in mind that this pass is not enabled right now and is an experimental pass
It can only be enabled with a hidden option to llvm of -mips-fast-isel.
Test Plan: Run test-suite, loadstore2.ll and I will run some executable tests.
Reviewers: dsanders
Subscribers: mcrosier
Differential Revision: http://reviews.llvm.org/D3856
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211061
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 16 Jun 2014 21:55:35 +0000 (21:55 +0000)]
AArch64: Add backend intrinsic for rbit.
Define an intrinsic for the frontend to use and pattern match it to
the RBIT instruction.
rdar://
9283021
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211058
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 16 Jun 2014 21:55:30 +0000 (21:55 +0000)]
ARM: intrinsic support for rbit.
We already have an ARMISD node. Create an intrinsic to map to it so we can
add support for the frontend __rbit() intrinsic.
rdar://
9283021
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211057
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Mon, 16 Jun 2014 21:36:02 +0000 (21:36 +0000)]
[PPC64] Fix PR19893 - improve code generation for local function addresses
Rafael opened http://llvm.org/bugs/show_bug.cgi?id=19893 to track non-optimal
code generation for forming a function address that is local to the compile
unit. The existing code was treating both local and non-local functions
identically.
This patch fixes the problem by properly identifying local functions and
generating the proper addis/addi code. I also noticed that Rafael's earlier
changes to correct the surrounding code in PPCISelLowering.cpp were also
needed for fast instruction selection in PPCFastISel.cpp, so this patch
fixes that code as well.
The existing test/CodeGen/PowerPC/func-addr.ll is modified to test the new
code generation. I've added a -O0 run line to test the fast-isel code as
well.
Tested on powerpc64[le]-unknown-linux-gnu with no regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211056
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 16 Jun 2014 21:18:27 +0000 (21:18 +0000)]
Since the DataLayout is always found off of the subtarget go ahead
and query the base target machine implementation for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211055
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 16 Jun 2014 20:54:28 +0000 (20:54 +0000)]
Clean up some unnecessary mutex guards.
These were being used as unreferenced parameters to enforce that
the methods must not be called without holding a mutex, but all
of the methods in question were internal, and the methods were
only exposed through an interface whose entire purpose was to
serialize access to these structures, so expecting the methods
to be accessed under a mutex is reasonable enough.
Reviewed by: blaikie
Differential Revision: http://reviews.llvm.org/D4162
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211054
91177308-0d34-0410-b5e6-
96231b3b80d8
Louis Gerbarg [Mon, 16 Jun 2014 20:31:50 +0000 (20:31 +0000)]
Improve comments for r211040
Added comment to clarify why we r211040 choose to bail out of fast isel instead
of generating a more complicated relocation, and fix mislabelled register in the
comments of the asan test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211052
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Mon, 16 Jun 2014 20:18:41 +0000 (20:18 +0000)]
Revert "lit: warn when passed invalid pathname" (r210597)
It was pointed out that this breaks the "virtual test discovery"
mechanism, which allows for narming tests in the test exec root.
Reverting until I can figure out how to fix this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211048
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 16 Jun 2014 18:49:36 +0000 (18:49 +0000)]
ARM: implement correct atomic operations on v7M
ARM v7M has ldrex/strex but not ldrexd/strexd. This means 32-bit
operations should work as normal, but 64-bit ones are almost certainly
doomed.
Patch by Phoebe Buckheister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211042
91177308-0d34-0410-b5e6-
96231b3b80d8
Louis Gerbarg [Mon, 16 Jun 2014 17:35:40 +0000 (17:35 +0000)]
Fix illegal relocations in X86FastISel
On x86_86 the lea instruction can only use a 32 bit immediate value. When
the code is compiled statically the RIP register is not used, meaning the
immediate is all that can be used for the relocation, which is not sufficient
in the case of targets more than +/- 2GB away. This patch bails out of fast
isel in those cases and reverts to DAG which does the right thing.
Test case included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211040
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 16 Jun 2014 16:55:20 +0000 (16:55 +0000)]
LowerSwitch: track bounding range for the condition tree.
When LowerSwitch transforms a switch instruction into a tree of ifs it
is actually performing a binary search into the various case ranges, to
see if the current value falls into one cases range of values.
So, if we have a program with something like this:
switch (a) {
case 0:
do0();
break;
case 1:
do1();
break;
case 2:
do2();
break;
default:
break;
}
the code produced is something like this:
if (a < 1) {
if (a == 0) {
do0();
}
} else {
if (a < 2) {
if (a == 1) {
do1();
}
} else {
if (a == 2) {
do2();
}
}
}
This code is inefficient because the check (a == 1) to execute do1() is
not needed.
The reason is that because we already checked that (a >= 1) initially by
checking that also (a < 2) we basically already inferred that (a == 1)
without the need of an extra basic block spawned to check if actually (a
== 1).
The patch addresses this problem by keeping track of already
checked bounds in the LowerSwitch algorithm, so that when the time
arrives to produce a Leaf Block that checks the equality with the case
value / range the algorithm can decide if that block is really needed
depending on the already checked bounds .
For example, the above with "a = 1" would work like this:
the bounds start as LB: NONE , UB: NONE
as (a < 1) is emitted the bounds for the else path become LB: 1 UB:
NONE. This happens because by failing the test (a < 1) we know that the
value "a" cannot be smaller than 1 if we enter the else branch.
After the emitting the check (a < 2) the bounds in the if branch become
LB: 1 UB: 1. This is because by checking that "a" is smaller than 2 then
the upper bound becomes 2 - 1 = 1.
When it is time to emit the leaf block for "case 1:" we notice that 1
can be squeezed exactly in between the LB and UB, which means that if we
arrived to that block there is no need to emit a block that checks if (a
== 1).
Patch by: Marcello Maggioni <hayarms@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211038
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 16 Jun 2014 16:42:53 +0000 (16:42 +0000)]
Refactor the disabling of Thumb-1 LDM/STM generation
Originally I switched the LD/ST optimizer off in TargetMachine as it was previously, but Eric has suggested he'd prefer that it be short-circuited in the pass itself.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211037
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 16 Jun 2014 16:41:00 +0000 (16:41 +0000)]
Fix pr17056.
This makes llvm-nm ignore members that are not sufficiently aligned for
lib/Object to handle.
These archives are invalid. GNU AR is able to handle this, but in general
just warns about broken archive members.
We should probably start warning too, but for now just make sure llvm-nm
exits with an 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211036
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 16 Jun 2014 16:08:36 +0000 (16:08 +0000)]
Convert the Archive API to use ErrorOr.
Now that we have c++11, even things like ErrorOr<std::unique_ptr<...>> are
easy to use.
No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211033
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Mon, 16 Jun 2014 15:15:41 +0000 (15:15 +0000)]
[AArch64] Remove dead code.
Both function declarations lack a callee and an implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211029
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron McInally [Mon, 16 Jun 2014 14:12:28 +0000 (14:12 +0000)]
Hook up vector int_ctlz for AVX512.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211024
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 16 Jun 2014 13:25:35 +0000 (13:25 +0000)]
[mips][mips64r6] ssnop is deprecated on MIPS32r6/MIPS64r6
Summary: Depends on D4120
Reviewers: jkolek, zoran.jovanovic, vmedic
Reviewed By: zoran.jovanovic, vmedic
Differential Revision: http://reviews.llvm.org/D4121
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211021
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 16 Jun 2014 13:18:59 +0000 (13:18 +0000)]
[mips][mips64r6] cl[oz], and dcl[oz] are re-encoded in MIPS32r6/MIPS64r6
Summary:
There is no change to the restrictions, just the result register is stored
once in the encoding rather than twice. The rt field is zero in
MIPS32r6/MIPS64r6.
Depends on D4119
Reviewers: zoran.jovanovic, jkolek, vmedic
Reviewed By: vmedic
Differential Revision: http://reviews.llvm.org/D4120
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211019
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 16 Jun 2014 13:13:03 +0000 (13:13 +0000)]
[mips][mips64r6] ll, sc, lld, and scd are re-encoded on MIPS32r6/MIPS64r6.
Summary:
The linked-load, store-conditional operations have been re-encoded such
that have a 9-bit offset instead of the 16-bit offset they have prior to
MIPS32r6/MIPS64r6.
While implementing this, I noticed that the atomic load/store pseudos always
emit a sign extension using sll and sra. I have improved this to use seb/seh
when they are available (MIPS32r2/MIPS64r2 and above).
Depends on D4118
Reviewers: jkolek, zoran.jovanovic, vmedic
Reviewed By: vmedic
Differential Revision: http://reviews.llvm.org/D4119
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211018
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Mon, 16 Jun 2014 11:22:33 +0000 (11:22 +0000)]
Support/ConvertUTF: restore compatibility with MSVC, which only implements C89
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211016
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Mon, 16 Jun 2014 11:09:46 +0000 (11:09 +0000)]
Support/ConvertUTF: implement U+FFFD insertion according to the recommendation
given in the Unicode spec
That is, replace every maximal subpart of an ill-formed subsequence with one
U+FFFD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211015
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 16 Jun 2014 10:39:21 +0000 (10:39 +0000)]
[AArch64] Fix a fencepost error in lowering for llvm.aarch64.neon.uqshl.
Patch by Jiangning Liu!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211014
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 16 Jun 2014 10:25:17 +0000 (10:25 +0000)]
[mips] Merge most of the big/little endian checks in atomic.ll
Summary:
There is very little difference between the big and little endian cases in
test/CodeGen/Mips/atomic.ll. Merge them together using multiple
FileCheck prefixes.
Depends on D4117
Reviewers: jkolek, zoran.jovanovic, vmedic
Reviewed By: vmedic
Differential Revision: http://reviews.llvm.org/D4118
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211013
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 16 Jun 2014 10:00:45 +0000 (10:00 +0000)]
[mips][mips64r6] [ls][wd]c2 were re-encoded with 11-bit signed immediates rather than 16-bit in MIPS32r6/MIPS64r6
Summary:
The error message for the invalid.s cases isn't very helpful. It happens because
there is an instruction with a wider immediate that would have matched if the
NotMips32r6 predicate were true. I have some WIP to improve the message but it
affects most error messages for removed/re-encoded instructions on
MIPS32r6/MIPS64r6 and should therefore be a separate commit.
Depens on D4115
Reviewers: zoran.jovanovic, jkolek, vmedic
Reviewed By: vmedic
Differential Revision: http://reviews.llvm.org/D4117
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211012
91177308-0d34-0410-b5e6-
96231b3b80d8
Christian Pirker [Mon, 16 Jun 2014 09:17:30 +0000 (09:17 +0000)]
ARMEB: Fix trunc store for vector types
Reviewed at http://reviews.llvm.org/D4135
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211010
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Sun, 15 Jun 2014 21:40:57 +0000 (21:40 +0000)]
Canonicalize addrspacecast ConstExpr between different pointer types
As a follow-up to r210375 which canonicalizes addrspacecast
instructions, this patch canonicalizes addrspacecast constant
expressions.
Given clang uses ConstantExpr::getAddrSpaceCast to emit addrspacecast
cosntant expressions, this patch is also a step towards having the
frontend emit canonicalized addrspacecasts.
Piggyback a minor refactor in InstCombineCasts.cpp
Update three affected tests in addrspacecast-alias.ll,
access-non-generic.ll and constant-fold-gep.ll and added one new test in
constant-fold-address-space-pointer.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211004
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 15 Jun 2014 21:22:52 +0000 (21:22 +0000)]
Fix copy paste error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211003
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 15 Jun 2014 21:09:00 +0000 (21:09 +0000)]
R600: Add a rotr testcase I forgot to add
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211002
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 15 Jun 2014 21:08:58 +0000 (21:08 +0000)]
R600: Remove a few more things from AMDILISelLowering
Try to keep all the setOperationActions for integer ops
together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211001
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 15 Jun 2014 21:08:54 +0000 (21:08 +0000)]
R600: Fix assert on vector sdiv
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211000
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 15 Jun 2014 20:23:38 +0000 (20:23 +0000)]
R600: Move / cleanup more leftover AMDIL stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210998
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 15 Jun 2014 20:08:02 +0000 (20:08 +0000)]
R600: Move division custom lowering out of AMDILISelLowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210997
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sun, 15 Jun 2014 19:55:14 +0000 (19:55 +0000)]
Temporarily revert r210953 in an attempt to bring the ARM buildbots
back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210996
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 15 Jun 2014 19:48:16 +0000 (19:48 +0000)]
R600: Report that integer division is expensive.
Divides by weird constants now emit much better code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210995
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 15 Jun 2014 19:48:13 +0000 (19:48 +0000)]
R600: Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210994
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Jun 2014 19:34:26 +0000 (19:34 +0000)]
PR20038: DebugInfo missing DIEs for some concrete variables.
I haven't nailed this down entirely, but this is about as small of a
test case as I can seem to construct and adequately demonstrates the
crasher. I'll continue investigating the root cause/fix(es).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210993
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Sun, 15 Jun 2014 14:42:25 +0000 (14:42 +0000)]
Add specialization of FoldingSetTrait for std::pair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210990
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Sun, 15 Jun 2014 09:27:20 +0000 (09:27 +0000)]
LegalizeDAG: make sure cast is unsigned before using FP_TO_UINT.
It's valid to use FP_TO_SINT when asking for a smaller type (e.g. all
"unsigned int16" values fit into a "signed int32"), but the reverse
isn't true.
Unfortunately, I'm not actually aware of any architecture with
asymmetric FP_TO_SINT and FP_TO_UINT handling and the logic happens to
work in the symmetric case, so I can't actually write a test for this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210986
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Sun, 15 Jun 2014 09:27:15 +0000 (09:27 +0000)]
AArch64: improve handling & modelling of FP_TO_XINT nodes.
There's probably no acatual change in behaviour here, just updating
the LowerFP_TO_INT function to be more similar to the reverse
implementation and updating costs to current CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210985
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Sun, 15 Jun 2014 09:27:06 +0000 (09:27 +0000)]
AArch64: improve vector [su]itofp handling.
This somehow got missed in the AArch64 merge, so should fix a
performance regression since 3.4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210984
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 15 Jun 2014 01:01:11 +0000 (01:01 +0000)]
Don't expect tests always crashing. Add "REQUIRES:asserts".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210983
91177308-0d34-0410-b5e6-
96231b3b80d8
Artyom Skrobov [Sat, 14 Jun 2014 13:49:57 +0000 (13:49 +0000)]
Replacing the private implementations of SwapValue with calls to sys::swapByteOrder()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210980
91177308-0d34-0410-b5e6-
96231b3b80d8
Artyom Skrobov [Sat, 14 Jun 2014 13:18:07 +0000 (13:18 +0000)]
Using llvm::sys::swapByteOrder() for the common case of byte-swapping a value in place
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210978
91177308-0d34-0410-b5e6-
96231b3b80d8
Artyom Skrobov [Sat, 14 Jun 2014 12:52:55 +0000 (12:52 +0000)]
Adding llvm::sys::swapByteOrder() for the common use-case of byte-swapping a value in place
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210976
91177308-0d34-0410-b5e6-
96231b3b80d8
Artyom Skrobov [Sat, 14 Jun 2014 11:36:01 +0000 (11:36 +0000)]
Renaming SwapByteOrder() to getSwappedBytes()
The next commit will add swapByteOrder(), acting in-place
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210973
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 14 Jun 2014 04:26:09 +0000 (04:26 +0000)]
R600: Add failing testcases.
These are reduced from assert in the
OpenCV CvtColor8u.BGR5652GRAY test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210969
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 14 Jun 2014 04:26:07 +0000 (04:26 +0000)]
Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210968
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 14 Jun 2014 04:26:05 +0000 (04:26 +0000)]
R600: Fix asserts related to constant initializers
This would assert if a constant address space was extern
and therefore didn't have an initializer. If the initializer
was undef, it would hit the unreachable unhandled initializer case.
An extern global should never really occur since we don't have
machine linking, but bugpoint likes to remove initializers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210967
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 14 Jun 2014 04:26:01 +0000 (04:26 +0000)]
R600: Use address space enum instead of value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210966
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 14 Jun 2014 03:48:29 +0000 (03:48 +0000)]
Remove extra whitespace in function declaration. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210965
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 13 Jun 2014 23:52:55 +0000 (23:52 +0000)]
DebugInfo: Remove some extra handling of abstract variables and instead rely solely on the delayed handling introduced in r210946
Now that we handle finding abstract variables at the end of the module,
remove the upfront handling and just ensure the abstract variable is
built when necessary.
In theory we could have a split implementation, where inlined variables
are immediately constructed referencing the abstract definition, and
concrete variables are delayed - but let's go with one solution for now
unless there's a reason not to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210961
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Jun 2014 23:11:13 +0000 (23:11 +0000)]
Remove InstrItineraryData off of the TargetMachine - it's already
on the subtarget and just forward the accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210955
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Jun 2014 23:04:46 +0000 (23:04 +0000)]
Move ARMJITInfo off of the TargetMachine and down onto the subtarget.
This required untangling a mess of headers that included around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210953
91177308-0d34-0410-b5e6-
96231b3b80d8
Jiangning Liu [Fri, 13 Jun 2014 23:00:36 +0000 (23:00 +0000)]
Complete remove test/Transforms/GlobalMerge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210952
91177308-0d34-0410-b5e6-
96231b3b80d8
Jiangning Liu [Fri, 13 Jun 2014 22:57:59 +0000 (22:57 +0000)]
Move GlobalMerge from Transform to CodeGen.
This patch is to move GlobalMerge pass from Transform/Scalar
to CodeGen, because GlobalMerge depends on TargetMachine.
In the mean time, the macro INITIALIZE_TM_PASS is also moved
to CodeGen/Passes.h. With this fix we can avoid making
libScalarOpts depend on libCodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210951
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Jun 2014 22:38:52 +0000 (22:38 +0000)]
The hazard recognizer only needs a subtarget, not a target machine
so make it take one. Fix up all users accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210948
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Jun 2014 22:38:48 +0000 (22:38 +0000)]
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210947
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 13 Jun 2014 22:35:44 +0000 (22:35 +0000)]
DebugInfo: Reference abstract definitions from variables in concrete definitions that preceed their first inline definition.
Rather than relying on abstract variables looked up at the time the
concrete variable is created, look them up at the end of the module to
ensure they're referenced even if they're created after the concrete
definition. This completes/matches the work done in r209677 to handle
this for the subprograms themselves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210946
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 13 Jun 2014 22:31:03 +0000 (22:31 +0000)]
[DWARF parser] Use distinction between DW_AT_ranges_base and DW_AT_GNU_ranges_base instead of DWARF version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210945
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 13 Jun 2014 22:29:31 +0000 (22:29 +0000)]
DwarfDebug::getExistingAbstractVariable: constify an existing reference parameter that didn't need to be mutated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210944
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 13 Jun 2014 22:18:23 +0000 (22:18 +0000)]
DebugInfo: Following up to r209677, refactor local variable emission to delay the choice between emitting the definition attributes or using DW_AT_abstract_definition
This doesn't fix the abstract variable handling yet, but it introduces a
similar delay mechanism as was added for subprograms, causing
DW_AT_location to be reordered to the beginning of the attribute list
for local variables, and fixes all the test fallout for that.
A subsequent commit will remove the abstract variable handling in
DbgVariable and just do the abstract variable lookup at module end to
ensure that abstract variables introduced after their concrete
counterparts are appropriately referenced by the concrete variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210943
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 13 Jun 2014 21:52:33 +0000 (21:52 +0000)]
DebugInfo: Refactor some tests to allow DW_AT_name to not be the first attribute in a local variable.
In an effort to fix concrete variables referencing abstract origins
where the concrete variable preceeds the first inlined usage, the
addition of attributes such as name, file, etc will be delayed until the
end of the module (to wait to see if any inlined instances have
occurred, thus necessitating an abstract definition that the concrete
definition should also reference).
These test cases don't actually need to care about this ordering of
attributes, so update them to be more resilient to such changes coming
in the near future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210940
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 13 Jun 2014 21:52:28 +0000 (21:52 +0000)]
test/DebugInfo/X86/dbg-value-isel.s: correct lexical block descriptor to match schema
This silently broke a long time ago when I unified some aspects of the
debug info schema. I'm just cleaning these up if/when they become a
problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210939
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 13 Jun 2014 21:20:44 +0000 (21:20 +0000)]
Make the error-handling functions thread-safe.
Prior to this change, error handling functions must be installed
and removed only inside of an llvm_[start/stop]_multithreading
pair. This change allows error handling functions to be installed
any time, and from any thread.
Reviewed by: chandlerc
Differential Revision: http://reviews.llvm.org/D4140
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210937
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 13 Jun 2014 17:53:44 +0000 (17:53 +0000)]
Remove top-level Clang -fsanitize= flags for optional ASan features.
Init-order and use-after-return modes can currently be enabled
by runtime flags. use-after-scope mode is not really working at the
moment.
The only problem I see is that users won't be able to disable extra
instrumentation for init-order and use-after-scope by a top-level Clang flag.
But this instrumentation was implicitly enabled for quite a while and
we didn't hear from users hurt by it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210924
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 13 Jun 2014 17:29:39 +0000 (17:29 +0000)]
X86: lower ATOMIC_CMP_SWAP_WITH_SUCCESS directly
Lowering this new node allows us to fold the almost universal
comparison for success before it's even formed. Instead we can create
a copy from EFLAGS and an X86ISD::SETCC operation since all "cmpxchg"
instructions set the zero-flag to the correct value.
rdar://problem/
13201607
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210923
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 13 Jun 2014 17:20:53 +0000 (17:20 +0000)]
R600: Cleanup some old AMDIL stuff.
Move / delete some of the more obviously wrong
setOperationAction calls. Most of these are setting Expand
for types that aren't legal which is the default anyway.
Leave stuff that might require more thought on whether it's
junk or not as it is.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210922
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 13 Jun 2014 17:20:48 +0000 (17:20 +0000)]
Finishing touch for the std::error_code transition.
While std::error_code itself seems to work OK in all platforms, there
are few annoying differences with regards to the std::errc enumeration.
This patch adds a simple llvm enumeration, which will hopefully avoid build
breakages in other platforms and surprises as we get more uses of
std::error_code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210920
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 13 Jun 2014 16:45:52 +0000 (16:45 +0000)]
Atomics: make use of the "cmpxchg weak" instruction.
This also simplifies the IR we create slightly: instead of working out
where success & failure should go manually, it turns out we can just
always jump to a success/failure block created for the purpose. Later
phases will sort out the mess without much difficulty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210917
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 13 Jun 2014 16:45:36 +0000 (16:45 +0000)]
Atomics: switch direction of cmpxchg comparison
This has two benefits: it makes the result more suitable for direct
insertaion into the struct to emulate the new cmpxchg, and it means
the name we give the instruction matches its actual effect better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210916
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 13 Jun 2014 16:38:59 +0000 (16:38 +0000)]
R600: Remove AMDIL instruction and register definitions
Most of these are no longer used any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210915
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Fri, 13 Jun 2014 16:12:08 +0000 (16:12 +0000)]
opt: Initialize asm printers
Without initializing the assembly printers a shared library build of opt is
linked with these libraries whereas for a static build these libraries are dead
code eliminated. This is unfortunate for plugins in case they want to use them,
as they neither can rely on opt to provide this functionality nor can they link
the printers in themselves as this breaks with a shared object build of opt.
This patch calls InitializeAllAsmPrinters() from opt, which increases the static
binary size from 50MB -> 52MB on my system (all backends compiled) and causes no
measurable increase in the time needed to run 'make check'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210914
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 13 Jun 2014 15:36:17 +0000 (15:36 +0000)]
Remove unused and odd code.
This code was never being used and any use of it would look fairly strange.
For example, it would try to map a object_error::parse_failed to
std::errc::invalid_argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210912
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 13 Jun 2014 15:21:50 +0000 (15:21 +0000)]
Remove broken include.
Looks like I got some git merge wrong.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210911
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 13 Jun 2014 15:01:11 +0000 (15:01 +0000)]
Fix KillTheDoctor after r210725.
We don't map these windows errors to generic ones since errc::timed_out is
not defined on mingw. Just use the raw windows error value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210910
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 13 Jun 2014 14:54:09 +0000 (14:54 +0000)]
SCCP: update for cmpxchg returning { iN, i1 } now.
I accidentally missed this one since its use looked OK locally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210909
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Fri, 13 Jun 2014 14:26:47 +0000 (14:26 +0000)]
[mips][mips64r6] Relocation R_MIPS_PC18_S3
Differential Revision: http://reviews.llvm.org/D3890
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210908
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 13 Jun 2014 14:24:23 +0000 (14:24 +0000)]
Docs: remove extra {} around result types.
It makes the types look like they're single-element structures. And
when we have instructions that *do* result in a struct, that can get
confusing rather quickly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210905
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 13 Jun 2014 14:24:16 +0000 (14:24 +0000)]
Docs: fix grammar error in description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210904
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 13 Jun 2014 14:24:07 +0000 (14:24 +0000)]
IR: add "cmpxchg weak" variant to support permitted failure.
This commit adds a weak variant of the cmpxchg operation, as described
in C++11. A cmpxchg instruction with this modifier is permitted to
fail to store, even if the comparison indicated it should.
As a result, cmpxchg instructions must return a flag indicating
success in addition to their original iN value loaded. Thus, for
uniformity *all* cmpxchg instructions now return "{ iN, i1 }". The
second flag is 1 when the store succeeded.
At the DAG level, a new ATOMIC_CMP_SWAP_WITH_SUCCESS node has been
added as the natural representation for the new cmpxchg instructions.
It is a strong cmpxchg.
By default this gets Expanded to the existing ATOMIC_CMP_SWAP during
Legalization, so existing backends should see no change in behaviour.
If they wish to deal with the enhanced node instead, they can call
setOperationAction on it. Beware: as a node with 2 results, it cannot
be selected from TableGen.
Currently, no use is made of the extra information provided in this
patch. Test updates are almost entirely adapting the input IR to the
new scheme.
Summary for out of tree users:
------------------------------
+ Legacy Bitcode files are upgraded during read.
+ Legacy assembly IR files will be invalid.
+ Front-ends must adapt to different type for "cmpxchg".
+ Backends should be unaffected by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210903
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron McInally [Fri, 13 Jun 2014 13:20:01 +0000 (13:20 +0000)]
Fix bad copy-and-paste from r210652. AVX512 masked leading zero intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210901
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 13 Jun 2014 13:15:59 +0000 (13:15 +0000)]
[mips] Add cache and pref instructions
Summary:
cache and pref were added in MIPS-III, and MIPS32 but were re-encoded in
MIPS32r6/MIPS64r6 to use a 9-bit offset rather than the 16-bit offset
available to earlier cores.
Resolved the decoding conflict between pref and lwc3.
Depends on D4115
Reviewers: zoran.jovanovic, jkolek, vmedic
Reviewed By: vmedic
Differential Revision: http://reviews.llvm.org/D4116
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210900
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 13 Jun 2014 13:08:38 +0000 (13:08 +0000)]
[mips][mips64r6] bc1any[24] are not available on MIPS32r6/MIPS64r6
Summary:
These MIPS-3D instructions have never been implemented in LLVM so we only
add testcases.
Reviewers: zoran.jovanovic, jkolek, vmedic
Reviewed By: vmedic
Differential Revision: http://reviews.llvm.org/D4115
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210899
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 13 Jun 2014 13:02:52 +0000 (13:02 +0000)]
[mips][mips64r6] b(ge|lt)zal are not available on MIPS32r6/MIPS64r6 and bal is a normal instruction
Summary:
b(ge|lt)zal have been removed in MIPS32r6/MIPS64r6. However, bal (an alias
for 'bgezal $zero, $offset') still remains with the same encoding it had
prior to MIPS32r6/MIPS64r6.
Updated the MipsNaCLELFStreamer, and MipsLongBranch to correctly handle the
MIPS32r6/MIPS64r6 BAL instruction in addition to the existing BAL_BR pseudo.
No changes were required to the CodeGen test that looks for BAL
(test/CodeGen/Mips/longbranch.ll) since the new instruction has the same
syntax.
Depends on D4113
Reviewers: jkolek, zoran.jovanovic, vmedic
Reviewed By: vmedic
Differential Revision: http://reviews.llvm.org/D4114
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210898
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 13 Jun 2014 12:49:06 +0000 (12:49 +0000)]
[mips][mips64r6] daddi is not available on MIPS64r6
Summary:
It's not emitted by the code generator so we only need assembler tests.
Also added missing daddi aliases from dsub mnemonics, and removed a couple
duplicate dsub tests.
Depends on D4112
Reviewers: zoran.jovanovic, jkolek, vmedic
Reviewed By: vmedic
Differential Revision: http://reviews.llvm.org/D4113
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210897
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 13 Jun 2014 12:23:56 +0000 (12:23 +0000)]
[Win32] Let utils/not aware of abort(), aka llvm_unreachable(), in msvcrt.
It has exit code as 3. abort(), aka unreachable, may be handled as crash.
FIXME: Could we move this into Win32/Program.inc?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210895
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 13 Jun 2014 12:05:06 +0000 (12:05 +0000)]
llvm/test/CodeGen/X86/fast-isel-args-fail2.ll: Don't expect to fail with -Asserts. It might or might not crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210894
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron McInally [Fri, 13 Jun 2014 11:40:31 +0000 (11:40 +0000)]
Add HasCDI predicate to AVX512 VPBROADCASTM*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210892
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 13 Jun 2014 09:14:50 +0000 (09:14 +0000)]
CPP backend: set volatile property on atomic instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210890
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Fri, 13 Jun 2014 08:33:03 +0000 (08:33 +0000)]
ARM: Fix fastcc calling convention for Thumb1
When targetting Thumb1 on a processor which has a VFP unit (which
is not accessible from Thumb1), we were converting the fastcc calling
convention to AAPCS-VFP, which is not possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210889
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 13 Jun 2014 07:44:38 +0000 (07:44 +0000)]
R600: Don't call setOperationAction with things that aren't opcodes.
CondCode actions are set with setCondCodeAction.
This should have been a harmless bug since the values seem to only
collide only with nodes that don't need to be handled, and these are
already correctly setup elsewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210888
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 13 Jun 2014 04:00:30 +0000 (04:00 +0000)]
R600/SI: Fix selection error on i64 rotl / rotr.
Evergreen is still broken due to missing shl_parts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210885
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 13 Jun 2014 03:20:08 +0000 (03:20 +0000)]
Remove the last uses of 'using std::error_code'
This finishes the transition to std::error_code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210877
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 13 Jun 2014 03:07:50 +0000 (03:07 +0000)]
Remove 'using std::error_code' from tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210876
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 13 Jun 2014 02:36:09 +0000 (02:36 +0000)]
Fix build on windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210873
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 13 Jun 2014 02:24:39 +0000 (02:24 +0000)]
Remove 'using std::errro_code' from lib.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210871
91177308-0d34-0410-b5e6-
96231b3b80d8