Commit Graph

32366 Commits

Author SHA1 Message Date
Benjamin Kramer 5ff90ed33e Initialize HasMetadata to zero.
llvm-svn: 82145
2009-09-17 14:51:57 +00:00
Evan Cheng 4ba30d9913 Remove simple regalloc. It has bit rotted.
llvm-svn: 82127
2009-09-17 05:48:07 +00:00
Chris Lattner ac6271e3f4 add a version of the APFloat constructor that initializes to 0.0
llvm-svn: 82110
2009-09-17 01:08:43 +00:00
Evan Cheng f56b0482c4 Fix PR4910: Broken logic in coalescer means when a physical register liveness is being shortened, the sub-registers were not. The symptom is the register allocator could not find a free register for this particular test.
llvm-svn: 82108
2009-09-17 00:57:15 +00:00
Daniel Dunbar c7012fa1e8 Some platforms may need malloc.h for alloca.
llvm-svn: 82100
2009-09-17 00:14:44 +00:00
Daniel Dunbar 487d1c8138 Update CMake.
llvm-svn: 82097
2009-09-17 00:06:48 +00:00
Sean Callanan cc774e7476 Added the LODS (load byte into register, usually
as part string parsing) instructions to the Intel
instruction tables.

llvm-svn: 82089
2009-09-16 22:59:28 +00:00
Daniel Dunbar 4498168753 Add StringRef::{rfind, rsplit}
llvm-svn: 82087
2009-09-16 22:38:48 +00:00
Sean Callanan 73645ac10c Added the LAR (load segment access rights)
instructions to the Intel instruction tables.

llvm-svn: 82084
2009-09-16 21:55:34 +00:00
Sean Callanan 7865f79011 Added the LOOP family of instructions to the Intel
instruction tables.

llvm-svn: 82083
2009-09-16 21:50:07 +00:00
Sean Callanan ca968cf1f0 Added an alternate form of register-register CMP
to the Intel instruction tables.

llvm-svn: 82081
2009-09-16 21:11:23 +00:00
Devang Patel 44b3a87f78 Fix typo.
llvm-svn: 82080
2009-09-16 21:09:07 +00:00
Devang Patel 852c9b6627 At iSel time, update DebugLoc based on debug info attached with an instruction.
llvm-svn: 82077
2009-09-16 20:39:11 +00:00
Dan Gohman 0f64d71d99 Add a new pass for doing late hoisting of floating-point and vector
constants out of loops. These aren't covered by the regular LICM
pass, because in LLVM IR constants don't require separate
instructions. They're not always covered by the MachineLICM pass
either, because it doesn't know how to unfold folded constant-pool
loads. This is somewhat experimental at this point, and off by
default.

llvm-svn: 82076
2009-09-16 20:25:11 +00:00
Devang Patel dec23fd825 Print debug info attached with an instruction.
llvm-svn: 82075
2009-09-16 20:21:17 +00:00
Bob Wilson 5d8cfb217c Expand vector floating-point conversions not supported by NEON.
llvm-svn: 82074
2009-09-16 20:20:44 +00:00
Devang Patel 820640d39f Provide a way to extract location info from DILocation.
llvm-svn: 82064
2009-09-16 18:20:05 +00:00
Devang Patel 0d9950e315 Parse debug info attached with an instruction.
llvm-svn: 82063
2009-09-16 18:18:06 +00:00
Devang Patel d5497a4bf8 Add llvm::Metadata to manage metadata used in a context.
This interface will be used to attach metadata with an instruction.

llvm-svn: 82060
2009-09-16 18:09:00 +00:00
Kevin Enderby c0edda3184 Fix incorrect assert that should be a user error for code like 'mov $0, %%eax'.
llvm-svn: 82054
2009-09-16 17:18:29 +00:00
Dan Gohman bd0050810c Change FoldPHIArgBinOpIntoPHI to decline folding if it would introduce two
phis, similar to the FoldPHIArgGEPIntoPHI change.

Also, delete some comments that don't reflect the code.

llvm-svn: 82053
2009-09-16 16:50:24 +00:00
Benjamin Kramer 6f3d4e900b Don't sort the vector when it is empty. This should fix some expensive checking
failures.

llvm-svn: 82040
2009-09-16 11:43:12 +00:00
Andreas Neustifter 41c1103273 Reapplied r81355 with the problems fixed.
(See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090907/086737.html and
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090907/086746.html)

llvm-svn: 82039
2009-09-16 11:35:50 +00:00
Xerxes Ranby 230c717e0b updated lib/CodeGen/CMakeLists.txt to unbreak cmake build after r82018
llvm-svn: 82038
2009-09-16 10:18:36 +00:00
Andreas Neustifter f8cb758ba8 Preserve ProfileInfo during CodeGenPrepare.
llvm-svn: 82034
2009-09-16 09:26:52 +00:00
Chris Lattner 05f4039763 move FnStubs/GVSTubs/HiddenGVStub handling out of the X86 asmprinter
and use MachineModuleInfoMachO instead.

llvm-svn: 82022
2009-09-16 06:25:03 +00:00
Chris Lattner 3828c2fa80 revert a hunk of r82018 that wasn't supposed to go in yet.
llvm-svn: 82020
2009-09-16 06:04:53 +00:00
Chris Lattner f3f54ffc89 add a new MachineModuleInfoMachO class, which is the per-module
stuff common across all macho targets.

llvm-svn: 82018
2009-09-16 06:03:48 +00:00
Chris Lattner 07fc26d63c the pointer MMI keeps will start out with object-file format specific stuff
llvm-svn: 82012
2009-09-16 05:26:00 +00:00
Chris Lattner 273215733c tidy up
llvm-svn: 82011
2009-09-16 05:25:43 +00:00
Chris Lattner 46dcaadb4a rearrange X86ATTAsmPrinter::doFinalization, making a scan of
the global variable list only happen for COFF targets.

