Commit Graph

9662 Commits

Author SHA1 Message Date
Dan Gohman
b2d746ce6d Add an explicit keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:57:42 +00:00
Dan Gohman
7f4151bc69 ConstantFolder and NoFolder no longer require their Context members.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:56:12 +00:00
Dan Gohman
3751aa559d Use the default copy-ctor, copy-assignment, and destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:52:30 +00:00
Dan Gohman
d1ad72f54f Add a comment about the additional meaning of setPreservesCFG() for
MachineFunctionPass passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78669 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:50:56 +00:00
Dan Gohman
3c8178e625 Remove an unnecessary mutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:03:52 +00:00
Shantonu Sen
7e83697c8e Regenerate per request of Gabor Greif (r78628)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 13:39:52 +00:00
Erick Tryzelaar
ccf9f2b12e Change llvm-c's ordering of contexts to make it consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 07:46:16 +00:00
Devang Patel
9d3627ea27 Remove dead metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78651 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 06:31:57 +00:00
Jakob Stoklund Olesen
8c54a62061 Rebuild RegScavenger::DistanceMap each time it is needed.
The register scavenger maintains a DistanceMap that maps MI pointers to their
distance from the top of the current MBB. The DistanceMap is built
incrementally in forward() and in bulk in findFirstUse(). It is used by
scavengeRegister() to determine which candidate register has the longest
unused interval.

Unfortunately the DistanceMap contents can become outdated. The first time
scavengeRegister() is called, the DistanceMap is filled to cover the MBB. If
then instructions are inserted in the MBB (as they always are following
scavengeRegister()), the recorded distances are too short. This causes bad
behaviour in the included test case where a register use /after/ the current
position is ignored because findFirstUse() thinks is is /before/ the current
position. A "using an undefined register" assertion follows promptly.

The fix is to build a fresh DistanceMap at the top of scavengeRegister(), and
discard it after use. This means that DistanceMap is no longer needed as a
RegScavenger member variable, and forward() doesn't need to update it.

The fix then discloses issue number two in the same test case: The candidate
search in scavengeRegister() finds a CSR that has been saved in the prologue,
but is currently unused. It would be both inefficient and wrong to spill such
a register in the emergency spill slot. In the present case, the emergency
slot restore is placed immediately before the normal epilogue restore, leading
to a "Redefining a live register" assertion.

Fix number two: When scavengerRegister() stumbles upon an unused register that
is overwritten later in the MBB, return that register early. It is important
to verify that the register is defined later in the MBB, otherwise it might be
an unspilled CSR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 06:25:12 +00:00
Bob Wilson
b0abb4dc42 Use vAny type to get rid of Neon intrinsics that differed only in whether
the overloaded vector types allowed floating-point or integer vector elements.
Most of these operations actually depend on the element type, so bitcasting
was not an option.

If you include the vpadd intrinsics that I updated earlier, this gets rid
of 20 intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 05:39:44 +00:00
Bob Wilson
f24bd401eb Use new EVT::vAny type to combine Neon intrinsics for VPADD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 01:15:26 +00:00
Bob Wilson
61fc4cf7aa Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
arguments that are vectors of any size and element type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 01:14:02 +00:00
Jim Grosbach
1b747ad8a0 SjLj based exception handling unwinding support. This patch is nasty, brutish
and short. Well, it's kinda short. Definitely nasty and brutish.

The front-end generates the register/unregister calls into the SjLj runtime,
call-site indices and landing pad dispatch. The back end fills in the LSDA
with the call-site information provided by the front end. Catch blocks are
not yet implemented.

