1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

12751 Commits

Author SHA1 Message Date
Owen Anderson
6c2af9f474 Remove dead code. ManagedCleanup is unused, and contained a serious bug in that
the provided cleanup function is never actually called.

llvm-svn: 113284
2010-09-07 20:53:39 +00:00
Owen Anderson
94ae132fc8 Fix PR7972, in which the PassRegistry was being leaked. As part of this,
switch to using a ManagedStatic for the global PassRegistry instead of a
ManagedCleanup, and fix a destruction ordering bug this exposed.

llvm-svn: 113283
2010-09-07 20:48:10 +00:00
Dan Gohman
6d4356d31f Tidy up the getModRefInfo declarations.
llvm-svn: 113275
2010-09-07 20:37:47 +00:00
Owen Anderson
7d56c30119 Properly initialize the pImpl member of PassRegistry to zero.
llvm-svn: 113264
2010-09-07 20:13:48 +00:00
Owen Anderson
f7efa840f0 Add doxygen comments for PassRegistry.
llvm-svn: 113262
2010-09-07 20:04:26 +00:00
Bill Wendling
9bb7ac566f Add an MVT::x86mmx type. It will take the place of all current MMX vector types.
llvm-svn: 113261
2010-09-07 20:03:56 +00:00
Owen Anderson
e15120e561 Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
and exposing internal details.

llvm-svn: 113252
2010-09-07 19:16:25 +00:00
Nick Lewycky
cad1395824 Create PTX backend. Patch by Che-Liang Chiou!
llvm-svn: 113235
2010-09-07 18:14:24 +00:00
Dale Johannesen
8354cab2de Add patterns for MMX that use the new intrinsics.
Enable palignr intrinsic.
These may need adjustment for a new VT in due course.

llvm-svn: 113233
2010-09-07 18:10:56 +00:00
Nick Lewycky
9698dae1df Add completely hokey binary-and and binary-or operations to ConstantRange and
teach LazyValueInfo to use them.

llvm-svn: 113196
2010-09-07 05:39:02 +00:00
Nick Lewycky
ca54f909d8 Add a new isSignWrappedSet() method to ConstantRange.
Fix zeroExtend and signExtend to support empty sets, and to return the smallest
possible result set which contains the extension of each element in their
inputs. For example zext i8 [100, 10) to i16 is now [0, 256), not i16 [100, 10)
which contains 63446 members.

llvm-svn: 113187
2010-09-06 23:52:49 +00:00
Chris Lattner
818045f208 pull a simple method out of LICM into a new
Loop::hasLoopInvariantOperands method. Remove
a useless and confusing Loop::isLoopInvariant(Instruction)
method, which didn't do what you thought it did.

No functionality change.

llvm-svn: 113133
2010-09-06 01:05:37 +00:00
Chris Lattner
92429b2601 fix inconsistent formatting.
llvm-svn: 113121
2010-09-05 22:43:56 +00:00
Chris Lattner
684ae57b8e implement rdar://6653118 - fastisel should fold loads where possible.
Since mem2reg isn't run at -O0, we get a ton of reloads from the stack,
for example, before, this code:

int foo(int x, int y, int z) {
  return x+y+z;
}

used to compile into:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	movl	4(%rsp), %esi
	addl	%edx, %esi
	movl	(%rsp), %edx
	addl	%esi, %edx
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Now we produce:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	addl	4(%rsp), %edx    ## Folded load
	addl	(%rsp), %edx     ## Folded load
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Fewer instructions and less register use = faster compiles.

llvm-svn: 113102
2010-09-05 02:18:34 +00:00
Jakob Stoklund Olesen
14f6dc4465 Remove dead code.
Clobber ranges are no longer used when joining physical registers.
Instead, all aliases are checked for interference.

llvm-svn: 113084
2010-09-04 21:09:33 +00:00
Chris Lattner
6c6f196725 fix this to work with allocators that have reference type with compilers
that diagnose invalid references to references.

llvm-svn: 113078
2010-09-04 18:45:02 +00:00
Eric Christopher
5dfc130a4b Reapply this increase to the number of virtual registers. All of the
various breakages appear to be dealt with.

Patch by Pekka Jääskeläinen.

llvm-svn: 113024
2010-09-03 22:46:31 +00:00
Jim Grosbach
1ebe0e2667 Add 'const' to getter function.
llvm-svn: 112984
2010-09-03 18:17:16 +00:00
Owen Anderson
e1e3ab9f6d Re-enable CorrelatedValuePropagation. I've tested nightly tests, llvm-gcc
bootstrap, and clang self-host.