llvm-svn: 82010
2009-09-16 05:20:33 +00:00
Chris Lattner 8df79f2681 remove the AsmPrinter::printMCInst hook hack now that
we have MCInstPrinter.

llvm-svn: 82006
2009-09-16 04:57:15 +00:00
Shantonu Sen b15840a6d6 fix cmake build
llvm-svn: 81999
2009-09-16 04:44:00 +00:00
Nate Begeman 1ae49ee7ca Do not try and sink a load whose chain result has more than one use, when
trying to create RMW opportunities in the x86 backend.  This can cause a 
cycle to appear in the graph, since the other uses may eventually feed into
the TokenFactor we are sinking the load below.

llvm-svn: 81996
2009-09-16 03:20:46 +00:00
Sean Callanan 771a1f1720 Added the ENTER instruction, which sets up a stack
frame, to the Intel instruction tables.

llvm-svn: 81995
2009-09-16 02:57:13 +00:00
Sean Callanan 0fdee53266 Added the definitions for one-bit left shifts to
the Intel instruction tables.

The patterns will stay blank because ADD reg, reg
is faster, but having the encoding available is
useful for the disassembler.

llvm-svn: 81994
2009-09-16 02:28:43 +00:00
Dan Gohman 3b7ce109ec Don't sink gep operators through phi nodes if the result would require
more than one phi, since that leads to higher register pressure on
entry to the phi. This is especially problematic when the phi is in
a loop header, as it increases register pressure throughout the loop.

llvm-svn: 81993
2009-09-16 02:01:52 +00:00
Sean Callanan 1c28c4db58 Removed a few instructions that were already
covered by other definitions.

llvm-svn: 81992
2009-09-16 01:54:38 +00:00
Chris Lattner b866602f06 Big change #1 for personality function references:
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding
fields from MAI: they aren't part of the asm syntax, they are
related to the structure of the object file.

To replace their functionality, add a new 
TLOF::getSymbolForDwarfGlobalReference method which asks targets
to decide how to reference a global from EH in a pc-relative way.

The default implementation just returns the symbol.  The default
darwin implementation references the symbol through an indirect
$non_lazy_ptr stub.  The bizarro x86-64 darwin specialization
handles the weird "foo@GOTPCREL+4" hack.

DwarfException.cpp now uses this to emit the reference to the
symbol in the right way, and this also eliminates another 
horrible hack from DwarfException.cpp:

-    if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL"))
-      O << "-" << MAI->getPCSymbol();

llvm-svn: 81991
2009-09-16 01:46:41 +00:00
Chris Lattner 0d3f6962a1 remove a dead variable.
llvm-svn: 81985
2009-09-16 01:29:11 +00:00
Chris Lattner 6a833f6806 add a helper method for creating MCSymbol and MCSymbolRefExpr at
the same time.

llvm-svn: 81984
2009-09-16 01:26:31 +00:00
Sean Callanan e739ac8900 Added a variety of floating-point and SSE instructions.
All of these do not have patterns (they're for the
disassembler).

Many of the floating-point instructions will probably
be rolled into definitions that have patterns, and may
eventually be superseded by mdefs.  So I put them
together and left a comment.

llvm-svn: 81979
2009-09-16 01:13:52 +00:00
Chris Lattner 6b99ae882b inline AsmPrinter::getCurrentFunctionEHName into its only caller.
llvm-svn: 81970
2009-09-16 00:35:39 +00:00
Bob Wilson 6cc46577f4 Expand some more vector operations not supported by Neon.
llvm-svn: 81969
2009-09-16 00:32:15 +00:00
Chris Lattner d106abfce7 Eliminate AsmPrinter::EmitExternalGlobal, inlining its (now)
one implementation into its one caller.  This eliminates a totally
awesome and gratuitous hack where we casted a Function* to 
GlobalVariable*.

llvm-svn: 81967
2009-09-16 00:17:39 +00:00
Bob Wilson 4ed397c141 Neon does not support vector divide or remainder. Expand them.
llvm-svn: 81966
2009-09-16 00:17:28 +00:00
Chris Lattner 4e465598f0 eliminate the PPC backend's implementation of EmitExternalGlobal
and use PersonalityPrefix/Suffix to achieve the same effect (like
the x86 backend).

This changes the code generated for ppc static mode, but guess what,
we were generating this before:

	.byte	0x9B                                        ; Personality (indirect pcrel sdata4)
	.long	___gxx_personality_v0-.                     ; Personality

which is not correct! (it is not an 'indirect' reference).
 

llvm-svn: 81965
2009-09-16 00:14:19 +00:00
Chris Lattner dd5a989034 eliminate the horrid AsmPrinter::getGlobalLinkName method, inlining
it into all of its call sites and simplifying them.

llvm-svn: 81962
2009-09-16 00:08:41 +00:00
Chris Lattner 3045f9e57b simplify some code
llvm-svn: 81961
2009-09-16 00:08:07 +00:00
Bob Wilson 194a2518e5 Expand all v2f64 arithmetic operations for Neon.
Radar 7200803.  (This should also fix the
SingleSource/UnitTests/Vector/sumarray-dbl test.)

llvm-svn: 81959
2009-09-15 23:55:57 +00:00
Sean Callanan f8f6479388 Added far return instructions (that is, returns to
code in other segments) to the Intel instruction
tables.

