1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

281 Commits

Author SHA1 Message Date
Jim Laskey
69d5018a05 Place dwarf headers at earliest possible point. Well behaved when skipping
functions.

llvm-svn: 28781
2006-06-14 11:35:03 +00:00
Chris Lattner
901e7ad557 Remove some dead code, identified by coverity.
llvm-svn: 28303
2006-05-15 05:48:32 +00:00
Chris Lattner
9789688d36 remove dead variable.
llvm-svn: 28248
2006-05-12 17:33:59 +00:00
Chris Lattner
56680711dc Indent .data/.text in the .s file
llvm-svn: 28204
2006-05-09 16:15:00 +00:00
Chris Lattner
f45b6d5c08 Split SwitchSection into SwitchTo{Text|Data}Section methods.
llvm-svn: 28184
2006-05-09 04:59:56 +00:00
Chris Lattner
daae9ee503 Print a grouping around inline asm blocks so that we can tell when we are
using them.

llvm-svn: 28134
2006-05-05 21:50:04 +00:00
Chris Lattner
eb41c99161 Rename MO_VirtualRegister -> MO_Register. Clean up immediate handling.
llvm-svn: 28104
2006-05-04 18:05:43 +00:00
Chris Lattner
97f1af2f14 There shalt be only one "immediate" operand type!
llvm-svn: 28099
2006-05-04 17:21:20 +00:00
Chris Lattner
c779fca289 Remove a bunch more SparcV9 specific stuff
llvm-svn: 28093
2006-05-04 01:15:02 +00:00
Chris Lattner
0f89e6b11d Remove some more unused stuff from MachineInstr that was leftover from V9.
llvm-svn: 28091
2006-05-04 00:44:25 +00:00
Owen Anderson
71bc529dfa Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.

llvm-svn: 28074
2006-05-03 01:29:57 +00:00
Nate Begeman
fa83cee567 Hooray, everyone now uses the same printBasicBlockLabel implementation
llvm-svn: 28056
2006-05-02 17:34:51 +00:00
Nate Begeman
05174045df Extend printBasicBlockLabel a bit so that it can be used to print all
basic block labels, consolidating the code to do so in one place for each
target.

llvm-svn: 28050
2006-05-02 05:37:32 +00:00
Nate Begeman
7ed816f900 JumpTable support! What this represents is working asm and jit support for
x86 and ppc for 100% dense switch statements when relocations are non-PIC.
This support will be extended and enhanced in the coming days to support
PIC, and less dense forms of jump tables.

llvm-svn: 27947
2006-04-22 18:53:45 +00:00
Jim Laskey
fabb0ba736 Make sure that debug labels are defined within the same section and after the
entry point of a function.

llvm-svn: 27494
2006-04-07 20:44:42 +00:00
Chris Lattner
0899b16b2d Codegen things like:
<int -1, int -1, int -1, int -1>
and
 <int 65537, int 65537, int 65537, int 65537>

Using things like:
  vspltisb v0, -1
and:
  vspltish v0, 1

instead of using constant pool loads.

This implements CodeGen/PowerPC/vec_splat.ll:splat_imm_i{32|16}.

llvm-svn: 27106
2006-03-25 06:12:06 +00:00
Jim Laskey
f3cc740d75 Change interface to DwarfWriter.
llvm-svn: 26991
2006-03-23 18:09:44 +00:00
Chris Lattner
cfbce5186a Add support for "ri" addressing modes where the immediate is a 14-bit field
which is shifted left two bits before use.  Instructions like STD use this
addressing mode.

llvm-svn: 26942
2006-03-22 05:26:03 +00:00
Chris Lattner
414fed4108 Print absolute memory references like this:
lwz r2, 8(0)
instead of this:
       lwz r2, 8(r0)

This fixes the llc/llc-beta failures on PPC last night.

llvm-svn: 26922
2006-03-21 17:21:13 +00:00
Evan Cheng
7ec94f2ff7 Added getTargetLowering() to TargetMachine. Refactored targets to support this.
llvm-svn: 26742
2006-03-13 23:20:37 +00:00
Jim Laskey
91d5ce2531 Use "llvm.metadata" section for debug globals. Filter out these globals in the
asm printer.