Built on Darwin and verified no llvm-core "make check" regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 00:09:57 +00:00
Lang Hames
52c1afcaea Modified VNInfo. The "copy" member is now a union which holds the copy for a register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 23:43:28 +00:00
Owen Anderson
e50ed30282 Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 22:56:29 +00:00
Devang Patel
1490d0f209 Align comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 22:20:38 +00:00
Devang Patel
72bcdb6c9b Keep track of DIType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 22:09:58 +00:00
Daniel Dunbar
5c468e3d70 llvm-mc/AsmParser: Allow .td users to redefine the names of the methods to call
on target specific operands for testing class membership and converting to
MCInst operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 21:00:45 +00:00
Daniel Dunbar
e74f3c0ce6 Rename ConvertType to ConvertConstant to avoid a name conflict on llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78596 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 20:56:46 +00:00
Owen Anderson
d6662add68 SimpleValueType-ify a few more methods on TargetLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 20:46:15 +00:00
Owen Anderson
70671845ad Continue the SimpleValueType-ification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78593 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 20:18:46 +00:00
Erick Tryzelaar
a84b155759 Convert comments to C90-style so llvm-c can import DataTypes.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78590 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 19:44:53 +00:00
Devang Patel
d7de19ad7b We are not using FoldingSet for metadata uniquing anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:59:07 +00:00
Owen Anderson
77547befdc Start moving TargetLowering away from using full MVTs and towards SimpleValueType, which will simplify the privatization of IntegerType in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:56:59 +00:00
Daniel Dunbar
338825c192 llvm-mc/AsmMatcher: Change assembler parser match classes to their own record
structure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78581 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:41:10 +00:00
Owen Anderson
0631fce850 Change the MDNode uniquing to a ValueMap, at Devang's request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:16:08 +00:00
Chris Lattner
f9bdeddb96 split MachO section handling stuff out to its out .h/.cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:15:01 +00:00
David Greene
b71d1b2fe2 Add support for printing loop structure information in asm comments.
This definitely slows down asm output so put it under an -asm-exuberant
flag.

This information is useful when doing static analysis of performance
issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 16:38:07 +00:00
David Goodwin
d94a4e5d8d Post RA scheduler changes. Introduce a hazard recognizer that uses the target schedule information to accurately model the pipeline. Update the scheduler to correctly handle multi-issue targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 15:55:25 +00:00
Daniel Dunbar
ca15f3d6d6 Add support for a user supplied pointer argument to llvm_install_error_handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 03:36:26 +00:00
Chris Lattner
ff4bc460c5 Make the big switch: Change MCSectionMachO to represent a section *semantically*
instead of syntactically as a string.  This means that it keeps track of the 
segment, section, flags, etc directly and asmprints them in the right format.
This also includes parsing and validation support for llvm-mc and 
"attribute(section)", so we should now start getting errors about invalid 
section attributes from the compiler instead of the assembler on darwin.

Still todo: 
1) Uniquing of darwin mcsections
2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h]
3) there are a few FIXMEs, for example what is the syntax to get the
   S_GB_ZEROFILL segment type?



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 01:39:42 +00:00
Chris Lattner
e36df3fd31 add a simple back() method to StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78544 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 00:44:02 +00:00
Bob Wilson
1ff446fef6 Change Neon table lookup (VTBL) and table extension (VTBX) intrinsics to
take the table vectors as separate arguments, instead of the previous
approach where they were combined into one big vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 06:03:09 +00:00
Daniel Dunbar
98164afb01 Extend comment on ParserMatchClass .td field, and add some missing
classes for X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 06:00:04 +00:00
Daniel Dunbar
6745d42e8e llvm-mc/AsmParser: Define match classes in the .td file.
-2 FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 05:18:30 +00:00
Daniel Dunbar
094da67bd7 STLExtras: Add less_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 03:36:59 +00:00
Chris Lattner
93b6db3de9 sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 23:39:42 +00:00
Chris Lattner
892e182393 1. Make MCSection an abstract class.
2. Move section switch printing to MCSection virtual method which takes a
   TAI.  This eliminates textual formatting stuff from TLOF.
3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and 
   TLOFELF::AtIsCommentChar.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 22:41:53 +00:00
