Commit Graph

11046 Commits

Author SHA1 Message Date
Chris Lattner
6a315c358c 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
2010-01-26 20:20:43 +00:00
Duncan Sands
b06f3ad5f9 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
2010-01-26 11:58:04 +00:00
Torok Edwin
871384fcda 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
2010-01-26 08:50:50 +00:00
Bill Wendling
ee49ad79fd 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
2010-01-26 08:27:24 +00:00
Chris Lattner
f1214cbf3c 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
2010-01-26 06:53:37 +00:00
Chris Lattner
3b131d7cc4 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
2010-01-26 06:42:44 +00:00
Chris Lattner
589c6f620e 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
2010-01-26 06:28:43 +00:00
Chris Lattner
beeb93e6ba 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
2010-01-26 05:58:28 +00:00
Chris Lattner
13e97a29d9 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
2010-01-26 05:30:30 +00:00
Chris Lattner
6bf1def159 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
2010-01-26 05:10:10 +00:00
Chris Lattner
f71cb015c1 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
2010-01-26 04:55:51 +00:00
Chris Lattner
b84822fb7b 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
2010-01-26 04:35:26 +00:00
Chris Lattner
b8da4ac698 this hook should be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 04:19:00 +00:00
Chris Lattner
85fe07866a 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
2010-01-26 04:05:28 +00:00
Victor Hernandez
e685f230b6 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
2010-01-26 02:36:35 +00:00
Chris Lattner
071c62fad0 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
2010-01-25 23:26:13 +00:00
Chris Lattner
da63b3ad63 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
2010-01-25 23:18:11 +00:00
Chris Lattner
44e87255e9 eliminate redundant argument to EmitJumpTableInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 22:41:33 +00:00
Chris Lattner
718fb59801 mcstreamerize gprel32 emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 21:28:50 +00:00
Chris Lattner
798d125659 handle the _set_ symbol with an MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94449 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 21:17:10 +00:00
Chris Lattner
78f485afb7 rename MAI::PICJumpTableDirective to MAI::GPRel32Directive to
make it clear what it is, instead of how it is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94448 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 21:10:10 +00:00
Chris Lattner
cba386ccac remove JumpTableDirective, it is always null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94445 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 20:52:54 +00:00
Chris Lattner
bfcb09688c sink an arm specific method out of asmprinter into the ARMAsmPrinter and
rename it to avoid shadowing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 19:39:52 +00:00
Chris Lattner
a6594fc715 mcstreamerize .file and .file. This also fixes an issue where the
normal form of .file would fail if the filename had a weird character
in it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94437 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 18:58:59 +00:00
Chris Lattner
ed0ab15170 add symbol attribute support for the ELF .type directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94435 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 18:30:45 +00:00
Bob Wilson
032742972f Change Value::getUnderlyingObject to have the MaxLookup value specified as a
parameter with a default value, instead of just hardcoding it in the
implementation.  The limit of MaxLookup = 6 was introduced in r69151 to fix
a performance problem with O(n^2) behavior in instcombine, but the scalarrepl
pass is relying on getUnderlyingObject to go all the way back to an AllocaInst.
Making the limit part of the method signature makes it clear that by default
the result is limited and should help avoid similar problems in the future.
This fixes pr6126.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 18:26:54 +00:00
Chris Lattner
99328add83 emit the .size directive for global variables on ELF through
mcstreamer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 07:52:13 +00:00
Chris Lattner
6559d7688e all supported target now have aligned common support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 07:29:13 +00:00
Chris Lattner
abb992d6a3 change the canonical form of "cond ? -1 : 0" to be
"sext cond" instead of a select.  This simplifies some instcombine
code, matches the policy for zext (cond ? 1 : 0 -> zext), and allows
us to generate better code for a testcase on ppc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 00:09:49 +00:00
Bill Wendling
187361b056 Remove the '-disable-scheduling' flag and replace it with the 'source' option of
the '-pre-RA-sched' flag. It actually makes more sense to do it this way. Also,
keep track of the SDNode ordering by default. Eventually, we would like to make
this ordering a way to break a "tie" in the scheduler. However, doing that now
breaks the "CodeGen/X86/abi-isel.ll" test for 32-bit Linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 10:26:57 +00:00
Chris Lattner
9eb158d5b4 mcize lcomm, simplify .comm, extend both to support 64-bit sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 07:47:02 +00:00
Chris Lattner
f9f93e4388 resolve a fixme: the "nonexecutable stack directive" is actually
a .section.  Switch to it with SwitchSection.

However, I think that this directive should be safe on any ELF target.
If so, we should hoist it up out of the X86 and SystemZ targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 07:21:06 +00:00
Chris Lattner
152a29bfa6 mcize visibility directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 06:53:23 +00:00
Chris Lattner
a5ad93a10a move the various directive enums out of the MCStreamer class
into a new MCDirectives.h file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 06:39:22 +00:00
Chris Lattner
52492ac0d0 Change constantexpr global variable initializers to convert the constants
to MCExpr then emit them through MCStreamer with EmitValue.  I think all
global variable initializers are now going through mcstreamer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 06:17:14 +00:00
Chris Lattner
3a9be0ee36 mcstreamerize .no_dead_strip and .reference for static ctors/dtors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94290 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 05:51:36 +00:00
Chris Lattner
3924868a95 mcize jump table and constant pool entry labels, .local on elf,
and some .weak directives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 05:19:23 +00:00
Chris Lattner
05f845314a emit .ascii and .asciz through MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 04:54:10 +00:00
Chris Lattner
4cf202ba06 remove one form of EmitString, just use EmitBytes instead. We must
be careful to add a \0 at the end though, because EmitString didn't
do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94277 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 03:11:46 +00:00
Devang Patel
2e369930dc Avoid using "Type" as the variable name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 00:26:28 +00:00
Chris Lattner
faca5497a2 move "EOL" from asmprinter to dwarfprinter. It should eventually
be completely eliminated, but today is not that day.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94253 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 23:47:11 +00:00
Chris Lattner
894d75aa01 move uleb printing from asmprinter to dwarfprinter, mcize,
cleanup and eliminate a bunch more uses of "EOL".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94250 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 23:18:42 +00:00
Chris Lattner
bb9078a6b2 move sleb printing out of asmprinter into dwarf printer, make clients
handle the comment better, MCize the non-.sleb case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:56:55 +00:00
Devang Patel
bc5201f837 Remove MetadataBase class because it is not adding significant value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:52:10 +00:00
Sean Callanan
5d74e1f644 Added a Register token to AsmToken and the appropriate
accessor method for its value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94241 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:42:22 +00:00
Sean Callanan
5635156203 Filled out the skeleton of the TargetAsmLexer to behave
exactly like an MCAsmLexer.  (The difference is that the
TargetAsmLexer knows how to handle target-specific stuff
like registers, whereas the MCAsmLexer is fully generic.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:35:01 +00:00
Chris Lattner
0ad9c911f5 inline away the trivial AsmPrinter::EOL() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94230 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:09:00 +00:00
Chris Lattner
0595324ed8 inline AsmPrinter::PrintHex into its two trivial callers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94228 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 21:57:56 +00:00
Chris Lattner
523a508576 change this to be a static function instead of a method on asmprinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 21:50:41 +00:00
Chris Lattner
14ca177beb Changes to fix buffering that I forgot to commit with previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 21:16:10 +00:00