llvm-svn: 112948
2010-09-03 04:16:28 +00:00
Bob Wilson
24fa0b33b1 Replace NEON vabdl, vaba, and vabal intrinsics with combinations of the
vabd intrinsic and add and/or zext operations.  In the case of vaba, this
also avoids the need for a DAG combine pattern to combine vabd with add.
Update tests.  Auto-upgrade the old intrinsics.

llvm-svn: 112941
2010-09-03 01:35:08 +00:00
Chris Lattner
0f0c0967e4 lets get crazy and name the header file the exact class name,
not a scrunched version of it.

llvm-svn: 112904
2010-09-02 23:09:42 +00:00
Chris Lattner
a06feeb64b AsmPrinter has a formatted stream, pass it down through AsmAnnotationWriter
llvm-svn: 112903
2010-09-02 23:07:12 +00:00
Bill Wendling
b601685422 Revert int_x86_mmx_palignr_b intrinsic to match llvm-gcc's version.
llvm-svn: 112886
2010-09-02 22:31:53 +00:00
Bill Wendling
55612891ec - Change __builtin_ia32_palignr intrinsic type to match the pattern in clang.
- Add patterns to match the following MMX builtins:

   * __builtin_ia32_vec_init_v8qi
   * __builtin_ia32_vec_init_v4hi
   * __builtin_ia32_vec_init_v2si
   * __builtin_ia32_vec_ext_v2si

  These builtins do not correspond to a single MMX instruction. They will have
  to be lowered -- most likely in the back-end.

llvm-svn: 112881
2010-09-02 22:26:35 +00:00
Dan Gohman
81f9434e99 Remove obsolete comments about throwing exceptions.
llvm-svn: 112874
2010-09-02 22:14:51 +00:00
John McCall
b91df6e799 After some discussion with djg, teach SmallVector to grow from a zero
capacity and remove the workaround in SmallVector<T,0>.  There are some
theoretical benefits to a N->2N+1 growth policy anyway.

llvm-svn: 112870
2010-09-02 21:55:03 +00:00
Benjamin Kramer
dd16ed1618 Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.
llvm-svn: 112849
2010-09-02 18:53:37 +00:00
Dan Gohman
5cf037ea20 Add a comment.
llvm-svn: 112836
2010-09-02 17:35:10 +00:00
Devang Patel
bbbd35d042 Fix .debug_range for linux. Patch by Krister Wombell.
llvm-svn: 112830
2010-09-02 16:43:44 +00:00
Duncan Sands
a95548a8d2 Reapply commit 112699, speculatively reverted by echristo, since
I'm sure it is harmless.  Original commit message:
If PrototypeValue is erased in the middle of using the SSAUpdator
then the SSAUpdator may access freed memory.  Instead, simply pass
in the type and name explicitly, which is all that was used anyway.

llvm-svn: 112810
2010-09-02 08:14:03 +00:00
Bob Wilson
3348d2eb50 Remove NEON vmull, vmlal, and vmlsl intrinsics, replacing them with multiply,
add, and subtract operations with zero-extended or sign-extended vectors.
Update tests.  Add auto-upgrade support for the old intrinsics.

llvm-svn: 112773
2010-09-01 23:50:19 +00:00
Dan Gohman
bc87387508 Reword this comment. Don't mention outs(), as that's not what
this code is actually testing for.

llvm-svn: 112767
2010-09-01 23:33:02 +00:00
Dale Johannesen
e7c3ecd9dd Recommit with changes. Comment out palignr for the
moment, as there's a testcase that uses it and expects it
to be subject to optimizations; we won't be doing that.
Some adjustments based on feedback from Bill.

llvm-svn: 112754
2010-09-01 22:43:48 +00:00
Dale Johannesen
8f257c1f83 Revert 112740, it broke some clang tests somehow...
llvm-svn: 112744
2010-09-01 21:36:44 +00:00
Dale Johannesen
20877c9c79 Add a few more missing MMX operations. This should be it.
llvm-svn: 112740
2010-09-01 21:03:03 +00:00
Owen Anderson
ef4f527b13 Disable CorrelatedValuePropagation while I track down selfhost failures.
llvm-svn: 112727
2010-09-01 19:20:46 +00:00
Owen Anderson
0ee04fbdc8 Tentatively add correlated value propagation to the set of standard passes.
llvm-svn: 112723
2010-09-01 18:30:15 +00:00
Eric Christopher
f72b7040a2 Speculatively revert 112699 and 112702, they seem to be causing
self host errors on clang-x86-64.