llvm-svn: 26599
2006-03-07 22:00:35 +00:00
Chris Lattner
bc35137363 Add memory printing support for PPC. Input memory operands now work with
inline asms! :)

llvm-svn: 26365
2006-02-24 20:27:40 +00:00
Chris Lattner
cdbd9d6d4c Implement the PPC inline asm "L" modifier. This allows us to compile:
long long test(long long X) {
  __asm__("foo %0 %L0 %1 %L1" : "=r"(X): "r"(X));
  return X;
}

to:
        foo r2 r3 r2 r3

llvm-svn: 26333
2006-02-23 19:31:10 +00:00
Evan Cheng
305141c1ba - Added option -relocation-model to set relocation model. Valid values include static, pic,
dynamic-no-pic, and default.
PPC and x86 default is dynamic-no-pic for Darwin, pic for others.
- Removed options -enable-pic and -ppc-static.

llvm-svn: 26315
2006-02-22 20:19:42 +00:00
Jim Laskey
b62a583c99 Coordinate activities with llvm-gcc4 and dwarf.
llvm-svn: 26314
2006-02-22 19:02:11 +00:00
Evan Cheng
c4cda2b89a Moved PICEnabled to include/llvm/Target/TargetOptions.h
llvm-svn: 26272
2006-02-18 00:08:58 +00:00
Chris Lattner
af26f481e9 If we have zero initialized data with external linkage, use .zerofill to
emit it (instead of .space), saving a bit of space in the .o file.

For example:
int foo[100];
int bar[100] = {};

when compiled with C++ or -fno-common results in shrinkage from 1160 to 360
bytes of space.  The X86 backend can also do this on darwin.

llvm-svn: 26185
2006-02-14 22:18:23 +00:00
Chris Lattner
02f3db9781 Make sure that weak functions are aligned properly
llvm-svn: 26181
2006-02-14 20:42:33 +00:00
Chris Lattner
2e1a495967 Darwin doesn't support #APP/#NO_APP
llvm-svn: 26066
2006-02-08 23:42:22 +00:00
Chris Lattner
86d1dcf613 Emit the 'mr' pseudoop for easier reading.
llvm-svn: 26053
2006-02-08 06:56:40 +00:00
Chris Lattner
b6fae6bad7 Change prototype
llvm-svn: 26022
2006-02-06 22:18:19 +00:00
Jim Laskey
62908083eb We seem to have settled to __DWARF for section name.
llvm-svn: 26015
2006-02-06 14:16:15 +00:00
Chris Lattner
085a324bfc Use the asmprinter to find out what the preferred alignment of a global is.
This patch speeds up 172.mgrid from 31.81s to 11.39s on darwin/ppc.
Many many thanks to Nate for tracking down the root cause of the issue.

llvm-svn: 25979
2006-02-05 01:30:45 +00:00
Chris Lattner
d202c4d3cc add a method
llvm-svn: 25884
2006-02-01 22:38:46 +00:00
Jim Laskey
583aae3110 Set up MachineDebugInfo to scan for debug information form "llvm.db"g globals.
Global Variable information is now pulled from "llvm.dbg.globals"

llvm-svn: 25655
2006-01-26 20:21:46 +00:00
Jim Laskey
18ba7ce7b3 Crude Dwarf global variable debugging.
llvm-svn: 25569
2006-01-24 00:49:18 +00:00
Chris Lattner
aafc339b4e Add explicit #includes of <iostream>
llvm-svn: 25515
2006-01-22 23:41:00 +00:00
Chris Lattner
1ecabc5a6f trivial formatting improvement: don't insert extra blank lines between .comm
vars.

llvm-svn: 25492
2006-01-21 01:35:26 +00:00
Jim Laskey
6b25a4e659 Added minimum Dwarf aranges. Cleaned up some section headers. Line number
support now works in gdb.

llvm-svn: 25417
2006-01-18 16:54:26 +00:00
Jim Laskey
52d9832e70 Add frame work for additional dwarf sections. Comments will improve as code
is added.