Chris Lattner
7c599d056a make target-specific TLOF impls (except PIC16) create target-specific
MCSection instances.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:52:13 +00:00
Chris Lattner
a1c31b779c stub out PECOFF/MachO/ELF MCSection classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78499 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:50:49 +00:00
Chris Lattner
5277b22687 eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.
A TAI hook is appropriate in this case because this is just an
asm syntax issue, not a semantic difference. TLOF should model
the semantics of the section.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:43:12 +00:00
Chris Lattner
0c0cb71233 now that getOrCreateSection is all object-file specific,
give the impls an object-file-specific name.  In the future
they can take different arguments etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:22:20 +00:00
Chris Lattner
fbf1d271e6 sink getOrCreateSection down into all the object file implementations,
now that they create *all* the sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:14:13 +00:00
Eric Christopher
d34ab83c16 Fix some cut and paste-os.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:09:33 +00:00
Daniel Dunbar
c43782cf71 Some ProfileInfo cleanups.
- Part of optimal static profiling patch sequence by Andreas Neustifter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 18:59:03 +00:00
Daniel Dunbar
55e354ac0e Add a basic static ProfileInfo provider (ProfileEstimatorPass).
- Part of optimal static profiling patch sequence by Andreas Neustifter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 18:44:18 +00:00
Eric Christopher
63cd7e557c Define intrinsics for crc instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 18:07:59 +00:00
Daniel Dunbar
caaa49336b More ProfileInfo improvements.
- Part of optimal static profiling patch sequence by Andreas Neustifter.

 - Store edge, block, and function information separately for each functions
   (instead of in one giant map).

 - Return frequencies as double instead of int, and use a sentinel value for
   missing information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78477 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 17:43:09 +00:00
Bruno Cardoso Lopes
3e0094d969 ELF improvements:
Handle large integers, x86_fp80, ConstantAggregateZero, and two more ConstantExpr:
GetElementPtr and IntToPtr
Set SHF_MERGE bit for mergeable strings
Avoid zero initialized strings to be classified as a bss symbol
Don't allow common symbols to be classified as STB_WEAK
Add a constant to be used as a global value offset in data relocations 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 17:29:04 +00:00
Jakob Stoklund Olesen
9390cd0e86 Remove RegisterScavenger::isSuperRegUsed(). This completely reverses the mistaken commit r77904.
Now there is no special treatment of instructions that redefine part of a
super-register. Instead, the super-register is marked with <imp-use,kill> and
<imp-def>. For instance, from LowerSubregs on ARM:

subreg: CONVERTING: %Q1<def> = INSERT_SUBREG %Q1<undef>, %D1<kill>, 5
subreg: %D2<def> = FCPYD %D1<kill>, 14, %reg0, %Q1<imp-def>

subreg: CONVERTING: %Q1<def> = INSERT_SUBREG %Q1, %D0<kill>, 6
subreg: %D3<def> = FCPYD %D0<kill>, 14, %reg0, %Q1<imp-use,kill>, %Q1<imp-def>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 13:19:10 +00:00
Jakob Stoklund Olesen
dffb051c21 Simplify RegScavenger::forward a bit more.
Verify that early clobber registers and their aliases are not used.

All changes to RegsAvailable are now done as a transaction so the order of
operands makes no difference.

The included test case is from PR4686. It has behaviour that was dependent on the order of operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78465 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 13:18:47 +00:00
Bob Wilson
9e699cc726 Add new intrinsics for Neon VTRN, VZIP and VUZP operations. Modeling these
as vector shuffles did not work out well.  Shuffles that produce double-wide
vectors accurately represent the operation but make it hard to do anything
with the results.  I considered splitting them up into 2 shuffles, one to
write each register separately, but there doesn't seem to be a good way to
reunite them for codegen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:53:05 +00:00
Daniel Dunbar
c3c9239d76 Add DEBUG_WITH_TYPE as a clean alternative to tweaking DEBUG_TYPE.
This:
--
#undef DEBUG_TYPE
#define DEBUG_TYPE "foo"
DEBUG(...)
#undef DEBUG_TYPE
#define DEBUG_TYPE ""
--
becomes this:
--
DEBUG_WITH_TYPE("foo", ...)
--


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:48:59 +00:00
Chris Lattner
db0a9706e7 remove a bunch of now-dead crud from the asmprinter and TAI interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:16:27 +00:00
Chris Lattner
59e8677b19 fix the column output stuff in the asmwriter from being dynamic and
driven by TAI to being static, driven by tblgen.  This means that a
target doesn't get impacted by this stuff at all if it doesn't opt
into it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:13:38 +00:00
Argyrios Kyrtzidis
8b6d86df06 Modifications to dyn_cast/cast to make them work for objects too, instead of only pointers.
The use case is if you have a wrapper class:

class Base {
  void *Ptr;
public:
  Base() : Ptr(0) { }
  operator bool() const { return Ptr; }
.....
}

and sub-wrappers that have exactly the same size:

class Sub : public Base {
public:
....
static bool classof(const Base*);
}

and in the code you would do:

void f(Base b) {
  Sub sub = dyn_cast<Sub>(b);
  if (sub) {
    ....
  }
}



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 22:49:24 +00:00
Chris Lattner
b124be4f97 fix comment pastos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 22:44:56 +00:00
Jeffrey Yasskin
0d5bd59553 To catch bugs like the one fixed in
http://llvm.org/viewvc/llvm-project?view=rev&revision=78127, I'm changing the
ExecutionEngine's global mappings to hold AssertingVH<const GlobalValue>. That
way, if unregistering a mapping fails to actually unregister it, we'll get an
assert. Running the jit nightly tests didn't uncover any actual instances of
the problem.

This also uncovered the fact that AssertingVH<const X> didn't work, so I fixed
that too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 19:54:29 +00:00
Andreas Bolka
699db99c1a SIV/MIV classification for LDA.
LoopDependenceAnalysis::getLoops is currently O(N*M) for a loop-nest of
depth N and a compound SCEV of M atomic SCEVs. As both N and M will
typically be very small, this should not be a problem. If it turns out
to be one, rewriting getLoops as SCEVVisitor will reduce complexity to
O(M).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78394 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 18:23:41 +00:00
Dan Gohman
1eaf391458 Use std::string() instead of std::string("").
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 01:43:45 +00:00
Dan Gohman
7db949df78 Fix a bunch of namespace pollution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 01:32:21 +00:00
Jakob Stoklund Olesen
31f5591c91 Get rid of RegScavenger::backwards() before the bitrot spreads.
If we need it one day, there is nothing wrong with putting it back in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 21:19:03 +00:00
Devang Patel
bceda93251 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 20:57:44 +00:00
Chris Lattner
24f654c8a4 Fix several fixmes and clean up code by sinking *all* section
creation activity into the target-specific subclasses of TLOF.
Before this, globals with explicit sections could be created by
the base class.

1. make getOrCreateSection protected, add a new getExplicitSectionGlobal
   pure virtual method to assign sections to globals with a specified
   section.
2. eliminate getSpecialCasedSectionGlobals, which is now PIC specific.
3. eliminate the getKindForNamedSection virtual method, which is
   now just a static method for ELF.
4. Add implementions of getExplicitSectionGlobal for ELF/PECOFF/Darwin/PIC16.
   They are now all detangled and understandable, woo! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 16:39:58 +00:00
John Mosby
e0161ea105 Reg Scavenging generalization (Thumb support):
- start support for new PEI w/reg alloc, allow running RS from emit{Pro,Epi}logue() target hooks.
- fix minor issue with recursion detection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 16:32:47 +00:00
Devang Patel
27a201d236 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 15:39:34 +00:00
Daniel Dunbar
8113c6739e Don't search the entire type table just to delete a type by name.
- This also fixes the ENABLE_EXPENSIVE_CHECKS failure on vmcore.ml.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78287 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 06:04:35 +00:00
Owen Anderson
d7f2a6cb3f Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 23:16:16 +00:00
Daniel Dunbar
c9008c5cc7 Make block and function count available via ProfileInfo.
- Part of optimal static profiling patch sequence by Andreas Neustifter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 21:51:16 +00:00
David Greene
a5bb59f856 Fix some column padding bugs, reorganize things as suggested by Chris
and eliminate complexity.  Yay!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 21:00:52 +00:00
Chris Lattner
cafbdc5c09 remove the 'DataSectionStartSuffix' and 'TextSectionStartSuffix' knobs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 20:49:52 +00:00
Dan Gohman
197f728d49 Fix FindExecutable to use sys::Path::GetMainExecutable instead of
just argv[0]. And remove the code for searching the current
working directory and for searching PATH; the point of FindExecutable
is not to find whatever version of the executable can be found by
searching around, but to find an executable that accompanies the
current executable.