llvm-svn: 81953
2009-09-15 23:37:51 +00:00
Chris Lattner 2251293788 remove some horrible MAI hooks which fortunately turn out to be always empty.
llvm-svn: 81946
2009-09-15 23:11:32 +00:00
Chris Lattner 7b40df7589 strength reduce a call to PrintRelDirective(true).
llvm-svn: 81942
2009-09-15 22:58:35 +00:00
Chris Lattner f2471ec967 add hooks to hang target-specific goop off MachineModuleInfo,
move MachineFunctionInfo virtual method out of line to give it
a home.

llvm-svn: 81940
2009-09-15 22:44:26 +00:00
Nate Begeman fbb88b180c Do not add the SVOffset to the Node CSE ID. The same pointer argument cannot have different
SVOffsets.

llvm-svn: 81937
2009-09-15 22:30:11 +00:00
Eric Christopher 17f54d0f42 Expand on comment.
llvm-svn: 81928
2009-09-15 21:56:46 +00:00
Sean Callanan 7a27b9342c Updated comments per Eli's suggestion.
llvm-svn: 81923
2009-09-15 21:43:27 +00:00
Sean Callanan 79b570de9d Added register-to-register ADD instructions to the
Intel tables, where the source operand is
specified by the R/M field and the destination
operand by the Reg field.

llvm-svn: 81914
2009-09-15 20:53:57 +00:00
Daniel Dunbar 316b4a0206 Drop the raw_ostream required buffer size to 1.
- As best I can tell, we have eliminated all the code which used to require a
   larger buffer size.

llvm-svn: 81912
2009-09-15 20:31:46 +00:00
Daniel Dunbar 9367ec8644 Fix -Asserts warning.
llvm-svn: 81909
2009-09-15 20:31:12 +00:00
Nate Begeman 178135c88b Better solution for tracking both the original alignment of the access, and the current alignment based
on the source value offset.  This avoids increasing the size of mem nodes. 

llvm-svn: 81897
2009-09-15 19:05:41 +00:00
Sean Callanan e8ea876cc3 Added a new register class for segment registers
to the Intel register table.
Added 16- and 64-bit MOVs to and from the segment
registers to the Intel instruction tables.

