Commit Graph

7648 Commits

Author SHA1 Message Date
Evan Cheng
d37c13cfd1 - Register scavenger should use MachineRegisterInfo and internal map to find the first use of a register after a given machine instruction.
- When scavenging a register, in addition to the spill, insert a restore before the first use.
- Abort if client is looking to scavenge a register even when a previously scavenged register is still live.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 02:32:35 +00:00
Dan Gohman
a1e6d363e5 Factor out the code for verifying the work of the scheduler,
extend it a bit, and make use of it in all schedulers, to
ensure consistent checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59689 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 01:26:25 +00:00
Dan Gohman
343f0c0467 Experimental post-pass scheduling support. Post-pass scheduling
is currently off by default, and can be enabled with
-disable-post-RA-scheduler=false.

This doesn't have a significant impact on most code yet because it doesn't
yet do anything to address anti-dependencies and it doesn't attempt to
disambiguate memory references. Also, several popular targets
don't have pipeline descriptions yet.

The majority of the changes here are splitting the SelectionDAG-specific
code out of ScheduleDAG, so that ScheduleDAG can be moved to
libLLVMCodeGen.a. The interface between ScheduleDAG-using code and
the rest of the scheduling code is somewhat rough and will evolve.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59676 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 23:18:57 +00:00
Dan Gohman
7d1cd3f21d Move the code for printing a graph node label for an SUnit into
a virtual method of SelectionDAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 22:09:45 +00:00
Dan Gohman
252ae9e8ae Convert SUnit's dump method into a print method and implement
dump in terms of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59665 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 21:32:03 +00:00
Devang Patel
dfca407c79 Do not use separate utility to walk all instructions and remove dead dbg intrinsics. Let instcombiner do this job.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 19:01:37 +00:00
Sanjiv Gupta
021f3f252e Int type for PIC16 is i16. Added i16 intrinsics for memmove, memcpy and memset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 08:50:17 +00:00
Chris Lattner
16062ca93a add a write method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 06:45:06 +00:00
Daniel Dunbar
911cfdb7d7 LLVMC2: -emit-llvm stops compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 04:15:56 +00:00
Daniel Dunbar
ff6477b720 LLVMC2: Teach llvm_gcc_c tool about -include and -fsyntax-only.
- Only focusing on llvm_gcc_c for now, eventually this needs to be
   refactored so it can be shared via all the gcc-like tools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 02:59:00 +00:00
Evan Cheng
01f63cdb04 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59558 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 22:27:13 +00:00
Devang Patel
f17fc461d1 Add new helper pass that strips all symbol names except debugging information.
This pass makes it easier to test wheter debugging info. influences optimization passes or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59552 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:34:39 +00:00
Oscar Fuentes
56608780c3 CMake: Remove HAVE_LT_DLOPEN from config.h.cmake because it was
removed from config.h.in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:12:01 +00:00
Dan Gohman
cbad42cfd1 Add more const qualifiers. This fixes build breakage from r59540.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 19:49:32 +00:00
Dan Gohman
b3b930a011 Make some methods const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 19:04:29 +00:00
Dan Gohman
3dbc4e3502 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 17:05:42 +00:00
Bill Wendling
5734450d40 Rename stackprotector_create intrinsic to stackprotector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 11:01:33 +00:00
Nicolas Geoffray
67c8c4caba Implement support for JIT exceptions on X86_64. Relative offsets are
encoded on 32 bytes, and the personality function is not encoded as
relative.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 10:44:46 +00:00
Bill Wendling
733bbc5320 Remove the stackprotector_check intrinsic. Use a volatile load instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 07:30:57 +00:00
Dan Gohman
3cc6243ddf Change SUnit's dump method to take a ScheduleDAG* instead of
a SelectionDAG*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59488 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 02:06:40 +00:00
Dan Gohman
e45b6f10e2 There is no InstrStage class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59480 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 01:05:04 +00:00
Mikhail Glushenkov
35fde15059 Support dependencies between plugins by priority-sorting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 17:30:25 +00:00
Mikhail Glushenkov
010887765a Add a layer of indirection to make plugins more flexible.
Use strings instead of TableGen defs in the compilation graph
definition. Makes it easier for the plugins to modify an existing graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59447 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 17:29:18 +00:00
Zhongxing Xu
69e3bd10ec move partial template specialization to FoldingSet.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 02:40:00 +00:00
Zhongxing Xu
0cf717d6b8 Fix 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:44:41 +00:00
Chris Lattner
a236c89ee3 add a new m_Specific pattern that matches only if we have a specific Value*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:38:30 +00:00
Chris Lattner
67abc10616 add a new template for matching a select between two constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59391 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:33:10 +00:00
Zhongxing Xu
f5b55475b3 Add partial specialization of FoldingSetTrait for ImmutableList.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:23:49 +00:00
Zhongxing Xu
2c228834fc Fix 80-column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:14:33 +00:00
Nick Lewycky
ac44d25bdd Clean up some strange whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 20:32:33 +00:00
Zhongxing Xu
2ef5d4cd6a Add Profile method to ImmutableList.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 09:26:02 +00:00
Oscar Fuentes
50925fbed4 CMake: Adds header and TableGen files to Visual Studio solution. A new
dummy library, `llvm_headers_do_not_build', is created for containing
all header and TableGen files under include/llvm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59346 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 02:08:08 +00:00
Oscar Fuentes
422fcf3837 CMake: Moved generation of Intrinsics.gen to
include/llvm/CMakeLists.txt. Does it with the `tablegen' cmake macro.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59342 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 00:24:38 +00:00
Dan Gohman
7e6a1bc0fa Add support for building a ScheduleDAG from MachineInstrs. This is currently
fairly conservative; it doesn't do alias-analysis queries and it doesn't
attempt to break anti-dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59324 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 21:47:58 +00:00
Richard Osborne
1d8f975890 Add XCore intrinsics for getid (returns thread id) and bitrev (reverses
bits in a word).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 10:12:16 +00:00
Dan Gohman
59d5f1d13b Add a version of NewSUnit for creating units with MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:41:36 +00:00
Dan Gohman
f449bf36ef Initial support for carrying MachineInstrs in SUnits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59278 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:06:09 +00:00
Dan Gohman
ae78a88e12 Clarify the comment about NumPreds and NumSuccs to reflect that they only
count non-control preds and succs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59276 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:41:41 +00:00
Dan Gohman
d23e0f81bc Remove the FlaggedNodes member from SUnit. Instead of requiring each SUnit
to carry a SmallVector of flagged nodes, just calculate the flagged nodes
dynamically when they are needed.