llvm-svn: 25410
2006-01-17 20:41:40 +00:00
Jim Laskey
0c4202b0ba Adding basic support for Dwarf line number debug information.
I promise to keep future commits smaller.

llvm-svn: 25396
2006-01-17 17:31:53 +00:00
Jim Laskey
5eddaee9f3 Added initial support for DEBUG_LABEL allowing debug specific labels to be
inserted in the code.

llvm-svn: 25104
2006-01-05 01:25:28 +00:00
Jim Laskey
61138e28ff Applied some recommend changes from sabre. The dominate one beginning "let the
pass manager do it's thing."  Fixes crash when compiling -g files and suppresses
dwarf statements if no debug info is present.

llvm-svn: 25100
2006-01-04 22:28:25 +00:00
Jim Laskey
62b29812a6 Tie dwarf generation to darwin assembler.
llvm-svn: 25093
2006-01-04 13:52:30 +00:00
Nate Begeman
96c7e22231 Fix one of the things in the todo file, and get a bit closer to folding
constant offsets from statics into the address arithmetic.

llvm-svn: 24999
2005-12-24 01:00:15 +00:00
Chris Lattner
8c2622a14e fix handling of weak linkage
llvm-svn: 24964
2005-12-22 21:15:17 +00:00
Nate Begeman
d4562971b3 Fix a couple of the FIXMEs, thanks to suggestion from Chris. This allows
us to load and store vectors directly at a pointer (offset of zero) by
using r0 as the base register.  This also requires some asm printer work
to satisfy the darwin assembler.

For
void %foo(<4 x float> * %a) {
entry:
  %tmp1 = load <4 x float> * %a;
  %tmp2 = add <4 x float> %tmp1, %tmp1
  store <4 x float> %tmp2, <4 x float> *%a
  ret void
}

We now produce:
_foo:
        lvx v0, 0, r3
        vaddfp v0, v0, v0
        stvx v0, 0, r3
        blr

Instead of:
_foo:
        li r2, 0
        lvx v0, r2, r3
        vaddfp v0, v0, v0
        stvx v0, r2, r3
        blr

llvm-svn: 24872
2005-12-19 23:40:42 +00:00
Nate Begeman
9c7dce88b5 Convert load/store over to being pattern matched
llvm-svn: 24871
2005-12-19 23:25:09 +00:00
Jim Laskey
37957b1ad3 Added source file/line correspondence for dwarf (PowerPC only at this point.)
llvm-svn: 24748
2005-12-16 22:45:29 +00:00
Chris Lattner
ba98d302be Weak and linkonce global vars should still have a .globl emitted for them
llvm-svn: 24747
2005-12-16 21:46:14 +00:00
Chris Lattner
890fd4e66c Update the darwin handling of linkonce & weak functions and GV stubs. This
should work in all permutations.

llvm-svn: 24728
2005-12-16 00:22:14 +00:00
Chris Lattner
95555853ad Use the shared asmprinter code for printing special llvm globals
llvm-svn: 24695
2005-12-13 06:32:50 +00:00
Chris Lattner
1468c52811 reindent a loop, unswitch a loop. No functionality changes
llvm-svn: 24692
2005-12-13 04:33:58 +00:00
Chris Lattner
6d4db7c732 Remove type casts that are no longer needed
llvm-svn: 24661
2005-12-11 07:45:47 +00:00
Chris Lattner
cdeeb94947 Teach the PPC backend about the ctor and dtor list when not using __main and
linking the entire program into one bc file.

llvm-svn: 24645
2005-12-09 18:24:29 +00:00
Nate Begeman
84be54b731 No longer track value types for asm printer operands, and remove them as
an argument to every operand printing function.  Requires some slight
tweaks to x86, the only user.

llvm-svn: 24541
2005-11-30 18:54:35 +00:00
Chris Lattner
a5ec3d8e81 Use generic constant pool emission code in the AsmPrinter class.
llvm-svn: 24465
2005-11-21 08:26:15 +00:00
Chris Lattner
31197fa019 Use the FunctionNumber provided by the AsmPrinter class
llvm-svn: 24462
2005-11-21 08:14:07 +00:00
Chris Lattner
d7ae8bcf66 Use CommentString where possible, fix a bug where aix mode wouldn't assemble
due to basic blocks being misnamed.