llvm-svn: 81895
2009-09-15 18:47:29 +00:00
Dale Johannesen c092b76d63 Change the marker byte for stubs from 0xcd to 0xce (another form of
interrupt instruction, which shouldn't arise any other way).  0xcd is
also used by JITMemoryManager to initialize the buffer to garbage,
which means it could appear following a noreturn call even when
that is not a stub, confusing X86CompilationCallback2.  PR 4929.

llvm-svn: 81888
2009-09-15 18:32:14 +00:00
Chris Lattner db4916a123 fix PR4984 by ensuring that fastisel adds properly sign extended GEP displacement
values to machineinstrs.

llvm-svn: 81886
2009-09-15 18:27:02 +00:00
Chris Lattner 7ff4a94c4b add missing file
llvm-svn: 81881
2009-09-15 18:03:13 +00:00
Bob Wilson 967bf27de2 Handle AddrMode4 for Thumb2 in rewriteT2FrameIndex. This occurs for
VLDM/VSTM instructions, and without this check, the code assumes that an
offset is allowed, as it would be with VLDR/VSTR.  The asm printer,
however, silently drops the offset, producing incorrect code.  Since the
address register in this case is either the stack or frame pointer, the
spill location ends up conflicting with some other stack slot or with
outgoing arguments on the stack.

llvm-svn: 81879
2009-09-15 17:56:18 +00:00
Sandeep Patel f3369c22a7 Fix superreg use in ARMAsmPrinter. Approved by Anton Korobeynikov.
llvm-svn: 81878
2009-09-15 17:53:11 +00:00
Chris Lattner 840c700654 several major improvements to the sparc backend: support for weak linkage
and PIC codegen.  Patch by Venkatraman Govindaraju!

llvm-svn: 81877
2009-09-15 17:46:24 +00:00
Dan Gohman 94262db4d4 Teach ValueTracking how to look through GlobalAliases. GlobalAliases are
not folded in the constant folder because the constant folder doesn't
simplify ConstantExpr operands.

llvm-svn: 81864
2009-09-15 16:14:44 +00:00
Dan Gohman 0ea0e1b4af Fix an accidental inversion of the inbounds flag.
llvm-svn: 81862
2009-09-15 16:00:30 +00:00
Dan Gohman e4532f30b1 When a constant's type is refined, update the constant in place
instead of cloning and RAUWing it.

 - Make AbstractTypeUser a friend of Value so that it can offer
   its subclasses a way to update a Value's type in place. This
   is better than a universally visible setType method on Value,
   and it's sufficient for the immediate need.

 - Eliminate the constant "convert" functions. This eliminates a
   lot of logic duplication, and fixes a complicated bug where a
   constant can't actually be cloned during the type refinement
   process because some of the types that its folder needs are
   half-destroyed, being in the middle of refinement themselves.

 - Move the getValType functions from being static overloaded
   functions in Constants.cpp to be members of class template
   specializations in ConstantsContext.h. This means that the
   code ends up getting instantiated twice, however it also
   makes it possible to eliminate all "convert" functions, so
   it's not a big net code size increase. And if desired, the
   duplicate instantiations could be eliminated with some
   reorganization.

llvm-svn: 81861
2009-09-15 15:58:07 +00:00
Nick Lewycky 7465cd769c Add more newlines to make up for the ones removed from the end of instructions.
llvm-svn: 81851
2009-09-15 07:08:25 +00:00
Evan Cheng a38ff3edae Another try at early partial coalescing. Identity phi source copies (their sources are defined by phi join def) are coalesced. And the phi join copy is backward copy propagated into the other copies.
Still miscompiling some tests. :-(

llvm-svn: 81849
2009-09-15 06:45:16 +00:00
Nick Lewycky c5cb3bd927 Forbid arrays of function-type and structures with function-typed fields.
While I'm there, change code that does:
  SomeTy == Type::getFooType(Context)
into:
  SomeTy->getTypeID() == FooTyID
to decrease the amount of useless type creation which may involve locking, etc.

llvm-svn: 81846
2009-09-15 06:28:26 +00:00
Chris Lattner ee8f74f5d1 fix PR4963: folding insertvalue would sometimes turn a packed struct into
an unpacked one.

llvm-svn: 81845
2009-09-15 06:28:12 +00:00
Chris Lattner e0987215f0 add a new CallGraphNode::replaceCallEdge method and use it from
argpromote to avoid invalidating an iterator.  This fixes PR4977.
All clang tests now pass with expensive checking (on my system 
at least).

llvm-svn: 81843
2009-09-15 05:40:35 +00:00
Chris Lattner e9a4992399 add newline to debug dump
llvm-svn: 81840
2009-09-15 05:14:57 +00:00
Chris Lattner d4d966f500 make -debug-pass=Executions show information about what call graph nodes
are in the SCC for each execution of a CGSCC pass.

llvm-svn: 81838
2009-09-15 05:03:04 +00:00
Chris Lattner f82f27be3f add some missing quotes in debug output
llvm-svn: 81836
2009-09-15 04:45:26 +00:00
Ted Kremenek 8e780355b7 Remove invalid add_dependencies line to unbreak the CMake build.
llvm-svn: 81827
2009-09-15 04:06:36 +00:00
Mikhail Glushenkov 0adf07eb9e Get rid of GetProcessId in Win32/Program.inc.
GetProcessId was introduced only in XP. As a bonus, this change makes Program
objects copyable, since Program is now basically a PID.

llvm-svn: 81826
2009-09-15 03:39:45 +00:00
Dan Gohman 520a6856ba Don't pull a load through a callseq_start if the load's chain
has multiple uses, as one of the other uses may be on a path
to a different node above the callseq_start, because that
leads to a cyclic graph. This problem is exposed when
-combiner-global-alias-analysis is used. This fixes PR4880.

llvm-svn: 81821
2009-09-15 01:22:01 +00:00
Nate Begeman d41f8fd2b3 Remove incorrect CSE code from r81813.
llvm-svn: 81819
2009-09-15 00:38:09 +00:00
Sean Callanan 050e0cdb9a Modified the Intel instruction tables to include
versions of CALL and JMP with segmented addresses
provided in-line, as pairs of immediates.

llvm-svn: 81818
2009-09-15 00:35:17 +00:00
Kevin Enderby ccab317837 Added the first bits of the ARM target assembler to llvm-mc. For now it only
parses the .word directive as 4 bytes and ARMAsmParser::ParseInstruction will
give an error is called.  Broke out the test of the .word directive into two
different test cases, one for x86 and one for arm.

llvm-svn: 81817
2009-09-15 00:27:25 +00:00
Nate Begeman 879d8f1c3e Substantially speed up combiner-aa in the following ways:
1. Switch from an std::set to a SmallPtrSet for visited chain nodes.
2. Do not force the recursive flattening of token factor nodes, regardless of
   use count.
3. Immediately process newly created TokenFactor nodes.

Also, improve combiner-aa by teaching it that loads to non-overlapping offsets
of relatively aligned objects cannot alias.

These changes result in a >5x speedup for combiner-aa on most testcases.

llvm-svn: 81816
2009-09-15 00:18:30 +00:00
Nate Begeman 01c1e1152d Teach the legalizer to propagate the original alignment of loads and store when
it splits them.

llvm-svn: 81815
2009-09-15 00:14:28 +00:00
Dan Gohman 65829a4ccb On x86-64, the 32-bit cmov doesn't actually clear the high 32-bit of
its result if the condition is false.

llvm-svn: 81814
2009-09-15 00:14:11 +00:00
Nate Begeman 02a685a914 Add an "original alignment" field to load and store nodes. This enables the
DAG Combiner to disambiguate chains for loads and stores of types which are
 broken up by the Legalizer into smaller pieces.  

llvm-svn: 81813
2009-09-15 00:13:12 +00:00
Dan Gohman f9eafce3af When extending a memset range past the front, set the alignment of the
memset region to the alignment of the new start address.

llvm-svn: 81810
2009-09-14 23:39:10 +00:00
Evan Cheng 7f789596f3 Add early coalescing to liveintervals. This is work in progress and is known to miscompute some tests. Read it at your own rish, I have aged 10 year while writing this.
The gist of this is if source of some of the copies that feed into a phi join is defined by the phi join, we'd like to eliminate them. However, if any of the non-identity source overlaps the live interval of the phi join then the coalescer won't be able to coalesce them. The early coalescer's job is to eliminate the identity copies by partially-coalescing the two live intervals.

llvm-svn: 81796
2009-09-14 21:33:42 +00:00
Bill Wendling 6dcc9d1b4b Pull the creation of the "RewindFunction" function out of the loop. It's only
created once, so shouldn't be stuck in the middle of the loop. Also early exit
if there are no uses of UnwindInst in the function.

llvm-svn: 81785
2009-09-14 20:52:37 +00:00
Jim Grosbach 04f9d2e264 trivial whitespace cleanup
llvm-svn: 81773
2009-09-14 17:27:35 +00:00
Chris Lattner dda095ec4a add PR#
llvm-svn: 81770
2009-09-14 16:49:26 +00:00
Daniel Dunbar 813efa2551 Update CMake.
llvm-svn: 81757
2009-09-14 05:22:47 +00:00
Chris Lattner 4dc75de733 PIC16 does allow colon after MBB labels, simplify EmitBasicBlockStart.
llvm-svn: 81755
2009-09-14 03:15:54 +00:00
Chris Lattner 11b2fc9ea4 Change MCAsmStreamer to take an MCInstPrinter instead of a
full AsmPrinter, and change TargetRegistry to keep track
of registered MCInstPrinters.

llvm-mc is still linking in the entire
target foo to get the code emitter stuff, but this is an
important step in the right direction.

llvm-svn: 81754
2009-09-14 03:02:37 +00:00
Nick Lewycky a22585ada9 Fix a pair of comment typos.
llvm-svn: 81750
2009-09-14 02:25:34 +00:00
Nick Lewycky 22c4a497ab Fifth time's a charm! Remove ourselves as abstract type listeners once we've
been told that the type is no longer abstract.

llvm-svn: 81749
2009-09-14 02:25:19 +00:00
Chris Lattner 6d31b43592 Give MCInstPrinter a MCAsmInfo member, make X86ATTInstPrinter
be a MCInstPrinter.

llvm-svn: 81746
2009-09-14 01:49:26 +00:00
Chris Lattner de57d8e72b add a new MCInstPrinter class, move the (trivial) MCDisassmbler ctor inline.
llvm-svn: 81745
2009-09-14 01:43:38 +00:00
Chris Lattner aa398f5d23 tidy up a bit.
llvm-svn: 81744
2009-09-14 01:34:40 +00:00
Nick Lewycky c9f9367785 Don't leak! Always remove oneself as a listener after adding oneself.
llvm-svn: 81736
2009-09-14 00:36:52 +00:00
Nick Lewycky 64f18eceaf Actually remove old types from the set.
Also break the type verification stuff into its own TypeSet to keep the
Verifier pass from becoming an AbstractTypeUser.

llvm-svn: 81729
2009-09-13 23:45:39 +00:00
Chris Lattner 0bad631cde kill off the last use of TRI::AsmName.
llvm-svn: 81727
2009-09-13 22:42:03 +00:00
Chris Lattner a3e68b567c add some special case handling for strangely named x86 registers.
llvm-svn: 81726
2009-09-13 22:41:48 +00:00
Chris Lattner a4760f3642 'printMCInst' doesn't print newlines after instructions anymore.
llvm-svn: 81723
2009-09-13 22:24:34 +00:00
Daniel Dunbar 51e72707b7 Remove unused variables.
llvm-svn: 81718
2009-09-13 21:31:07 +00:00
Nick Lewycky 6133026331 Storing a set of PATypeHolders is a bad idea because their sort order will
change as types are refined. Remove abstract types from CheckedTypes when they
we're informed that they have been refined. The only way types get refined in
the verifier is when later function passes start optimizing. Fixes PR4970.

llvm-svn: 81716
2009-09-13 21:07:59 +00:00
Chris Lattner eb2cc68254 remove all but one reference to TargetRegisterDesc::AsmName.
llvm-svn: 81714
2009-09-13 20:31:40 +00:00
Chris Lattner ad10b3be3e the tblgen produced 'getRegisterName' method does not access
the object, make it static instead of const.

llvm-svn: 81711
2009-09-13 20:19:22 +00:00
Chris Lattner 56950c6b97 switch the x86 asmprinters to use getRegisterName instead
of getting it from TRI, inst printing now is codegen context
free!

llvm-svn: 81710
2009-09-13 20:15:16 +00:00
Chris Lattner 06c5eed9e9 make tblgen produce a function that returns the name for a physreg.
Nothing is using this info yet.

llvm-svn: 81707
2009-09-13 20:08:00 +00:00
Chris Lattner 6822e695c1 eliminate an extraneous use of TRI::getAsmName in a comment.
llvm-svn: 81705
2009-09-13 19:48:37 +00:00
Chris Lattner 6ceb0faafd make intel asmprinter use TRI::getAsmName instead of TRI::getName like
all the other targets.  Add support for weak/linkonce linkage so it doesn't
crash on basically all nontrivial testcases.

llvm-svn: 81704
2009-09-13 19:44:38 +00:00
Chris Lattner 1cbd3ded33 split MCInst printing out of the X86ATTInstPrinter
class into its own X86ATTInstPrinter class.  The inst
printer now has just one dependence on the code generator
(TRI).

llvm-svn: 81703
2009-09-13 19:30:11 +00:00
Chris Lattner 159db96ae1 reduce indentation with early exit.
llvm-svn: 81699
2009-09-13 19:10:08 +00:00
Chris Lattner d940dd5801 remove MAI::JumpTableSpecialLabelPrefix now that MAI
has real information about linker private linkage.

llvm-svn: 81695
2009-09-13 19:02:16 +00:00
Chris Lattner 43f119c3da delete the fixme too! :)
llvm-svn: 81689
2009-09-13 18:50:22 +00:00
Chris Lattner 033d31165d merge the linux cpool/jtbl pic tests into pic.ll and convert to filecheck.
Change the picbase symbol on non-darwin systems from ".Lllvm$4.$piclabel" to
".L4$pb".  The actual name doesn't matter and the darwin name is shorter.

llvm-svn: 81688
2009-09-13 18:46:37 +00:00
Chris Lattner 1c815bef6a make X86ATTAsmPrinter::PrintPICBaseSymbol forward to X86MCInstLower.
llvm-svn: 81685
2009-09-13 18:33:59 +00:00
Chris Lattner 1d04aa78f3 replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.

llvm-svn: 81684
2009-09-13 18:25:37 +00:00
Chris Lattner de79e4fc2e fix MCSymbol printing on darwin to exactly match the mangler (handling of \n and " in a symbol name).
llvm-svn: 81683
2009-09-13 18:11:09 +00:00
Chris Lattner 3d6c8ebb58 Make the MC symbol printer and llvm::Mangler exactly agree on mangling
for systems that don't support quoting (PR4966).

llvm-svn: 81682
2009-09-13 18:04:46 +00:00
Chris Lattner 4cd449813a convert some uses of printBasicBlockLabel to use GetMBBSymbol
instead.

llvm-svn: 81677
2009-09-13 17:14:04 +00:00
Anton Korobeynikov 6b9b8c1471 Fix merge problem
llvm-svn: 81658
2009-09-13 01:12:15 +00:00
Anton Korobeynikov 6c89da7027 Define proper subreg sets for arm - this should fix bunch of subtle problems
with subreg - superreg mapping and also fix PR4965.

llvm-svn: 81657
2009-09-13 00:59:43 +00:00
Daniel Dunbar a22637897a Experimental fix for PR4960.
- Could we just always implement this as __clear_cache for __GNUC__?

llvm-svn: 81655
2009-09-12 23:29:02 +00:00
Chris Lattner a602bebb61 devirtualize AsmPrinter::printBasicBlockLabel since it is never overridden.
Move GetMBBSymbol up to AsmPrinter and make printBasicBlockLabel use it so that
we only have one place that decides what to name bb labels.  Hopefully various
clients of printBasicBlockLabel can start using GetMBBSymbol instead.

llvm-svn: 81652
2009-09-12 23:02:08 +00:00
Dan Gohman 648c836f6c Remove unnecessary #include.
llvm-svn: 81636
2009-09-12 22:24:25 +00:00
Anton Korobeynikov 8d0fbebb9f Add QPR_VFP2 regclass and add copy_to_regclass nodes, where needed to
constraint the register usage.

llvm-svn: 81635
2009-09-12 22:21:08 +00:00
Dan Gohman f436e87813 Preserve the inbounds flag, so that the constant folder doesn't
recompute it.

llvm-svn: 81634
2009-09-12 22:02:17 +00:00
Dan Gohman 07b5c40ed8 Fix the build when DEBUG_SYMBOL_TABLE is set.
llvm-svn: 81633
2009-09-12 21:56:48 +00:00
Chris Lattner a1378f3d89 factor MBB label lowering better
llvm-svn: 81630
2009-09-12 21:06:08 +00:00
Chris Lattner 6ccf7ed4be X86MCInstLower::Lower should only not emit anything to OutStreamer,
this means that it can only lower one MachineInstr to one MCInst.  To
make this fly, we need to pull out handling of MO_GOT_ABSOLUTE_ADDRESS
(which generates an implicit label) out of X86MCInstLower.

llvm-svn: 81629
2009-09-12 21:01:20 +00:00
Chris Lattner 5090e6c4a7 eliminate the "MBBLabel" MCOperand type, and just use a MCSymbol for
MBB labels like everything else.

llvm-svn: 81628
2009-09-12 20:45:03 +00:00
Chris Lattner 3172208823 split MachineInstr -> MCInst lowering into its own class (not
being embedded into X86ATTAsmPrinter).  This still depends heavily
on X86ATTAsmPrinter, but this is a step in the right direction.

llvm-svn: 81627
2009-09-12 20:34:57 +00:00
Chris Lattner a3f2662a24 remove the "old" at&t style asmprinter. Unfortunately, most of the
operand printing crapola cannot be removed yet because it is used by
the inline asm print stuff.

llvm-svn: 81626
2009-09-12 20:01:36 +00:00
Lang Hames dad2da59ad Moved some more index operations over to LiveIntervals.
llvm-svn: 81605
2009-09-12 03:34:03 +00:00
Sean Callanan 57dba6768e Added the WAIT instruction to the Intel tables,
for the purposes of the disassembler.

llvm-svn: 81603
2009-09-12 02:52:41 +00:00
Sean Callanan 29849eadef Added CMPS (string comparison) instructions for all
operand widths to the Intel instruction tables, for
the purposes of the disassembler.

llvm-svn: 81601
2009-09-12 02:25:20 +00:00
Evan Cheng 760c92a5be Remove -new-coalescer-heuristic. It's not useful.
llvm-svn: 81600
2009-09-12 02:14:41 +00:00
Evan Cheng fe4d1e64d5 80 col violations.
llvm-svn: 81598
2009-09-12 02:01:07 +00:00
Chris Lattner 42c1287b68 fix another GCC bootstrap problem, which manifested as things
like:
foo.s:2412:non-relocatable subtraction expression, "_gomp_tls_key" minus "L1$pb"

llvm-svn: 81596
2009-09-12 01:11:50 +00:00
Chris Lattner 37a4e48529 fix an embarassing typo that resulted in llvm-gcc bootstrap miscompare
because the sorting wasn't sorting.

llvm-svn: 81592
2009-09-12 00:49:00 +00:00
Sean Callanan 4dc00d3781 Added SCAS instructions in their 8, 16, 32, and
64-bit variants for the disassembler.

llvm-svn: 81591
2009-09-12 00:37:19 +00:00
Daniel Dunbar b918900995 Fix -Asserts warning.
llvm-svn: 81580
2009-09-11 22:07:31 +00:00
Ted Kremenek c74e09f654 Update CMake files.
llvm-svn: 81577
2009-09-11 21:49:45 +00:00
Dan Gohman e592923603 Fix llvm-extract's "writing bitcode to a terminal" warning, which wasn't
working. To support this, add an is_displayed() function to raw_ostream,
and generalize Process::StandardOutIsDisplayed and friends in order to
support it.

Also, call RemoveFileOnSignal before creating a file instead of after, so
that the file isn't left behind if the program is interrupted between when
the file is created and RemoveFileOnSignal is called.

While here, add a -S to llvm-extract and port it to IRReader so that it
supports assembly input.

llvm-svn: 81568
2009-09-11 20:46:33 +00:00
Jim Grosbach 210d6fef51 Revert array initialization regclass change so that the initialization stays static, not runtime.
llvm-svn: 81560
2009-09-11 20:13:17 +00:00
Jim Grosbach a1072a85d6 Update register class references to use the global constant ARM::*RegisterClass names.
llvm-svn: 81556
2009-09-11 19:49:06 +00:00
Sean Callanan 31e48cdb5d Added ADC, SUB, SBB, and OR instructions that operate
on rAX and an immediate.

llvm-svn: 81551
2009-09-11 19:01:56 +00:00
Chris Lattner 8b3a539579 fix pasto
llvm-svn: 81544
2009-09-11 18:33:44 +00:00
Caroline Tice 183a519771 Don't generate Dwarf line table entries for source line 0.
llvm-svn: 81542
2009-09-11 18:25:54 +00:00
Chris Lattner 61bfc3adeb fix some fixmes: emit stubs in sorted order.
llvm-svn: 81541
2009-09-11 18:20:26 +00:00
Duncan Sands 4bd8040d14 Fix PR4948 (and a leak): by not destroying the DwarfException
object, the timer it creates was not being deleted.  Since the
timer belonged to a static timer group, the timer group would
be destroyed on shutdown, and would notice and complain that
not all timers it contained were destroyed.

llvm-svn: 81533
2009-09-11 17:24:29 +00:00
Chris Lattner 992e42b606 turn on -experimental-asm-printer for x86 / AT&T by default.
llvm-svn: 81532
2009-09-11 17:07:27 +00:00
Chris Lattner 7730dcc858 reject attempts to take the address of an intrinsic, PR4949.
llvm-svn: 81530
2009-09-11 17:05:29 +00:00
Andreas Neustifter bcdb0423c5 Bugfix. Sorry.
llvm-svn: 81517
2009-09-11 08:43:15 +00:00
Andreas Neustifter f5a1ca2133 Make ProfileEstimator even more robust on general CFGs.
llvm-svn: 81516
2009-09-11 08:39:33 +00:00
Chris Lattner 19a9f42f20 switch HiddenGVStubs to be a DenseMap instead of a string map, mirroring FnStubs and GVStubs.
llvm-svn: 81514
2009-09-11 07:03:20 +00:00
Chris Lattner 446d589cad Fix a bug I introduced in FnStubs generation, switch GVStubs to be a
densemap instead of StringMap to match FnStubs.

llvm-svn: 81513
2009-09-11 06:59:18 +00:00
Chris Lattner 9a7edd6bba change FnStubs from being a StringMap<std::string> to being a much
more efficient SmallPtrSet<MCSymbol*>.  This eliminates string
craziness and fixes CodeGen/X86/darwin-quote.ll with the new asmprinter.

Codegen is producing stubs in a nondeterminstic order, but it was doing
this before anyway.

llvm-svn: 81511
2009-09-11 06:36:33 +00:00
Chris Lattner 30c44c053f printInstruction() no longer prints a \n after itself, do it
for the two instruction MOVPC32r sequence.

llvm-svn: 81509
2009-09-11 05:59:55 +00:00
Chris Lattner 35ed98aaef reimplement X86ATTAsmPrinter::GetGlobalAddressSymbol in terms of
Mangler::getNameWithPrefix.  In addition to avoiding some over
quoting, this also is more efficient because it uses smallvector
instead of std::string thrashing.

llvm-svn: 81508
2009-09-11 05:58:44 +00:00
Chris Lattner c827f53495 fix prefix ordering, it's L_foo not _Lfoo
llvm-svn: 81506
2009-09-11 05:51:29 +00:00
Chris Lattner 840c8d72d0 add a new Mangler::getNameWithPrefix API which returns the
(uniqued if unnamed) global variable name with the prefix that
it is supposed to get.  It doesn't do "mangling" in the sense of
adding quotes and hacking on bad characters.

llvm-svn: 81505
2009-09-11 05:40:42 +00:00
Chris Lattner 1051efc339 convert X86ATTAsmPrinter::GetExternalSymbolSymbol to use SmallString
instead of std::string and Mangler.

llvm-svn: 81503
2009-09-11 04:36:43 +00:00
Chris Lattner 482c5df56d rearrange some code, export a SmallString version of DecorateCygMingName.
llvm-svn: 81502
2009-09-11 04:28:13 +00:00
Evan Cheng 74a3231de4 Follow up to 81494. When the folded reload is narrowed to a 32-bit load then change the destination register to a 32-bit one or add a sub-register index.
llvm-svn: 81496
2009-09-11 01:01:31 +00:00
Evan Cheng 3cad6283b8 It's not legal to fold a load from a narrower stack slot into a wider instruction. If done, the instruction does a 64-bit load and that's not
safe. This can happen we a subreg_to_reg 0 has been coalesced. One
exception is when the instruction that folds the load is a move, then we
can simply turn it into a 32-bit load from the stack slot.                                                                                                                    

rdar://7170444

llvm-svn: 81494
2009-09-11 00:39:26 +00:00
Dan Gohman 9cbef32726 Make fast-isel try ISD::FNEG before resorting to bitcasts and xors.
llvm-svn: 81493
2009-09-11 00:36:43 +00:00
Dan Gohman 89b090e51e Reapply r81171 with a fix: don't try to use i64 when it
isn't legal.

llvm-svn: 81492
2009-09-11 00:34:46 +00:00
Dan Gohman 11ff570292 Fix indentation.
llvm-svn: 81484
2009-09-11 00:05:10 +00:00
Dan Gohman 21c6216c87 Teach lib/VMCore/ConstantFold.cpp how to set the inbounds keyword and
how to fold notionally-out-of-bounds array getelementptr indices instead
of just doing these in lib/Analysis/ConstantFolding.cpp, because it can
be done in a fairly general way without TargetData, and because not all
constants are visited by lib/Analysis/ConstantFolding.cpp. This enables
more constant folding.

Also, set the "inbounds" flag when the getelementptr indices are
one-past-the-end.

llvm-svn: 81483
2009-09-11 00:04:14 +00:00
Dan Gohman 7190d48075 Factor out the code for checking that all indices in a getelementptr are
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.

llvm-svn: 81478
2009-09-10 23:37:55 +00:00
Dan Gohman 91d598de5c Give these files top-level comments that describe the current code.
llvm-svn: 81473
2009-09-10 23:07:18 +00:00
Devang Patel 5ffc3854f6 Fix whitespaces.
llvm-svn: 81468
2009-09-10 22:36:12 +00:00
Bob Wilson 39f51320ca Don't swap the operands of a subtraction when trying to create a
post-decrement load/store.

llvm-svn: 81464
2009-09-10 22:09:31 +00:00
Dale Johannesen 50f0376f49 Fix uppercaseo.
llvm-svn: 81463
2009-09-10 22:01:32 +00:00
Kevin Enderby ce4bec8e0c Added the ParseInstruction() hook for target specific assembler directives so
that things like .word can be parsed as target specific.  Moved parsing .word
out of AsmParser.cpp into X86AsmParser.cpp as it is 2 bytes on X86 and 4 bytes
for other targets that support the .word directive.

llvm-svn: 81461
2009-09-10 20:51:44 +00:00
Victor Hernandez 7b98b9291c Fit code within 80 columns
llvm-svn: 81459
2009-09-10 20:18:57 +00:00
Sean Callanan 62aebf9fa2 Added XOR instructions for rAX and immediates of
various widths.

llvm-svn: 81458
2009-09-10 19:52:26 +00:00
Sean Callanan 64804f37bb Added MOV instructions between rAX and memory offsets,
including segment offsets and (for 8-bit operands)
absolute offsets.

llvm-svn: 81457
2009-09-10 18:33:42 +00:00
Sean Callanan 31bb414efd Added a variety of PUSH and POP instructions, including
ones capable of accessing R/M operands instead of just
registers.

llvm-svn: 81456
2009-09-10 18:29:13 +00:00
Bill Wendling 9535ae42ff Exit early if exception handling isn't supported.
llvm-svn: 81454
2009-09-10 18:28:06 +00:00
Andreas Neustifter 753441e318 Make ProfileEstimator more robust on general CFGs.
llvm-svn: 81450
2009-09-10 16:30:38 +00:00
Benjamin Kramer 4bf4e8686c Add some braces to make newer GCCs happy and update CMakeLists.
llvm-svn: 81443
2009-09-10 11:31:39 +00:00
Andreas Neustifter f4858d59e5 Cleaned up code by factoring out common portions of edge loading into function.
llvm-svn: 81438
2009-09-10 07:12:35 +00:00
Nick Lewycky dddf5dcdaf Correctly handle the case where a comparison is created in one BasicBlock and
used by a terminator in another.

llvm-svn: 81437
2009-09-10 07:02:09 +00:00
Bill Wendling 023ed6480e Comment and whitespace cleanups. No intentional functionality change.
llvm-svn: 81436
2009-09-10 06:50:01 +00:00
Bill Wendling 9e5c2065c5 Revert part of my r81424 patch. I removed what looked like superfluous padding
from the exception tables. However, Duncan explained why it's a can of worms to
do it the GCC way. I went back to doing it the LLVM way and added Duncan's
explanation so that I don't do this again in the future.

llvm-svn: 81434
2009-09-10 06:27:16 +00:00
Evan Cheng 1d9d4bdc99 Add malloc call utility functions. Patch by Victor Hernandez.
llvm-svn: 81426
2009-09-10 04:36:43 +00:00
Bill Wendling 243ac566e2 Don't hardcode the TType format size. In fact, rework the code so that it's more
like what GCC outputs. The mysterious code to insert padding wasn't in GCC at
all. I modified the TType base offset code to calculate the offset like GCC
does, though.

llvm-svn: 81424
2009-09-10 02:07:37 +00:00
Evan Cheng f6b2404a84 Proper support of non-lazy indirect symbols.
llvm-svn: 81422
2009-09-10 01:23:53 +00:00
Bill Wendling bf56268ff9 Remove the "#if 0" that Noone loved. It wasn't really necessary, because the
code within it was the same inside and out. There's still a problem of the
TypeInfoSize should be the size of the TType format encoding (at least that's
what GCC thinks it should be).

llvm-svn: 81417
2009-09-10 01:12:47 +00:00
Bob Wilson 59e4c84c6f Revert r81171 which was causing pr4927.
llvm-svn: 81415
2009-09-10 00:49:22 +00:00
Bill Wendling a482ec83c5 Pull check for SJLJ EH into a boolean and use that.
llvm-svn: 81409
2009-09-10 00:17:04 +00:00
Bill Wendling 73094e15c4 Use the SizeOfEncodedValue function instead of magic variables for the
sizeof(DW_EH_PE_udata4).

llvm-svn: 81408
2009-09-10 00:13:16 +00:00
Bill Wendling 7b40b5a243 Add helpful comment.
llvm-svn: 81406
2009-09-10 00:04:48 +00:00