Andrew Trick [Thu, 31 Oct 2013 22:11:56 +0000 (22:11 +0000)]
Add support for stack map generation in the X86 backend.
Originally implemented by Lang Hames.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193811
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 22:07:46 +0000 (22:07 +0000)]
Relax check line to match what llvm-nm prints for COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193810
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 31 Oct 2013 21:56:03 +0000 (21:56 +0000)]
Do not convert "call asm" to "invoke asm" in Inliner.
Given that backend does not handle "invoke asm" correctly ("invoke asm" will be
handled by SelectionDAGBuilder::visitInlineAsm, which does not have the right
setup for LPadToCallSiteMap) and we already made the assumption that inline asm
does not throw in InstCombiner::visitCallSite, we are going to make the same
assumption in Inliner to make sure we don't convert "call asm" to "invoke asm".
If it becomes necessary to add support for "invoke asm" later on, we will need
to modify the backend as well as remove the assumptions that inline asm does
not throw.
Fix rdar://
15317907
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193808
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 21:27:02 +0000 (21:27 +0000)]
XFAIL on ppc64 too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193804
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 21:22:43 +0000 (21:22 +0000)]
XFAIL this for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193802
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 20:51:58 +0000 (20:51 +0000)]
Use LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN instead of the "dso list".
There are two ways one could implement hiding of linkonce_odr symbols in LTO:
* LLVM tells the linker which symbols can be hidden if not used from native
files.
* The linker tells LLVM which symbols are not used from other object files,
but will be put in the dso symbol table if present.
GOLD's API is the second option. It was implemented almost 1:1 in llvm by
passing the list down to internalize.
LLVM already had partial support for the first option. It is also very similar
to how ld64 handles hiding these symbols when *not* doing LTO.
This patch then
* removes the APIs for the DSO list.
* marks LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN all linkonce_odr unnamed_addr
global values and other linkonce_odr whose address is not used.
* makes the gold plugin responsible for handling the API mismatch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193800
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 31 Oct 2013 20:11:32 +0000 (20:11 +0000)]
[AArch64] Add diagnostic tests for NEON scalar shift immediate instructions (see: r193790).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193798
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Thu, 31 Oct 2013 19:59:55 +0000 (19:59 +0000)]
Use StringRef::startswith_lower. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193796
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Thu, 31 Oct 2013 19:53:53 +0000 (19:53 +0000)]
[ConstantRange] improve my previous patch per Nick suggestion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193795
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 31 Oct 2013 19:28:44 +0000 (19:28 +0000)]
[AArch64] Add support for NEON scalar shift immediate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193790
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Thu, 31 Oct 2013 19:22:33 +0000 (19:22 +0000)]
SparcV9 doesnt have rem instruction either.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193789
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 31 Oct 2013 19:12:36 +0000 (19:12 +0000)]
Use a larger invalid attribute bitcode number
That way the test won't start faililng when someone adds a new attribute
and wants to use the next logical enum (38) for bitcode. The new
bitcode file tries to use the number 48 as an attribute instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193787
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 31 Oct 2013 18:54:20 +0000 (18:54 +0000)]
DWARFDebugArangeSet: remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193785
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 31 Oct 2013 18:18:09 +0000 (18:18 +0000)]
Add FileCheck tests for @LINE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193782
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Thu, 31 Oct 2013 18:10:25 +0000 (18:10 +0000)]
[mips] XFAIL several MCJIT remote tests
Two of the tests are new test cases (cross-module-a.ll, multi-module-a.ll)
not yet supported on MIPS, while XFAIL for the other two tests was
accidentally removed in r193570 and this change reverts those lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193781
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 31 Oct 2013 18:05:02 +0000 (18:05 +0000)]
DWARFUnit: kill dead code and make a couple of functions private. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193780
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 31 Oct 2013 17:54:35 +0000 (17:54 +0000)]
Debug Info: remove duplication of DIEs when a DIE can be shared across CUs.
We add a map in DwarfDebug to map MDNodes that are shareable across CUs to the
corresponding DIEs: MDTypeNodeToDieMap. These DIEs can be shared across CUs,
that is why we keep the maps in DwarfDebug instead of CompileUnit.
We make the assumption that if a DIE is not added to an owner yet, we assume
it belongs to the current CU. Since DIEs for the type system are added to
their owners immediately after creation, and other DIEs belong to the current
CU, the assumption should be true.
A testing case is added to show that we only create a single DIE for a type
MDNode and we use ref_addr to refer to the type DIE.
We also add a testing case to show ref_addr relocations for non-darwin
platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193779
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Thu, 31 Oct 2013 17:50:45 +0000 (17:50 +0000)]
Merge and filecheckize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193778
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 31 Oct 2013 17:25:22 +0000 (17:25 +0000)]
Cleanup: update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193773
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 31 Oct 2013 17:20:14 +0000 (17:20 +0000)]
DWARFAbbreviationDeclaration: remove dead code, refactor parsing code and make it more robust. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193770
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 31 Oct 2013 17:18:24 +0000 (17:18 +0000)]
Lower stackmap intrinsics directly to their target opcode in the DAG builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193769
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 31 Oct 2013 17:18:17 +0000 (17:18 +0000)]
Add Verifier test case for variable argument intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193768
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 31 Oct 2013 17:18:14 +0000 (17:18 +0000)]
Add experimental stackmap intrinsics to definition file and documenation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193767
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 31 Oct 2013 17:18:11 +0000 (17:18 +0000)]
Enable variable arguments support for intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193766
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 31 Oct 2013 17:18:07 +0000 (17:18 +0000)]
whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193765
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 15:58:33 +0000 (15:58 +0000)]
Remove another unused flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193756
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 15:49:39 +0000 (15:49 +0000)]
Remove unused flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193752
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 14:35:00 +0000 (14:35 +0000)]
Rules adjustments in order to build on DragonFly BSD.
Patch by Robin Hahling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193750
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 14:07:59 +0000 (14:07 +0000)]
Remove the --shrink-wrap option.
It had no tests, was unused and was "experimental at best".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193749
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron McInally [Thu, 31 Oct 2013 13:56:31 +0000 (13:56 +0000)]
Add AVX512 unmasked integer broadcast intrinsics and support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193748
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 31 Oct 2013 13:15:32 +0000 (13:15 +0000)]
AVX-512: Implemented CMOV for 512-bit vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193747
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 31 Oct 2013 12:14:17 +0000 (12:14 +0000)]
[SystemZ] Automatically detect zEC12 and z196 hosts
As on other hosts, the CPU identification instruction is priveleged,
so we need to look through /proc/cpuinfo. I copied the PowerPC way of
handling "generic".
Several tests were implicitly assuming z10 and so failed on z196.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193742
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Thu, 31 Oct 2013 09:32:11 +0000 (09:32 +0000)]
[AArch64] Make the use of FP instructions optional, but enabled by default.
This adds a new subtarget feature called FPARMv8 (implied by NEON), and
predicates the support of the FP instructions and registers on this feature.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193739
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 31 Oct 2013 06:21:00 +0000 (06:21 +0000)]
llvm/test/Bitcode/invalid.ll: Tweak expresion to mach "llvm-dis.EXE:"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193738
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 04:20:23 +0000 (04:20 +0000)]
Fix a use after free on invalid input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193737
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 04:07:41 +0000 (04:07 +0000)]
Fix most memory leaks in tablegen.
Found by the valgrind bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193736
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 31 Oct 2013 03:03:55 +0000 (03:03 +0000)]
Merge CallGraph and BasicCallGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193734
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuchen Wu [Thu, 31 Oct 2013 02:01:24 +0000 (02:01 +0000)]
Updated llvm-cov's OVERVIEW description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193732
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 31 Oct 2013 00:20:48 +0000 (00:20 +0000)]
Legalize: Improve legalization of long vector extends.
When an extend more than doubles the size of the elements (e.g., a zext
from v16i8 to v16i32), the normal legalization method of splitting the
vectors will run into problems as by the time the destination vector is
legal, the source vector is illegal. The end result is the operation
often becoming scalarized, with the typical horrible performance. For
example, on x86_64, the simple input of:
define void @bar(<16 x i8> %a, <16 x i32>* %p) nounwind {
%tmp = zext <16 x i8> %a to <16 x i32>
store <16 x i32> %tmp, <16 x i32>*%p
ret void
}
Generates:
.section __TEXT,__text,regular,pure_instructions
.section __TEXT,__const
.align 5
LCPI0_0:
.long 255 ## 0xff
.long 255 ## 0xff
.long 255 ## 0xff
.long 255 ## 0xff
.long 255 ## 0xff
.long 255 ## 0xff
.long 255 ## 0xff
.long 255 ## 0xff
.section __TEXT,__text,regular,pure_instructions
.globl _bar
.align 4, 0x90
_bar:
vpunpckhbw %xmm0, %xmm0, %xmm1
vpunpckhwd %xmm0, %xmm1, %xmm2
vpmovzxwd %xmm1, %xmm1
vinsertf128 $1, %xmm2, %ymm1, %ymm1
vmovaps LCPI0_0(%rip), %ymm2
vandps %ymm2, %ymm1, %ymm1
vpmovzxbw %xmm0, %xmm3
vpunpckhwd %xmm0, %xmm3, %xmm3
vpmovzxbd %xmm0, %xmm0
vinsertf128 $1, %xmm3, %ymm0, %ymm0
vandps %ymm2, %ymm0, %ymm0
vmovaps %ymm0, (%rdi)
vmovaps %ymm1, 32(%rdi)
vzeroupper
ret
So instead we can check if there are legal types that enable us to split
more cleverly when the input vector is already legal such that we don't
turn it into an illegal type. If the extend is such that it's more than
doubling the size of the input we check if
- the number of vector elements is even,
- the source type is legal,
- the type of a split source is illegal,
- the type of an extended (by doubling element size) source is legal, and
- the type of that extended source when split is legal.
If the conditions are met, instead of just splitting both the
destination and the source types, we create an extend that only goes up
one "step" (doubling the element width), and the continue legalizing the
rest of the operation normally. The result is that this operates as a
new, more effecient, termination condition for the loop of "split the
operation until the destination type is legal."
With this change, the above example now compiles to:
_bar:
vpxor %xmm1, %xmm1, %xmm1
vpunpcklbw %xmm1, %xmm0, %xmm2
vpunpckhwd %xmm1, %xmm2, %xmm3
vpunpcklwd %xmm1, %xmm2, %xmm2
vinsertf128 $1, %xmm3, %ymm2, %ymm2
vpunpckhbw %xmm1, %xmm0, %xmm0
vpunpckhwd %xmm1, %xmm0, %xmm3
vpunpcklwd %xmm1, %xmm0, %xmm0
vinsertf128 $1, %xmm3, %ymm0, %ymm0
vmovaps %ymm0, 32(%rdi)
vmovaps %ymm2, (%rdi)
vzeroupper
ret
This generalizes a custom lowering that was added a while back to the
ARM backend. That lowering is no longer necessary, and is removed. The
testcases for it, however, provide excellent ARM tests for this change
and so remain.
rdar://
14735100
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193727
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 30 Oct 2013 23:43:29 +0000 (23:43 +0000)]
Fix a few typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193723
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 30 Oct 2013 23:30:05 +0000 (23:30 +0000)]
Fix CodeGen for unaligned loads with address spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193721
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 30 Oct 2013 22:54:58 +0000 (22:54 +0000)]
Teach scalarrepl about address spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193720
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Oct 2013 22:37:51 +0000 (22:37 +0000)]
Add calls to doInitialization() and doFinalization() in verifyFunction()
The function verifyFunction() in lib/IR/Verifier.cpp misses some
calls. It creates a temporary FunctionPassManager that will run a
single Verifier pass. Unfortunately, FunctionPassManager is no
PassManager and does not call doInitialization() and doFinalization()
by itself. Verifier does important tasks in doInitialization() such as
collecting type information used to check DebugInfo metadata and
doFinalization() does some additional checks. Therefore these checks
were missed and debug info couldn't be verified at all, it just
crashed if the function had some.
verifyFunction() is currently not used in llvm unless -debug option is
enabled, and in unittests/IR/VerifierTest.cpp
VerifierTest had to be changed to create the function in a module from
which the type debug info can be collected.
Patch by Michael Kruse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193719
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 30 Oct 2013 22:08:11 +0000 (22:08 +0000)]
Produce .weak_def_can_be_hidden for some linkonce_odr values
With this patch llvm produces a weak_def_can_be_hidden for linkonce_odr
if they are also unnamed_addr or don't have their address taken.
There is not a lot of documentation about .weak_def_can_be_hidden, but
from the old discussion about linkonce_odr_auto_hide and the name of
the directive this looks correct: these symbols can be hidden.
Testing this with the ld64 in Xcode 5 linking clang reduces the number of
exported symbols from 21053 to 19049.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193718
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 30 Oct 2013 20:42:41 +0000 (20:42 +0000)]
DebugInfo: Push header handling down into CompileUnit
This is a preliminary step to handling type units by abstracting over
all (type or compile) units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193714
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Wed, 30 Oct 2013 20:41:45 +0000 (20:41 +0000)]
[Mips] Add more SHF_MIPS_xxx ELF section flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193713
91177308-0d34-0410-b5e6-
96231b3b80d8
Will Dietz [Wed, 30 Oct 2013 20:27:17 +0000 (20:27 +0000)]
Add DebugInfo testcase for high_pc encoded as constant, fixed in r193555.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193711
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 30 Oct 2013 19:05:41 +0000 (19:05 +0000)]
Fix GVN creating bitcast between address spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193710
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Roeder [Wed, 30 Oct 2013 18:47:25 +0000 (18:47 +0000)]
This commit adds some (but not all) of the x86-64 relocations that are not
currently supported in the ELF object writer, along with a simple test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193709
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 30 Oct 2013 18:32:26 +0000 (18:32 +0000)]
Add {start,end}with_lower methods to StringRef.
startswith_lower is ocassionally useful and I think worth adding.
endwith_lower is added for completeness.
Differential Revision: http://llvm-reviews.chandlerc.com/D2041
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193706
91177308-0d34-0410-b5e6-
96231b3b80d8
Artyom Skrobov [Wed, 30 Oct 2013 18:10:09 +0000 (18:10 +0000)]
[ARM] NEON instructions were erroneously decoded from certain invalid encodings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193705
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 30 Oct 2013 17:22:05 +0000 (17:22 +0000)]
R600: Custom lower f32 = uint_to_fp i64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193701
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 30 Oct 2013 17:14:24 +0000 (17:14 +0000)]
DwarfDebug: Change Abbreviations member from pointer to reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193699
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 30 Oct 2013 17:09:32 +0000 (17:09 +0000)]
fix RST reference in Writing an LLVM Pass
Currently, instead of showing up as link, it is rendered as
...of FunctionPass <writing-an-llvm-pass-FunctionPass>. The...
PR17733. Patch by Tay Ray Chuan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193698
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 30 Oct 2013 16:10:10 +0000 (16:10 +0000)]
Add #include of raw_ostream.h to MipsSEISelLowering.cpp
Fixing this Windows build error:
..\lib\Target\Mips\MipsSEISelLowering.cpp(997) : error C2027: use of undefined type 'llvm::raw_ostream'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193696
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 30 Oct 2013 15:45:42 +0000 (15:45 +0000)]
[mips][msa] Correct definition of bins[lr] and CHECK-DAG-ize related tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193695
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Wed, 30 Oct 2013 15:36:50 +0000 (15:36 +0000)]
make ConstantRange::signExtend() optimal
the case [x, INT_MIN) was not handled optimally
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193694
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 30 Oct 2013 15:20:38 +0000 (15:20 +0000)]
[mips][msa] Added support for matching bmnz, bmnzi, bmz, and bmzi from normal IR (i.e. not intrinsics)
Also corrected the definition of the intrinsics for these instructions (the
result register is also the first operand), and added intrinsics for bsel and
bseli to clang (they already existed in the backend).
These four operations are mostly equivalent to bsel, and bseli (the difference
is which operand is tied to the result). As a result some of the tests changed
as described below.
bitwise.ll:
- bsel.v test adapted so that the mask is unknown at compile-time. This stops
it emitting bmnzi.b instead of the intended bsel.v.
- The bseli.b test now tests the right thing. Namely the case when one of the
values is an uimm8, rather than when the condition is a uimm8 (which is
covered by bmnzi.b)
compare.ll:
- bsel.v tests now (correctly) emits bmnz.v instead of bsel.v because this
is the same operation (see MSA.txt).
i8.ll
- CHECK-DAG-ized test.
- bmzi.b test now (correctly) emits equivalent bmnzi.b with swapped operands
because this is the same operation (see MSA.txt).
- bseli.b still emits bseli.b though because the immediate makes it
distinguishable from bmnzi.b.
vec.ll:
- CHECK-DAG-ized test.
- bmz.v tests now (correctly) emits bmnz.v with swapped operands (see
MSA.txt).
- bsel.v tests now (correctly) emits bmnz.v with swapped operands (see
MSA.txt).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193693
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 30 Oct 2013 15:19:37 +0000 (15:19 +0000)]
[AArch64] Add support for NEON scalar floating-point compare instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193691
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron McInally [Wed, 30 Oct 2013 15:19:10 +0000 (15:19 +0000)]
Refactor the AVX512 intrinsics. Cluster the intrinsics into the appropriate vector extension class within the .td file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193690
91177308-0d34-0410-b5e6-
96231b3b80d8
Howard Hinnant [Wed, 30 Oct 2013 15:10:54 +0000 (15:10 +0000)]
Rehash but don't grow when full of tombstones.
This problem was found and fixed by José Fonseca in March 2011 for
SmallPtrSet, committed r128566. But as far as I can tell, all other
llvm hash tables retain the same problem: the bucket count can grow
without bound while size() remains near constant by repeated
insert/erase cycles that tend to fill the container with tombstones.
Here is a demo that has been reduced to a trivial case:
int
main()
{
llvm::DenseSet<unsigned> d;
for (unsigned i = 0; i < 0xFFFFFFF; ++i)
{
d.insert(i);
d.erase(i);
}
}
While the container size() never grows above 1, the bucket count grows
like this:
nb = 64
nb = 128
nb = 256
nb = 512
nb = 1024
nb = 2048
nb = 4096
nb = 8192
nb = 16384
nb = 32768
nb = 65536
nb = 131072
nb = 262144
nb = 524288
nb =
1048576
nb =
2097152
nb =
4194304
nb =
8388608
nb =
16777216
nb =
33554432
nb =
67108864
nb =
134217728
nb =
268435456
The above program currently consumes a few GB ram. This patch brings
the memory consumption down by several orders of magnitude, and keeps
the bucket count at 64 for the above test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193689
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 30 Oct 2013 14:45:14 +0000 (14:45 +0000)]
[mips][msa] Added support for matching bins[lr]i.[bhwd] from normal IR (i.e. not intrinsics)
This required correcting the definition of the bins[lr]i intrinsics because
the result is also the first operand.
It also required removing the (arbitrary) check for 32-bit immediates in
MipsSEDAGToDAGISel::selectVSplat().
Currently using binsli.d with 2 bits set in the mask doesn't select binsli.d
because the constant is legalized into a ConstantPool. Similar things can
happen with binsri.d with more than 10 bits set in the mask. The resulting
code when this happens is correct but not optimal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193687
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 30 Oct 2013 13:51:01 +0000 (13:51 +0000)]
[mips][msa] Combine binsri-like DAG of AND and OR into equivalent VSELECT
(or (and $a, $mask), (and $b, $inverse_mask)) => (vselect $mask, $a, $b).
where $mask is a constant splat. This allows bitwise operations to make use
of bsel.
It's also a stepping stone towards matching bins[lr], and bins[lr]i from
normal IR.
Two sets of similar tests have been added in this commit. The bsel_* functions
test the case where binsri cannot be used. The binsr_*_i functions will
start to use the binsri instruction in the next commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193682
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 30 Oct 2013 13:31:27 +0000 (13:31 +0000)]
[mips] MipsSETargetLowering now reports DAGCombiner changes when using -debug-only=mips-isel
No test since -debug output is intended for developers and not end-users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193681
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 30 Oct 2013 13:07:44 +0000 (13:07 +0000)]
[mips][msa] Added support for matching splat.[bhw] from normal IR (i.e. not intrinsics)
splat.d is implemented but this subtest is currently disabled. This is because
it is difficult to match the appropriate IR on MIPS32. There is a patch under
review that should help with this so I hope to enable the subtest soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193680
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Wed, 30 Oct 2013 06:36:19 +0000 (06:36 +0000)]
Revert "SelectionDAG: Teach the legalizer to split SETCC if VSELECT needs splitting too."
Now Hexagon and SystemZ are not happy with it :-(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193677
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Wed, 30 Oct 2013 05:48:18 +0000 (05:48 +0000)]
SelectionDAG: Teach the legalizer to split SETCC if VSELECT needs splitting too.
The Type Legalizer recognizes that VSELECT needs to be split, because the type
is to wide for the given target. The same does not always apply to SETCC,
because less space is required to encode the result of a comparison. As a result
VSELECT is split and SETCC is unrolled into scalar comparisons.
This commit fixes the issue by checking for VSELECT-SETCC patterns in the DAG
Combiner. If a matching pattern is found, then the result mask of SETCC is
promoted to the expected vector mask type for the given target. This mask has
usually the same size as the VSELECT return type (except for Intel KNL). Now the
type legalizer will split both VSELECT and SETCC.
This allows the following X86 DAG Combine code to sucessfully detect the MIN/MAX
pattern. This fixes PR16695, PR17002, and <rdar://problem/
14594431>.
Reviewed by Nadav
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193676
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 30 Oct 2013 04:03:03 +0000 (04:03 +0000)]
Reformat Makefile. No other changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193675
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 30 Oct 2013 02:29:43 +0000 (02:29 +0000)]
[mips] Compute stack alignment on the fly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193673
91177308-0d34-0410-b5e6-
96231b3b80d8
Josh Magee [Wed, 30 Oct 2013 02:25:14 +0000 (02:25 +0000)]
Reformat code with clang-format.
Differential Revision: http://llvm-reviews.chandlerc.com/D2057
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193672
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 30 Oct 2013 00:49:39 +0000 (00:49 +0000)]
StackProtector.h: Fix trailing comments for doxygen. [-Wdocumentation]
s!//<!///<!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193669
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 30 Oct 2013 00:49:33 +0000 (00:49 +0000)]
Trailing whitespace in a comment line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193668
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 29 Oct 2013 23:14:15 +0000 (23:14 +0000)]
Debug Info: code clean up.
Use EmitLabelOffsetDifference for handling on darwin platform when
non-darwin platforms use EmitLabelPlusOffset.
Also fix a bug in EmitLabelOffsetDifference where the size is hard-coded
to 4 even though Size is passed in as an argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193660
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 29 Oct 2013 22:57:10 +0000 (22:57 +0000)]
Debug Info: support for DW_FORM_ref_addr.
To support ref_addr, we calculate the section offset of a DIE (i.e. offset
of a DIE from beginning of the debug info section). The Offset field in DIE
is currently CU-relative. To calculate the section offset, we add a
DebugInfoOffset field in CompileUnit to store the offset of a CU from beginning
of the debug info section. We set the value in DwarfUnits::computeSizeAndOffset
for each CompileUnit.
A helper function DIE::getCompileUnit is added to return the CU DIE that
the input DIE belongs to. We also add a map CUDieMap in DwarfDebug to help
finding the CU for a given CU DIE.
For a cross-referenced DIE, we first find the CU DIE it belongs to with
getCompileUnit, then we use CUDieMap to get the corresponding CU for the CU DIE.
Adding the section offset of the CU with the CU-relative offset of a DIE gives
us the seciton offset of the DIE.
We correctly emit ref_addr with relocation using EmitLabelPlusOffset when
doesDwarfUseRelocationsAcrossSections is true.
This commit handles the emission of DW_FORM_ref_addr when we have an attribute
with FORM_ref_addr. A follow-on patch will start using ref_addr when adding a
DIEEntry. This commit will be tested and verified in the follow-on patch.
Reviewed off-list by Eric, Thanks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193658
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 29 Oct 2013 22:49:29 +0000 (22:49 +0000)]
Debug Info: instead of calling addToContextOwner which constructs the context
after the DIE creation, we construct the context first.
Ensure that we create the context before we create a type so that we can add
the newly created type to the parent. Remove last use of addToContextOwner
now that it's not needed.
We use createAndAddDIE to wrap around "new DIE(". Now all shareable DIEs
should be added to their parents right after the creation.
Reviewed off-list by Eric, Thanks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193657
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 29 Oct 2013 22:27:32 +0000 (22:27 +0000)]
Struct byval cleanup: add helper functions to reduce code duplication.
Helper functions are added:
emitPostLd: emit a post-increment load operation with given size.
emitPostSt: emit a post-increment store operation with given size.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193656
91177308-0d34-0410-b5e6-
96231b3b80d8
Josh Magee [Tue, 29 Oct 2013 21:16:16 +0000 (21:16 +0000)]
[stackprotector] Update the StackProtector pass to perform datalayout analysis.
This modifies the pass to classify every SSP-triggering AllocaInst according to
an SSPLayoutKind (LargeArray, SmallArray, AddrOf). This analysis is collected
by the pass and made available for use, but no other pass uses it yet.
The next patch will make use of this analysis in PEI and StackSlot
passes. The end goal is to support ssp-strong stack layout rules.
WIP.
Differential Revision: http://llvm-reviews.chandlerc.com/D1789
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193653
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 29 Oct 2013 21:04:19 +0000 (21:04 +0000)]
Update comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193651
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 29 Oct 2013 20:59:29 +0000 (20:59 +0000)]
Workaround MSVC 32-bit miscompile of getCondCodeAction.
Use 32-bit types for the array instead of 64. This should
generally be better anyway.
In optimized + assert builds, I saw a failure when a
cond code / type combination that is never set was loading
a non-zero value and hitting the != Promote assert.
It turns out when loading the 64-bit value to do the shift,
the assembly loads the 2 32-bit halves from non-consecutive
addresses. The address the second half of the loaded uint64_t
doesn't include the offset of the array in the struct. Instead
of being offset + 4, it's just + 4.
I'm not entirely sure why this wasn't observed before.
setCondCodeAction isn't heavily used by the in-tree targets,
and not with the higher valued vector SimpleValueTypes. Only
PPC is using one of the > 32 valued types, and that is probably
never used by anyone on a 32-bit MSVC compiled host.
I ran into this when upgrading LLVM versions, so I guess the
value loaded from the nonsense address happened to work out
before.
No test since I'm not really sure if / how it can be reproduced
with the current in tree targets, and it's not supposed to change
anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193650
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 29 Oct 2013 20:40:52 +0000 (20:40 +0000)]
Removing a switch statement that contains only a default label. This resolves an MSVC warning. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193649
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 29 Oct 2013 19:29:03 +0000 (19:29 +0000)]
[mips] Align the stack to 16-bytes for mfp64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193641
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 29 Oct 2013 18:31:14 +0000 (18:31 +0000)]
Remove declared but not implemented function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193637
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 29 Oct 2013 17:53:27 +0000 (17:53 +0000)]
Fix common typos in the docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193632
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 29 Oct 2013 17:28:26 +0000 (17:28 +0000)]
Move getSymbol to TargetLoweringObjectFile.
This allows constructing a Mangler with just a TargetMachine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193630
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 29 Oct 2013 17:27:14 +0000 (17:27 +0000)]
Debug Info: clean up testing case.
Add a tag before the name attribute for readability. Use CHECK-NEXT
instead of CHECK-NOT followed by a CHECK. Add new lines to separate checking
of different DIEs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193629
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 29 Oct 2013 17:07:16 +0000 (17:07 +0000)]
Add a helper getSymbol to AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193627
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Tue, 29 Oct 2013 17:01:29 +0000 (17:01 +0000)]
add test cases for frameaddr and returnaddr for aarch64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193626
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Tue, 29 Oct 2013 17:00:25 +0000 (17:00 +0000)]
[AArch64] Implement FrameAddr and ReturnAddr
Fixes PR17690
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193625
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Tue, 29 Oct 2013 16:54:52 +0000 (16:54 +0000)]
[ARM] Make sure HasCRC is initialized to false in Subtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193624
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Tue, 29 Oct 2013 16:38:59 +0000 (16:38 +0000)]
Support for microMIPS jump instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193623
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 29 Oct 2013 16:37:28 +0000 (16:37 +0000)]
R600/SI: Add compute support for CI v2
v2:
- Fix LDS size calculation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193621
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 29 Oct 2013 16:37:20 +0000 (16:37 +0000)]
R600: Expand vector FSQRT ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193620
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Tue, 29 Oct 2013 16:32:19 +0000 (16:32 +0000)]
DWARF parser: propery handle DW_FORM_ref_sig8 and fix Windows build.
Based on D2050 by Timur Iskhodzhanov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193619
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 29 Oct 2013 16:24:21 +0000 (16:24 +0000)]
The asm printer has a mangler. Use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193618
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 29 Oct 2013 16:18:15 +0000 (16:18 +0000)]
The AsmPrinter has a Mangler. Use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193617
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 29 Oct 2013 16:11:22 +0000 (16:11 +0000)]
The asm printer has a mangler. Don't keep a second pointer to it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193616
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 29 Oct 2013 14:25:43 +0000 (14:25 +0000)]
Support names like llvm-ar-3.4 and llvm-ranlib-3.4.
They are used in some packages. For example:
http://packages.ubuntu.com/saucy/i386/llvm-3.4/filelist
This fixes pr17721.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193612
91177308-0d34-0410-b5e6-
96231b3b80d8
Bernard Ogden [Tue, 29 Oct 2013 14:16:09 +0000 (14:16 +0000)]
Test cleanup for v8 instructions
Add some missing tests, factor out a test not specific to v8 into
its own file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193611
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 29 Oct 2013 13:44:11 +0000 (13:44 +0000)]
Clarify that GlobalVariables definitions must have an initializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193609
91177308-0d34-0410-b5e6-
96231b3b80d8
Timur Iskhodzhanov [Tue, 29 Oct 2013 12:13:22 +0000 (12:13 +0000)]
Quick-fix DebugInfo build on Windows
MSVC can't comprehend
template<typename T, size_t N>
ArrayRef<T> makeArrayRef(const T (&Arr)[N]) {
return ArrayRef<T>(Arr);
}
if Arr is
static const uint8_t sizes[];
declared in a templated and defined a few lines later.
I'll send a proper fix (i.e. get rid of unnecessary templates) for review soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193604
91177308-0d34-0410-b5e6-
96231b3b80d8