llvm-svn: 112719
2010-09-01 17:29:10 +00:00
Dan Gohman
f9e09104f1 Make tool_output_file's raw_ostream instance a member variable instead
of a base class.

This makes it possible to unregister the file from FilesToRemove when
the file is done. Also, this eliminates the need for
formatted_tool_output_file.

llvm-svn: 112706
2010-09-01 14:20:41 +00:00
Dan Gohman
5f2118dd6f Add an interface for unregistering a file from the FilesToRemove list.
llvm-svn: 112705
2010-09-01 14:17:34 +00:00
Michael J. Spencer
3363f79ebb COFF: Fix incorrect SCT_COMPLEX_TYPE_SHIFT. Add a few constants.
llvm-svn: 112703
2010-09-01 14:09:36 +00:00
Dan Gohman
ace824be4a Make the iterator form of erase return void, since it always succeeds,
and since this is what std::map and std::set do.

llvm-svn: 112701
2010-09-01 14:00:35 +00:00
Duncan Sands
8797da600f Define LLVM_GLOBAL_VISIBILITY to be __declspec(dllexport) on
windows systems.

llvm-svn: 112700
2010-09-01 13:07:11 +00:00
Duncan Sands
f7e2f45e1a If PrototypeValue is erased in the middle of using the SSAUpdator
then the SSAUpdator may access freed memory.  Instead, simply pass
in the type and name explicitly, which is all that was used anyway.

llvm-svn: 112699
2010-09-01 10:29:33 +00:00
Duncan Sands
67159c80d8 Add convenience class for working with eh.exception calls.
llvm-svn: 112698
2010-09-01 09:26:00 +00:00
Dan Gohman
ad593f9d93 Revert 112442 and 112440 until the compile time problems introduced
by 112440 are resolved.

llvm-svn: 112692
2010-09-01 01:45:53 +00:00
Dale Johannesen
1ba5a3fc80 Add some MMX intrinsics that duplicate functionality
available in normal llvm operators.  We aren't going to
use those for MMX any more because it's unsafe for the
optimizers to synthesize new MMX instructions.

llvm-svn: 112685
2010-09-01 00:40:09 +00:00
Devang Patel
9e8ee9242f Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
This patch was developed on top of original patch by Artur Pietrek.

llvm-svn: 112678
2010-08-31 23:50:19 +00:00
Benjamin Kramer
739963f98e Remove noisy semicolon.
llvm-svn: 112673
2010-08-31 23:38:13 +00:00
Kevin Enderby
cc1c9257f6 This is the second of three patches to implement support for the .loc directive
and output the dwarf line number tables.  This takes the current loc info after
an instruction is assembled and saves the needed info into an object that has
vector and for each section.  These objects will be used for the final patch to 
build and emit the encoded dwarf line number tables.  Again for now this is only
in the Mach-O streamer but at some point will move to a more generic place.

llvm-svn: 112668
2010-08-31 22:55:11 +00:00
Devang Patel
46570e6783 Reapply r112623. Included additional check for unused byval argument.
llvm-svn: 112659
2010-08-31 22:22:42 +00:00
Dale Johannesen
49a1560c66 Comment typo.
llvm-svn: 112652
2010-08-31 21:53:15 +00:00
Devang Patel
b94251aea0 Revert r112623. It is causing self host build failures.
llvm-svn: 112631
2010-08-31 19:41:03 +00:00
Devang Patel
414cbc940a Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011.

llvm-svn: 112623
2010-08-31 18:50:09 +00:00
Duncan Sands
2a1c11e104 Stop using the dom frontier in DwarfEHPrepare by not promoting alloca's
any more.  I plan to reimplement alloca promotion using SSAUpdater later.
It looks like Bill's URoR logic really always needs domtree, so the pass
now always asks for domtree info.

llvm-svn: 112597
2010-08-31 09:05:06 +00:00
Owen Anderson
ccaee65189 Rename ValuePropagation to a more descriptive CorrelatedValuePropagation.
llvm-svn: 112591
2010-08-31 07:48:34 +00:00
Michael J. Spencer
b475feaea4 Fix spelling/typo.
llvm-svn: 112585
2010-08-31 06:36:22 +00:00
Bruno Cardoso Lopes
ebe80d78ff zap unused method. x86 is the only user and already has a more powerfull version
llvm-svn: 112571
2010-08-31 02:36:20 +00:00
Dan Gohman
d261381db5 Update the descriptions of NoModRef and ModRef to be consistent
with the descriptions of Mod and Ref.