Update the tools to use sys::Program::FindProgramByName when they
want PATH searching.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 20:21:17 +00:00
Dan Gohman
d87dc0fdab Add an explicit keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 16:40:32 +00:00
Dan Gohman
892fe182c8 Delete an obsolete sentance from a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 16:39:42 +00:00
Daniel Dunbar
ee16638bfc Remove unnecessary ProfileInfoLoader methods.
- Part of optimal static profiling patch sequence by Andreas Neustifter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 15:55:56 +00:00
Daniel Dunbar
c9af366fc3 Add StringRef::endswith
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 15:48:26 +00:00
Andrew Lenharth
ea2381eb71 only point to dest labels if the graph has them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 15:04:22 +00:00
Benjamin Kramer
19229581ba Remove unused forward decls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 11:33:27 +00:00
Bruno Cardoso Lopes
52d0851446 - Remove custom handling of jumptables by the elf writter (this was
a dirty hack and isn't need anymore since the last x86 code emitter patch)
- Add a target-dependent modifier to addend calculation
- Use R_X86_64_32S relocation for X86::reloc_absolute_word_sext
- Use getELFSectionFlags whenever possible
- fix getTextSection to use TLOF and emit the right text section 
- Handle global emission for static ctors, dtors and Type::PointerTyID
- Some minor fixes



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 06:57:03 +00:00
Andreas Bolka
831f6f6d2a ZIV tester for LDA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 04:26:05 +00:00
Chris Lattner
58bed8fc29 expose SectionKindForGlobal to curious clients, named as
getKindForGlobal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 04:25:40 +00:00
Dan Gohman
98ca4f2a32 Major calling convention code refactoring.
Instead of awkwardly encoding calling-convention information with ISD::CALL,
ISD::FORMAL_ARGUMENTS, ISD::RET, and ISD::ARG_FLAGS nodes, TargetLowering
provides three virtual functions for targets to override:
LowerFormalArguments, LowerCall, and LowerRet, which replace the custom
lowering done on the special nodes. They provide the same information, but
in a more immediately usable format.

This also reworks much of the target-independent tail call logic. The
decision of whether or not to perform a tail call is now cleanly split
between target-independent portions, and the target dependent portion
in IsEligibleForTailCallOptimization.

This also synchronizes all in-tree targets, to help enable future
refactoring and feature work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 01:29:28 +00:00
Bruno Cardoso Lopes
e55fef36a9 1) Proper emit displacements for x86, using absolute relocations where necessary
for ELF to work.  
2) RIP addressing: Use SIB bytes for absolute relocations where RegBase=0, 
IndexReg=0.
3) The JIT can get the real address of cstpools and jmptables during
code emission, fix that for object code emission


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78129 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 00:11:21 +00:00
Chris Lattner
4f95d2bda4 revert r78048, it isn't worth using assertingvh here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 23:07:12 +00:00
Owen Anderson
48b2f3e485 Factor some of the constants+context related code out into a separate header, to make LLVMContextImpl.h
not hideous.  Also, fix some MSVC compile errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 22:41:48 +00:00
Owen Anderson
d03eecd063 Privatize the last bit of Constant-creation state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:25:11 +00:00
Chris Lattner
f9c1ccf280 rip out SectionEndDirectiveSuffix support, only uses by
the masm backend.  If anyone cares about masm in the future,
we'll have semantic sections it can hang off of.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:09:41 +00:00
Douglas Gregor
c7a6da6e14 Add some type traits that are used for Clang's statically-checked
canonical types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 17:04:52 +00:00
Chris Lattner
ec409759e9 enhance codegen to put 16-bit character strings into the
__TEXT,__ustring section on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:27:13 +00:00
Chris Lattner
7e88a50428 fix a fixme: don't create an explicit "CStringSection" for ELF,
it is just being used as a prefix, so forward substitute it directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:19:50 +00:00
Chris Lattner
3b24c01720 make MergeableCString be a SectionKind "abstract class", and
add new concrete versions for 1/2/4-byte mergable strings.

