oota-llvm.git
14 years agomake findDebugLoc a class method
Dale Johannesen [Wed, 20 Jan 2010 21:36:02 +0000 (21:36 +0000)]
make findDebugLoc a class method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94032 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosplit function stub printing out to its own function,
Chris Lattner [Wed, 20 Jan 2010 21:19:44 +0000 (21:19 +0000)]
split function stub printing out to its own function,
no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94030 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate the GVStubs and HiddenGVStubs maps, and use
Chris Lattner [Wed, 20 Jan 2010 21:16:14 +0000 (21:16 +0000)]
eliminate the GVStubs and HiddenGVStubs maps, and use
MachineModuleInfoMachO instead.  This eliminates two sources
of nondeterministic output in the ppc backend, but function
stubs are still bad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94029 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodon't forget to initialize an instance variable!
Chris Lattner [Wed, 20 Jan 2010 20:48:59 +0000 (20:48 +0000)]
don't forget to initialize an instance variable!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94021 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen XDEBUG is enabled, check for SelectionDAG cycles at some key
David Greene [Wed, 20 Jan 2010 20:13:31 +0000 (20:13 +0000)]
When XDEBUG is enabled, check for SelectionDAG cycles at some key
points.  This will help us find future problems like the one
described in PR6019.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94019 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadopt getAdjustedAnalysisPointer in a few more passes.
Chris Lattner [Wed, 20 Jan 2010 20:09:02 +0000 (20:09 +0000)]
adopt getAdjustedAnalysisPointer in a few more passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94018 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadopt getAdjustedAnalysisPointer in two more passes.
Chris Lattner [Wed, 20 Jan 2010 19:53:32 +0000 (19:53 +0000)]
adopt getAdjustedAnalysisPointer in two more passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94017 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadopt getAdjustedAnalysisPointer in BasicCallGraph.
Chris Lattner [Wed, 20 Jan 2010 19:51:46 +0000 (19:51 +0000)]
adopt getAdjustedAnalysisPointer in BasicCallGraph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94015 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd some new methods to adjust this pointers. Not used yet.
Chris Lattner [Wed, 20 Jan 2010 19:26:14 +0000 (19:26 +0000)]
add some new methods to adjust this pointers.  Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94013 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a helper method.
Chris Lattner [Wed, 20 Jan 2010 19:25:45 +0000 (19:25 +0000)]
add a helper method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94012 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodon't send null pointers through the constantexpr codepath unneededly.
Chris Lattner [Wed, 20 Jan 2010 17:57:50 +0000 (17:57 +0000)]
don't send null pointers through the constantexpr codepath unneededly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94010 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoreduce redundant are's.
Chris Lattner [Wed, 20 Jan 2010 17:53:51 +0000 (17:53 +0000)]
reduce redundant are's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94008 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove per-function inline threshold calculation to a method.
Jakob Stoklund Olesen [Wed, 20 Jan 2010 17:51:28 +0000 (17:51 +0000)]
Move per-function inline threshold calculation to a method.

