oota-llvm.git
14 years agoppc/linux isn't ready for this and it was an accident that it was included.
Chris Lattner [Wed, 27 Jan 2010 01:02:43 +0000 (01:02 +0000)]
ppc/linux isn't ready for this and it was an accident that it was included.
This should fix a bunch of linux buildbot failures.

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

14 years agoWhen converting dbg.declare to dbg.value, attach promoted store's debug metadata...
Victor Hernandez [Wed, 27 Jan 2010 00:44:36 +0000 (00:44 +0000)]
When converting dbg.declare to dbg.value, attach promoted store's debug metadata to dbg.value

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

14 years agoLinker needs to do deep-copy of function-local metadata to update references to funct...
Victor Hernandez [Wed, 27 Jan 2010 00:30:42 +0000 (00:30 +0000)]
Linker needs to do deep-copy of function-local metadata to update references to function arguments

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

14 years agouse existing basic block numbers instead of recomputing
Chris Lattner [Wed, 27 Jan 2010 00:20:02 +0000 (00:20 +0000)]
use existing basic block numbers instead of recomputing
a new set of them.

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

14 years agoSwitch MSP430, CellSPU, SystemZ, Darwin/PPC, Alpha, and Sparc to
Chris Lattner [Wed, 27 Jan 2010 00:17:20 +0000 (00:17 +0000)]
Switch MSP430, CellSPU, SystemZ, Darwin/PPC, Alpha, and Sparc to
EmitFunctionHeader:

7 files changed, 16 insertions(+), 210 deletions(-)

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

14 years agoClarify what -tailcallopt option actually do.
Evan Cheng [Wed, 27 Jan 2010 00:10:09 +0000 (00:10 +0000)]
Clarify what -tailcallopt option actually do.

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

14 years agoAdjust setjmp instruction sequence to not need 32-bit alignment padding
Jim Grosbach [Wed, 27 Jan 2010 00:07:20 +0000 (00:07 +0000)]
Adjust setjmp instruction sequence to not need 32-bit alignment padding

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

14 years agoEliminate target hook IsEligibleForTailCallOptimization.
Evan Cheng [Wed, 27 Jan 2010 00:07:07 +0000 (00:07 +0000)]
Eliminate target hook IsEligibleForTailCallOptimization.

Target independent isel should always pass along the "tail call" property. Change
target hook LowerCall's parameter "isTailCall" into a refernce. If the target
decides it's impossible to honor the tail call request, it should set isTailCall
to false to make target independent isel happy.

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

14 years agoRestore to pre-94570 state.
Evan Cheng [Wed, 27 Jan 2010 00:00:57 +0000 (00:00 +0000)]
Restore to pre-94570 state.

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

14 years agomcize label emission for functions.
Chris Lattner [Tue, 26 Jan 2010 23:53:39 +0000 (23:53 +0000)]
mcize label emission for functions.

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

14 years agouse EmitLinkage for functions as well as globals. One output
Chris Lattner [Tue, 26 Jan 2010 23:51:52 +0000 (23:51 +0000)]
use EmitLinkage for functions as well as globals.  One output
change is that we now use ".linkonce discard" for global variables
instead of ".linkonce samesize".  These should be the same, just less
strict.  If anyone is interested in mcizing MCSection for COFF targets,
this should be easy to fix.

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

14 years agopull linkage emission code out to a new EmitLinkage function.
Chris Lattner [Tue, 26 Jan 2010 23:47:12 +0000 (23:47 +0000)]
pull linkage emission code out to a new EmitLinkage function.

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

14 years agorearrange some directives, no functionality change.
Chris Lattner [Tue, 26 Jan 2010 23:41:48 +0000 (23:41 +0000)]
rearrange some directives, no functionality change.

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

14 years agoRoll r94484 (avoiding RTTI problems in tests) forward again in a way that isn't
Jeffrey Yasskin [Tue, 26 Jan 2010 23:30:46 +0000 (23:30 +0000)]
Roll r94484 (avoiding RTTI problems in tests) forward again in a way that isn't
broken by setting CXXFLAGS on the command line.

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

14 years agoAvoid extra calls to MD->getNumOperands()
Victor Hernandez [Tue, 26 Jan 2010 23:29:09 +0000 (23:29 +0000)]
Avoid extra calls to MD->getNumOperands()

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

