1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

53056 Commits

Author SHA1 Message Date
Rafael Espindola
4f3e648dd0 Improve comment. Thanks for Andrew for the suggestion.
llvm-svn: 151127
2012-02-22 03:44:46 +00:00
Rafael Espindola
23cd372dbf Semantically revert 151015. Add a comment on why we should be able to assert
the dominance once the dominates method is fixed and why we can use the builder's
insertion point.
Fixes pr12048.

llvm-svn: 151125
2012-02-22 03:21:39 +00:00
Aaron Ballman
a76a5b7265 Adding support for Microsoft's thiscall calling convention. LLVM side of the patch.
llvm-svn: 151123
2012-02-22 03:04:40 +00:00
Jakob Stoklund Olesen
fdda2fc23a Clarify ARM calling conventions.
llvm-svn: 151113
2012-02-22 01:07:19 +00:00
Jakob Stoklund Olesen
a1db1a4669 Use SparseSet for the RAFast live virtual register map.
This makes RAFast 4% faster, and it gets rid of the dodgy DenseMap
iteration.

This also revealed that RAFast would sometimes dereference DenseMap
iterators after erasing other elements from the map. That does seem to
work in the current DenseMap implementation, but SparseSet doesn't allow
it.

llvm-svn: 151111
2012-02-22 01:02:37 +00:00
Akira Hatanaka
4330fc73ec Use a function in MathExtras to do sign extension.
llvm-svn: 151107
2012-02-22 00:16:54 +00:00
Jakob Stoklund Olesen
f585983be9 Calls don't really change the stack pointer.
Even if a call instruction has %SP<imp-def> operands, it doesn't change
the value of the stack pointer.

llvm-svn: 151104
2012-02-21 23:47:43 +00:00
Lang Hames
15c7539a46 Add API "handleMoveIntoBundl" for updating liveness when moving instructions into
bundles. This method takes a bundle start and an MI being bundled, and makes
the intervals for the MI's operands appear to start/end on the bundle start.

Also fixes some minor cosmetic issues (whitespace, naming convention) in the
HMEditor code.

llvm-svn: 151099
2012-02-21 22:29:38 +00:00
Eric Christopher
7b19cf8b2a There's no need for a DW_AT_byte_size on a pointer type.
Part of rdar://10493979 where it reduces by about .5% (10k)

llvm-svn: 151097
2012-02-21 22:25:53 +00:00
Nick Lewycky
664d5b131f Use the target-aware constant folder on expressions to improve the chance
they'll be simple enough to simulate, and to reduce the chance we'll encounter
equal but different simple pointer constants.

This removes the symptoms from PR11352 but is not a full fix. A proper fix would
either require a guarantee that two constant objects we simulate are folded
when equal, or a different way of handling equal pointers (ie., trying a
constantexpr icmp on them to see whether we know they're equal or non-equal or
unsure).

