1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

28308 Commits

Author SHA1 Message Date
Evan Cheng
1b99da6e30 Rename "loop aligner" pass to "code placement optimization" pass.
llvm-svn: 71150
2009-05-07 05:42:24 +00:00
Evan Cheng
1109c5103e Eliminate compiler warnings.
llvm-svn: 71149
2009-05-07 05:31:56 +00:00
Bill Wendling
6edd6ef74f Just turn aggressive stack coloring off at -O3.
llvm-svn: 71140
2009-05-07 01:33:38 +00:00
Bill Wendling
7c50dcd02e Temporarily revert r71010. It was causing massive failures during self-hosting.
llvm-svn: 71138
2009-05-07 01:27:25 +00:00
Argyrios Kyrtzidis
0f60e636c0 Make DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's methods:
-Have it return a label ID
-Remove the unused Instruction parameter

No functionality change.

llvm-svn: 71132
2009-05-07 00:16:31 +00:00
Dan Gohman
dee50585e0 Use stable_sort instead of plain sort to avoid the risk of generating
trivially different code on different hosts (due to differing
std::sort implementations).

llvm-svn: 71124
2009-05-06 22:54:33 +00:00
Bill Wendling
6e1b018958 - Move some debug fields to coincide with how GCC emits them. No functionality
change.
- Reformatting.

llvm-svn: 71118
2009-05-06 21:21:34 +00:00
Oscar Fuentes
a06115b0ab CMake: Updated lib/Target/PIC16/CMakeLists.txt.
llvm-svn: 71115
2009-05-06 20:40:05 +00:00
Dale Johannesen
b2cf4944c2 Use X86AddrNumOperands instead of magic constant one
more place.  This fixes a bunch of x86-64 JIT regressions.
(Introduced when the value of the magic constant changed
in 68645.  At the time apparently nobody noticed; failures
were hidden in 70343-70439 by an unrelated bug, so showed
up again as "new" failures in 70440.)

llvm-svn: 71106
2009-05-06 19:04:30 +00:00
Evan Cheng
0ee6696fd8 Do not use register as base ptr of pre- and post- inc/dec load / store nodes.
llvm-svn: 71098
2009-05-06 18:25:01 +00:00
Evan Cheng
ecc4cc83a8 Unbreak the build.
llvm-svn: 71091
2009-05-06 18:00:56 +00:00
David Greene
be8ff09e46 Make sure to use signed arithmetic in APInt to fix a regression.
llvm-svn: 71090
2009-05-06 17:39:26 +00:00
Dan Gohman
33e1f0fcb5 Simplify code by using SmallVector's pop_back_val() instead of
separate back() and pop_back() calls.

llvm-svn: 71089
2009-05-06 17:22:41 +00:00
Oscar Fuentes
24167db5ad CMake: Updated lib/CodeGen/CMakeLists.txt.
llvm-svn: 71085
2009-05-06 14:56:40 +00:00
Duncan Sands
28e07fdaa2 OCaml parameter attribute bindings from PR2752.
Incomplete, but better than nothing.

llvm-svn: 71081
2009-05-06 12:21:17 +00:00
Duncan Sands
938fde7e43 Add generic expansion of SUB when ADD and XOR
are legal.  Based on a patch by Micah Villmow.

llvm-svn: 71078
2009-05-06 11:29:50 +00:00
Duncan Sands
b71ad70b4e Fix PR3754: don't mark functions that wrap MallocInst with
the readnone.  Since MallocInst is scheduled for deletion
it doesn't seem worth doing anything more subtle, such as
having mayWriteToMemory return true for MallocInst.

llvm-svn: 71077
2009-05-06 08:42:00 +00:00
Sanjiv Gupta
cc6f71e64c Emit banksel and movlp instructions.
Split large global data (both initialized and un-initialized) into multiple sections of <= 80 bytes.
Provide routines to manage PIC16 ABI naming conventions.

llvm-svn: 71073
2009-05-06 08:02:01 +00:00
Duncan Sands
880eaf5278 Allow readonly functions to unwind exceptions. Teach
the optimizers about this.  For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.

llvm-svn: 71071
2009-05-06 06:49:50 +00:00
Lang Hames
fcc5ebb1d4 Renamed Spiller classes (plus uses and related files) to VirtRegRewriter.
llvm-svn: 71057
2009-05-06 02:36:21 +00:00
Dan Gohman
39d3c78f6a Fix a copy+pasto in a comment.
llvm-svn: 71035
2009-05-05 23:02:38 +00:00
Dan Gohman
c1169472a2 Delete a FIXME which is no longer relevant, and add a FIXME that is.
llvm-svn: 71033
2009-05-05 22:59:55 +00:00
Evan Cheng
0d781df8dc Quotes should be printed before private prefix; some code clean up.
llvm-svn: 71032
2009-05-05 22:50:29 +00:00
Bill Wendling
265f9ffc43 Add dump method to DIDescriptor.
llvm-svn: 71028
2009-05-05 22:19:25 +00:00
Dan Gohman
5e839321f2 If a MachineBasicBlock has multiple ways of reaching another block,
allow it to have multiple CFG edges to that block. This is needed
to allow MachineBasicBlock::isOnlyReachableByFallthrough to work
correctly. This fixes PR4126.