14 years agoIgnore 'forced' tailcall opt in fastisel mode.
Evan Cheng [Tue, 26 Jan 2010 23:28:40 +0000 (23:28 +0000)]
Ignore 'forced' tailcall opt in fastisel mode.

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

14 years agoremove a noop function.
Chris Lattner [Tue, 26 Jan 2010 23:26:29 +0000 (23:26 +0000)]
remove a noop function.

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

14 years agoFix inline cost predictions with SCIENCE.
Jakob Stoklund Olesen [Tue, 26 Jan 2010 23:21:56 +0000 (23:21 +0000)]
Fix inline cost predictions with SCIENCE.

After running a batch of measurements, it is clear that the inliner metrics
need some adjustments:

Own argument bonus:       20 -> 5
Outgoing argument penalty: 0 -> 5
Alloca bonus:             10 -> 5
Constant instr bonus:      7 -> 5
Dead successor bonus:     40 -> 5*(avg instrs/block)

The new cost metrics are generaly 25 points higher than before, so we may need
to move thresholds.

With this change, InlineConstants::CallPenalty becomes a political correction:

if (!isa<IntrinsicInst>(II) && !callIsSmall(CS.getCalledFunction()))
  NumInsts += InlineConstants::CallPenalty + CS.arg_size();

The code size is accurately modelled by CS.arg_size(). CallPenalty is added
because calls tend to take a long time, so it may not be worth it to inline a
function with lots of calls.

All of the political corrections are in the InlineConstants namespace:
IndirectCallBonus, CallPenalty, LastCallToStaticBonus, ColdccPenalty,
NoreturnPenalty.

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

14 years agonow that enough stuff is constified, move function header printing
Chris Lattner [Tue, 26 Jan 2010 23:18:44 +0000 (23:18 +0000)]
now that enough stuff is constified, move function header printing
logic up from X86 into the common code.  The other targets will
hopefully start using this soon.

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

14 years agoconstify a bunch of dwarf stuff now that the registerinfo method
Chris Lattner [Tue, 26 Jan 2010 23:18:02 +0000 (23:18 +0000)]
constify a bunch of dwarf stuff now that the registerinfo method
is constified.

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

14 years agoconstify a method argument.
Chris Lattner [Tue, 26 Jan 2010 23:15:09 +0000 (23:15 +0000)]
constify a method argument.

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

14 years agoAllow some automatic tailcall optimization without changing ABI.
Evan Cheng [Tue, 26 Jan 2010 23:13:04 +0000 (23:13 +0000)]
Allow some automatic tailcall optimization without changing ABI.

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

14 years agoDelete blank lines that bug me.
Evan Cheng [Tue, 26 Jan 2010 23:07:57 +0000 (23:07 +0000)]
Delete blank lines that bug me.

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

14 years agocall emitconstantpool and emitjumptable like other targets.
Chris Lattner [Tue, 26 Jan 2010 22:06:58 +0000 (22:06 +0000)]
call emitconstantpool and emitjumptable like other targets.

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

14 years agoBefore existing NamedMDNode entry in the symbol table, remove any existing entry...
Devang Patel [Tue, 26 Jan 2010 22:03:41 +0000 (22:03 +0000)]
Before existing NamedMDNode entry in the symbol table, remove any existing entry with the same name.

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

14 years agoemit jump table an alias ".set" directives through MCStreamer as
Chris Lattner [Tue, 26 Jan 2010 21:53:08 +0000 (21:53 +0000)]
emit jump table an alias ".set" directives through MCStreamer as
assignments.

.set x, a-b

is the same as:

x = a-b

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

14 years agofix CastInst::castIsValid to reject aggregate types, fixing PR6153:
Chris Lattner [Tue, 26 Jan 2010 21:51:43 +0000 (21:51 +0000)]
fix CastInst::castIsValid to reject aggregate types, fixing PR6153:

llvm-as: t.ll:1:25: error: invalid cast opcode for cast from '[4 x i8]' to '[1 x i32]'
@x = constant [1 x i32] bitcast ([4 x i8] c"abcd" to [1 x i32])
                        ^

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

14 years agoRemve unnecessary include.
Devang Patel [Tue, 26 Jan 2010 21:42:58 +0000 (21:42 +0000)]
Remve unnecessary include.

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

14 years agoUse AssertingVH, just to be paranoid.
Devang Patel [Tue, 26 Jan 2010 21:39:14 +0000 (21:39 +0000)]
Use AssertingVH, just to be paranoid.

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