llvm-svn: 112557
2010-08-30 23:47:24 +00:00
Bob Wilson
826a677f94 Remove NEON vmovn intrinsic, replacing it with vector truncate operations.
Auto-upgrade the old intrinsic and update tests.

llvm-svn: 112507
2010-08-30 20:02:30 +00:00
Eric Christopher
da5541e56d Fix LLVM target initialization to deal with sociopathic outside projects
that like to randomly define things like "X86", regenerate autoconf bits
and update cmake.

Fixes PR7852.

Patch by Xerxes Rånby!

llvm-svn: 112499
2010-08-30 18:34:48 +00:00
Eric Christopher
5f8ae3dbd6 Kill a couple of unused variables.
llvm-svn: 112498
2010-08-30 18:31:44 +00:00
Chris Lattner
e667efb462 nuke dead ivar which was supposed to be committed with r112496
llvm-svn: 112497
2010-08-30 18:16:27 +00:00
Chris Lattner
9e35d96cea two changes: 1) make AliasSet hold the list of call sites with an
assertingvh so we get a violent explosion if the pointer dangles.

2) Fix AliasSetTracker::deleteValue to remove call sites with
   by-pointer comparisons instead of by-alias queries.  Using
   findAliasSetForCallSite can cause alias sets to get merged
   when they shouldn't, and can also miss alias sets when the
   call is readonly.

#2 fixes PR6889, which only repros with a .c file :(

llvm-svn: 112452
2010-08-29 18:42:23 +00:00
Dan Gohman
9ea315c5ca Make IVUsers iterative instead of recursive.
This has the side effect of reversing the order of most of
IVUser's results.

llvm-svn: 112442
2010-08-29 16:40:03 +00:00
Dan Gohman
5110488830 Delete an unused declaration.
llvm-svn: 112424
2010-08-29 14:48:15 +00:00
Chris Lattner
875b659115 Stop explicitly scheduling domfrontier before the loop passes,
since none of them use it.  With this, we now only run 
domfrontier (an N^2 analysis) 3 times at clang -O3: once for 
"early" per-function cleanup, once at the start of the
per-function pipeline to support SRoA, and once late because
the EHPrepare class uses it.

EHPrepare needs to stop using it, this is silly and wasteful.

llvm-svn: 112420
2010-08-29 07:05:51 +00:00
Bob Wilson
807d004452 Remove NEON vaddl, vaddw, vsubl, and vsubw intrinsics. Instead, use llvm
IR add/sub operations with one or both operands sign- or zero-extended.
Auto-upgrade the old intrinsics.

llvm-svn: 112416
2010-08-29 05:57:34 +00:00
Chris Lattner
fac07b1dca implement SSAUpdater::RewriteUseAfterInsertions, a helpful form of RewriteUse.
llvm-svn: 112409
2010-08-29 04:54:06 +00:00
Chris Lattner
ecf276b787 remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.

llvm-svn: 112356
2010-08-28 04:09:24 +00:00
Chris Lattner
4b49ada02c remove the ABCD and SSI passes. They don't have any clients that
I'm aware of, aren't maintained, and LVI will be replacing their value.
nlewycky approved this on irc.

llvm-svn: 112355
2010-08-28 03:51:24 +00:00
Owen Anderson
dc4703bcd5 Add a prototype of a new peephole optimizing pass that uses LazyValue info to simplify PHIs and select's.
This pass addresses the missed optimizations from PR2581 and PR4420.

llvm-svn: 112325
2010-08-27 23:31:36 +00:00
Eric Christopher
67801775eb Fix a couple of typos.
Patch by Cameron Esfahani!

llvm-svn: 112297
2010-08-27 21:38:11 +00:00
Dan Gohman
636c57c5de Switch ScalarEvolution's main Value*->SCEV* map from std::map
to DenseMap.

llvm-svn: 112281
2010-08-27 18:55:03 +00:00
Bob Wilson
c01101e76c Add alignment arguments to all the NEON load/store intrinsics.
Update all the tests using those intrinsics and add support for
auto-upgrading bitcode files with the old versions of the intrinsics.

llvm-svn: 112271
2010-08-27 17:13:24 +00:00
Jim Grosbach
2b81a07dc7 Simplify eliminateFrameIndex() interface back down now that PEI doesn't need
to try to re-use scavenged frame index reference registers. rdar://8277890

