Commit Graph

28229 Commits

Author SHA1 Message Date
Evan Cheng a35aed567a Revert part of 70929 that has to do with determining whether a SIB byte is needed. It causes a lot of x86_64 JIT failures.
llvm-svn: 70986
2009-05-05 18:18:57 +00:00
Chris Lattner 929b644b0f Do not require variable debug info nodes to have a compile unit.
For implicit decls like "self" and "_cmd" in ObjC, these decls
should not have a location.

llvm-svn: 70964
2009-05-05 04:55:56 +00:00
Evan Cheng 6fc03634db Do not substitute if the new register isn't in the register class of the operand being updated.
llvm-svn: 70953
2009-05-05 00:46:16 +00:00
Evan Cheng 1ff2727c95 Move getInstrOperandRegClass from the scheduler to TargetInstrInfo.
llvm-svn: 70950
2009-05-05 00:30:09 +00:00
Evan Cheng dbfb102523 Do forward and backward substitution to eliminate loads and stores when possible.
llvm-svn: 70937
2009-05-04 23:13:13 +00:00
Evan Cheng c298ccb998 - Avoid the longer SIB encoding on x86_64 when it's not needed.
- Synchronize instruction length computation code in X86InstrInfo with code in X86CodeEmitter.cpp
Patch by Zoltan Varga.

llvm-svn: 70929
2009-05-04 22:49:16 +00:00
Dan Gohman 48f8222293 Re-apply 70645, converting ScalarEvolution to use
CallbackVH, with fixes. allUsesReplacedWith need to
walk the def-use chains and invalidate all users of a
value that is replaced. SCEVs of users need to be
recalcualted even if the new value is equivalent. Also,
make forgetLoopPHIs walk def-use chains, since any
SCEV that depends on a PHI should be recalculated when
more information about that PHI becomes available.

llvm-svn: 70927
2009-05-04 22:30:44 +00:00
Dan Gohman fc2a8d1eb0 Fix an 80-column violation.
llvm-svn: 70925
2009-05-04 22:23:18 +00:00
Dan Gohman 4b56fab92b Fix doxygen comment syntax.
llvm-svn: 70924
2009-05-04 22:20:30 +00:00
Chris Lattner 354b12259f Make DBG_STOPPOINT nodes, and therefore DBG_LABEL labels, get a DebugLoc, so that it
shows up in -print-machineinstrs.  This doesn't appear to affect anything, but it was
weird for some DBG_LABELs to have DebugLocs but not all of them.

llvm-svn: 70921
2009-05-04 22:10:05 +00:00
Dan Gohman a30370bc33 Constify a bunch of SCEV-using code.
llvm-svn: 70919
2009-05-04 22:02:23 +00:00
Dan Gohman bb525f7e02 X86FastISel doesn't support the -tailcallopt ABI.
llvm-svn: 70902
2009-05-04 19:50:33 +00:00
Argyrios Kyrtzidis 71fb950b73 Restore a comment.
llvm-svn: 70900
2009-05-04 19:23:45 +00:00
Anton Korobeynikov 2d1e7321f6 Fix code emission for conditional branches.
Patch by Collin Winter!

llvm-svn: 70898
2009-05-04 19:10:38 +00:00
Dan Gohman 3f02595048 Use true instead of 1 for a boolean value. And fix a copy+pasto
in a comment.

llvm-svn: 70882
2009-05-04 17:25:21 +00:00
Dan Gohman 630f4e1eb3 Trim unnecessary #includes.
llvm-svn: 70880
2009-05-04 17:11:06 +00:00
Duncan Sands 50c70336b0 Teach capture tracking that readonly functions can
only capture their arguments by returning them or
throwing an exception or not based on the argument
value.  Patch essentially by Frits van Bommel.

llvm-svn: 70876
2009-05-04 16:50:29 +00:00
Chris Lattner fa552d728d fix some problems spotted by Duncan and Nicolas Geoffray
llvm-svn: 70872
2009-05-04 16:29:24 +00:00
Argyrios Kyrtzidis 9ae29b2d8f -Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.
-Depend on DebugLocs for source line info.

(Comes with Regression-Be-Gone(tm))

llvm-svn: 70871
2009-05-04 16:23:49 +00:00
Evan Cheng 3f77805642 Make sure to color with only allocatable registers for the specific register class.
llvm-svn: 70821
2009-05-04 03:30:11 +00:00
Chris Lattner d579cb1167 * Sink 4 duplicates of edge threading validity checks and DOUT prints into
ThreadEdge directly.  This shares the code, but is just a refactoring.
* Make JumpThreading compute the set of loop headers and avoid threading
  across them.  This prevents jump threading from forming irreducible 
  loops (goodness) but also prevents it from threading in other cases that
  are beneficial (see the comment above FindFunctionBackedges).