llvm-svn: 71018
2009-05-05 21:10:19 +00:00
Bill Wendling
5f4fcbeb10 Temporarily reverting r71008. It was causing this failure:
Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/
CodeGen/X86/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/
CodeGen/X86/change-compare-stride-1.ll
Failed with exit(1) at line 2
while running: grep {cmpq       $-478,} change-compare-stride-1.ll.tmp
child process exited abnormally

llvm-svn: 71013
2009-05-05 20:49:46 +00:00
Evan Cheng
984da04cd0 Enable stack coloring with regs at -O3.
llvm-svn: 71010
2009-05-05 20:30:36 +00:00
David Greene
2bb2b3840e Handle overflow of 64-bit loop conditions.
llvm-svn: 71008
2009-05-05 20:22:36 +00:00
Chris Lattner
5cc9a36d1c Add basic support for code generation of
addrspace(257) -> FS relative on x86.  Patch by Zoltan Varga!

llvm-svn: 70992
2009-05-05 18:52:19 +00:00
Evan Cheng
138eed76c7 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
a96ef42a06 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
77e14276e0 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
95ce4ffb36 Move getInstrOperandRegClass from the scheduler to TargetInstrInfo.
llvm-svn: 70950
2009-05-05 00:30:09 +00:00
Evan Cheng
ecfc8e8464 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
6843d3293b - 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
00c4ac3add 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
eecaa636fb Fix an 80-column violation.
llvm-svn: 70925
2009-05-04 22:23:18 +00:00
Dan Gohman
6bfe85b985 Fix doxygen comment syntax.
llvm-svn: 70924
2009-05-04 22:20:30 +00:00
Chris Lattner
7e3c94b55e 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
6c425d29e7 Constify a bunch of SCEV-using code.
llvm-svn: 70919
2009-05-04 22:02:23 +00:00
Dan Gohman
2973567a95 X86FastISel doesn't support the -tailcallopt ABI.
llvm-svn: 70902
2009-05-04 19:50:33 +00:00
Argyrios Kyrtzidis
f82d02a6ca Restore a comment.
llvm-svn: 70900
2009-05-04 19:23:45 +00:00
Anton Korobeynikov
262a397978 Fix code emission for conditional branches.
Patch by Collin Winter!