llvm-svn: 112241
2010-08-26 23:32:16 +00:00
Jim Grosbach
d21756ab1e tidy up a bit. no functional change.
llvm-svn: 112228
2010-08-26 21:56:30 +00:00
Chris Lattner
57e5760947 add m_BitCast for matching a bitcast.
llvm-svn: 112222
2010-08-26 21:35:52 +00:00
Bruno Cardoso Lopes
6150648a64 zap the now unused MVT::getIntVectorWithNumElements
llvm-svn: 112218
2010-08-26 20:53:12 +00:00
Devang Patel
83384fcb5c Fix prototypes.
llvm-svn: 112200
2010-08-26 17:47:45 +00:00
Dan Gohman
8088d5e31d Reapply r112091 and r111922, support for metadata linking, with a
fix: add a flag to MapValue and friends which indicates whether
any module-level mappings are being made. In the common case of
inlining, no module-level mappings are needed, so MapValue doesn't
need to examine non-function-local metadata, which can be very
expensive in the case of a large module with really deep metadata
(e.g. a large C++ program compiled with -g).

This flag is a little awkward; perhaps eventually it can be moved
into the ClonedCodeInfo class.

llvm-svn: 112190
2010-08-26 15:41:53 +00:00
John McCall
33faad67cc SmallVector's growth policies don't like starting from zero capacity.
I think there are good reasons to change this, but in the interests
of short-term stability, make SmallVector<...,0> reserve non-zero
capacity in its constructors.  This means that SmallVector<...,0>
uses more memory than SmallVector<...,1> and should really only be
used (unless/until this workaround is removed) by clients that
care about using SmallVector with an incomplete type.

llvm-svn: 112147
2010-08-26 02:11:48 +00:00
Dan Gohman
c7605a66b7 Rewrite ExtractGV, removing a bunch of stuff that didn't fully work,
and was over-complicated, and replacing it with a simple implementation.

llvm-svn: 112120
2010-08-26 00:22:55 +00:00
John McCall
0c3659857d Provide an explicit specialization of SmallVector at N=0 which does
not require its type argument to be complete if no members are
actually used.

llvm-svn: 112106
2010-08-25 23:11:24 +00:00
Chris Lattner
36e90f42f3 add a specialization for the MVT form of getTypeAction, since it is
trivial.

llvm-svn: 112105
2010-08-25 23:05:45 +00:00
Chris Lattner
ef3055ca05 remove some llvmcontext arguments that are now dead post-refactoring.
llvm-svn: 112104
2010-08-25 23:00:45 +00:00
Chris Lattner
fe7c4ec039 Change handling of illegal vector types to widen when possible instead of
expanding: e.g. <2 x float> -> <4 x float> instead of -> 2 floats.  This
affects two places in the code: handling cross block values and handling
function return and arguments.  Since vectors are already widened by 
legalizetypes, this gives us much better code and unblocks x86-64 abi
and SPU abi work.

For example, this (which is a silly example of a cross-block value):
define <4 x float> @test2(<4 x float> %A) nounwind {
 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
 %C = fadd <2 x float> %B, %B
  br label %BB
BB:
 %D = fadd <2 x float> %C, %C
 %E = shufflevector <2 x float> %D, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
 ret <4 x float> %E
}

Now compiles into:

_test2:                                 ## @test2
## BB#0:
 addps %xmm0, %xmm0
 addps %xmm0, %xmm0
 ret

previously it compiled into:

_test2:                                 ## @test2
## BB#0:
 addps %xmm0, %xmm0
 pshufd $1, %xmm0, %xmm1
                                        ## kill: XMM0<def> XMM0<kill> XMM0<def>
 insertps $0, %xmm0, %xmm0
 insertps $16, %xmm1, %xmm0
 addps %xmm0, %xmm0
 ret

This implements rdar://8230384

llvm-svn: 112101
2010-08-25 22:49:25 +00:00
Chris Lattner
56bc3bc1af tidy up
llvm-svn: 112099
2010-08-25 22:45:53 +00:00
Eric Christopher
6263463ccb Fix header define to reflect the name of the file.
Patch by Adam Treat!

llvm-svn: 112077
2010-08-25 19:28:39 +00:00
Dan Gohman
6300d80566 lto_codegen_set_gcc_path was removed.
llvm-svn: 112069
2010-08-25 18:37:04 +00:00
Eric Christopher
d0404930db Regenerate.
llvm-svn: 112042
2010-08-25 08:45:06 +00:00
Jim Grosbach
1b102f0b63 Add ARM heuristic for when to allocate a virtual base register for stack
access. rdar://8277890&7352504