llvm-svn: 24459
2005-11-21 08:02:41 +00:00
Chris Lattner
f3af64b478 unify the darwin and aix constant pool printers
llvm-svn: 24458
2005-11-21 07:57:37 +00:00
Chris Lattner
3e2c6c1d15 Adjust to capitalized AsmPrinter method names
llvm-svn: 24456
2005-11-21 07:51:23 +00:00
Chris Lattner
b4955ba62b use PrivateGlobalPrefix for basic blocks
llvm-svn: 24453
2005-11-21 07:41:05 +00:00
Chris Lattner
bc917fe899 This is now implemented in common codegen code
llvm-svn: 24446
2005-11-21 07:06:58 +00:00
Chris Lattner
78bb97af59 set PrivateGlobalPrefix on darwin, use it when printing out CP references
llvm-svn: 24441
2005-11-21 06:47:58 +00:00
Chris Lattner
da306413bb only use dyld stubs if not in ppc-static mode. This completes support for
non-static codegen.

llvm-svn: 24403
2005-11-17 19:40:30 +00:00
Chris Lattner
25e065cc46 refactor call operand handling to eliminate special cases from printOp.
llvm-svn: 24401
2005-11-17 19:25:59 +00:00
Chris Lattner
02522dc4e6 disentangle call operands from branch operands a bit
llvm-svn: 24400
2005-11-17 19:16:08 +00:00
Nate Begeman
684381a73b Patch to clean up function call pseudos and support the BLA instruction,
which branches to an absolute address.  This is required to support objc
direct dispatch.

llvm-svn: 24370
2005-11-16 00:48:01 +00:00
Chris Lattner
bbed9bff31 Make sure to use SwitchSection to switch sections so that we don't accidentally emit
functions into the .const section.  Whoops.

llvm-svn: 24363
2005-11-15 01:45:01 +00:00
Chris Lattner
baf0cc4e6e Handle globals with explicit alignment requests
llvm-svn: 24355
2005-11-14 19:00:30 +00:00
Chris Lattner
9bfbc74ed4 Teach the PPC asmwriter to honor globals with explicit section requests.
llvm-svn: 24353
2005-11-14 18:52:46 +00:00
Chris Lattner
e1435b7831 Make BB and CPI labels use the function number, not the function name as a
uniquing id.  This makes things happy when the function name is quoted,
preventing labels like LBB"foo"_2.

llvm-svn: 24295
2005-11-10 21:59:25 +00:00
Chris Lattner
fb66a38f13 Darwin supports quoted labels. This implements:
test/Regression/CodeGen/PowerPC/darwin-labels.ll

llvm-svn: 24287
2005-11-10 19:33:43 +00:00
Chris Lattner
7ad799fbc1 Make the aix asm printer interface properly with the parent class
llvm-svn: 24274
2005-11-10 18:20:29 +00:00
Chris Lattner
dd58fcaf6b Add a flag to enable a darwin linker optimization
llvm-svn: 24130
2005-11-01 00:12:36 +00:00
Chris Lattner
906dc8d0e5 Make constant pool entries use private labels. This is important when you're
not compiling a whole program at a time :)

llvm-svn: 24129
2005-10-31 22:12:06 +00:00
Chris Lattner
c3f548dceb Do not globalize internal symbols
llvm-svn: 24064
2005-10-28 18:44:07 +00:00
Chris Lattner
5edea4e9cd Fix the JIT encoding of LWA, LD, STD, and STDU.
llvm-svn: 23787
2005-10-18 16:51:22 +00:00
Nate Begeman
723637974b More PPC32 -> PPC changes, as well as merging some classes that were
redundant after the change.

llvm-svn: 23759
2005-10-16 05:39:50 +00:00
Chris Lattner
d3946bbea6 Rename PPC32*.h to PPC*.h
This completes the grand PPC file renaming

llvm-svn: 23745
2005-10-14 23:59:06 +00:00
Chris Lattner
0405f3388f Rename PowerPC*.h to PPC*.h
llvm-svn: 23743
2005-10-14 23:51:18 +00:00