14 years agoRevert test polarity to match comment and desired outcome. Remove undeserved bonus.
Jakob Stoklund Olesen [Tue, 26 Jan 2010 21:31:35 +0000 (21:31 +0000)]
Revert test polarity to match comment and desired outcome. Remove undeserved bonus.

A GEP with all constant indices is already considered free by
analyzeBasicBlock(), so don't give it an extra bonus in
CountCodeReductionForAlloca().

This patch should remove a small positive bias toward inlining functions with
variable-index GEPs, and remove a smaller negative bias from functions with
all-constant index GEPs.

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

14 years agoRemove dead code.
Jakob Stoklund Olesen [Tue, 26 Jan 2010 21:31:30 +0000 (21:31 +0000)]
Remove dead code.

Functions containing indirectbr are marked NeverInline by analyzeBasicBlock(),
so there is no point in giving indirectbr special treatment in
CountCodeReductionForConstant. It is never called.

No functional change intended.

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

14 years agoSkip calculation of ArgumentWeights if it will never be used.
Jakob Stoklund Olesen [Tue, 26 Jan 2010 21:31:24 +0000 (21:31 +0000)]
Skip calculation of ArgumentWeights if it will never be used.

Save a few bytes by allocating the correct size vector.

No functional change intended.

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

14 years agoEmit DW_AT_containing_type attribute for a class if containing type is known.
Devang Patel [Tue, 26 Jan 2010 21:16:06 +0000 (21:16 +0000)]
Emit DW_AT_containing_type attribute for a class if containing type is known.

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

14 years agoAdd extra element to composite type. This new element will be used to record c++...
Devang Patel [Tue, 26 Jan 2010 21:14:59 +0000 (21:14 +0000)]
Add extra element to composite type. This new element will be used to record c++ class that holds current class's vtable.

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

14 years agoEliminate SetDirective, and replace it with HasSetDirective.
Chris Lattner [Tue, 26 Jan 2010 20:40:54 +0000 (20:40 +0000)]
Eliminate SetDirective, and replace it with HasSetDirective.
Default HasSetDirective to true, since most targets have it.

The targets that claim to not have it probably do, or it is
spelled differently. These include Blackfin, Mips, Alpha, and
PIC16.  All of these except pic16 are normal ELF targets, so
they almost certainly have it.

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

14 years agoDelete dead code.
Evan Cheng [Tue, 26 Jan 2010 20:36:21 +0000 (20:36 +0000)]
Delete dead code.

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

14 years agoEmit .comm alignment in bytes but .align in powers of 2 for ARM ELF.
Rafael Espindola [Tue, 26 Jan 2010 20:21:43 +0000 (20:21 +0000)]
Emit .comm alignment in bytes but .align in powers of 2 for ARM ELF.

Original patch by Sandeep Patel and updated by me.

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

14 years agoeliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
Chris Lattner [Tue, 26 Jan 2010 20:20:43 +0000 (20:20 +0000)]
eliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
that has it.

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

14 years agodon't set to the default value.
Chris Lattner [Tue, 26 Jan 2010 20:17:34 +0000 (20:17 +0000)]
don't set to the default value.

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

14 years agotest commit.
Junjie Gu [Tue, 26 Jan 2010 19:45:17 +0000 (19:45 +0000)]
test commit.

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

14 years ago-disable-output is no longer needed with -analyze.
Dan Gohman [Tue, 26 Jan 2010 19:25:59 +0000 (19:25 +0000)]
-disable-output is no longer needed with -analyze.

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

14 years agoMake the unsigned-range code more consistent with the signed-range code,
Dan Gohman [Tue, 26 Jan 2010 19:19:05 +0000 (19:19 +0000)]
Make the unsigned-range code more consistent with the signed-range code,
and clean up some loose ends.

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

14 years agoCode refactoring, no functionality change.
Evan Cheng [Tue, 26 Jan 2010 19:04:47 +0000 (19:04 +0000)]
Code refactoring, no functionality change.

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

14 years agoRevert 94484. Re-disable unittests that need RTTI.
Bob Wilson [Tue, 26 Jan 2010 19:04:37 +0000 (19:04 +0000)]
Revert 94484.  Re-disable unittests that need RTTI.

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