The local-liveness change is due to a trivial scheduling change where
the scheduler arbitrary decision differently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:24:17 +00:00
Dale Johannesen
330169fa3e Extend InlineAsm::C_Register to allow multiple specific registers
(actually, code already all worked, only the comment
changed).  Use this to implement 'A' constraint on x86.
Fixes PR 1779.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59266 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:52:36 +00:00
Dan Gohman
550f5afb68 Make the Node member of SUnit private, and add accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:36:12 +00:00
Dan Gohman
a23b3b803e Change ScheduleDAG's DAG member from a reference to a pointer, to prepare
for the possibility of scheduling without a SelectionDAG being present.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:21:28 +00:00
Bill Wendling
cdcc3e6e12 Modify the intrinsics pattern to separate out the "return" types from the
"parameter" types. An intrinsic can now return a multiple return values like
this:

  def add_with_overflow : Intrinsic<[llvm_i32_ty, llvm_i1_ty],
                                    [LLVMMatchType<0>, LLVMMatchType<0>]>;



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 09:08:33 +00:00
Daniel Dunbar
0d9eb9b491 Add Binary flag to raw_fd_ostream constructor.
Document raw_fd_ostream's treatment of "-".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59219 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 05:01:07 +00:00
Bill Wendling
e9e6bdf27f Implement stack protectors as function attributes: "ssp" and "sspreq".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 01:02:14 +00:00
Dan Gohman
7fc610f073 Revert the part of r59145 that changed the comment about
virtual registers possibly having multiple kills while still
being defined and killed in the same block. If LiveIntervals
is manually re-run after two-address lowering, it currently
does add extra kills to two-address instructions, but this
is considered a bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59194 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 23:24:15 +00:00
Dan Gohman
bc5cbb8be9 Move the code that inserts X87 FP_REG_KILL instructions from a
special-purpose hook to a new pass. Also, add check to see if any
x87 virtual registers are used, to avoid doing any work in the
common case that no x87 code is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 22:55:05 +00:00
Dan Gohman
e8f4ac2b10 Update VarInfo's comments to reflect the current code. LiveVar
no longer records a unique defining instruction, and virtual
registers may have multiple kills while still being defined
and killed in the same block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59145 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 17:02:24 +00:00
Dan Gohman
4974b6aae1 Correct a function name in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 16:53:40 +00:00
Tanya Lattner
0a6b8fd44a Add ptr annotation intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 07:17:57 +00:00