These are not actually created yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 05:35:56 +00:00
Chris Lattner
0a0193edf9 switch ValueMap to using AssertingVH. This is an old patch I had laying
around in a tree I forgot about.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 04:31:02 +00:00
Daniel Dunbar
a277f4e33d Remove unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 04:04:25 +00:00
Daniel Dunbar
214e22396f Remove now unused Module argument to createTargetMachine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 04:02:45 +00:00
Chris Lattner
290c2f56ce eliminate CurrentSection, rename CurrentSection_ -> CurrentSection, make it private,
eliminate IsInTextSection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78017 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:20:21 +00:00
Chris Lattner
c6fdced3db Kill off SwitchToDataSection and SwitchToTextSection, woo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:10:34 +00:00
Devang Patel
4771e16fa9 Keep track of metadata used by other metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:51:10 +00:00
Dan Gohman
5544c6cad8 Minor whitespace fix, so this doesn't look like a unary *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:30:18 +00:00
Dan Gohman
43ee5f7c08 Add a new Constant::getIntegerValue helper function, and convert a
few places in InstCombine to use it, to fix problems handling pointer
types. This fixes the recent llvm-gcc bootstrap error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 22:07:33 +00:00
David Greene
b525766479 Re-apply LiveInterval index dumping patch, with fixes suggested by Bill
and others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 21:55:09 +00:00
Chris Lattner
11e9657eeb Eliminate textual section switching from the x86 backend, one
more step towards "semantics sections"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 21:53:27 +00:00
Chris Lattner
38c398808c make getObjFileLowering() return a non-const reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 19:12:26 +00:00
Benjamin Kramer
d5fe92efbc llvm_report_error already prints "LLVM ERROR:". So stop reporting errors like "LLVM ERROR: llvm: error:" or "LLVM ERROR: ERROR:".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 13:33:33 +00:00
Anton Korobeynikov
4ab15535e7 Add 'Indirect' LocInfo class and use to pass __m128 on win64. Also minore fixes here and there (mostly __m64).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 08:13:56 +00:00
Devang Patel
a82f8838c6 Add NamedMDNode destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 06:19:01 +00:00
Daniel Dunbar
defc85327a Fix a race condition in getting the process exit code on Win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 05:02:46 +00:00
Daniel Dunbar
4bd03abe59 Remove now unused arguments from TargetRegistry::lookupTarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 04:20:57 +00:00
Daniel Dunbar
3c2d4bf97f Pass target triple string in to TargetMachine constructor.
This is not just a matter of passing in the target triple from the module;
currently backends are making decisions based on the build and host
architecture. The goal is to migrate to making these decisions based off of the
triple (in conjunction with the feature string). Thus most clients pass in the
target triple, or the host triple if that is empty.

This has one important change in the way behavior of the JIT and llc.

For the JIT, it was previously selecting the Target based on the host
(naturally), but it was setting the target machine features based on the triple
from the module. Now it is setting the target machine features based on the
triple of the host.

For LLC, -march was previously only used to select the target, the target
machine features were initialized from the module's triple (which may have been
empty). Now the target triple is taken from the module, or the host's triple is
used if that is empty. Then the triple is adjusted to match -march.

The take away is that -march for llc is now used in conjunction with the host
triple to initialize the subtarget. If users want more deterministic behavior
from llc, they should use -mtriple, or set the triple in the input module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 04:03:51 +00:00
Andreas Bolka
5eca4525f4 Restrict LDA to affine subscripts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 01:03:48 +00:00
Daniel Dunbar
275872e799 Fix some comments referring to std::cerr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 01:02:24 +00:00
Daniel Dunbar
e28039cfd1 Move most targets TargetMachine constructor to only taking a target triple.
- The C, C++, MSIL, and Mips backends still need the module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 23:37:13 +00:00
Jakob Stoklund Olesen
1391cc19d0 Remove unneeded intrinsics from Blackfin backend.
__builtin_bfin_ones does the same as ctpop, so it can be implemented in the front-end.