No functional change except the forgotten test for
InlineLimit.getNumOccurrences() == 0 in the CurrentThreshold2 calculation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94007 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agouse getGlobalDirective(), don't hardcode .globl. PR6093
Chris Lattner [Wed, 20 Jan 2010 17:50:30 +0000 (17:50 +0000)]
use getGlobalDirective(), don't hardcode .globl.  PR6093

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94006 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix an infinite recursion problem. dbgs() should return errs() in
David Greene [Wed, 20 Jan 2010 15:27:19 +0000 (15:27 +0000)]
Fix an infinite recursion problem.  dbgs() should return errs() in
release mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94001 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate some uses of AsmPrinter::EmitIntXXX
Chris Lattner [Wed, 20 Jan 2010 07:41:15 +0000 (07:41 +0000)]
eliminate some uses of AsmPrinter::EmitIntXXX

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93996 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBackout r93990
Victor Hernandez [Wed, 20 Jan 2010 07:37:49 +0000 (07:37 +0000)]
Backout r93990

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93995 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoinline and radically simplify printDataDirective. It will eventually
Chris Lattner [Wed, 20 Jan 2010 07:33:29 +0000 (07:33 +0000)]
inline and radically simplify printDataDirective.  It will eventually
go completely away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93994 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoemit basic block labels with mcstreamer.
Chris Lattner [Wed, 20 Jan 2010 07:24:05 +0000 (07:24 +0000)]
emit basic block labels with mcstreamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93993 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoemit integer and fp zeros as (e.g.) .byte 0 instead of .space 1,
Chris Lattner [Wed, 20 Jan 2010 07:19:19 +0000 (07:19 +0000)]
emit integer and fp zeros as (e.g.) .byte 0 instead of .space 1,
for tidiness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93992 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosignficant cleanups to EmitGlobalConstant (including streamerization
Chris Lattner [Wed, 20 Jan 2010 07:11:32 +0000 (07:11 +0000)]
signficant cleanups to EmitGlobalConstant (including streamerization
of int initializers), change some methods to be static functions,
use raw_ostream::write_hex instead of a smallstring dance with
APValue::toStringUnsigned(S, 16).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93991 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix/strengthen verification of llvm.dbg.declare
Victor Hernandez [Wed, 20 Jan 2010 06:57:02 +0000 (06:57 +0000)]
Fix/strengthen verification of llvm.dbg.declare

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93990 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch Elts from vector to SmallVector
Victor Hernandez [Wed, 20 Jan 2010 06:56:16 +0000 (06:56 +0000)]
Switch Elts from vector to SmallVector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93989 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoswitch ConstantFP emission to use MCStreamer, significantly
Chris Lattner [Wed, 20 Jan 2010 06:53:37 +0000 (06:53 +0000)]
switch ConstantFP emission to use MCStreamer, significantly
simplifying the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93988 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomake mcasmstreamer handle expanding 8 byte integer constants to
Chris Lattner [Wed, 20 Jan 2010 06:45:39 +0000 (06:45 +0000)]
make mcasmstreamer handle expanding 8 byte integer constants to
4-byte constants if .quad isn't supported.  Switch a bunch of
methods used by the dwarf writer to use OutStreamer.EmitIntValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93987 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agogive createAsmStreamer an 'isLittleEndian' argument.
Chris Lattner [Wed, 20 Jan 2010 06:39:07 +0000 (06:39 +0000)]
give createAsmStreamer an 'isLittleEndian' argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93986 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorevert 93934, removing the MCAsmInfo endianness bit. I can't
Chris Lattner [Wed, 20 Jan 2010 06:34:14 +0000 (06:34 +0000)]
revert 93934, removing the MCAsmInfo endianness bit.  I can't
stomache MCAsmInfo having this, and I found a better solution to
this layering issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93985 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix if/else brackets; getFunctionForValue() is to be called for non-metadata values
Victor Hernandez [Wed, 20 Jan 2010 06:22:33 +0000 (06:22 +0000)]
Fix if/else brackets; getFunctionForValue() is to be called for non-metadata values

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93984 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix the conditions to unambiguously show the logic they represent. This is the
Chandler Carruth [Wed, 20 Jan 2010 06:01:02 +0000 (06:01 +0000)]
Fix the conditions to unambiguously show the logic they represent. This is the
logic enforced in the test case as well, so hopefully it is correct. Please
review Victor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93980 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMap operands of all function-local metadata, not just metadata passed to llvm.dbg...
Victor Hernandez [Wed, 20 Jan 2010 05:49:59 +0000 (05:49 +0000)]
Map operands of all function-local metadata, not just metadata passed to llvm.dbg.declare intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93979 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid unnecessary Elts array
Victor Hernandez [Wed, 20 Jan 2010 05:44:11 +0000 (05:44 +0000)]
Avoid unnecessary Elts array

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93978 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRefactor common parts of MDNode::getFunction() and assertLocalFunction() into getFunc...
Victor Hernandez [Wed, 20 Jan 2010 04:45:57 +0000 (04:45 +0000)]
Refactor common parts of MDNode::getFunction() and assertLocalFunction() into getFunctionForValue()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93977 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf a instruction belongs to another function (and not current function) as per debug...
Devang Patel [Wed, 20 Jan 2010 02:05:23 +0000 (02:05 +0000)]
If a instruction belongs to another function (and not current function) as per debug info attached with the instruction then ignore the dangling lexical scope of this instruction. Such scopes are unreachable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93967 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd some asserts to check SelectionDAG problems earlier.
David Greene [Wed, 20 Jan 2010 00:59:23 +0000 (00:59 +0000)]
Add some asserts to check SelectionDAG problems earlier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93960 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFor 'install-clang' target, also traverse tools/clang/lib/Runtime.
Daniel Dunbar [Wed, 20 Jan 2010 00:43:07 +0000 (00:43 +0000)]
For 'install-clang' target, also traverse tools/clang/lib/Runtime.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93958 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove findDebugLoc somewhere more central. Fix
Dale Johannesen [Wed, 20 Jan 2010 00:19:24 +0000 (00:19 +0000)]
Move findDebugLoc somewhere more central.  Fix
more cases where debug declarations affect
debug line info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93953 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFold (add x, shl(0 - y, n)) -> sub(x, shl(y, n)), to simplify some code
Dan Gohman [Tue, 19 Jan 2010 23:30:49 +0000 (23:30 +0000)]
Fold (add x, shl(0 - y, n)) -> sub(x, shl(y, n)), to simplify some code
that SCEVExpander can produce when running on behalf of LSR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93949 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWrap some comments to 80 columns.
Bob Wilson [Tue, 19 Jan 2010 22:56:26 +0000 (22:56 +0000)]
Wrap some comments to 80 columns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93940 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake SCEVAddRecExpr's getType return a pointer type when the add
Dan Gohman [Tue, 19 Jan 2010 22:53:50 +0000 (22:53 +0000)]
Make SCEVAddRecExpr's getType return a pointer type when the add
has a pointer member. This helps reduce unnecessary bitcasting
and uglygeps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93939 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a case where debug_value was perturbing the
Dale Johannesen [Tue, 19 Jan 2010 22:50:05 +0000 (22:50 +0000)]
Fix a case where debug_value was perturbing the
line number info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93937 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen doing address-mode sinking, expand the base register first, rather
Dan Gohman [Tue, 19 Jan 2010 22:45:06 +0000 (22:45 +0000)]
When doing address-mode sinking, expand the base register first, rather
than the scaled register. This makes it more likely that subsequent
AddrModeMatcher queries will match the new address the same way as the
old, instead of accidentally matching what had been the base register
as the new scaled register, and then failing to match the scaled register.
This fixes some problems with address-mode sinking multiple muls into a
block, which will be a lot more common with some upcoming
LoopStrengthReduction changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93935 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agogive MCAsmInfo a 'has little endian' bit. This is unfortunate, but
Chris Lattner [Tue, 19 Jan 2010 22:42:28 +0000 (22:42 +0000)]
give MCAsmInfo a 'has little endian' bit.  This is unfortunate, but
I really want clients of the streamer to be able to say "emit this
64-bit integer" and have it get broken down right by the streamer.

I may change this in the future, we'll see how it works out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93934 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a comment and tidy up some whitespace.
Dan Gohman [Tue, 19 Jan 2010 22:27:22 +0000 (22:27 +0000)]
Add a comment and tidy up some whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93932 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a typo and an 80-column violation in comments.
Dan Gohman [Tue, 19 Jan 2010 22:26:02 +0000 (22:26 +0000)]
Fix a typo and an 80-column violation in comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93931 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoGive ScalarEvolution access to the DominatorTree. It'll need this
Dan Gohman [Tue, 19 Jan 2010 22:21:27 +0000 (22:21 +0000)]
Give ScalarEvolution access to the DominatorTree. It'll need this
to make more intellegent AddRec folding decisions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93930 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify the rest of fp constant printing.
Chris Lattner [Tue, 19 Jan 2010 22:16:33 +0000 (22:16 +0000)]
simplify the rest of fp constant printing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93929 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify the code for printing x86 long double, don't do work
Chris Lattner [Tue, 19 Jan 2010 22:11:05 +0000 (22:11 +0000)]
simplify the code for printing x86 long double, don't do work
for -fverbose-asm unless it's on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93926 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIdentify predicate and optional-def operands when printing machine
Jakob Stoklund Olesen [Tue, 19 Jan 2010 22:08:34 +0000 (22:08 +0000)]
Identify predicate and optional-def operands when printing machine
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93925 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a new EmitIntValue method that MCStreamer impls can optionally define
Chris Lattner [Tue, 19 Jan 2010 22:03:38 +0000 (22:03 +0000)]
add a new EmitIntValue method that MCStreamer impls can optionally define
and that clients can use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93923 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a new helper function to IVUsers for returning the "canonical"
Dan Gohman [Tue, 19 Jan 2010 21:55:32 +0000 (21:55 +0000)]
Add a new helper function to IVUsers for returning the "canonical"
form of an expression. This is the expression without the
post-increment adjustment made, which is useful in determining
which registers will be used by the expansion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93921 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd nounwinds.
Dan Gohman [Tue, 19 Jan 2010 21:51:51 +0000 (21:51 +0000)]
Add nounwinds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93919 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate AsmPrinter::EmitZeros: just use MCStreamer directly.
Chris Lattner [Tue, 19 Jan 2010 21:51:22 +0000 (21:51 +0000)]
eliminate AsmPrinter::EmitZeros: just use MCStreamer directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93918 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPromoted the getTok() method to MCAsmParser so that
Sean Callanan [Tue, 19 Jan 2010 21:44:56 +0000 (21:44 +0000)]
Promoted the getTok() method to MCAsmParser so that
the two token accessor functions are declared consistently.
Modified the clients of MCAsmParser to reflect this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93916 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStubs for getHostCPUFeatures API. This implements part of PR5389.
Xerxes Ranby [Tue, 19 Jan 2010 21:26:05 +0000 (21:26 +0000)]
Stubs for getHostCPUFeatures API. This implements part of PR5389.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93913 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove predicates when changing an add into an unpredicable mov.
Jakob Stoklund Olesen [Tue, 19 Jan 2010 21:08:28 +0000 (21:08 +0000)]
Remove predicates when changing an add into an unpredicable mov.

Since the mov is executed unconditionally, make sure that the add didn't have
any predicate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93909 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate CMake list.
Benjamin Kramer [Tue, 19 Jan 2010 20:59:04 +0000 (20:59 +0000)]
Update CMake list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93905 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd some new debugging APIs to print out "raw" SelectionDAGs to make
David Greene [Tue, 19 Jan 2010 20:37:34 +0000 (20:37 +0000)]
Add some new debugging APIs to print out "raw" SelectionDAGs to make
understanding CannotYTetSelect and other errors easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93901 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPropagated the parser-side Lex function's declaration to
Sean Callanan [Tue, 19 Jan 2010 20:27:46 +0000 (20:27 +0000)]
Propagated the parser-side Lex function's declaration to
MCAsmParser, and changed the target-specific AsmParsers
to use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93900 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdded a Lex function to the AsmParser, to allow handling
Sean Callanan [Tue, 19 Jan 2010 20:22:31 +0000 (20:22 +0000)]
Added a Lex function to the AsmParser, to allow handling
of include directives to occur within the parser itself.
This will break the lexer's dependency on a SourceMgr as
input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93899 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a bug introduced on r92564 where the name "Node" was already
Bruno Cardoso Lopes [Tue, 19 Jan 2010 19:57:07 +0000 (19:57 +0000)]
Fix a bug introduced on r92564 where the name "Node" was already
in use by Mips.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93897 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoGeneralize mcasmstreamer data emission APIs to take an address space
Chris Lattner [Tue, 19 Jan 2010 19:46:13 +0000 (19:46 +0000)]
Generalize mcasmstreamer data emission APIs to take an address space
identifier.  There is no way to work around it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93896 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not extend extension results beyond the use of a PHI instruction at the start...
Evan Cheng [Tue, 19 Jan 2010 19:45:51 +0000 (19:45 +0000)]
Do not extend extension results beyond the use of a PHI instruction at the start of a use block. A PHI use is expected to kill its source values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93895 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorefactor code to be static functions instead of methods on AsmPrinter.
Chris Lattner [Tue, 19 Jan 2010 19:10:44 +0000 (19:10 +0000)]
refactor code to be static functions instead of methods on AsmPrinter.
This fixes some bugs handling address spaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93891 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomcstreamerize AsmPrinter::EmitZeros, at least when emitting to the
Chris Lattner [Tue, 19 Jan 2010 18:58:52 +0000 (18:58 +0000)]
mcstreamerize AsmPrinter::EmitZeros, at least when emitting to the
default address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93890 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd an MCAsmStreamer::EmitFill specialization of EmitFill that
Chris Lattner [Tue, 19 Jan 2010 18:52:28 +0000 (18:52 +0000)]
add an MCAsmStreamer::EmitFill specialization of EmitFill that
emits one directive instead of N.  Not doing this would be a
significant regression on the # bytes generated by .fill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93889 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a "MCStreamer::EmitFill" method, and move the default implementation
Chris Lattner [Tue, 19 Jan 2010 18:45:47 +0000 (18:45 +0000)]
add a "MCStreamer::EmitFill" method, and move the default implementation
(which just iteratively emits bytes) to MCStreamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93888 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove MAI::ZeroDirectiveSuffix, which is only used by MASM,
Chris Lattner [Tue, 19 Jan 2010 18:37:01 +0000 (18:37 +0000)]
remove MAI::ZeroDirectiveSuffix, which is only used by MASM,
which we don't support anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93886 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFor aligned load/store instructions, it's only required to know whether a
Jim Grosbach [Tue, 19 Jan 2010 18:31:11 +0000 (18:31 +0000)]
For aligned load/store instructions, it's only required to know whether a
function can support dynamic stack realignment. That's a much easier question
to answer at instruction selection stage than whether the function actually
will have dynamic alignment prologue. This allows the removal of the
stack alignment heuristic pass, and improves code quality for cases where
the heuristic would result in dynamic alignment code being generated when
it was not strictly necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93885 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agooptimize ~(~X >>s Y) --> (X >>s Y), patch by Edmund Grimley
Chris Lattner [Tue, 19 Jan 2010 18:16:19 +0000 (18:16 +0000)]
optimize ~(~X >>s Y) --> (X >>s Y), patch by Edmund Grimley
Evans!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93884 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOn pic function calls some arguments were marked dead and
Bruno Cardoso Lopes [Tue, 19 Jan 2010 17:00:43 +0000 (17:00 +0000)]
On pic function calls some arguments were marked dead and
the instruction to load those args removed. This fix PR6071

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93880 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThe change in r90189 adds a link in a directory outside the iPhone platform
Bob Wilson [Tue, 19 Jan 2010 16:42:10 +0000 (16:42 +0000)]
The change in r90189 adds a link in a directory outside the iPhone platform
directory when building the llvmCore_Embedded project.  Fix this by putting
the iPhone platform directory into DEST_DIR instead of DEST_ROOT.  I also
noticed what appears to be an unintentional use of DEVELOPER_BIN instead of
DEVELOPER_DIR, so I fixed that and changed to use DEVELOPER_DIR in some places
that were hardcoded to "Developer".  Finally, the other changes here allowed
some refactoring and simplification, which I have done.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93878 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoload f64 +0.0 in a cleaner way. This fix part of PR5445
Bruno Cardoso Lopes [Tue, 19 Jan 2010 12:53:04 +0000 (12:53 +0000)]
load f64 +0.0 in a cleaner way. This fix part of PR5445

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93876 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix return registers for mips eabi
Bruno Cardoso Lopes [Tue, 19 Jan 2010 12:37:35 +0000 (12:37 +0000)]
Fix return registers for mips eabi

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93875 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomcstreamer'ize the rest of EmitGlobalVariable that is used on
Chris Lattner [Tue, 19 Jan 2010 06:41:24 +0000 (06:41 +0000)]
mcstreamer'ize the rest of EmitGlobalVariable that is used on
darwin.  The next big piece to get global variables streamerized
is EmitGlobalConstant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93870 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodon't let asm-verbose break the check-next lines in these tests.
Chris Lattner [Tue, 19 Jan 2010 06:39:54 +0000 (06:39 +0000)]
don't let asm-verbose break the check-next lines in these tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93869 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agostop using the .lcomm pseudoop on darwin, instead, directly use the
Chris Lattner [Tue, 19 Jan 2010 06:25:51 +0000 (06:25 +0000)]
stop using the .lcomm pseudoop on darwin, instead, directly use the
.zerofill directive.  Streamerize its generation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93868 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix parsing .comm directives on systems which do not represent alignments
Chris Lattner [Tue, 19 Jan 2010 06:22:22 +0000 (06:22 +0000)]
fix parsing .comm directives on systems which do not represent alignments
as a power of 2.  This fixes MC/AsmParser/directive_comm.s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93867 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoonly darwin has zerofill
Chris Lattner [Tue, 19 Jan 2010 06:21:23 +0000 (06:21 +0000)]
only darwin has zerofill

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93866 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMDNodes are not expected to disappear or replaced by another MDNode, so there is...
Devang Patel [Tue, 19 Jan 2010 06:19:05 +0000 (06:19 +0000)]
MDNodes are not expected to disappear or replaced by another MDNode, so there is no need to pay the cost of WeakVH and ValueMaps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93865 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid including DebugInfo.h in AsmPrinter.h
Devang Patel [Tue, 19 Jan 2010 06:09:04 +0000 (06:09 +0000)]
Avoid including DebugInfo.h in AsmPrinter.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93864 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agozap the ARM version of PrintGlobalVariable, which I missed.
Chris Lattner [Tue, 19 Jan 2010 06:08:15 +0000 (06:08 +0000)]
zap the ARM version of PrintGlobalVariable, which I missed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93863 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomc'ize some stuff, don't comment out .lcomm directive in -fverbose-asm mode.
Chris Lattner [Tue, 19 Jan 2010 06:01:04 +0000 (06:01 +0000)]
mc'ize some stuff, don't comment out .lcomm directive in -fverbose-asm mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93860 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofactor this code better.
Chris Lattner [Tue, 19 Jan 2010 05:51:42 +0000 (05:51 +0000)]
factor this code better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93859 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoNow that we have everything nicely factored (e.g. asmprinter is not
Chris Lattner [Tue, 19 Jan 2010 05:38:33 +0000 (05:38 +0000)]
Now that we have everything nicely factored (e.g. asmprinter is not
doing global variable classification anymore) and hookized, sink almost
all target targets global variable emission code into AsmPrinter and out
of each target.

Some notes:

1. PIC16 does completely custom and crazy stuff, so it is not changed.
2. XCore has some custom handling for extra directives.  I'll look at it next.
3. This switches linux/ppc to use .globl instead of .global.  If .globl is
   actually wrong, let me know and I'll fix it.
4. This makes linux/ppc get a lot of random cases right which were obviously
   wrong before, it is probably now a bit healthier.
5. Blackfin will probably start getting .comm and other things that it didn't
   before.  If this is undesirable, it should explicitly opt out of these
   things by clearing the relevant fields of MCAsmInfo.

This leads to a nice diffstat:
 14 files changed, 127 insertions(+), 830 deletions(-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93858 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agouse %object like other elf targets, gas accepts either.
Chris Lattner [Tue, 19 Jan 2010 05:25:38 +0000 (05:25 +0000)]
use %object like other elf targets, gas accepts either.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93857 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify the mips target to print .size and .type for c strings
Chris Lattner [Tue, 19 Jan 2010 05:23:59 +0000 (05:23 +0000)]
simplify the mips target to print .size and .type for c strings
just like all other elf targets.  Bruno, if this isn't right, please
let me know + why :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93856 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agohookize the cygwin ".linkonce" directive.
Chris Lattner [Tue, 19 Jan 2010 05:08:13 +0000 (05:08 +0000)]
hookize the cygwin ".linkonce" directive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93855 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomore cleanups. Emit the .local directive even on cygwin/mingw.
Chris Lattner [Tue, 19 Jan 2010 04:59:55 +0000 (04:59 +0000)]
more cleanups.  Emit the .local directive even on cygwin/mingw.
I'm not sure that this is correct, but it causes no test failures,
and just emitting a .comm without protecting its linkage somehow
is surely not right.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93854 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosome cleanups
Chris Lattner [Tue, 19 Jan 2010 04:53:18 +0000 (04:53 +0000)]
some cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93853 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".
Chris Lattner [Tue, 19 Jan 2010 04:48:20 +0000 (04:48 +0000)]
add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93852 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agohoist handling of external globals and special globals up to common code.
Chris Lattner [Tue, 19 Jan 2010 04:39:15 +0000 (04:39 +0000)]
hoist handling of external globals and special globals up to common code.
This makes a similar code dead in all the other targets, I'll clean it up
in a bit.

This also moves handling of lcomm up before acquisition of a section,
since lcomm never needs a section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93851 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove production of .reference directives for static ctor/dtor list on
Chris Lattner [Tue, 19 Jan 2010 04:34:02 +0000 (04:34 +0000)]
move production of .reference directives for static ctor/dtor list on
darwin into common code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93849 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a crash in scalarrepl for memcpy/memmove where the source and destination
Bob Wilson [Tue, 19 Jan 2010 04:32:48 +0000 (04:32 +0000)]
Fix a crash in scalarrepl for memcpy/memmove where the source and destination
are the same.  I had already fixed a similar problem where the source and
destination were different bitcasts derived from the same alloca, but the
previous fix still did not handle the case where both operands are exactly
the same value.  Radar 7552893.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93848 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agouse BSSLocal classifier to identify 'lcomm' data instead of
Chris Lattner [Tue, 19 Jan 2010 04:21:20 +0000 (04:21 +0000)]
use BSSLocal classifier to identify 'lcomm' data instead of
duplicating the logic (differently) in lots of different targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93847 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomake TLOF subclassify BSS based on linkage type into private, external
Chris Lattner [Tue, 19 Jan 2010 04:15:51 +0000 (04:15 +0000)]
make TLOF subclassify BSS based on linkage type into private, external
and everything else (weak).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93846 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agonow that elf weak bss symbols are handled correctly, simplify a bunch of code.
Chris Lattner [Tue, 19 Jan 2010 03:13:44 +0000 (03:13 +0000)]
now that elf weak bss symbols are handled correctly, simplify a bunch of code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93845 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a significant difference between llvm and gcc on ELF systems:
Chris Lattner [Tue, 19 Jan 2010 03:06:01 +0000 (03:06 +0000)]
fix a significant difference between llvm and gcc on ELF systems:
GCC would put weak zero initialized mutable data in the .bss section,
we would put it into a crasy '.gnu.linkonce.b.test,"aw",@nobits'
section.  Fixing this will allow simplifications next up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93844 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agointroduce a section kind for common linkage. Use this to slightly
Chris Lattner [Tue, 19 Jan 2010 02:48:26 +0000 (02:48 +0000)]
introduce a section kind for common linkage.  Use this to slightly
simplify and commonize some of the asmprinter logic for globals.

This also avoids printing the MCSection for .zerofill, which broke
the llvm-gcc build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93843 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agothere is no need to emit a .section above .comm on linux.
Chris Lattner [Tue, 19 Jan 2010 02:46:56 +0000 (02:46 +0000)]
there is no need to emit a .section above .comm on linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93842 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEven more explanation.
Bill Wendling [Tue, 19 Jan 2010 02:44:01 +0000 (02:44 +0000)]
Even more explanation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93841 91177308-0d34-0410-b5e6-96231b3b80d8