llvm-svn: 70820
2009-05-04 02:28:08 +00:00
Chris Lattner 351134ba93 Factor loop backedge finding out of CodeGenPrepare into a new
FindFunctionBackedges function.

llvm-svn: 70819
2009-05-04 02:25:58 +00:00
Evan Cheng 4b6072bcb8 The stack slots which share the same stack slot after coloring can, but do not have to, use the same register. In fact, they each may have different register class requirements.
llvm-svn: 70815
2009-05-04 00:24:50 +00:00
Argyrios Kyrtzidis 79be34012f Revert r70803 for now, it causes a regression.
llvm-svn: 70811
2009-05-03 23:27:19 +00:00
Argyrios Kyrtzidis ce7196b903 -Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.
-Depend on DebugLocs for source line info.

llvm-svn: 70803
2009-05-03 22:03:35 +00:00
Evan Cheng 1de5cf548e Typo.
llvm-svn: 70792
2009-05-03 19:10:11 +00:00
Evan Cheng 210fc62a91 In some rare cases, the register allocator can spill registers but end up not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However, reloads and restores might be folded into uses / defs and freed registers might not be used at all.
VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants.

Not yet enabled. This is part 1. More coming.

llvm-svn: 70787
2009-05-03 18:32:42 +00:00
Anton Korobeynikov 4ff60e0cc2 Handle implicit zext in a better way. Shamelessly stolen from x86 backend.
Thanks for Dan Gohman for suggestion!

llvm-svn: 70782
2009-05-03 15:50:18 +00:00
Anton Korobeynikov 2745bc92fa Fix typo
llvm-svn: 70770
2009-05-03 13:19:57 +00:00
Anton Korobeynikov 1324f810d7 Update due to mainline API change
llvm-svn: 70769
2009-05-03 13:19:42 +00:00
Anton Korobeynikov d089ef1003 Add TODO list :)
llvm-svn: 70768
2009-05-03 13:19:24 +00:00
Anton Korobeynikov 47fcd72e24 Make handling of conditional stuff much more straightforward
llvm-svn: 70767
2009-05-03 13:19:09 +00:00
Anton Korobeynikov dedfa00ba1 Temporary disable imm patterns for cmp. Actually, all cmp-related stuff (select_cc, setcc, br_cc). needs to be rethought
llvm-svn: 70766
2009-05-03 13:18:50 +00:00
Anton Korobeynikov eb2152f753 Expand divisions into libcalls
llvm-svn: 70765
2009-05-03 13:18:33 +00:00
Anton Korobeynikov 05b7a7c8f8 Properly handle sdiv / udiv / srem / urem libcalls
llvm-svn: 70764
2009-05-03 13:18:16 +00:00
Anton Korobeynikov 29747e9c26 Custom lower SIGN_EXTEND
llvm-svn: 70763
2009-05-03 13:17:49 +00:00
Anton Korobeynikov 3c48ea7dbe Some eye-candy
llvm-svn: 70762
2009-05-03 13:17:31 +00:00
Anton Korobeynikov 48e21c57f1 Print function header / footer
llvm-svn: 70761
2009-05-03 13:17:11 +00:00
Anton Korobeynikov 8847e3e554 Fix printing: je => jeq
llvm-svn: 70760
2009-05-03 13:16:54 +00:00
Anton Korobeynikov f3a6bc8562 Add 8bit shifts
llvm-svn: 70759
2009-05-03 13:16:37 +00:00
Anton Korobeynikov 61763b532a Handle logical shift right (at least I hope so :) )
llvm-svn: 70758
2009-05-03 13:16:17 +00:00
Anton Korobeynikov 20a91130ce Handle anyext
llvm-svn: 70757
2009-05-03 13:15:57 +00:00
Anton Korobeynikov e31559576f Expand all sorts of indirect branches
llvm-svn: 70755
2009-05-03 13:15:40 +00:00
Anton Korobeynikov 41917df643 Add InsertBranch() hook for tail mergeing
llvm-svn: 70754
2009-05-03 13:15:22 +00:00
Anton Korobeynikov 4b0a0f18fb Implement bswap
llvm-svn: 70753
2009-05-03 13:15:03 +00:00
Anton Korobeynikov ba0e81d4b2 Properly handle ExternalSymbol's
llvm-svn: 70752
2009-05-03 13:14:46 +00:00
Anton Korobeynikov de60d1caef Expand muls (all mulls!) to libcalls for now
llvm-svn: 70751
2009-05-03 13:14:25 +00:00
Anton Korobeynikov 399ad444fd Proper name 16 bit libcalls
llvm-svn: 70750
2009-05-03 13:14:08 +00:00
Anton Korobeynikov f3fc92d6fc Add libcall expansion for 16 and 128 bit muls
llvm-svn: 70749
2009-05-03 13:13:51 +00:00
Anton Korobeynikov 0da755ee3e Provide addc and subc
llvm-svn: 70748
2009-05-03 13:13:34 +00:00