14 years agoSwitch AllocaDbgDeclares to SmallVector and don't leak DIFactory
Victor Hernandez [Tue, 26 Jan 2010 18:57:53 +0000 (18:57 +0000)]
Switch AllocaDbgDeclares to SmallVector and don't leak DIFactory

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

14 years agoFix a typo in a comment that Duncan noticed.
Dan Gohman [Tue, 26 Jan 2010 18:32:54 +0000 (18:32 +0000)]
Fix a typo in a comment that Duncan noticed.

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

14 years agoRemove SIL, DIL, and BPL from the GR8_NOREX allocation order also.
Dan Gohman [Tue, 26 Jan 2010 18:30:24 +0000 (18:30 +0000)]
Remove SIL, DIL, and BPL from the GR8_NOREX allocation order also.

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

14 years agoSIL, DIL, BPL, and SPL require a REX prefix.
Dan Gohman [Tue, 26 Jan 2010 18:14:22 +0000 (18:14 +0000)]
SIL, DIL, BPL, and SPL require a REX prefix.

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

14 years agoRename ItCount to BECount, since it holds a backedge-taken count rather
Dan Gohman [Tue, 26 Jan 2010 16:46:18 +0000 (16:46 +0000)]
Rename ItCount to BECount, since it holds a backedge-taken count rather
than an iteration count.

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

14 years agoFix ICmpInst::makeConstantRange to use ConstantRange's API properly
Dan Gohman [Tue, 26 Jan 2010 16:04:20 +0000 (16:04 +0000)]
Fix ICmpInst::makeConstantRange to use ConstantRange's API properly
in the case of empty and full ranges.

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

14 years agoFix a typo that several people pointed out. Also, address the case of
Dan Gohman [Tue, 26 Jan 2010 15:56:18 +0000 (15:56 +0000)]
Fix a typo that several people pointed out. Also, address the case of
wrapping that Duncan pointed out.

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

14 years agoSupport -arch.
Mikhail Glushenkov [Tue, 26 Jan 2010 14:55:44 +0000 (14:55 +0000)]
Support -arch.

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

14 years agoSupport for -iquote.
Mikhail Glushenkov [Tue, 26 Jan 2010 14:55:30 +0000 (14:55 +0000)]
Support for -iquote.

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

14 years agoBetter error message.
Mikhail Glushenkov [Tue, 26 Jan 2010 14:55:16 +0000 (14:55 +0000)]
Better error message.

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

14 years agoEscape double quotes in 'help'.
Mikhail Glushenkov [Tue, 26 Jan 2010 14:55:04 +0000 (14:55 +0000)]
Escape double quotes in 'help'.

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

14 years agoTweak the way appendModuleInlineAsm works, so you aren't obliged
Duncan Sands [Tue, 26 Jan 2010 11:58:04 +0000 (11:58 +0000)]
Tweak the way appendModuleInlineAsm works, so you aren't obliged
to append a newline when using setModuleInlineAsm in case later
someone calls appendModuleInlineAsm - make newline handling fully
automatic.  In case anyone is wondering there is only one user of
appendModuleInlineAsm: the dragonegg plugin.

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

14 years agoRegenerate configure.
Torok Edwin [Tue, 26 Jan 2010 08:50:50 +0000 (08:50 +0000)]
Regenerate configure.

With the previous cleanup to configure.ac, configure is now only 393k, instead of 1.1M!

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

14 years agoRemove unneeded checks from configure.ac.
Torok Edwin [Tue, 26 Jan 2010 08:48:04 +0000 (08:48 +0000)]
Remove unneeded checks from configure.ac.

HAVE_{BI,STD,FWD}_ITERATOR and HAVE_NAMESPACES were not used in the code.
bison and flex are no longer used.
CAN_DLOPEN_SELF was never used either.
AC_PROG_LIBTOOL is not needed since we don't use libtool, we only need the
libltdl checks for dlopen.
Add check for AR, it used to be done by AC_PROG_LIBTOOL.
AC_TYPE_SIGNAL is deprecated, follow autoupdate's suggestion and replace with
void.
Remove unused m4 files.
Configure can now be generated using autoconf 2.65 too, without any warnings!

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