llvm-svn: 70898
2009-05-04 19:10:38 +00:00
Dan Gohman
f8f167320d 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
83dfa97326 Trim unnecessary #includes.
llvm-svn: 70880
2009-05-04 17:11:06 +00:00
Duncan Sands
4c7021febf 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
84cf4d62a8 fix some problems spotted by Duncan and Nicolas Geoffray
llvm-svn: 70872
2009-05-04 16:29:24 +00:00
Argyrios Kyrtzidis
fb958c2b09 -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
9df9768ee5 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
6807ddd3d9 * 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
b07d558841 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
bb12bac53b 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
e68261749e Revert r70803 for now, it causes a regression.
llvm-svn: 70811
2009-05-03 23:27:19 +00:00
Argyrios Kyrtzidis
bb6e4d027c -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
a64d6b8822 Typo.
llvm-svn: 70792
2009-05-03 19:10:11 +00:00
Evan Cheng
28aa6c41d1 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
df33e5a803 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
15587901c3 Fix typo
llvm-svn: 70770
2009-05-03 13:19:57 +00:00
Anton Korobeynikov
46a92ec4d6 Update due to mainline API change
llvm-svn: 70769
2009-05-03 13:19:42 +00:00
Anton Korobeynikov
13ed1c4514 Add TODO list :)
llvm-svn: 70768
2009-05-03 13:19:24 +00:00
Anton Korobeynikov
8988fea464 Make handling of conditional stuff much more straightforward
llvm-svn: 70767
2009-05-03 13:19:09 +00:00
Anton Korobeynikov
d8c42b2dee 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
e6c8cc6c51 Expand divisions into libcalls
llvm-svn: 70765
2009-05-03 13:18:33 +00:00
Anton Korobeynikov
34d22f34a8 Properly handle sdiv / udiv / srem / urem libcalls
llvm-svn: 70764
2009-05-03 13:18:16 +00:00
Anton Korobeynikov
54bbd77498 Custom lower SIGN_EXTEND
llvm-svn: 70763
2009-05-03 13:17:49 +00:00
Anton Korobeynikov
9103796e69 Some eye-candy
llvm-svn: 70762
2009-05-03 13:17:31 +00:00
Anton Korobeynikov
c0ea294fb9 Print function header / footer
llvm-svn: 70761
2009-05-03 13:17:11 +00:00
Anton Korobeynikov
f4b4812c83 Fix printing: je => jeq
llvm-svn: 70760
2009-05-03 13:16:54 +00:00
Anton Korobeynikov
4b5232c990 Add 8bit shifts
llvm-svn: 70759
2009-05-03 13:16:37 +00:00
Anton Korobeynikov
d0e3939bdf Handle logical shift right (at least I hope so :) )
llvm-svn: 70758
2009-05-03 13:16:17 +00:00
Anton Korobeynikov
7dd27f2e41 Handle anyext
llvm-svn: 70757
2009-05-03 13:15:57 +00:00
Anton Korobeynikov
baf9278166 Expand all sorts of indirect branches
llvm-svn: 70755
2009-05-03 13:15:40 +00:00
Anton Korobeynikov
806b8efb5e Add InsertBranch() hook for tail mergeing
llvm-svn: 70754
2009-05-03 13:15:22 +00:00
Anton Korobeynikov
b97b120cf9 Implement bswap
llvm-svn: 70753
2009-05-03 13:15:03 +00:00
Anton Korobeynikov
cebc97d79c Properly handle ExternalSymbol's
llvm-svn: 70752
2009-05-03 13:14:46 +00:00
Anton Korobeynikov
9b84c6b633 Expand muls (all mulls!) to libcalls for now
llvm-svn: 70751
2009-05-03 13:14:25 +00:00
Anton Korobeynikov
7f560f113d Proper name 16 bit libcalls
llvm-svn: 70750
2009-05-03 13:14:08 +00:00
Anton Korobeynikov
b4da45ecd8 Add libcall expansion for 16 and 128 bit muls
llvm-svn: 70749
2009-05-03 13:13:51 +00:00
Anton Korobeynikov
80d0bdc789 Provide addc and subc
llvm-svn: 70748
2009-05-03 13:13:34 +00:00
Anton Korobeynikov
1f80bde7ad Add left shift
llvm-svn: 70747
2009-05-03 13:13:17 +00:00
Anton Korobeynikov
d9b4143e47 Add direct branch
llvm-svn: 70746
2009-05-03 13:12:58 +00:00
Anton Korobeynikov
c5a13f6a3f It's error-prone to maintain two separate variants of asmprinting stuff, one of which is even used. Drop second (aka 'intel') variant of operands. It can be added later, if needed.
llvm-svn: 70745
2009-05-03 13:12:37 +00:00
Anton Korobeynikov
f7943f8df6 Lower select with custom inserted and make condjumps generic
llvm-svn: 70744
2009-05-03 13:12:23 +00:00
Anton Korobeynikov
d55d6586ae Add first draft for conditions, conditional branches, etc
llvm-svn: 70743
2009-05-03 13:12:06 +00:00
Anton Korobeynikov
2b8085a3f5 Hanle i8 returns
llvm-svn: 70742
2009-05-03 13:11:48 +00:00
Anton Korobeynikov
67b1a5c20b Small tweaking
llvm-svn: 70741
2009-05-03 13:11:35 +00:00
Anton Korobeynikov
c428224a89 Add prologue/epilogue emission. Fix frame pointer handling.
llvm-svn: 70740
2009-05-03 13:11:20 +00:00
Anton Korobeynikov
10d199fa80 Add code for save/restore of callee-saved registers
llvm-svn: 70739
2009-05-03 13:11:04 +00:00
Anton Korobeynikov
6a63537ff0 Two more hooks for RA and FP registers
llvm-svn: 70738
2009-05-03 13:10:40 +00:00
Anton Korobeynikov
06d645c199 Proper handle loading of effective address of stack slot stuff
llvm-svn: 70737
2009-05-03 13:10:26 +00:00
Anton Korobeynikov
88cc152a78 Match frame indexes
llvm-svn: 70736
2009-05-03 13:10:11 +00:00
Anton Korobeynikov
e7639579a3 First draft of stack slot loads / stores lowering
llvm-svn: 70735
2009-05-03 13:09:57 +00:00
Anton Korobeynikov
1f9d4dc64d Reverse order of memory arguments
llvm-svn: 70734
2009-05-03 13:09:40 +00:00
Anton Korobeynikov
f3fadcbbda Remove bogus pattern
llvm-svn: 70733
2009-05-03 13:09:24 +00:00
Anton Korobeynikov
47c1450013 Correct asmprinting of memory operands
llvm-svn: 70732
2009-05-03 13:09:10 +00:00
Anton Korobeynikov
eea3a58bbf Match wrapper node for address
llvm-svn: 70731
2009-05-03 13:08:51 +00:00
Anton Korobeynikov
cd06be1d13 Add lowering for global address nodes. Not pretty efficient though.
llvm-svn: 70730
2009-05-03 13:08:33 +00:00
Anton Korobeynikov
e02a674ee0 Some early full call lowering draft for direct calls
llvm-svn: 70729
2009-05-03 13:08:13 +00:00
Anton Korobeynikov
b396742d02 Add call frame setup instruction elimination and lowerid for bunch of call-related stuff.
llvm-svn: 70728
2009-05-03 13:07:54 +00:00
Anton Korobeynikov
4fa710b300 Add CALL lowering.
llvm-svn: 70727
2009-05-03 13:07:31 +00:00