__builtin_bfin_loadbytes loads from an unaligned pointer with the disalignexcpt instruction. It does the same as loading from a pointer with the low bits masked. It is better if the front-end creates a masked load. We can always instruction select the masked to disalignexcpt+load.

We keep csync/ssync/idle. These intrinsics represent instructions that need workarounds for some silicon revisions. We may even want to convert inline assembler to intrinsics to enable the workarounds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77917 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 21:49:05 +00:00
Daniel Dunbar
bf4fc28303 Adjust comment to distinguish between target name and triple target name they
match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 19:41:20 +00:00
Jakob Stoklund Olesen
0e6a4efdd4 Scavenger asserts.
Allow imp-def and imp-use of anything in the scavenger asserts, just like the machine code verifier.
Allow redefinition of a sub-register of a live register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 18:28:41 +00:00
Jakob Stoklund Olesen
6b30f5c867 Add some basic blackfin intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 18:28:11 +00:00
Jakob Stoklund Olesen
d950941e13 Analog Devices Blackfin back-end.
Generate code for the Blackfin family of DSPs from Analog Devices:

  http://www.analog.com/en/embedded-processing-dsp/blackfin/processors/index.html
  
We aim to be compatible with the exsisting GNU toolchain found at:

  http://blackfin.uclinux.org/gf/project/toolchain
  
The back-end is experimental.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 17:32:10 +00:00
Benjamin Kramer
e6864c1d35 Remove duplicated colons and spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 12:13:02 +00:00
Chris Lattner
18a4c16726 move dwarf debug info section selection stuff from TAI to
TLOF, unifying all the dwarf targets at the same time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 07:24:22 +00:00
Chris Lattner
35039ac241 convert EHFrameSection to be managed by TLOF instead of TAI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 06:52:36 +00:00
Chris Lattner
d90183d25d Move the getInlineAsmLength virtual method from TAI to TII, where
the only real caller (GetFunctionSizeInBytes) uses it.

The custom ARM implementation of this is basically reimplementing
an assembler poorly for negligible gain.  It should be removed 
IMNSHO, but I'll leave that to ARMish folks to decide.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 05:20:37 +00:00
Chris Lattner
b6bbfebdc6 move a virtual method body to its .cpp file to avoid a #include
in a header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:58:19 +00:00
Chris Lattner
9ba8c6872d remove the dead ELFTargetAsmInfo.h/cpp file. TargetAsmInfo
defaults to being ELF.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77866 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:33:09 +00:00
Chris Lattner
8d4a0a328a remove TargetAsmInfo::TM, which is now dead. The basic TAI class now
no longer depends on TM!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:27:24 +00:00
Chris Lattner
05e5fcab09 move an enum from TM -> TargetOptions. This makes TargetOptions.h
be self contained, and it isn't used from TM.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:08:52 +00:00
Chris Lattner
b6d667403f remove the dead PreferredEHDataFormat TAI hook: its now dead
even considering #if 0 code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:02:52 +00:00
Chris Lattner
d5bbb07ec8 move getDwarfExceptionSection from TAI to TLOF and rename it to
getLSDASection() to be more specific.  This makes it pretty obvious
that the ELF LSDA section is being specified wrong in PIC mode.  We're
probably getting a lot of startup-time relocations to a readonly page,
which is expensive and bad.