llvm-svn: 111968
2010-08-24 21:19:33 +00:00
Kevin Enderby
024b04ad93 First bit of support for the dwarf .loc directive. This patch updates the
needed parsing for the .loc directive and saves the current info from that
into the context.  The next patch will take the current loc info after an
instruction is assembled and save that info into a vector for each section for
use to build the line number tables.  The patch after that will encode the info
from those vectors into the output file as the dwarf line tables.

llvm-svn: 111956
2010-08-24 20:32:42 +00:00
Jim Grosbach
0c3eb7ca50 Move enabling the local stack allocation pass into the target where it belongs.
For now it's still a command line option, but the interface to the generic
code doesn't need to know that.

llvm-svn: 111942
2010-08-24 19:05:43 +00:00
Dan Gohman
30fd721e48 Use MapValue in the Linker instead of having a private function
which does the same thing. This eliminates redundant code and
handles MDNodes better. MDNode linking still doesn't fully
work yet though.

llvm-svn: 111941
2010-08-24 18:50:07 +00:00
Dan Gohman
50869535fc MDNode, MDString, and NamedMDNode are not meant to be subclassed;
make their protected members private. And remove an unnecessary
explicit keyword.

llvm-svn: 111915
2010-08-24 15:34:03 +00:00
Mikhail Glushenkov
8001ceb30e llvmc: Make syntax more consistent.
CompilationGraph and LanguageMap definitions do not use special syntax anymore.

llvm-svn: 111862
2010-08-23 23:21:23 +00:00
Jim Grosbach
33f85d977a Remove the MFI storage of the local allocation block size. It's not needed.
llvm-svn: 111847
2010-08-23 21:29:29 +00:00
Chris Lattner
f0f35c4aea Add a new llvm.x86.int intrinsic, allowing access to the
x86 int and int3 instructions.  Patch by Peter Housel!

llvm-svn: 111831
2010-08-23 19:39:25 +00:00
Mikhail Glushenkov
14e2900dfd llvmc: Properly handle (error) in edge properties.
llvm-svn: 111827
2010-08-23 19:24:08 +00:00
Mikhail Glushenkov
7128448296 Trailing whitespace.
llvm-svn: 111825
2010-08-23 19:23:54 +00:00
Dan Gohman
602bb31883 formatted_tool_output_file::close needs to flush its buffer before
closing the underlying stream.

llvm-svn: 111822
2010-08-23 18:43:24 +00:00
Devang Patel
cf6c6b4038 Handle qualified constants that are directly folded by FE.
PR 7920.

llvm-svn: 111820
2010-08-23 18:25:56 +00:00
Benjamin Kramer
926ba6058b Avoid O(n*m) complexity in StringRef::find_first(_not)_of(StringRef).
- Cache used characters in a bitset to reduce memory overhead to just 32 bytes.
- On my core2 this code is faster except when the checked string was very short
  (smaller than the list of delimiters).