14 years agoFix autoconf 2.65 warning (don't use _cv_ inside AC_CACHE_VAL).
Torok Edwin [Tue, 26 Jan 2010 08:43:05 +0000 (08:43 +0000)]
Fix autoconf 2.65 warning (don't use _cv_ inside AC_CACHE_VAL).

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

14 years agoRemove warning about non return on a non-void function.
Bill Wendling [Tue, 26 Jan 2010 08:27:24 +0000 (08:27 +0000)]
Remove warning about non return on a non-void function.

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

14 years agoeliminate the TargetLowering::UsesGlobalOffsetTable bool, which is
Chris Lattner [Tue, 26 Jan 2010 06:53:37 +0000 (06:53 +0000)]
eliminate the TargetLowering::UsesGlobalOffsetTable bool, which is
subsumed by TargetLowering::getJumpTableEncoding().  Change uses of
it to be more specific.

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

14 years agoNow that printPICJumpTableSetLabel is not overloaded,
Chris Lattner [Tue, 26 Jan 2010 06:42:44 +0000 (06:42 +0000)]
Now that printPICJumpTableSetLabel is not overloaded,
inline it into its only caller, allowing us to simplify it
and hoist bits out of the loop.

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

14 years agoMove getJTISymbol from MachineJumpTableInfo to MachineFunction,
Chris Lattner [Tue, 26 Jan 2010 06:28:43 +0000 (06:28 +0000)]
Move getJTISymbol from MachineJumpTableInfo to MachineFunction,
which is more convenient, and change getPICJumpTableRelocBaseExpr
to take a MachineFunction to match.

Next, move the X86 code that create a PICBase symbol to
X86TargetLowering::getPICBaseSymbol from
X86MCInstLower::GetPICBaseSymbol, which was an asmprinter specific
library.  This eliminates a 'gross hack', and allows us to
implement X86ISelLowering::getPICJumpTableRelocBaseExpr which now
calls it.

This in turn allows us to eliminate the
X86AsmPrinter::printPICJumpTableSetLabel method, which was the
only overload of printPICJumpTableSetLabel.

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

14 years agoadd a new MachineJumpTableInfo::getJTISymbol method,
Chris Lattner [Tue, 26 Jan 2010 05:58:28 +0000 (05:58 +0000)]
add a new MachineJumpTableInfo::getJTISymbol method,
use it to implement the default TargetLowering::getPICJumpTableRelocBaseExpr

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

14 years agostub out a new target hook, need some refactoring before I can
Chris Lattner [Tue, 26 Jan 2010 05:30:30 +0000 (05:30 +0000)]
stub out a new target hook, need some refactoring before I can
implement it.

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

14 years agosimplify asmprinter: only emit .set directives when entries have
Chris Lattner [Tue, 26 Jan 2010 05:15:20 +0000 (05:15 +0000)]
simplify asmprinter: only emit .set directives when entries have
EK_LabelDifference32 kind and the target has .set support.  Simplify
X86AsmPrinter::printPICJumpTableSetLabel to make use of recent helpers.

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

14 years agorename printPICJumpTableEntry -> EmitJumpTableEntry,
Chris Lattner [Tue, 26 Jan 2010 05:10:10 +0000 (05:10 +0000)]
rename printPICJumpTableEntry -> EmitJumpTableEntry,
make it private and non-virtual.  It handles the non-pic
case too, so just use it, simplifying EmitJumpTableInfo.

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

14 years agoimplement X86 @GOTOFF jump table entries with the new EK_Custom32
Chris Lattner [Tue, 26 Jan 2010 05:02:42 +0000 (05:02 +0000)]
implement X86 @GOTOFF jump table entries with the new EK_Custom32
jump table entry kind, instead of overloading
AsmPrinter::printPICJumpTableEntry.

This has a pretty horrible and inefficient FIXME around how @GOTOFF
is currently smashed into the mcsymbol name, but otherwise this is
much cleaner.

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

14 years agoadd a new MachineBasicBlock::getSymbol method, replacing
Chris Lattner [Tue, 26 Jan 2010 04:55:51 +0000 (04:55 +0000)]
add a new MachineBasicBlock::getSymbol method, replacing
the AsmPrinter::GetMBBSymbol.

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

14 years agoNew PBQP solver.
Lang Hames [Tue, 26 Jan 2010 04:49:58 +0000 (04:49 +0000)]
New PBQP solver.

* Fixed a reduction bug which occasionally led to infinite-cost (invalid)
  register allocation solutions despite the existence finite-cost solutions.
* Significantly reduced memory usage (>50% reduction).
* Simplified a lot of the solver code.

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

14 years agoFix the the ceiling-division used in computing the MaxBECount so that it doesn't
Dan Gohman [Tue, 26 Jan 2010 04:40:18 +0000 (04:40 +0000)]
Fix the the ceiling-division used in computing the MaxBECount so that it doesn't
have trouble with an intermediate add overflowing. Also, be more conservative
about the case where the induction variable in an SLT loop exit can step past
the RHS of the SLT and overflow in a single step.

Make getSignedRange more aggressive, to recover for some common cases which
the above fixes pessimized.

This addresses rdar://7561161.

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

14 years agodon't bother setting the AsmPrinter::MF ivar, now that
Chris Lattner [Tue, 26 Jan 2010 04:38:11 +0000 (04:38 +0000)]
don't bother setting the AsmPrinter::MF ivar, now that
AsmPrinter::SetupMachineFunction sets it.  Note that systemz
and msp430 didn't.  Yay for reduced inconsistency! :)

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

14 years agomake MachineFunction keep track of its ID and make
Chris Lattner [Tue, 26 Jan 2010 04:35:26 +0000 (04:35 +0000)]
make MachineFunction keep track of its ID and make
MachineFunctionAnalysis dole them out, instead of having
AsmPrinter do both.  Have the AsmPrinter::SetupMachineFunction
method set the 'AsmPrinter::MF' variable.

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

14 years agothis hook should be const.
Chris Lattner [Tue, 26 Jan 2010 04:19:00 +0000 (04:19 +0000)]
this hook should be const.

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

14 years agoAdd a comment about a missed opportunity.
Dan Gohman [Tue, 26 Jan 2010 04:13:15 +0000 (04:13 +0000)]
Add a comment about a missed opportunity.

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

14 years agoPrint empty and full sets specially.
Dan Gohman [Tue, 26 Jan 2010 04:12:55 +0000 (04:12 +0000)]
Print empty and full sets specially.

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

14 years agoAdd support for target-specific 32-bit custom-lowered
Chris Lattner [Tue, 26 Jan 2010 04:05:28 +0000 (04:05 +0000)]
Add support for target-specific 32-bit custom-lowered
jump table entries.

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

14 years agoUnbreak MSVC/CMake build.
Daniel Dunbar [Tue, 26 Jan 2010 03:56:22 +0000 (03:56 +0000)]
Unbreak MSVC/CMake build.

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

14 years agomake jit jump table emission be based on the EntryKind instead of magic variables.
Chris Lattner [Tue, 26 Jan 2010 03:47:15 +0000 (03:47 +0000)]
make jit jump table emission be based on the EntryKind instead of magic variables.
JITInfo::getPICJumpTableEntry can probably be removed now, but I don't plan to do
this.

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

14 years agoswitch jump table entry emission to be based on EntryKind
Chris Lattner [Tue, 26 Jan 2010 03:43:22 +0000 (03:43 +0000)]
switch jump table entry emission to be based on EntryKind
instead of magic variables.

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

14 years agoIn mem2reg, for all alloca/stores that get promoted where the alloca has an associate...
Victor Hernandez [Tue, 26 Jan 2010 02:42:15 +0000 (02:42 +0000)]
In mem2reg, for all alloca/stores that get promoted where the alloca has an associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store.

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

14 years agoAdd MDNode::getIfExists(), an efficient way to determine if a value is used by metada...
Victor Hernandez [Tue, 26 Jan 2010 02:36:35 +0000 (02:36 +0000)]
Add MDNode::getIfExists(), an efficient way to determine if a value is used by metadata (since metadata does not appear in a value's use list)

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

14 years agoAssert when debug intrinsic insert functions are passed empty arguments
Victor Hernandez [Tue, 26 Jan 2010 02:07:38 +0000 (02:07 +0000)]
Assert when debug intrinsic insert functions are passed empty arguments

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

14 years agoImplement cond ? -1 : 0 with sbb.
Evan Cheng [Tue, 26 Jan 2010 02:00:44 +0000 (02:00 +0000)]
Implement cond ? -1 : 0 with sbb.

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

14 years agoAccept immediate as value of a dbg_value.
Dale Johannesen [Tue, 26 Jan 2010 01:54:26 +0000 (01:54 +0000)]
Accept immediate as value of a dbg_value.

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

14 years agoRe-enable unit tests disabled in r94164 by telling GTest about the
Jeffrey Yasskin [Tue, 26 Jan 2010 01:26:46 +0000 (01:26 +0000)]
Re-enable unit tests disabled in r94164 by telling GTest about the
lack of RTTI.

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

14 years agoAdded the implementation of the Intel-specific
Sean Callanan [Tue, 26 Jan 2010 01:00:10 +0000 (01:00 +0000)]
Added the implementation of the Intel-specific
TargetAsmLexer.

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

14 years agoGenerate DEBUG_VALUE comments on x86. The (limited)
Dale Johannesen [Tue, 26 Jan 2010 00:09:58 +0000 (00:09 +0000)]
Generate DEBUG_VALUE comments on x86.  The (limited)
dbg.declare's we currently generate go through both
register allocators without perturbing the results.

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

14 years agoAdded the TargetAsmLexer implementation for AT&T syntax.
Sean Callanan [Tue, 26 Jan 2010 00:08:25 +0000 (00:08 +0000)]
Added the TargetAsmLexer implementation for AT&T syntax.

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

14 years agouse findDebugLoc in more places.
Dale Johannesen [Tue, 26 Jan 2010 00:03:12 +0000 (00:03 +0000)]
use findDebugLoc in more places.

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

14 years agoMinor jump table cleanup.
Jim Grosbach [Mon, 25 Jan 2010 23:50:13 +0000 (23:50 +0000)]
Minor jump table cleanup.

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

14 years agoin 32-bit pic mode for targets with a GOT, x86 emits jump table
Chris Lattner [Mon, 25 Jan 2010 23:38:14 +0000 (23:38 +0000)]
in 32-bit pic mode for targets with a GOT, x86 emits jump table
entries with @GOTOFF whih is EK_GPRel32BlockAddress.

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

14 years agofix quoting problem jim noticed!
Chris Lattner [Mon, 25 Jan 2010 23:28:03 +0000 (23:28 +0000)]
fix quoting problem jim noticed!

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

14 years agoRearrange handling of jump tables. Highlights:
Chris Lattner [Mon, 25 Jan 2010 23:26:13 +0000 (23:26 +0000)]
Rearrange handling of jump tables.  Highlights:
1. MachineJumpTableInfo is now created lazily for a function the first time
   it actually makes a jump table instead of for every function.
2. The encoding of jump table entries is now described by the
   MachineJumpTableInfo::JTEntryKind enum.  This enum is determined by the
   TLI::getJumpTableEncoding() hook, instead of by lots of code scattered
   throughout the compiler that "knows" that jump table entries are always
   32-bits in pic mode (for example).
3. The size and alignment of jump table entries is now calculated based on
   their kind, instead of at machinefunction creation time.

Future work includes using the EntryKind in more places in the compiler,
eliminating other logic that "knows" the layout of jump tables in various
situations.

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

14 years agoprep work to support a future where getJumpTableInfo will return
Chris Lattner [Mon, 25 Jan 2010 23:22:00 +0000 (23:22 +0000)]
prep work to support a future where getJumpTableInfo will return
a null pointer for functions with no jump tables.  No functionality
change.

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

14 years agoadd a method to get the alignment of an integer type even
Chris Lattner [Mon, 25 Jan 2010 23:18:11 +0000 (23:18 +0000)]
add a method to get the alignment of an integer type even
when we don't have one laying around.  Useful if you don't
have an llvmcontext handy.

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

14 years agoMake it SP, LR, PC for GPR Register Class instead of LR, SP, PC.
Johnny Chen [Mon, 25 Jan 2010 22:54:29 +0000 (22:54 +0000)]
Make it SP, LR, PC for GPR Register Class instead of LR, SP, PC.

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

14 years agoeliminate redundant argument to EmitJumpTableInfo
Chris Lattner [Mon, 25 Jan 2010 22:41:33 +0000 (22:41 +0000)]
eliminate redundant argument to EmitJumpTableInfo

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

14 years agoImplemented ARMInstPrinter::printThumbS4ImmOperand().
Johnny Chen [Mon, 25 Jan 2010 22:13:10 +0000 (22:13 +0000)]
Implemented ARMInstPrinter::printThumbS4ImmOperand().

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

14 years agoImplemented the dialect decision logic for the X86
Sean Callanan [Mon, 25 Jan 2010 21:59:20 +0000 (21:59 +0000)]
Implemented the dialect decision logic for the X86
TargetAsmLexer.  Dialect-specific lexing code will
be placed in the functions LexTokenATT() and
LexTokenIntel().

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