llvm-svn: 151093
2012-02-21 22:08:06 +00:00
Evan Cheng
9759637dc1 Proper support for a bastardized darwin-eabi hybird ABI.
llvm-svn: 151083
2012-02-21 20:46:00 +00:00
Rafael Espindola
8d727cc0cb s/the the/the/
llvm-svn: 151079
2012-02-21 19:27:16 +00:00
Benjamin Kramer
bc60ae1e71 Fix unsigned off-by-one in comment.
llvm-svn: 151056
2012-02-21 13:40:06 +00:00
Benjamin Kramer
dacc2e8edb InstCombine: Don't transform a signed icmp of two GEPs into a signed compare of the indices.
This transformation is not safe in some pathological cases (signed icmp of pointers should be an
extremely rare thing, but it's valid IR!). Add an explanatory comment.

Kudos to Duncan for pointing out this edge case (and not giving up explaining it until I finally got it).

llvm-svn: 151055
2012-02-21 13:31:09 +00:00
Duncan Sands
cb8147cfe5 Move the implementation of StringRef::split out of StringExtras.cpp
and into StringRef.cpp, which is where the other StringRef stuff is.

llvm-svn: 151054
2012-02-21 12:00:25 +00:00
Jay Foad
aea6e7df6b Revert r151049 cos it broke the buildbots.
llvm-svn: 151052
2012-02-21 11:44:46 +00:00
Chandler Carruth
4cc3bda4d3 Tiny cosmetic change to use the same style for all of the while loops in
the normalize routine, especially the empty while loops.

llvm-svn: 151050
2012-02-21 09:29:14 +00:00
Jay Foad
9034028575 PR1210: make uniquing of struct and function types more efficient by
using a DenseMap and Talin's new GeneralHash, avoiding the need for a
temporary std::vector on every lookup.

Patch by Meador Inge!

llvm-svn: 151049
2012-02-21 09:25:52 +00:00
Chandler Carruth
22537f932d Replace a hand rolled loop with a lovely StringRef helper we have these
days. No functionality changed.

llvm-svn: 151048
2012-02-21 09:12:48 +00:00
Chandler Carruth
b2adf74ff3 Pull the parsing helper functions out of the Triple interface entirely.
They're private static methods but we can just make them static
functions in the implementation. It makes the implementations a touch
more wordy, but takes another chunk out of the header file.

Also, take the opportunity to switch the names to the new coding
conventions.

No functionality changed here.

llvm-svn: 151047
2012-02-21 08:53:32 +00:00
Chandler Carruth
12774336b5 Clean up comments that I missed when changing the triple representation.
Somehow, I even missed the ones I wrote just the other day...

Thanks to Matt for the code review.

llvm-svn: 151045
2012-02-21 08:31:18 +00:00
Andrew Trick
25ec43e9fe Clear virtual registers after they are no longer referenced.
Passes after RegAlloc should be able to rely on MRI->getNumVirtRegs() == 0.
This makes sharing code for pre/postRA passes more robust.
Now, to check if a pass is running before the RA pipeline begins, use MRI->isSSA().
To check if a pass is running after the RA pipeline ends, use !MRI->getNumVirtRegs().

PEI resets virtual regs when it's done scavenging.

PTX will either have to provide its own PEI pass or assign physregs.

llvm-svn: 151032
2012-02-21 04:51:23 +00:00
Andrew Trick
719b2521ef StackSlotColoring does not use a VirtRegMap
llvm-svn: 151031
2012-02-21 04:51:19 +00:00
Rafael Espindola
8ef9503d71 Use more idiomatic assert.
llvm-svn: 151026
2012-02-21 03:51:14 +00:00
Rafael Espindola
aec58a4177 Avoid warning on non assert builds.
llvm-svn: 151025
2012-02-21 03:48:30 +00:00
Chandler Carruth
34c9c293e1 Switch the llvm::Triple class to immediately parse the triple string on
construction. Simplify its interface, implementation, and users
accordingly as there is no longer an 'uninitialized' state to check for.
Also, fixes a bug lurking in the interface as there was one method that
didn't correctly check for initialization.

llvm-svn: 151024
2012-02-21 03:39:36 +00:00
Rafael Espindola
232a730f45 It turns out that with the current scev organization ReuseOrCreateCast cannot
know where users will be added. Because of this, it cannot use
Builder.GetInsertPoint at all.

This patch
* removes the FIXME about adding the assert.
* adds a comment explaining hy we don't have one.
* removes a broken logic that only works for some callers and is not needed
  since r150884.
* adds an assert to caller that would have caught the bug fixed by r150884.

llvm-svn: 151015
2012-02-21 01:19:51 +00:00
Lang Hames
1b774db571 Fix some bugs in HMEditor's moveAllOperandsInto logic.
llvm-svn: 151006
2012-02-21 00:00:36 +00:00
Nick Lewycky
b9cf2477b9 Check for the correct size in the invariant marker.
llvm-svn: 151003
2012-02-20 23:32:26 +00:00
Evan Cheng
3bffc22fc2 Fix machine-cp by having it to check sub-register indicies. e.g.
ecx = mov eax
al  = mov ch
The second copy is not a nop because the sub-indices of ecx,ch is not the
same of that of eax/al.

Re-enabled machine-cp.
PR11940

llvm-svn: 151002
2012-02-20 23:28:17 +00:00
Chad Rosier
b98a4accfa Fix 80-column violation.
llvm-svn: 150998
2012-02-20 23:13:17 +00:00
Benjamin Kramer
0dac66d9a2 InstCombine: Removing the base from the address calculation is only safe when the GEPs are inbounds.
llvm-svn: 150978
2012-02-20 18:45:10 +00:00
Eric Christopher
742c530fa0 Make this a bit prettier and more obvious when a derived type isn't
derived from anything.

llvm-svn: 150975
2012-02-20 18:04:39 +00:00
Eric Christopher
69a0eb9258 If a derived type is also a composite type, print that information
too.

llvm-svn: 150974
2012-02-20 18:04:35 +00:00
Eric Christopher
ed41b1f1ef Add support for runtime languages on our forward declarations.
llvm-svn: 150973
2012-02-20 18:04:14 +00:00
Benjamin Kramer
9ade8e4d79 InstCombine: When comparing two GEPs that were derived from the same base pointer but use different types, expand the offset calculation and to the compare on the offset if profitable.
This came up in SmallVector code.

llvm-svn: 150962
2012-02-20 15:07:47 +00:00
Benjamin Kramer
3d87f26b44 InstCombine: Make OptimizePointerDifference more aggressive.
- Ignore pointer casts.
- Also expand GEPs that aren't constantexprs when they have one use or only constant indices.

- We now compile "&foo[i] - &foo[j]" into "i - j".

llvm-svn: 150961
2012-02-20 14:34:57 +00:00
James Molloy
9963b8be92 Teach the DAGCombiner that certain loadext nodes followed by ANDs can be converted to zeroexts.
llvm-svn: 150957
2012-02-20 12:02:38 +00:00
James Molloy
6cbdd131b3 Improve generated code for extending loads and some trunc stores on ARM.
Teach TargetSelectionDAG about lengthening loads for vector types and set v4i8 as legal. Allow FP_TO_UINT for v4i16 from v4i32.

llvm-svn: 150956
2012-02-20 09:24:05 +00:00
Evan Cheng
499c67989a Make post-ra tail duplication bundle safe. No test case as recent codegen
flow changes have already hidden the bug. rdar://10893812

llvm-svn: 150949
2012-02-20 07:51:58 +00:00
Nick Lewycky
a87b6c7974 Rename class Evaluate to Evaluator and put it in an anonymous namespace.
llvm-svn: 150947
2012-02-20 03:25:59 +00:00
Chris Lattner
50ad7c3f54 fold comparisons of gep'd alloca points with null to false,
implementing PR12013.  We now compile the testcase to:

__Z4testv:                              ## @_Z4testv
## BB#0:                                ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
	pushq	%rbx
	subq	$64, %rsp
	leaq	32(%rsp), %rbx
	movq	%rbx, (%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 16(%rsp)
	movl	$1, 32(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	(%rsp), %rdi
	callq	__Z1gRN4llvm11SmallVectorIiLj8EEE
	movq	(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	LBB0_2
## BB#1:
	callq	_free
LBB0_2:                                 ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
	addq	$64, %rsp
	popq	%rbx
	ret

instead of:

__Z4testv:                              ## @_Z4testv
## BB#0:
	pushq	%rbx
	subq	$64, %rsp
	xorl	%eax, %eax
	leaq	(%rsp), %rbx
	addq	$32, %rbx
	movq	%rbx, (%rsp)
	movq	%rbx, 8(%rsp)
	leaq	64(%rsp), %rcx
	movq	%rcx, 16(%rsp)
	je	LBB0_2
## BB#1:
	movl	$1, 32(%rsp)
	movq	%rbx, %rax
LBB0_2:                                 ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
	addq	$4, %rax
	movq	%rax, 8(%rsp)
	leaq	(%rsp), %rdi
	callq	__Z1gRN4llvm11SmallVectorIiLj8EEE
	movq	(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	LBB0_4
## BB#3:
	callq	_free
LBB0_4:                                 ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
	addq	$64, %rsp
	popq	%rbx
	ret

This doesn't shrink clang noticably though.

llvm-svn: 150944
2012-02-20 00:42:49 +00:00
Chandler Carruth
132aecc08e Move constructors out-of-line and flesh out their documentation. No
functionality changed. This is in preparation for some refactoring of
how this class behaves.

llvm-svn: 150941
2012-02-20 00:02:47 +00:00
Nick Lewycky
c7e2bbf39f Move EvaluateFunction and EvaluateBlock into a class, and make the class store
the information that they pass around between them. No functionality change!

llvm-svn: 150939
2012-02-19 23:26:27 +00:00
Benjamin Kramer
576a9ea6ca Silence operator precedence warning.
llvm-svn: 150921
2012-02-19 12:25:07 +00:00
Ahmed Charles
745c53c2a7 Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
llvm-svn: 150918
2012-02-19 11:37:01 +00:00
Ahmed Charles
6e49e54bbb StringRef'ize EmitSourceFileHeader().
llvm-svn: 150917
2012-02-19 11:35:20 +00:00
Craig Topper
da569ead22 Remove some unneeded includes and fix ordering in X86ISelLowering.cpp. Remove unneeded 'using namespace'.
llvm-svn: 150916
2012-02-19 07:15:48 +00:00
Lang Hames
88e5e4d72e Add machinery for pushing live ranges onto bundle starts while bundling.
llvm-svn: 150915
2012-02-19 07:13:05 +00:00
Lang Hames
bdb4efcb20 Simplify moveEnteringDownFrom rules.
llvm-svn: 150914
2012-02-19 06:13:56 +00:00
Craig Topper
c35afe3434 Unify all shuffle mask checking functions take a mask and VT instead of VectorShuffleSDNode.
llvm-svn: 150913
2012-02-19 05:41:45 +00:00
Lang Hames
831e129c9d Skip through instructions rather than operands when looking for last use slot.
llvm-svn: 150912
2012-02-19 04:38:25 +00:00
NAKAMURA Takumi
4518369791 APFloat::toString(): Fix overrun at scanning.
FYI, clang/test/SemaTemplate/template-id-printing.cpp had been failing due to it on cygwin-clang.

llvm-svn: 150911
2012-02-19 03:18:29 +00:00
Lang Hames
8b2e08187a Fix TODO and trailing whitespace.
llvm-svn: 150910
2012-02-19 03:09:55 +00:00
Lang Hames
b946cb5e75 Defer sanity checks on live intervals until after all have been updated. Hold (LiveInterval, LiveRange) pairs to update, rather than vregs.
llvm-svn: 150909
2012-02-19 03:00:30 +00:00
Craig Topper
7582570aff Make a bunch of X86ISelLowering shuffle functions static now that they are no longer needed by isel.
llvm-svn: 150908
2012-02-19 02:53:47 +00:00
Jia Liu
e9bdee01e7 comment fix ARM.h
llvm-svn: 150904
2012-02-19 02:04:03 +00:00
Jia Liu
6bb2f0f0e4 some comment fix for X86 and ARM
llvm-svn: 150902
2012-02-19 02:03:36 +00:00
Craig Topper
cfbfa3dcd1 Add vmfunc instruction to X86 assembler and disassembler.
llvm-svn: 150899
2012-02-19 01:39:49 +00:00
Ahmed Charles
b1856af87c Fix issue with bitwise and precedence.
llvm-svn: 150897
2012-02-18 22:56:41 +00:00
Talin
777c85d862 Hashing.h - utilities for hashing various data types.
llvm-svn: 150890
2012-02-18 21:00:49 +00:00
Rafael Espindola
6be26e6aa6 White space fixes.
llvm-svn: 150886
2012-02-18 19:46:02 +00:00
Rafael Espindola
64fe8ada6e Temporarily disable this assert. Looks like it found a similar issue when
building bullet.

llvm-svn: 150885
2012-02-18 17:51:43 +00:00
Rafael Espindola
5154b9bedb Don't skip debug instructions when looking for the insertion point of
the cast. If we do, we can end up with

   inst1
   ---------------  < Insertion point
   dbg inst
   new inst

instead of the desired

   inst1
   new inst
   ---------------  < Insertion point
   dbg inst

Another option would be for InsertNoopCastOfTo (or its callers) to move the
insertion point and we would end up with

   inst1
   dbg inst
   new inst
   ---------------  < Insertion point

but that complicates the callers. This fixes PR12018 (and firefox's build).

llvm-svn: 150884
2012-02-18 17:22:58 +00:00
Jia Liu
b077b6085d Emacs-tag and some comment fix for all ARM, CellSPU, Hexagon, MBlaze, MSP430, PPC, PTX, Sparc, X86, XCore.
llvm-svn: 150878
2012-02-18 12:03:15 +00:00
Craig Topper
e42fa08789 Add X86InstrSVM.td that I forgot to add in r150873.
llvm-svn: 150874
2012-02-18 08:34:12 +00:00
Craig Topper
ecf21d8132 Add X86 assembler and disassembler support for AMD SVM instructions. Original patch by Kay Tiong Khoo. Few tweaks by me for code density and to reduce replication.
llvm-svn: 150873
2012-02-18 08:19:49 +00:00
Chandler Carruth
6f19135606 Trivial cleanup to group the generic 'armvN' cases with the 'arm' case,
etc. No functionality changed.

llvm-svn: 150867
2012-02-18 04:34:17 +00:00
Eli Friedman
be89455c98 Fix a rather nasty regression from r150690: LHS != RHS does not imply LHS->stripPointerCasts() != RHS->stripPointerCasts().
llvm-svn: 150863
2012-02-18 03:29:25 +00:00
Lang Hames
095e9964bd Bring HMEditor into line with LLVM coding standards.
llvm-svn: 150851
2012-02-17 23:43:40 +00:00
Eric Christopher
325985565a Ignore the lifetime intrinsics in fast-isel.
llvm-svn: 150848
2012-02-17 23:03:39 +00:00
Jakob Stoklund Olesen
4aa0e7c7c4 Don't print out pointer values in SUnit::dump().
llvm-svn: 150842
2012-02-17 21:44:51 +00:00
Matt Beaumont-Gay
a45b6e23d0 Sink variable into assert
llvm-svn: 150841
2012-02-17 21:40:48 +00:00
Lang Hames
27171ecf20 Add support for regmask slots to HMEditor. Also fixes a comment error.
llvm-svn: 150840
2012-02-17 21:29:41 +00:00
Kevin Enderby
36596f0ae8 Fix typo in comment ldopen() -> dlopen().
llvm-svn: 150836
2012-02-17 19:26:00 +00:00
Jakob Stoklund Olesen
c22a5531d8 Handle regmask operands in ARMInstrInfo.
llvm-svn: 150833
2012-02-17 19:23:15 +00:00
Kevin Enderby
ba7e6a7525 Put back the initializing the targets in the disassembler API with a comment as
to why this is needed.  This broke the darwin's otool(1) program.  This change
was made in r144385.

llvm-svn: 150832
2012-02-17 19:18:29 +00:00
Jakob Stoklund Olesen
dc42602f74 Fix ARMBaseInstrInfo::getInstrLatency for calls.
Calls always clobber CPSR.

llvm-svn: 150831
2012-02-17 19:07:59 +00:00
Jakob Stoklund Olesen
bde432b917 Transfer regmasks to MRI.
MRI keeps track of which physregs have been used. Make sure it gets
updated with all the regmask-clobbered registers.

Delete the closePhysRegsUsed() function which isn't necessary.

llvm-svn: 150830
2012-02-17 19:07:56 +00:00
Dan Gohman
71b80f9e8c Calls and invokes with the new clang.arc.no_objc_arc_exceptions
metadata may still unwind, but only in ways that the ARC
optimizer doesn't need to consider. This permits more
aggressive optimization.

llvm-svn: 150829
2012-02-17 18:59:53 +00:00
Lang Hames
ed9553242f Refactor 'handleMove' code in live intervals. Clients of LiveIntervals won't see
any changes.

Internally this adds a private inner class HMEditor, to LiveIntervals. HMEditor provides
an API for updating live intervals when code is moved or bundled.

llvm-svn: 150826
2012-02-17 18:44:18 +00:00
Dan Gohman
eb02ab2f74 Remove a comment about an alternative approach that wouldn't
actually work, at least as described. LLVM Metadata is not
intended to suppress LLVM IR rules, as it can be stripped at
any time.

llvm-svn: 150821
2012-02-17 18:33:38 +00:00
Jim Grosbach
f636a3204d Tidy up.
llvm-svn: 150820
2012-02-17 17:35:10 +00:00
David Chisnall
57bacb511d Generate the correct EH frame section types on Solaris, this time without breaking other platforms...
llvm-svn: 150819
2012-02-17 17:31:15 +00:00
David Chisnall
d237b9b330 Revert r150814. It turns out that there is a good reason for this after all...
llvm-svn: 150818
2012-02-17 16:51:02 +00:00
Jakob Stoklund Olesen
355efd71af Revert r150288, "Allow Post-RA LICM to hoist reserved register reads."
This caused miscompilations on out-of-tree targets, and possibly i386 as
well.

I'll find some other way of hoisting %rip-relative loads from loops
containing calls.

llvm-svn: 150816
2012-02-17 16:40:44 +00:00
David Chisnall
6c7c6fe0c2 Don't lazily allocate eh_frame. We're not lazily allocating things like the LSDA, which are only used when the eh frame is used, so this lazy allocation doesn't really make sense.
Fix the type of eh_frame on Solaris so that Sun ld doesn't fail to combine them (thus making it impossible for the unwind library to find them and breaking exceptions).

llvm-svn: 150814
2012-02-17 16:32:07 +00:00
David Chisnall
d5d4804858 ... and it's probably best to use the correct alignment, rather than just guessing that it's the same as the size.
llvm-svn: 150813
2012-02-17 16:30:39 +00:00
David Chisnall
86b0f069d6 It turns out that putting an 8-byte symbol in a 4-byte section makes Solaris ld sulk. GNU ld is perfectly happy with it, which is worrying for a whole other set of reasons...
Thanks to Anton, Duncan and Rafael for helping me track this down.
Pointy hat to Rafael for introducing the bug in the first place.

llvm-svn: 150811
2012-02-17 16:05:50 +00:00
Jia Liu
cd92ae4cf2 remove Emacs-tag form .cpp files in Mips Backend, and fix some typo.
llvm-svn: 150805
2012-02-17 08:55:11 +00:00
Eric Christopher
61e7e5c8c9 Typo in variable name.
llvm-svn: 150796
2012-02-17 07:08:46 +00:00
Craig Topper
a25b84d986 Remove the last of the old vector_shuffle patterns from X86 isel.
llvm-svn: 150795
2012-02-17 07:02:34 +00:00
Nick Lewycky
a5a53772d9 Add support for invariant.start inside the static constructor evaluator. This is
useful to represent a variable that is const in the source but can't be constant
in the IR because of a non-trivial constructor. If globalopt evaluates the
constructor, and there was an invariant.start with no matching invariant.end
possible, it will mark the global constant afterwards.

llvm-svn: 150794
2012-02-17 06:59:21 +00:00
Akira Hatanaka
e232ee7225 Do not promote i32 arguments to i64. This was causing unnecessary sign extension
instructions to be emitted.

llvm-svn: 150782
2012-02-17 02:20:26 +00:00
Bill Wendling
1c92c9b270 Remove redundant comment. Use a more efficient datatype.
llvm-svn: 150780
2012-02-17 02:12:54 +00:00
Bill Wendling
b2fd149709 Fix some grammar-os and formatting.
llvm-svn: 150779
2012-02-17 02:09:28 +00:00
Lang Hames
a8cd3b538d Reverse iterator - should be incrementing rather than decrementing.
llvm-svn: 150778
2012-02-17 01:54:11 +00:00
Jia Liu
ecc08b8cfe add Emacs tag and fix some comment error in file headers
llvm-svn: 150775
2012-02-17 01:23:50 +00:00
Chad Rosier
7867a0bd92 [fast-isel] Add support for returning non-legal types with no sign- or zero-
entend flag.

llvm-svn: 150774
2012-02-17 01:21:28 +00:00
Lang Hames
dd3a5d8e78 MachineScheduler shouldn't use/preserve LiveDebugVariables.
llvm-svn: 150773
2012-02-17 01:11:37 +00:00