llvm-svn: 111817
2010-08-23 18:16:08 +00:00
Benjamin Kramer
e4c21a06f7 StringRef tweaks:
- Respect find_first_of(char's From parameter instead of silently dropping it.
- Prefer std::string() to std::string("")

llvm-svn: 111814
2010-08-23 17:44:13 +00:00
Michael J. Spencer
18689045ce MC: Add partial x86-64 support to COFF.
llvm-svn: 111728
2010-08-21 05:58:13 +00:00
Bruno Cardoso Lopes
28d9071635 This is the first step towards refactoring the x86 vector shuffle code. The
general idea here is to have a group of x86 target specific nodes which are
going to be selected during lowering and then directly matched in isel.

The commit includes the addition of those specific nodes and a *bunch* of
patterns, and incrementally we're going to switch between them and what we
have right now. Both the patterns and target specific nodes can change as
we move forward with this work.

llvm-svn: 111691
2010-08-20 22:55:05 +00:00
Dan Gohman
31ab7e6b8c CreateTemporaryType doesn't needs its Context argument.
llvm-svn: 111687
2010-08-20 22:39:47 +00:00
Bill Wendling
163660135e Create the new linker type "linker_private_weak_def_auto".
It's similar to "linker_private_weak", but it's known that the address of the
object is not taken. For instance, functions that had an inline definition, but
the compiler decided not to inline it. Note, unlike linker_private and
linker_private_weak, linker_private_weak_def_auto may have only default
visibility.  The symbols are removed by the linker from the final linked image
(executable or dynamic library).

llvm-svn: 111684
2010-08-20 22:05:50 +00:00
Dan Gohman
072e7bdcd4 Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.

llvm-svn: 111681
2010-08-20 22:02:26 +00:00
Dan Gohman
63286950ea Reword NamedMDNode's comment.
llvm-svn: 111663
2010-08-20 18:22:57 +00:00
Dan Gohman
730afb791f Delete SlowOperationInformer, which is no longer used.
llvm-svn: 111661
2010-08-20 18:07:37 +00:00
Mikhail Glushenkov
e351eb2c3a Add include guards to Support/Regex.h.
If the omission was intentional, please add a comment.

llvm-svn: 111657
2010-08-20 17:38:44 +00:00
Mikhail Glushenkov
034e27c664 Trailing whitespace.
llvm-svn: 111656
2010-08-20 17:38:38 +00:00
Jim Grosbach
079599c699 Add explicit initializer for UseLocalStackAllocationBlock in MFI constructor
llvm-svn: 111655
2010-08-20 17:34:22 +00:00
Dan Gohman
20fe555d22 Delete raw_stdout_ostream and raw_stderr_ostream, which are unused
outside of outs() and errs() themselves, and they don't really
need custom classes.

llvm-svn: 111642
2010-08-20 16:39:41 +00:00
Dan Gohman
3a66b58b4f Add an inspirational quote.
llvm-svn: 111641
2010-08-20 16:36:19 +00:00
Dan Gohman
d4746301ab Add a comment.
llvm-svn: 111640
2010-08-20 16:35:30 +00:00
Dan Gohman
4d1241b6b6 Move raw_ostream's Error flag into raw_fd_ostream, as that's the only
class which is using it.

llvm-svn: 111639
2010-08-20 16:34:20 +00:00
Dan Gohman
4407d184e9 Export error-handling functions in formatted_tool_output_file.
llvm-svn: 111638
2010-08-20 16:27:38 +00:00
Erick Tryzelaar
68c31295f7 Expose LLVMSetOperand and LLVMGetNumOperands to llvm-c and ocaml.
llvm-svn: 111625
2010-08-20 14:51:22 +00:00
Mikhail Glushenkov
63df898925 llvmc: Cut global namespace pollution.
llvm-svn: 111619
2010-08-20 11:24:44 +00:00
Mikhail Glushenkov
0d337cfe16 Disambiguate calls to WriteGraph() to disable ADL.
llvm-svn: 111618
2010-08-20 11:24:35 +00:00
Mikhail Glushenkov
962164363e Trailing whitespace.
llvm-svn: 111617
2010-08-20 11:24:31 +00:00
Bob Wilson
0039bc228b Replace the arm.neon.vmovls and vmovlu intrinsics with vector sign-extend and
zero-extend operations.

llvm-svn: 111614
2010-08-20 04:54:02 +00:00
Dan Gohman
d88735e805 Introduce a new tool_output_file class, which extends raw_ostream with
functionality that most command-line tools need: ensuring that the
output file gets deleted if the tool is interrupted or encounters an
error.

llvm-svn: 111595
2010-08-20 00:48:10 +00:00
Jim Grosbach
4e6f40561f Better handling of offsets on frame index references. rdar://8277890
llvm-svn: 111585
2010-08-19 23:52:25 +00:00
Bob Wilson
0498520f7c Update comment to remove special case for vector extending loads. An
extending vector load should extend each element in the same way as the
corresponding scalar extending load.

llvm-svn: 111577
2010-08-19 23:39:00 +00:00
Eric Christopher
6c9edbff19 Re-re-revert this patch. It seems to be causing performance
and correctness regressions.

llvm-svn: 111527
2010-08-19 17:21:10 +00:00
Jim Grosbach
d6e0ffd95b Update local stack block allocation to let PEI do the allocs if no additional
base registers were required. This will allow for slightly better packing
of the locals when alignment padding is necessary after callee saved registers.

llvm-svn: 111508
2010-08-19 02:47:08 +00:00
Dan Gohman
bb27588b3f Revert r111199; it breaks -debug-pass=Structure output.
llvm-svn: 111500
2010-08-19 01:29:07 +00:00
Eric Christopher
3f1dd52a7c Reapply the virtual register patch from 109102. The places where we were
depending on the number of virtual registers appear to have all been handled
now.

llvm-svn: 111499
2010-08-19 01:25:50 +00:00
Alexis Hunt
068811ea03 Finish full attribute class emission for clang.
For more information, see the accompanying clang patch.

llvm-svn: 111454
2010-08-18 23:23:09 +00:00
Dan Gohman
95e334dbca Make raw_fd_ostream consider itself the owner of STDOUT_FILENO when
constructed with an output filename of "-". In particular, allow the
file descriptor to be closed, and close the file descriptor in the
destructor if it hasn't been explicitly closed already, to ensure
that any write errors are detected.

llvm-svn: 111436
2010-08-18 22:26:19 +00:00
Chris Lattner
bd80bd5d69 move gep decomposition out of ValueTracking into BasicAA. The form of
decomposition that it is doing is very basicaa specific and is only used
by basicaa.

Now with less tree breakingness.

llvm-svn: 111433
2010-08-18 22:07:29 +00:00
Dan Gohman
9b5ed21492 Introduce a ScopedFatalErrorHandler class to make it easy to register
fatal error handlers which automatically get unregistered at the end
of a scope.

llvm-svn: 111398
2010-08-18 20:16:39 +00:00
Jakob Stoklund Olesen
a94deec1c0 Revert r111394. It was too aggressive.
We must complete the DFS, otherwise we might miss needed phi-defs, and
prematurely color live ranges with a non-dominating value.

This is not a big deal since we get to color more of the CFG and the next
mapValue call will be faster.

llvm-svn: 111397
2010-08-18 20:06:05 +00:00
Jakob Stoklund Olesen
221c0b3c75 Aggressively prune the DFS when inserting phi-defs.
llvm-svn: 111394
2010-08-18 19:00:11 +00:00
Jakob Stoklund Olesen
d16fd86de1 Add df_iterator::getPathLength and getPath as a way of getting a path from the
entry node to the current node.

llvm-svn: 111392
2010-08-18 19:00:05 +00:00
Daniel Dunbar
3d68ce9eeb Revert r111375, "move gep decomposition out of ValueTracking into BasicAA. The
form of", it doesn't pass tests.

llvm-svn: 111385
2010-08-18 18:43:08 +00:00
Owen Anderson
65795241db Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer issues.
llvm-svn: 111382
2010-08-18 18:39:01 +00:00
Chris Lattner
2d584f0b0e move gep decomposition out of ValueTracking into BasicAA. The form of
decomposition that it is doing is very basicaa specific and is only used
by basicaa.

llvm-svn: 111375
2010-08-18 18:22:17 +00:00
Jim Grosbach
b517fe948f Add hook for re-using virtual base registers for local stack slot access.
Nothing fancy, just ask the target if any currently available base reg
is in range for the instruction under consideration and use the first one
that is. Placeholder ARM implementation simply returns false for now.

ongoing saga of rdar://8277890

llvm-svn: 111374
2010-08-18 17:57:37 +00:00
Chris Lattner
25446ccf9f don't emit zero bit fields with Emit, fixing undefined behavior,
PR7778

llvm-svn: 111336
2010-08-18 00:29:18 +00:00
Chris Lattner
c27b10f80d Don't pass in a null pointer to std::string's ctor, an empty string
ref should produce an empty std::string.  This fixes PR7879.

llvm-svn: 111332
2010-08-18 00:11:25 +00:00
Jim Grosbach
ff8f931bbf Add materialization of virtual base registers for frame indices allocated into
the local block. Resolve references to those indices to a new base register.
For simplification and testing purposes, a new virtual base register is
allocated for each frame index being resolved. The result is truly horrible,
but correct, code that's good for exercising the new code paths.

Next up is adding thumb1 support, which should be very simple. Following that
will be adding base register re-use and implementing a reasonable ARM
heuristic for when a virtual base register should be generated at all.

llvm-svn: 111315
2010-08-17 22:41:55 +00:00
Daniel Dunbar
b5312b0f26 CrashRecovery: Add CrashRecoveryContext::GetCurrent(), so clients can find the active context from anywhere.
llvm-svn: 111308
2010-08-17 22:32:37 +00:00
Daniel Dunbar
0fc35d7284 CrashRecovery: Make CrashRecoveryContext static methods thread safe.
llvm-svn: 111307
2010-08-17 22:32:34 +00:00
Anton Korobeynikov
8c6bfd1c24 Add some win64 coff goodness.
Patch by Cameron Esfahani!

llvm-svn: 111287
2010-08-17 21:05:54 +00:00
Benjamin Kramer
1e37b165c8 Sketch i386 relocations handling, from Roman Divacky.
Hello world builds & runs now on i386/ELF with -integrated-as.

llvm-svn: 111264
2010-08-17 18:20:28 +00:00