Someone who cares about ELF C++ should investigate this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 01:34:32 +00:00
Chris Lattner
80ec2792b2 convert ctors/dtors section to be in TLOF instead of
TAI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77842 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:34:36 +00:00
Daniel Dunbar
cdcb388a58 Change MCOperand to use Create style instead of Make style for constructing
operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:09:22 +00:00
Chris Lattner
7b1dcdfce1 make SectionKind::Kind completely private now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:04:12 +00:00
Chris Lattner
1ef9be2883 Make SectionKind::get() private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77835 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 00:02:44 +00:00
Chris Lattner
2798119ab4 (re)introduce new simpler apis for creation sectionkinds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 23:57:16 +00:00
Chris Lattner
83d77faf6e Remove "JumpTableDataSection" from TAI, instead, have AsmPrinter
compute it based on what it knows.  As part of this, rename getSectionForMergeableConstant
to getSectionForConstant because it works for non-mergable constants also.

The only functionality change from this is that Xcore will start dropping
its jump tables into readonly section instead of data section in -static mode.
This should be fine as the linker resolves the relocations.  If this is a
problem, let me know and we'll come up with another solution.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 23:46:12 +00:00
Chris Lattner
b80610cd13 REmove dead fields of TAI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 22:40:22 +00:00
Chris Lattner
824583844a fix a fixme by sinking various target-specific directives down into
the appropriate subclasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:56:13 +00:00
Chris Lattner
f9650c061e it turns out that isWeak() was basically dead anyway. Kill off SectionInfo :-/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77812 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:46:23 +00:00
Chris Lattner
0064e85050 fix a layering violation by moving SectionKind out to its own header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:30:49 +00:00
Dan Gohman
f17008844a Minor whitespace tidiness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:25:46 +00:00
Chris Lattner
423d190dbe with the previous refactoring, fixme fixed!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:21:43 +00:00
Chris Lattner
968ff11967 Change SectionKind to be a property that is true of a *section*, it
should have no state that is specific to particular globals in the
section.  In this case, it means the removal of the "isWeak" and
"ExplicitSection" bits.  MCSection uses the new form of SectionKind.

To handle isWeak, I introduced a new SectionInfo class, which is
SectionKind + isWeak, and it is used by the part of the code generator
that does classification of a specific global.

The ExplicitSection disappears.  It is moved onto MCSection as a new
"IsDirective" bit.  Since the Name of a section is either a section
or directive, it makes sense to keep this bit in MCSection.  Ultimately
the creator of MCSection should canonicalize (e.g.) .text to whatever
the actual section is.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 21:11:14 +00:00
Dan Gohman
7aeff084a4 Use the default copy ctor and copy-assignment operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77793 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 19:11:31 +00:00
Chris Lattner
4a7bc1e5aa All MCSections are now required to have a SectionKind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 18:25:49 +00:00
Dan Gohman
f94083333c Give MachineFunctionAnalysis a destructor so it can verify that
that it released its allocated memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 04:19:43 +00:00
Ted Kremenek
458ba32680 Make default ctor for ImmutableSet::iterator public.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 01:28:23 +00:00
Owen Anderson
7e3142b012 Privatize all but one of the remaining constant tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:45:43 +00:00
Mikhail Glushenkov
7ea9de78ee Add a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 22:24:20 +00:00
David Greene
bef8768bd0 Simplify operand padding by keying off tabs in the asm stream. If
padding is disabled, tabs get replaced by spaces except in the case of
the first operand, where the tab is output to line up the operands after
the mnemonics.

Add some better comments and eliminate redundant code.

Fix some testcases to not assume tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:57:10 +00:00
Daniel Dunbar
76c4d7696c llvm-mc: Support quoted identifiers.
- Uses MCAsmToken::getIdentifier which returns the (sub)string representing the
   meaningfull contents a string or identifier token.

 - Directives aren't done yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:55:09 +00:00
Chris Lattner
7a01e95915 PreferredEHDataFormat is always call with data and global, but this whole
thing is #if0'd out anyway.  Just simplify the code by reducing the interface.
Not deleting this is essential for Bill's continuing happiness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:39:55 +00:00
Owen Anderson
647e3016de Move the metadata constructors back to 2.5 syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:35:40 +00:00
Chris Lattner
26630c1180 move emitUsedDirectiveFor to TargetLoweringObjectFile and rename it to
indicate that it is a predicate, not an emitter.  This eliminates TAI
dependencies on Mangler and GlobalValue.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:52:39 +00:00