Chris Lattner
882b9fa977
Switch to using the generic constant pool emitter impl, use shorter
...
CPI names
llvm-svn: 24466
2005-11-21 08:29:17 +00:00
Chris Lattner
ef83ebd45d
Use generic constant pool emission code in the AsmPrinter class.
...
llvm-svn: 24465
2005-11-21 08:26:15 +00:00
Chris Lattner
ffbfa71866
Use the FunctionNumber provided by the AsmPrinter class
...
llvm-svn: 24462
2005-11-21 08:14:07 +00:00
Chris Lattner
dd3bf8e4a2
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
a0222a1698
unify the darwin and aix constant pool printers
...
llvm-svn: 24458
2005-11-21 07:57:37 +00:00
Chris Lattner
99946fb63f
Adjust to capitalized AsmPrinter method names
...
llvm-svn: 24456
2005-11-21 07:51:23 +00:00
Chris Lattner
d365627d3e
Use PrivateGlobalPrefix for basic block labels. This allows the x86 darwin
...
port to properly use L for the bb prefix instead of .
llvm-svn: 24454
2005-11-21 07:43:59 +00:00
Chris Lattner
c2bc19af57
use PrivateGlobalPrefix for basic blocks
...
llvm-svn: 24453
2005-11-21 07:41:05 +00:00
Chris Lattner
2b53ea99b0
Use PrivateGlobalPrefix for basic block labels
...
llvm-svn: 24452
2005-11-21 07:39:22 +00:00
Chris Lattner
9885c97088
Use PrivateGlobalPrefix for basic blocks
...
llvm-svn: 24451
2005-11-21 07:38:08 +00:00
Chris Lattner
a43b832f7f
Switch to the new shared SwitchSection
...
llvm-svn: 24450
2005-11-21 07:30:28 +00:00
Chris Lattner
2bccd73dbb
Start using SwitchSection, allowing globals and functions to be emitted
...
to specific sections. Delete some dead functions copied from the X86 backend.
llvm-svn: 24449
2005-11-21 07:26:04 +00:00
Chris Lattner
050bf2faf8
convert the rest of this over to use SwitchSection
...
llvm-svn: 24448
2005-11-21 07:16:34 +00:00
Chris Lattner
024e32e118
Start using the AsmPrinter shared SwitchSection code. This allows the X86
...
backend to implement global variables in sections.
llvm-svn: 24447
2005-11-21 07:11:11 +00:00
Chris Lattner
b650241f8b
This is now implemented in common codegen code
...
llvm-svn: 24446
2005-11-21 07:06:58 +00:00
Chris Lattner
2c0b435ba6
Rename SwitchSection -> switchSection to avoid conflicting with a future
...
change.
llvm-svn: 24443
2005-11-21 06:55:27 +00:00
Chris Lattner
8a4995e42a
Start using PrivateGlobalPrefix correctly
...
llvm-svn: 24442
2005-11-21 06:51:52 +00:00
Chris Lattner
41cb115afb
set PrivateGlobalPrefix on darwin, use it when printing out CP references
...
llvm-svn: 24441
2005-11-21 06:47:58 +00:00
Chris Lattner
618981fd03
Naturally align doubles in the constant pool, set PrivateGlobalPrefix on
...
darwin, use it when printing the constant pool indices so the labels are
appropriately private, emit cp entries to .const instead of .data on darwin
and only emit a single .section for the constant pool, not one for each
entry.
llvm-svn: 24440
2005-11-21 06:46:22 +00:00
Chris Lattner
6c1ca888d4
Lower READCYCLECOUNTER correctly, preserving the chain result
...
llvm-svn: 24438
2005-11-20 22:57:19 +00:00
Chris Lattner
d1061ac8d1
encode rdtsc correctly
...
llvm-svn: 24435
2005-11-20 22:13:18 +00:00
Chris Lattner
6df9e11989
use chain operands to ensure the copies don't wander from the rdtsc instruction.
...
llvm-svn: 24434
2005-11-20 22:01:40 +00:00
Andrew Lenharth
0bf68ae434
The second patch of X86 support for read cycle counter.
...
llvm-svn: 24430
2005-11-20 21:41:10 +00:00
Chris Lattner
d7102c4980
Teach the x86 backend about the register constraints of its addressing mode.
...
Patch by Evan Cheng
llvm-svn: 24423
2005-11-19 07:01:30 +00:00
Chris Lattner
252d88c68e
Capture more operand info, patch by Evan Cheng
...
llvm-svn: 24422
2005-11-19 07:00:10 +00:00
Chris Lattner
3f0f71b92b
Add load and other support to the dag-dag isel. Patch contributed by Evan
...
Cheng!
llvm-svn: 24419
2005-11-19 02:11:08 +00:00
Andrew Lenharth
6bc51c6f34
prevent latent switch creation
...
llvm-svn: 24413
2005-11-18 13:57:03 +00:00
Chris Lattner
57ce97862d
add more patterns, patch by Evan Cheng.
...
llvm-svn: 24406
2005-11-18 01:04:42 +00:00
Nate Begeman
227f1bdd2f
Also add the new vector value type here, for completeness.
...
llvm-svn: 24405
2005-11-18 00:53:32 +00:00
Chris Lattner
cdde9990b7
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
6ab87fa360
refactor call operand handling to eliminate special cases from printOp.
...
llvm-svn: 24401
2005-11-17 19:25:59 +00:00
Chris Lattner
bd9efdb64c
disentangle call operands from branch operands a bit
...
llvm-svn: 24400
2005-11-17 19:16:08 +00:00
Chris Lattner
3570cf456b
add an option to generate completely non-pic code, corresponding to what
...
gcc -static produces on PPC. This is used for building kexts and other things.
With this, materializing the address of a global looks like:
lis r2, ha16(L_H$non_lazy_ptr)
la r3, lo16(L_H$non_lazy_ptr)(r2)
we're still emitting stubs for functions, which is wrong. That is next.
llvm-svn: 24399
2005-11-17 18:55:48 +00:00
Chris Lattner
8f8ed28a64
Fix a bug that resistor on IRC hit where we tried to create token factor
...
nodes of load results, not of their chain results.
llvm-svn: 24398
2005-11-17 18:30:17 +00:00
Chris Lattner
5aba6ae3b3
Enable global address legalization, fixing a todo and allowing the removal
...
of some code. This exposes the implicit load from the stubs to the DAG, allowing
them to be optimized by the dag combiner. It also moves darwin specific stuff
out of the isel into the legalizer, and allows more to be moved to the .td file.
llvm-svn: 24397
2005-11-17 18:26:56 +00:00
Chris Lattner
0fe88e3f32
Teach the selector to fold lo(g) into load instruction immediate fields
...
llvm-svn: 24396
2005-11-17 18:02:16 +00:00
Chris Lattner
4b11fa284d
Generate LA and ADDIS when possible.
...
llvm-svn: 24395
2005-11-17 17:52:01 +00:00
Chris Lattner
3648c20472
Use the right accessor to create this node
...
llvm-svn: 24394
2005-11-17 17:51:38 +00:00
Chris Lattner
595088aa0f
Add an initial hack at legalizing GlobalAddress into the appropriate nodes
...
on Darwin to remove smarts from the isel. This is currently disabled by
default (uncomment setOperationAction(ISD::GlobalAddress to enable it).
tblgen needs to become smarter about tglobaladdr nodes and bigger patterns
needed to be added to the .td file. However, we can currently emit stuff like
this: :)
li r2, lo16(L_x$non_lazy_ptr)
lis r3, ha16(L_x$non_lazy_ptr)
lwzx r2, r3, r2
The obvious improvements will follow.
llvm-svn: 24390
2005-11-17 07:30:41 +00:00
Chris Lattner
840458276c
Add globaladdress and targetglobaladdress nodes for dag patterns
...
llvm-svn: 24389
2005-11-17 07:20:15 +00:00
Chris Lattner
63ed749ce0
LI could theoretically be used for the lo-part of a global address, just like
...
lis can be used for the high part.
llvm-svn: 24388
2005-11-17 07:04:43 +00:00
Chris Lattner
b7025749e1
When lowering direct calls, lower them to use a targetglobaladress directly
...
instead of a globaladdress. This has no effect on the generated code at all.
llvm-svn: 24386
2005-11-17 05:56:14 +00:00
Chris Lattner
2bf458af92
Add patterns for some 16-bit immediate instructions, patch contributed by
...
Evan Cheng.
llvm-svn: 24384
2005-11-17 02:01:55 +00:00
Chris Lattner
5930d3df3d
Add patterns for several simple instructions that take i32 immediates.
...
Patch contributed by Evan Cheng!
llvm-svn: 24382
2005-11-16 22:59:19 +00:00
Andrew Lenharth
59eefd4787
who would have thought you would want to write into globals too
...
llvm-svn: 24381
2005-11-16 21:15:53 +00:00
Chris Lattner
655e7dfd0d
initial step at adding a dag-to-dag isel for X86 backend. Patch contributed
...
by Evan Cheng!
llvm-svn: 24371
2005-11-16 01:54:32 +00:00
Nate Begeman
a171f6b20c
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
63985e2892
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
76ac068568
Separate X86ISelLowering stuff out from the X86ISelPattern.cpp file. Patch
...
contributed by Evan Cheng.
llvm-svn: 24358
2005-11-15 00:40:23 +00:00
Chris Lattner
1a4adc7aee
Handle globals with explicit alignment requests
...
llvm-svn: 24355
2005-11-14 19:00:30 +00:00
Chris Lattner
0aacd2ab9b
Teach the PPC asmwriter to honor globals with explicit section requests.
...
llvm-svn: 24353
2005-11-14 18:52:46 +00:00
Duraid Madina
76034f95f6
add FP select. next up - divide!
...
llvm-svn: 24346
2005-11-14 01:17:30 +00:00
Chris Lattner
54c8fcf303
unbreak the build
...
llvm-svn: 24339
2005-11-13 01:45:23 +00:00
Andrew Lenharth
ab72424488
enable LSR by default on alpha
...
llvm-svn: 24337
2005-11-12 19:21:08 +00:00
Andrew Lenharth
2ba45d1ee9
fix more regressions
...
llvm-svn: 24335
2005-11-12 19:06:28 +00:00
Andrew Lenharth
56526ec1a9
fix READCYCLECOUNTER
...
llvm-svn: 24334
2005-11-12 19:04:09 +00:00
Andrew Lenharth
97e8207a05
fix yet more regressions
...
llvm-svn: 24308
2005-11-11 23:08:46 +00:00
Andrew Lenharth
fab772045e
generate chain result
...
llvm-svn: 24307
2005-11-11 23:02:55 +00:00
Andrew Lenharth
5b3b9d7052
Fix a bunch more alpha regressions
...
llvm-svn: 24304
2005-11-11 19:52:25 +00:00
Andrew Lenharth
01aa56397d
continued readcyclecounter support
...
llvm-svn: 24300
2005-11-11 16:47:30 +00:00
Chris Lattner
fafff9ba1d
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
4b3b9192b2
do not allow '.' in symbol names
...
llvm-svn: 24292
2005-11-10 21:39:29 +00:00
Chris Lattner
9eb7dfa15a
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
369b61f068
Call this method with the object we have
...
llvm-svn: 24279
2005-11-10 18:53:25 +00:00
Chris Lattner
59e44ff3d3
Make the aix asm printer interface properly with the parent class
...
llvm-svn: 24274
2005-11-10 18:20:29 +00:00
Andrew Lenharth
e373163e95
fix a bunch of regressions
...
llvm-svn: 24269
2005-11-10 16:59:55 +00:00
Andrew Lenharth
97a7fcfd2b
whatever. Intermediate patch to see what breaks. Seems ok.
...
llvm-svn: 24260
2005-11-09 19:17:08 +00:00
Chris Lattner
88e234dd49
Add a new option to indicate we want the code generator to emit code quickly,
...
not spending tons of time microoptimizing it. This is useful for an -O0
style of build.
llvm-svn: 24235
2005-11-08 02:12:47 +00:00
Chris Lattner
b28f214033
Add a new option to indicate we want the code generator to emit code quickly,not spending tons of time microoptimizing it. This is useful for an -O0style of build.
...
llvm-svn: 24233
2005-11-08 02:11:51 +00:00
Duraid Madina
3c1c8c55c3
add support for storing and returning bools
...
llvm-svn: 24228
2005-11-07 03:11:02 +00:00
Duraid Madina
4a30d4a460
just some random hacking - calls (particularly indirect) need a lot of
...
love (especially with -sched=simple)
llvm-svn: 24225
2005-11-06 13:43:30 +00:00
Nate Begeman
3ee3e69556
Add the necessary support to the ISel to allow targets to codegen the new
...
alignment information appropriately. Includes code for PowerPC to support
fixed-size allocas with alignment larger than the stack. Support for
arbitrarily aligned dynamic allocas coming soon.
llvm-svn: 24224
2005-11-06 09:00:38 +00:00
Duraid Madina
4645db0948
ask for 16-byte aligned jmpbufs. This should unbreak C++ on IA64 (and
...
a bunch of other things) but is currently ignored by the code
generator.
llvm-svn: 24206
2005-11-06 04:29:30 +00:00
Chris Lattner
75fe59c4ea
add a case Nate sent me
...
llvm-svn: 24195
2005-11-05 08:57:56 +00:00
Duraid Madina
31071b7471
oops, forgot to load GP for indirect calls, though the old code now commented
...
out failed (e.g. methcall) - now the code compiles, though it's not quite
right just yet (tm) ;)
would fix this but it's 3am! :O
llvm-svn: 24186
2005-11-04 17:55:53 +00:00
Duraid Madina
d3260128af
kill redundant SP/GP/RP save/restores across calls
...
llvm-svn: 24183
2005-11-04 10:01:10 +00:00
Duraid Madina
fc1d1b2499
add support for loading bools
...
llvm-svn: 24182
2005-11-04 09:59:06 +00:00
Duraid Madina
7ac646ef95
fun with predicates! (add TRUNC i64->i1, AND i1 i1, fix XOR i1 i1)
...
llvm-svn: 24175
2005-11-04 00:57:56 +00:00
Duraid Madina
f0f22a55b0
add pattern to load constant 0 into a predicate reg
...
llvm-svn: 24164
2005-11-03 10:09:32 +00:00
Chris Lattner
674660ff03
Fix a bug that prevented this pattern from matching
...
llvm-svn: 24161
2005-11-03 05:45:34 +00:00
Chris Lattner
9b9a839605
Fix a QOI issue noticed by Markus F.X.J. Oberhumer.
...
This fixes PR641
llvm-svn: 24154
2005-11-02 17:42:58 +00:00
Duraid Madina
955ffafd79
"fix" support for FP constants (this code asserts in the scheduler,
...
though)
llvm-svn: 24152
2005-11-02 07:32:59 +00:00
Duraid Madina
4480dcdcea
add F0 and F1 to the FP register class
...
llvm-svn: 24151
2005-11-02 07:30:39 +00:00
Chris Lattner
b5310bdbe9
This works now
...
llvm-svn: 24150
2005-11-02 06:49:37 +00:00
Duraid Madina
17decbb253
add support for SELECT to TargetSelectionDAG.td, add support for
...
selecting ints to IA64, and a few other ia64 bits and pieces
llvm-svn: 24147
2005-11-02 02:37:18 +00:00
Duraid Madina
9abf1650ed
add support for loading FP constants +0.0 and +1.0 to the dag isel,
...
stop pretending -0.0 and -1.0 are machine constants
llvm-svn: 24146
2005-11-02 02:35:04 +00:00
Jim Laskey
802748cd61
Allow itineraries to be passed through the Target Machine.
...
llvm-svn: 24139
2005-11-01 20:06:59 +00:00
Duraid Madina
5a087ff8c3
heh, scheduling was easy?
...
need to send chris, jim and sampo a box of fish each
llvm-svn: 24135
2005-11-01 05:49:08 +00:00
Duraid Madina
9b61d3c1e2
FORTRAN!!! :( and other similarly unfortunate things mean that on ia64
...
one sometimes needs to pass FP args in both FP *and* integer registers.
llvm-svn: 24134
2005-11-01 05:46:16 +00:00
Duraid Madina
b81b61330e
so tablegen was thinking I might want to convert FPs to predicates.
...
clever little tablegen!
llvm-svn: 24133
2005-11-01 03:32:15 +00:00
Duraid Madina
6c912bffd6
add support for int->FP and FP->int ops, and add ia64 patterns for these
...
llvm-svn: 24132
2005-11-01 03:07:25 +00:00
Duraid Madina
a284b6636f
add zeroextend predicate->integer
...
llvm-svn: 24131
2005-11-01 01:29:55 +00:00
Chris Lattner
7432ceef5c
Add a flag to enable a darwin linker optimization
...
llvm-svn: 24130
2005-11-01 00:12:36 +00:00
Chris Lattner
6b63e0c6fd
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
Duraid Madina
88fc69f627
add FP compares and implicit register defs to the dag isel
...
llvm-svn: 24118
2005-10-31 01:42:11 +00:00
Chris Lattner
5c7d731832
If the module has no t-t and the host is an alpha, default to using the Alpha BE
...
llvm-svn: 24110
2005-10-30 16:44:01 +00:00
Duraid Madina
57b7ee9da8
fix some broken comparisons, this affected the Pattern isel too.
...
llvm-svn: 24109
2005-10-30 10:14:19 +00:00
Chris Lattner
e507a15184
This is implemented
...
llvm-svn: 24107
2005-10-30 06:42:12 +00:00
Chris Lattner
85b184b292
Make -time-passes output prettier
...
llvm-svn: 24096
2005-10-29 16:45:02 +00:00
Duraid Madina
7abaf906e2
add some FP stuff, some mix.* stuff, and constant pool support to the
...
DAG instruction selector, which should be destroyed one day (in the pattern
isel also) since ia64 can pack any constant in the instruction stream
llvm-svn: 24094
2005-10-29 16:08:30 +00:00
Chris Lattner
dcceae104e
remove reference to this pass
...
llvm-svn: 24088
2005-10-29 05:28:34 +00:00
Duraid Madina
c252f33fdb
add shladd
...
llvm-svn: 24080
2005-10-29 04:13:40 +00:00
Nate Begeman
00cea9b2e0
New case to handle someday
...
llvm-svn: 24075
2005-10-28 23:26:57 +00:00
Chris Lattner
7ca53a5783
Don't emit "32" for unordered comparison
...
llvm-svn: 24073
2005-10-28 22:58:07 +00:00
Chris Lattner
f8899a6877
add a hack to get code with ordered comparisons working. This hack is
...
tracked as PR642
llvm-svn: 24068
2005-10-28 20:49:47 +00:00
Chris Lattner
5d6cb604de
add support for branch on ordered/unordered.
...
llvm-svn: 24067
2005-10-28 20:32:44 +00:00
Chris Lattner
97d72c80e4
Do not globalize internal symbols
...
llvm-svn: 24064
2005-10-28 18:44:07 +00:00
Chris Lattner
12fca42062
These are autogenerated
...
llvm-svn: 24063
2005-10-28 18:26:52 +00:00
Duraid Madina
f221c261f3
DAG->DAG instruction selection for ia64! "hello world" works, not much else.
...
use -enable-ia64-dag-isel to turn this on
TODO: delete lowering stuff from the pattern isel
: get operations on predicate bits working
: get other bits of pseudocode going
: use sampo's mulh/mull-using divide-by-constant magic
: *so* many patterns ("extr", "tbit" and "dep" will be fun :)
: add FP
: add a JIT!
: get it working 100%
in short: this'll be happier in a couple of weeks, but it's here now so
the tester can make me feel guilty sooner.
OTHER: there are a couple of fixes to the pattern isel, in particular
making the linker happy with big blobs of fun like pypy.
llvm-svn: 24058
2005-10-28 17:46:35 +00:00
Chris Lattner
529169cab2
remove dead stuff
...
llvm-svn: 24054
2005-10-28 04:58:24 +00:00
Chris Lattner
e68a807025
Eliminate getClass, it is not needed
...
llvm-svn: 24053
2005-10-28 04:57:11 +00:00
Chris Lattner
a0dfc67ae6
a bad case for bitfield insert
...
llvm-svn: 24051
2005-10-28 00:20:45 +00:00
Andrew Lenharth
381cab36ed
int comparison patterns
...
llvm-svn: 24020
2005-10-26 18:44:45 +00:00
Jim Laskey
75eab3ca63
Typo made worse x 2 - take 2.
...
llvm-svn: 24018
2005-10-26 18:07:50 +00:00
Chris Lattner
f718a9e17b
Fix an assert compiling MallocBench/gs
...
llvm-svn: 24017
2005-10-26 18:01:11 +00:00
Jim Laskey
b1f2cedbaa
Typo x 2
...
llvm-svn: 24016
2005-10-26 17:50:22 +00:00
Andrew Lenharth
7ac194560e
Simplify instinfo, set random bits on more fp insts, and fix 1 opcode
...
llvm-svn: 24014
2005-10-26 17:41:46 +00:00
Jim Laskey
a2b5235fac
Give full control of subtarget features over to table generated code.
...
llvm-svn: 24013
2005-10-26 17:30:34 +00:00
Jim Laskey
53ad110490
Add attribute name and type to SubtargetFeatures.
...
llvm-svn: 24012
2005-10-26 17:28:23 +00:00
Chris Lattner
ce9580fce4
Add nodes for CondCodeSDNode and setcc, and add a bunch of pattern fragments
...
to make it easy to use them. This lets you write patterns like:
(set PRRC:$rd, (setne GPRC:$rS, imm:$SH))
and stuff.
llvm-svn: 24009
2005-10-26 17:00:25 +00:00
Nate Begeman
ff1796534f
Add a note about some bitfield stuff we could be doing better.
...
llvm-svn: 23994
2005-10-25 23:50:02 +00:00
Nate Begeman
762bf809b5
Correctly Expand or Promote FP_TO_UINT based on the capabilities of the
...
machine. This allows us to generate great code for i32 FP_TO_UINT now on
targets with 64 bit extensions.
llvm-svn: 23993
2005-10-25 23:48:36 +00:00
Chris Lattner
81ff73ec46
autogen undef
...
llvm-svn: 23991
2005-10-25 21:03:41 +00:00
Chris Lattner
3a4b141e8c
Add undef
...
llvm-svn: 23990
2005-10-25 21:03:14 +00:00
Chris Lattner
b439dad538
Allow pseudos to have patterns, no functionality change
...
llvm-svn: 23988
2005-10-25 20:58:43 +00:00
Chris Lattner
261009a4df
Autogen fsel
...
llvm-svn: 23987
2005-10-25 20:55:47 +00:00
Chris Lattner
65845a2f7c
Expose the fextend on the DAG instead of doing it in the matcher
...
llvm-svn: 23986
2005-10-25 20:54:57 +00:00
Chris Lattner
cd7f101c9a
Autogen a few new ppc-specific nodes
...
llvm-svn: 23985
2005-10-25 20:41:46 +00:00
Chris Lattner
26ee5953f7
The dag isel generator generates this now
...
llvm-svn: 23984
2005-10-25 20:36:10 +00:00
Chris Lattner
c0a201c318
Be a bit more paranoid about calling SelectNodeTo
...
llvm-svn: 23982
2005-10-25 20:26:41 +00:00
Chris Lattner
e1fd05ebde
Fix a couple of minor bugs. The first fixes povray, the second fixes things
...
if the dag combiner isn't run
llvm-svn: 23981
2005-10-25 19:32:37 +00:00
Jim Laskey
db4621a5f5
Preparation of supporting scheduling info. Need to find info based on selected
...
CPU.
llvm-svn: 23974
2005-10-25 15:15:28 +00:00
Chris Lattner
76b12c4d95
do not wrap this whole file in namespace llvm
...
llvm-svn: 23962
2005-10-24 06:38:35 +00:00
Chris Lattner
2a65d7b633
Make this build with GCC 4.1, patch contributed by Vladimir A. Merzliakov!
...
llvm-svn: 23956
2005-10-24 04:51:35 +00:00
Chris Lattner
bde3845548
DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now
...
llvm-svn: 23940
2005-10-24 02:26:13 +00:00
Chris Lattner
df88d79c08
only build .a version of this library
...
llvm-svn: 23938
2005-10-24 02:14:49 +00:00
Chris Lattner
437b6116c9
There is no need to build an archive version of this library
...
llvm-svn: 23936
2005-10-24 02:09:03 +00:00
Chris Lattner
87d4e1c130
This file is hopelessly out of date
...
llvm-svn: 23935
2005-10-24 02:07:08 +00:00
Chris Lattner
d36c34822e
Simplify this, matching changes in the tblgen emitter
...
llvm-svn: 23909
2005-10-23 22:34:25 +00:00
Chris Lattner
03bf3a1763
Simplify this due to changes in the tblgen side
...
llvm-svn: 23908
2005-10-23 22:33:22 +00:00
Chris Lattner
abcce5c4b3
mark this as beta
...
llvm-svn: 23906
2005-10-23 22:23:45 +00:00
Chris Lattner
8ff9df29a9
If a user requests help, give them help on both features and processors
...
llvm-svn: 23905
2005-10-23 22:23:13 +00:00
Chris Lattner
766361e8f4
Autogen subtarget information from .td files.
...
llvm-svn: 23904
2005-10-23 22:15:34 +00:00
Chris Lattner
4b5921d4d8
Add subtarget feature/processor defns to the .td file
...
llvm-svn: 23903
2005-10-23 22:08:45 +00:00
Chris Lattner
a389f0d8fa
rearrange things a bit so that instructions can use subtarget features in the
...
future.
llvm-svn: 23902
2005-10-23 22:08:13 +00:00
Chris Lattner
437fd559d7
add a marker
...
llvm-svn: 23901
2005-10-23 22:07:20 +00:00
Chris Lattner
b54070745e
add a note that Nate mentioned last week
...
llvm-svn: 23898
2005-10-23 21:44:59 +00:00
Chris Lattner
2e81fba9cd
Put some of my random notes somewhere public
...
llvm-svn: 23897
2005-10-23 19:52:42 +00:00
Chris Lattner
f64f8407c2
Improve help output.
...
llvm-svn: 23893
2005-10-23 05:33:39 +00:00
Chris Lattner
0d4923b975
improve -help output
...
llvm-svn: 23892
2005-10-23 05:28:51 +00:00
Chris Lattner
18a70c35b8
Move static functions from .h file, reduce #includes, pass strings by const&,
...
use LowercaseString from StringExtras.h, remove extraneous space from help
output.
llvm-svn: 23891
2005-10-23 05:26:26 +00:00
Andrew Lenharth
c6072af580
Add several things.
...
loads
branches
setcc
working calls
Global address
External addresses
now I can manage malloc calls.
llvm-svn: 23887
2005-10-23 03:43:48 +00:00
Andrew Lenharth
5a990417f8
Well, the Constant matching pattern works. Can't say much about calls or globals yet.
...
llvm-svn: 23884
2005-10-22 22:06:58 +00:00
Chris Lattner
42b3a5d596
This file is entirely ifdef'd out
...
llvm-svn: 23882
2005-10-22 19:37:08 +00:00
Jim Laskey
13a19453d2
Add g3 back to the mix and reorder to irritate them anal folk. Actually, it's
...
to group appropriately and provide cues to maintainers that the lists don't
need to be ordered.
llvm-svn: 23880
2005-10-22 08:04:24 +00:00
Chris Lattner
c5d511c4d9
64-bit reg support should not be enabled by default, as support isn't complete.
...
llvm-svn: 23878
2005-10-21 22:15:43 +00:00
Chris Lattner
e296949fbe
Instead of aborting if not a case we can handle specially, break out and
...
let the generic code handle it. This fixes CodeGen/Generic/2005-10-21-longlonggtu.ll on ppc.
also, reindent this code
llvm-svn: 23874
2005-10-21 21:17:10 +00:00
Jim Laskey
9ed9032e22
Plugin new subtarget backend into the build.
...
llvm-svn: 23870
2005-10-21 19:05:19 +00:00
Chris Lattner
229878b7bc
silence a release mode warning
...
llvm-svn: 23868
2005-10-21 16:01:26 +00:00
Nate Begeman
fd0d55ec69
Match rotate. This does actually match the rotates in an rc5 cipher, but I
...
haven't seen it fire on our testsuite.
llvm-svn: 23863
2005-10-21 06:36:18 +00:00
Nate Begeman
ae5d9bd65b
Don't generate operations that aren't yet supported
...
llvm-svn: 23858
2005-10-21 01:52:45 +00:00
Nate Begeman
62e9e5462c
Kill some now-dead code.
...
llvm-svn: 23857
2005-10-21 01:52:20 +00:00
Andrew Lenharth
a099c0131e
byte zap not immediate goodness
...
llvm-svn: 23855
2005-10-21 01:24:05 +00:00
Nate Begeman
4dd383120f
Invert the TargetLowering flag that controls divide by consant expansion.
...
Add a new flag to TargetLowering indicating if the target has really cheap
signed division by powers of two, make ppc use it. This will probably go
away in the future.
Implement some more ISD::SDIV folds in the dag combiner
Remove now dead code in the x86 backend.
llvm-svn: 23853
2005-10-21 00:02:42 +00:00
Andrew Lenharth
a6a23b5874
Inst cleanup. As a bonus, operands are in the correct order for cmovs. Expect new stuff to pass in the JIT tonight
...
llvm-svn: 23852
2005-10-20 23:58:36 +00:00
Chris Lattner
a553780e98
Use a literal to define ineg instead of immzero
...
llvm-svn: 23851
2005-10-20 23:30:37 +00:00
Andrew Lenharth
d4c0ed74e4
added a few 1 operand form stuff. Seems to break regalloc on alpha. sigh
...
llvm-svn: 23849
2005-10-20 19:39:24 +00:00
Andrew Lenharth
7e0e8234f6
add cttz and ctpop
...
llvm-svn: 23848
2005-10-20 19:38:11 +00:00
Andrew Lenharth
eb0ad1863b
Sounds good, finish the intop conversion.
...
llvm-svn: 23843
2005-10-20 14:42:48 +00:00
Nate Begeman
60bbe2d1e5
Add some more patterns for i64 on ppc
...
llvm-svn: 23842
2005-10-20 07:51:08 +00:00
Chris Lattner
fd07fcda67
Add some pattern fragments to simplify the repetitive parts of the patterns
...
for some common ops and use them for a few examples. Andrew, if you like
this, feel free to convert the rest over, if you hate it, feel free to
revert.
llvm-svn: 23837
2005-10-20 04:21:06 +00:00
Chris Lattner
cd4be8798f
simplify this a bit by using immediates
...
llvm-svn: 23836
2005-10-20 03:57:03 +00:00
Nate Begeman
c6f067a8c4
Move the target constant divide optimization up into the dag combiner, so
...
that the nodes can be folded with other nodes, and we can not duplicate
code in every backend. Alpha will probably want this too.
llvm-svn: 23835
2005-10-20 02:15:44 +00:00
Andrew Lenharth
794f15868a
forgot this one
...
llvm-svn: 23833
2005-10-20 00:29:02 +00:00
Andrew Lenharth
7b69867052
ret 0; works, not much else
...
still lots of uglyness.
Maybe calls will come soon.
Fixing the return value of things will be necessary to make alpha work.
llvm-svn: 23832
2005-10-20 00:28:31 +00:00
John Criswell
196e8c1f58
This fixes PR638:
...
Regression/CodeGen/Generic/2004-02-08-UnwindSupport.llx
llvm-svn: 23831
2005-10-19 20:07:15 +00:00
Jim Laskey
74ab9960f2
Added InstrSchedClass to each of the PowerPC Instructions.
...
Note that when adding new instructions that you should refer to the table at the
bottom of PPCSchedule.td.
llvm-svn: 23830
2005-10-19 19:51:16 +00:00
Nate Begeman
9f3c26c4ea
Write patterns for the various shl and srl patterns that don't involve
...
doing something clever.
llvm-svn: 23824
2005-10-19 18:42:01 +00:00
Jim Laskey
9761100055
Push processor descriptions to the top of target and add command line info.
...
llvm-svn: 23820
2005-10-19 13:34:52 +00:00
Chris Lattner
c16b0c387f
now that tblgen is smarter, use integers directly. This should help Andrew too
...
llvm-svn: 23818
2005-10-19 04:32:04 +00:00
Chris Lattner
5f37623218
teach ppc backend these are copies
...
llvm-svn: 23813
2005-10-19 01:50:36 +00:00
Chris Lattner
5b6f4dc623
Convert these cases to patterns
...
llvm-svn: 23811
2005-10-19 01:38:02 +00:00
Nate Begeman
9eaa6bac06
Woo, it kinda works. We now generate this atrociously bad, but correct,
...
code for long long foo(long long a, long long b) { return a + b; }
_foo:
or r2, r3, r3
or r3, r4, r4
or r4, r5, r5
or r5, r6, r6
rldicr r2, r2, 32, 31
rldicl r3, r3, 0, 32
rldicr r4, r4, 32, 31
rldicl r5, r5, 0, 32
or r2, r3, r2
or r3, r5, r4
add r4, r3, r2
rldicl r2, r4, 32, 32
or r4, r4, r4
or r3, r2, r2
blr
llvm-svn: 23809
2005-10-19 01:12:32 +00:00
Chris Lattner
ecdf842311
apply some tblgen majik to simplify the X register definitions
...
llvm-svn: 23805
2005-10-19 00:17:55 +00:00
Nate Begeman
92e77502f3
Make a new reg class for 64 bit regs that aliases the 32 bit regs. This
...
will have to tide us over until we get real subreg support, but it prevents
the PrologEpilogInserter from spilling 8 byte GPRs on a G4 processor.
Add some initial support for TRUNCATE and ANY_EXTEND, but they don't
currently work due to issues with ScheduleDAG. Something wll have to be
figured out.
llvm-svn: 23803
2005-10-19 00:05:37 +00:00
Nate Begeman
78afac2ddd
Add the ability to lower return instructions to TargetLowering. This
...
allows us to lower legal return types to something else, to meet ABI
requirements (such as that i64 be returned in two i32 regs on Darwin/ppc).
llvm-svn: 23802
2005-10-18 23:23:37 +00:00
Jim Laskey
d812a2e449
Simple edits; remove unimplimented cases and clarify long haul SLU cases.
...
llvm-svn: 23788
2005-10-18 16:59:23 +00:00
Chris Lattner
5a2fb9787b
Fix the JIT encoding of LWA, LD, STD, and STDU.
...
llvm-svn: 23787
2005-10-18 16:51:22 +00:00
Jim Laskey
c6533006c8
Checking in first round of scheduling tablegen files. Not tied in as yet.
...
llvm-svn: 23786
2005-10-18 16:23:40 +00:00
Chris Lattner
53b9c3ad4c
add a case
...
llvm-svn: 23785
2005-10-18 06:30:51 +00:00
Nate Begeman
e74dfbb9ce
Do the right thing and enable 64 bit regs under the control of a subtarget
...
option. Currently the only way to enable this is to specify the
64bitregs mattr flag. It is never enabled by default on any config yet.
llvm-svn: 23779
2005-10-18 00:56:42 +00:00
Nate Begeman
0b71e007ef
First bits of 64 bit PowerPC stuff, currently disabled. A lot of this is
...
purely mechanical.
llvm-svn: 23778
2005-10-18 00:28:58 +00:00
Nate Begeman
6cca84e43c
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
Nate Begeman
c0896117d3
Remove some dead code now that the dag combiner exists.
...
llvm-svn: 23754
2005-10-15 22:08:02 +00:00
Chris Lattner
d869bec4fe
Remove some dead code: the ORI/ORIS cases are autogen'd. This makes
...
SelectIntImmediateExpr dead.
llvm-svn: 23753
2005-10-15 22:06:18 +00:00
Chris Lattner
03354280eb
prune #includes
...
llvm-svn: 23752
2005-10-15 21:58:54 +00:00
Chris Lattner
a52969c8d6
These instructions are now autogenerated
...
llvm-svn: 23751
2005-10-15 21:44:56 +00:00
Chris Lattner
286c1d7cfa
Add a pattern for FSQRTS
...
llvm-svn: 23750
2005-10-15 21:44:15 +00:00
Chris Lattner
efa382616b
remove dead code
...
llvm-svn: 23749
2005-10-15 21:40:12 +00:00
Chris Lattner
e33870d154
remove broken SRA/rlwimi case
...
llvm-svn: 23746
2005-10-15 19:04:48 +00:00
Chris Lattner
6f3b954662
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
0aa794ba5b
Merge PPCJITInfo.h and PPC32JITInfo.h. Note that the PowerPCJITInfo
...
and PPC32JITInfo classes should be merged.
llvm-svn: 23744
2005-10-14 23:53:41 +00:00
Chris Lattner
bfca1ab79d
Rename PowerPC*.h to PPC*.h
...
llvm-svn: 23743
2005-10-14 23:51:18 +00:00
Chris Lattner
e80bf1b33a
Rename PowerPCInstrBuilder.h -> PPC*
...
llvm-svn: 23742
2005-10-14 23:45:43 +00:00
Chris Lattner
2ed745a905
Nuke the PowerPCTargetMachine.h header. Note that the PowerPCTargetMachine
...
still should be merged into the PPC32TargetMachine class
llvm-svn: 23741
2005-10-14 23:44:05 +00:00
Chris Lattner
7503d46feb
Rename PowerPC*.td -> PPC*.td
...
llvm-svn: 23740
2005-10-14 23:40:39 +00:00
Chris Lattner
f3b97f53b9
These are dead
...
llvm-svn: 23739
2005-10-14 23:38:51 +00:00
Chris Lattner
0921e3bfc1
Eliminate PowerPC.td and PPC32.td, consolidating them into PPC.td
...
llvm-svn: 23738
2005-10-14 23:37:35 +00:00
Chris Lattner
09cd9e7661
Like the comment says...
...
llvm-svn: 23737
2005-10-14 22:48:24 +00:00
Chris Lattner
2121f3ca50
Nuke PowerPCInstrFormats.h, its contents are dead. Remove the definitions
...
from the .td file that correspond to it
llvm-svn: 23736
2005-10-14 22:44:13 +00:00
Nate Begeman
9d7008b08d
Properly split f32 and f64 into separate register classes for scalar sse fp
...
fixing a bunch of nasty hackery
llvm-svn: 23735
2005-10-14 22:06:00 +00:00
Nate Begeman
c41e1be2e8
Remove an unnecsesary file. PPC32 and PPC64 share architected registers.
...
We will decide with subtarget support whether we ever use an i64 register
class.
llvm-svn: 23734
2005-10-14 18:58:46 +00:00
Chris Lattner
56f31f5408
add the integer truncate/extension operations
...
llvm-svn: 23733
2005-10-14 06:40:20 +00:00
Chris Lattner
7d9f719d42
These are now autogenerated
...
llvm-svn: 23731
2005-10-14 06:26:29 +00:00
Chris Lattner
9c0d3c5932
Add patterns for FP round/extend
...
llvm-svn: 23727
2005-10-14 04:55:50 +00:00
Chris Lattner
6e83cbf7f3
add a new SDTCisOpSmallerThanOp type constraint, and implement fround/fextend in terms of it
...
llvm-svn: 23726
2005-10-14 04:55:10 +00:00
Chris Lattner
d59a57a8d5
These definitions have been moved to common code.
...
llvm-svn: 23681
2005-10-10 06:01:00 +00:00
Chris Lattner
d83571bbf2
Pull DAG ISel generation nodes out of the PowerPC backend to where they
...
can be used by other targets. For those targets that want to use it,
have at. :)
llvm-svn: 23680
2005-10-10 06:00:30 +00:00
Andrew Lenharth
1dfb85c7af
This seems useful from the original patch that added the function. If there is a reason it is not useful on a RISC type target, let me know and I will pull it out
...
llvm-svn: 23676
2005-10-09 20:11:35 +00:00
Chris Lattner
89c7fa22b1
Disable formation of rlwinm instructions from SRA bases. This fixes
...
the 177.mesa failure from last night, and fixes the
CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll regression test I added.
If this code cannot be fixed, it should be removed for good, but I'll leave
it to Nate to decide its fate.
llvm-svn: 23670
2005-10-09 05:36:17 +00:00
Nate Begeman
967ce74980
Remove another unused file. Preparing for the great "enable i64 on ppc32"
...
merge, and using subtarget info for ptr size.
llvm-svn: 23668
2005-10-08 01:32:34 +00:00
Nate Begeman
af72457fc4
Remove a file that is no longer used
...
llvm-svn: 23666
2005-10-08 01:21:27 +00:00
Chris Lattner
dae96f8881
When preselecting, favor things that have low depth to select first. This
...
is faster and uses less stack space. This reduces our stack requirement
enough to compile sixtrack, and though it's a hack, should be enough until
we switch to iterative isel
llvm-svn: 23664
2005-10-07 22:10:27 +00:00
Chris Lattner
e373592258
Fix a CQ regression from my patch to split F32/F64 into seperate register
...
classes on PPC. We were emitting fmr instructions to do fp extensions, which
weren't getting coallesced. This fixes Regression/CodeGen/PowerPC/fpcopy.ll
llvm-svn: 23654
2005-10-07 05:00:52 +00:00
Chris Lattner
cd8b421799
Fix CodeGen/Generic/bool-to-double.ll
...
llvm-svn: 23652
2005-10-07 04:50:48 +00:00
Chris Lattner
318622fb9f
Pull out Call, reducing stack frame size from 6032 bytes to 5184 bytes.
...
llvm-svn: 23650
2005-10-06 19:07:45 +00:00
Chris Lattner
491b8294f4
Pull out setcc, this reduces stack frame size from 7520 to 6032 bytes
...
llvm-svn: 23649
2005-10-06 19:03:35 +00:00
Chris Lattner
502a36935e
Pull two more methods out, reducing stack frame size from 8224 -> 7520 bytes
...
llvm-svn: 23648
2005-10-06 18:56:10 +00:00
Chris Lattner
259e6c76f2
Add a recursive-iterative hybrid stage to attempt to reduce stack space, this
...
helps but not enough.
Start pulling cases out of PPC32DAGToDAGISel::Select. With GCC 4, this function
required 8512 bytes of stack space for each invocation (GCC 3 required less
than 700 bytes). Pulling this first function out gets us down to 8224. More
to come :(
llvm-svn: 23647
2005-10-06 18:45:51 +00:00
Andrew Lenharth
e4c91fc9e8
This is suppose to work now
...
llvm-svn: 23644
2005-10-06 16:54:29 +00:00
Andrew Lenharth
332df13b9e
remove VAX compatibility instruction, we will never use this
...
llvm-svn: 23643
2005-10-06 16:53:32 +00:00
Chris Lattner
05da0d966e
silence some warnings
...
llvm-svn: 23637
2005-10-05 17:15:09 +00:00
Chris Lattner
d1a5bc8dbd
Add a forward def
...
llvm-svn: 23621
2005-10-04 05:09:20 +00:00
Chris Lattner
afef68baff
Speed up the asm printer a lot by not printing formatted LLVM asm output
...
for globals
llvm-svn: 23608
2005-10-03 07:08:36 +00:00
Chris Lattner
9982da2703
silence some warnings
...
llvm-svn: 23594
2005-10-02 16:29:36 +00:00
Chris Lattner
c0e655b65d
silence a warning
...
llvm-svn: 23593
2005-10-02 16:27:59 +00:00
Chris Lattner
68303a78ff
add patterns for float binops and fma ops
...
llvm-svn: 23592
2005-10-02 07:46:28 +00:00
Chris Lattner
98da1d9910
Sort the cpu and features table, so that the alpha backend doesn't fail EVERY
...
compile with an assertion that the tables are not sorted!
llvm-svn: 23591
2005-10-02 07:13:52 +00:00
Chris Lattner
3734d204b8
another solution to the fsel issue. Instead of having 4 variants, just force
...
the comparison to be 64-bits. This is fine because extensions from float
to double are free.
llvm-svn: 23589
2005-10-02 07:07:49 +00:00
Chris Lattner
9e98672962
fsel can take a different FP type for the comparison and for the result. As such
...
split the FSEL family into 4 things instead of just two.
llvm-svn: 23588
2005-10-02 06:58:23 +00:00
Chris Lattner
a17e6c486c
fix an f32/f64 type mismatch
...
llvm-svn: 23587
2005-10-02 06:37:13 +00:00
Chris Lattner
4155ae0f74
Adjust to change in ctor
...
llvm-svn: 23585
2005-10-02 06:23:51 +00:00
Chris Lattner
5ab9d42bb4
Minor tweak to the branch selector. When emitting a two-way branch, and if
...
we're in a single-mbb loop, make sure to emit the backwards branch as the
conditional branch instead of the uncond branch. For example, emit this:
LBBl29_z__44:
stw r9, 0(r15)
stw r9, 4(r15)
stw r9, 8(r15)
stw r9, 12(r15)
addi r15, r15, 16
addi r8, r8, 1
cmpw cr0, r8, r28
ble cr0, LBBl29_z__44
b LBBl29_z__48 *** NOT PART OF LOOP
Instead of:
LBBl29_z__44:
stw r9, 0(r15)
stw r9, 4(r15)
stw r9, 8(r15)
stw r9, 12(r15)
addi r15, r15, 16
addi r8, r8, 1
cmpw cr0, r8, r28
bgt cr0, LBBl29_z__48 *** PART OF LOOP!
b LBBl29_z__44
The former sequence has one fewer dispatch group for the loop body.
llvm-svn: 23582
2005-10-01 23:06:26 +00:00
Chris Lattner
6f4dc51d6f
like the comment says, enable this
...
llvm-svn: 23581
2005-10-01 23:02:40 +00:00
Chris Lattner
8713ebf37c
fix typo
...
llvm-svn: 23578
2005-10-01 02:51:36 +00:00
Chris Lattner
d3eee1a09b
Modify the ppc backend to use two register classes for FP: F8RC and F4RC.
...
These are used to represent float and double values, and the two regclasses
contain the same physical registers.
llvm-svn: 23577
2005-10-01 01:35:02 +00:00
Jim Laskey
f61232354f
Should be using flag and not chain.
...
llvm-svn: 23572
2005-09-30 23:43:37 +00:00
Nate Begeman
fbfad0b565
Remove some now-dead code.
...
llvm-svn: 23571
2005-09-30 21:28:27 +00:00
Andrew Lenharth
49e48f6234
subtarget support for CIX and FIX extentions (the only 2 I care about right now)
...
llvm-svn: 23569
2005-09-30 20:24:38 +00:00
Chris Lattner
c9f4219cfc
Rename MRegisterDesc -> TargetRegisterDesc for consistency
...
llvm-svn: 23564
2005-09-30 17:49:27 +00:00
Chris Lattner
81f32a2acb
trim down the target info structs now that we have a preferred spill register class for each callee save register
...
Why is V9 maintaining these tables manually? ugh!
llvm-svn: 23561
2005-09-30 17:38:36 +00:00
Chris Lattner
88025e17c5
constant fold these calls
...
llvm-svn: 23558
2005-09-30 17:16:59 +00:00
Chris Lattner
bb1c9ecb17
simplify this code using the new regclass info passed in
...
llvm-svn: 23557
2005-09-30 17:12:38 +00:00
Chris Lattner
8688b92b86
stub out a virtual method
...
llvm-svn: 23554
2005-09-30 06:55:18 +00:00
Chris Lattner
4984e99b83
CR registers are not used by this "target"
...
llvm-svn: 23552
2005-09-30 06:43:58 +00:00
Chris Lattner
6169a78f46
these registers don't belong to any register classes, so don't mark them
...
as callee save. They can never be generated by the compiler.
llvm-svn: 23551
2005-09-30 06:42:24 +00:00
Chris Lattner
33ce5f8a73
Now that self referential classes are supported, get rid of a work-around.
...
llvm-svn: 23544
2005-09-30 04:13:23 +00:00
Chris Lattner
f6d4173f75
pass extra args
...
llvm-svn: 23539
2005-09-30 01:31:52 +00:00
Chris Lattner
64ca7cda3f
these methods get extra args
...
llvm-svn: 23538
2005-09-30 01:30:55 +00:00
Chris Lattner
a654525c1c
Pass extra regclasses into spilling code
...
llvm-svn: 23537
2005-09-30 01:29:42 +00:00
Chris Lattner
08f157c5b2
Use the 32-bit version for now
...
llvm-svn: 23534
2005-09-30 00:05:05 +00:00
Chris Lattner
027a2671ef
Add a bunch of patterns for F64 FP ops, add some more integer ops
...
llvm-svn: 23533
2005-09-29 23:34:24 +00:00
Chris Lattner
1de5706e68
Remove code for patterns that are autogenerated
...
llvm-svn: 23532
2005-09-29 23:33:31 +00:00
Andrew Lenharth
a7a83b9255
begining alpha subtarget support
...
llvm-svn: 23531
2005-09-29 22:54:56 +00:00
Chris Lattner
0a1cd715d4
tblgen autogens this pattern now
...
llvm-svn: 23530
2005-09-29 22:37:24 +00:00
Andrew Lenharth
bae1f9d790
copy and paste error
...
llvm-svn: 23528
2005-09-29 21:11:57 +00:00
Chris Lattner
a748e3ae5b
now that tblgen is smarter, this pattern is not needed. Also, tblgen
...
now inverts commuted versions of ANDC/ORC with the current .td file.
llvm-svn: 23527
2005-09-29 19:29:15 +00:00
Chris Lattner
02d3ba3db8
consistency with other cases, no functionality change
...
llvm-svn: 23524
2005-09-29 17:38:52 +00:00
Chris Lattner
eca4f56646
Make the JIT default to the DAG isel instead of the pattern isel, like LLC.
...
The Pattern isel has some strange memory corruption issues going on. :(
This should have been converted over anyway, but it got forgotten somehow
when switching to the dag isel.
llvm-svn: 23523
2005-09-29 17:31:03 +00:00
Chris Lattner
08c319fbdd
Never rely on ReplaceAllUsesWith when selecting, use CodeGenMap instead.
...
ReplaceAllUsesWith does not replace scalars SDOperand floating around on
the stack, permitting things to be selected multiple times.
llvm-svn: 23515
2005-09-29 00:59:32 +00:00
Chris Lattner
d4e9e8b7ec
Codegen ADD X, IMM -> addis/addi if needed.
...
This implements PowerPC/fold-li.ll
llvm-svn: 23514
2005-09-28 23:07:13 +00:00
Chris Lattner
b9b2e77295
Autogen MUL, move FP cases together
...
llvm-svn: 23512
2005-09-28 22:53:16 +00:00
Chris Lattner
5769311c92
disentangle FP from INT versions of div/mul
...
llvm-svn: 23511
2005-09-28 22:50:24 +00:00
Chris Lattner
585131baaf
Use the autogenerated matcher for ADD/SUB
...
llvm-svn: 23510
2005-09-28 22:47:28 +00:00
Chris Lattner
f023b2cda2
add a patter for SUBFIC
...
llvm-svn: 23509
2005-09-28 22:47:06 +00:00
Chris Lattner
21551ea5ab
Mark int binops as int-only, add FP binops. Mark FADD/FMUL as commutative but
...
not associative. Add [SU]REM.
llvm-svn: 23508
2005-09-28 22:38:27 +00:00
Chris Lattner
d3ea19b51a
Add FP versions of the binary operators, keeping the int and fp worlds seperate.
...
llvm-svn: 23506
2005-09-28 22:29:58 +00:00
Chris Lattner
0815dcae3f
Add FP versions of the binary operators, keeping the int and fp worlds seperate.
...
Though I have done extensive testing, it is possible that this will break
things in configs I can't test. Please let me know if this causes a problem
and I'll fix it ASAP.
llvm-svn: 23505
2005-09-28 22:29:17 +00:00
Chris Lattner
7fe6734dff
Mark associative nodes as associative
...
llvm-svn: 23503
2005-09-28 20:58:39 +00:00
Chris Lattner
b97b054ba7
Nate pointed out that mulh[us] are commutative as well. Thanks!
...
llvm-svn: 23500
2005-09-28 19:01:44 +00:00
Chris Lattner
89d168ceb3
expose commutativity information
...
llvm-svn: 23498
2005-09-28 18:27:58 +00:00
Chris Lattner
fab48b3285
All (xor *) cases are autogenerated now
...
llvm-svn: 23497
2005-09-28 18:12:37 +00:00
Chris Lattner
037d69a404
add support for missed eqv tests
...
llvm-svn: 23496
2005-09-28 18:10:51 +00:00
Chris Lattner
33f8e08c8f
Implement PowerPC/eqv-andc-orc-nor.ll:EQV3
...
llvm-svn: 23494
2005-09-28 18:04:52 +00:00
Chris Lattner
8cd7b88a88
learn to codegen not as NOR instead of xoris/xori
...
llvm-svn: 23490
2005-09-28 17:13:15 +00:00
Chris Lattner
bb5939a436
These nodes are all autogenerated
...
llvm-svn: 23489
2005-09-28 17:07:09 +00:00
Chris Lattner
a028e7a39c
Darwin, like many BSD systems, has a setjmp/longjmp which saves the signal mask
...
on setjmp calls and restores it on longjmp calls (both of which require syscalls).
This makes the calls REALLY slow. Use _setjmp/_longjmp instead. This speeds up
hexxagon from 120.31s to 15.68s: from 5.53x slower than GCC to 28% faster than GCC.
llvm-svn: 23482
2005-09-27 22:18:25 +00:00
Chris Lattner
59dc1e082c
initialize new flag
...
llvm-svn: 23480
2005-09-27 22:13:56 +00:00
Chris Lattner
5635cc069f
fix CBackend/2005-09-27-VolatileFuncPtr.ll
...
llvm-svn: 23475
2005-09-27 20:52:44 +00:00
Chris Lattner
c628f00845
Make sure to clear the CodeGenMap after each basic block is selected to avoid
...
cross MBB pollution.
llvm-svn: 23470
2005-09-27 17:45:33 +00:00
Chris Lattner
54ec5f2089
Move the post-lsr simplify cfg pass after lowereh, so it can clean up after
...
eh lowering as well.
llvm-svn: 23459
2005-09-27 00:14:41 +00:00
Chris Lattner
4435b149a0
minor pattern shuffling
...
llvm-svn: 23458
2005-09-26 22:20:16 +00:00
Chris Lattner
6736a6cdd2
Teach the dag isel generator how to construct arbitrary immediates. The
...
generated isel now tries li then lis, then lis+ori.
llvm-svn: 23418
2005-09-24 00:41:58 +00:00
Chris Lattner
de3c87a2ab
Implement the isLoadFromStackSlot interface
...
llvm-svn: 23387
2005-09-19 05:23:44 +00:00
Chris Lattner
4d9cf68023
Implement hook for ppc
...
llvm-svn: 23374
2005-09-17 01:03:26 +00:00
Chris Lattner
0ebec06671
disable this for now
...
llvm-svn: 23366
2005-09-15 21:44:00 +00:00
Chris Lattner
9e4a4ee3dc
Give all operands names
...
llvm-svn: 23357
2005-09-14 21:11:13 +00:00
Chris Lattner
2e84be22a8
give all operands names
...
llvm-svn: 23356
2005-09-14 21:10:24 +00:00
Chris Lattner
f006d15e7f
Fix some issues exposed by more testing. XORIS had the wrong operands
...
specified. The various *imm operands defined by PPC are really all i32,
even though the actual immediate is restricted to a smaller value in it.
llvm-svn: 23352
2005-09-14 20:53:05 +00:00
Chris Lattner
6b013fc923
Fix some bugs noticed by new checking code
...
llvm-svn: 23350
2005-09-14 18:18:39 +00:00
Chris Lattner
b42e962d23
fix a major regression from my patch this afternoon
...
llvm-svn: 23347
2005-09-14 06:06:45 +00:00
Chris Lattner
b011cb2746
we don't need this proto any longer
...
llvm-svn: 23342
2005-09-13 22:05:21 +00:00
Chris Lattner
03e08eefc7
move the #include for the generated code into the isel class body so we
...
can use/define class methods
llvm-svn: 23339
2005-09-13 22:03:06 +00:00
Chris Lattner
0f965a615e
Change the arg lowering code to use copyfromreg from vregs associated
...
with incoming arguments instead of the pregs themselves. This fixes
the scheduler from causing problems by moving a copyfromreg for an argument
to after a select_cc node (now it can, and bad things won't happen).
llvm-svn: 23334
2005-09-13 19:33:40 +00:00
Chris Lattner
ee8113293e
This has been moved to the target-indep code
...
llvm-svn: 23333
2005-09-13 19:32:18 +00:00
Chris Lattner
fb96e50b8c
This code is no longer needed, it is moved to the target-indep code
...
llvm-svn: 23332
2005-09-13 19:31:44 +00:00
Chris Lattner
64685b4ca2
Majik numbers are bad
...
llvm-svn: 23330
2005-09-13 19:03:13 +00:00
Chris Lattner
aa6cbd90c5
Remove some dead vectors
...
llvm-svn: 23329
2005-09-13 18:47:49 +00:00
Chris Lattner
4309c3a785
PowerPC cannot truncstore i1 natively
...
llvm-svn: 23304
2005-09-10 00:21:06 +00:00
Chris Lattner
0f2146bb5d
I forgot that we always spill fp values as 64-bits. Implement spill folding
...
for FP as well. This triggers a couple dozen times on 177.mesa (for example).
llvm-svn: 23299
2005-09-09 21:59:44 +00:00
Chris Lattner
712e78ee28
Fix a problem that Nate noticed, where spill code was not getting coallesced
...
with copies, leading to code like this:
lwz r4, 380(r1)
or r10, r4, r4 ;; Last use of r4
By teaching the PPC backend how to fold spills into copies, we now get this
code:
lwz r10, 380(r1)
wow. :)
This reduces a testcase nate sent me from 1505 instructions to 1484.
Note that this could handle FP values but doesn't currently, for reasons
mentioned in the patch
llvm-svn: 23298
2005-09-09 21:46:49 +00:00
Chris Lattner
f540c1a2e8
code cleanup
...
llvm-svn: 23297
2005-09-09 20:51:08 +00:00
Chris Lattner
c37a2f13c4
Teach the code generator that rlwimi is commutable if the rotate amount
...
is zero. This lets the register allocator elide some copies in some cases.
This implements CodeGen/PowerPC/rlwimi-commute.ll
llvm-svn: 23292
2005-09-09 18:17:41 +00:00
Chris Lattner
39b4d83f6a
Introduce two new concepts:
...
1. Add support for defining Pattern's, which can match expressions when there
is no instruction that directly implements something. Instructions usually
implicitly define patterns.
2. Add support for defining SDNodeXForm's, which are node transformations.
This seperates the concept of a node xform out from the existing predicate
support.
Using this new stuff, we add a few instruction patterns, one for testing, and
two for OR/XOR by an arbitrary immediate.
llvm-svn: 23286
2005-09-09 00:39:56 +00:00
Chris Lattner
4b09f3c6f5
whitespace/comment changes, no functionality diffs
...
llvm-svn: 23283
2005-09-08 23:17:26 +00:00
Chris Lattner
0ec8fa0880
Add a bunch of stuff needed for node type inference. Move 'BLR' down with
...
the rest of the instructions, add comment markers to seperate portions of
the file into logical parts
llvm-svn: 23277
2005-09-08 19:50:41 +00:00
Chris Lattner
76cb006e2c
add patterns for x?oris?
...
llvm-svn: 23268
2005-09-08 17:40:49 +00:00
Chris Lattner
2d8032b54c
add patterns to the addi/addis/mulli etc instructions. Define predicates
...
for matching signed 16-bit and shifted 16-bit ppc immediates
llvm-svn: 23267
2005-09-08 17:33:10 +00:00
Chris Lattner
cf9b0e6673
Add patterns for some new instructions, allowing the use of the ineg fragment.
...
llvm-svn: 23266
2005-09-08 17:01:54 +00:00
Chris Lattner
7c8dba750c
ignore generated files
...
llvm-svn: 23263
2005-09-07 23:47:44 +00:00
Chris Lattner
498915dafa
Remove some cases handled by the generated portion of the isel
...
llvm-svn: 23262
2005-09-07 23:45:15 +00:00
Chris Lattner
5ea0ee7b19
On non-apple systems, when using -march=ppc32, do not print:
...
'' is not a recognized processor for this target (ignoring processor)
Default to "generic" instead of "" for the default CPU.
llvm-svn: 23257
2005-09-07 05:45:33 +00:00
Chris Lattner
8d0e9d90aa
Print:
...
'' is not a recognized processor for this target (ignoring processor)
instead of:
is not a recognized processor for this target (ignoring processor)
llvm-svn: 23256
2005-09-07 05:44:14 +00:00
Nate Begeman
6095214bf0
Implement i64<->fp using the fctidz/fcfid instructions on PowerPC when we
...
are allowed to generate 64-bit-only PowerPC instructions for 32 bit hosts,
such as the PowerPC 970.
This speeds up 189.lucas from 81.99 to 32.64 seconds.
llvm-svn: 23250
2005-09-06 22:03:27 +00:00
Andrew Lenharth
a63a066205
Fix up the AssertXext problem, as well as adding it at calls
...
llvm-svn: 23246
2005-09-06 17:00:23 +00:00
Nate Begeman
e9e2c6d314
Add note about future optimization noted in the ppc compiler writer's guide
...
llvm-svn: 23245
2005-09-06 15:30:48 +00:00
Nate Begeman
2dded8302a
Add accessor for 64bit flag, so that we can tell when it is safe to
...
generate the fun in-register fp<->long instructions.
llvm-svn: 23244
2005-09-06 15:30:12 +00:00
Andrew Lenharth
c8bd5bda59
revert part of the last change, should fix regressions
...
llvm-svn: 23241
2005-09-04 06:12:19 +00:00
Chris Lattner
aa833d4571
explicitly specify an operands list for patterns with inputs (e.g. neg)
...
llvm-svn: 23240
2005-09-03 01:28:40 +00:00
Chris Lattner
8ae9525bd0
include the dag isel fragment
...
llvm-svn: 23239
2005-09-03 01:17:22 +00:00
Chris Lattner
0442dcfabc
ask for a dag isel
...
llvm-svn: 23238
2005-09-03 01:15:41 +00:00
Chris Lattner
5f12cf14be
Change the isel to not break out of the big giant switch. Instead, the
...
switch should never be exited, so its bottom is now unreachable.
llvm-svn: 23234
2005-09-03 00:53:47 +00:00
Chris Lattner
9220f92c41
rearrange logical ops to group them together more consistently.
...
Define the PatFrag class which can be used to define subpatterns to match
things with. Define 'not', and use it to define the patterns for andc,
nand, etc.
llvm-svn: 23233
2005-09-03 00:21:51 +00:00
Chris Lattner
dcbb561b76
Add AND/OR/XOR
...
llvm-svn: 23232
2005-09-02 22:35:53 +00:00
Chris Lattner
3a1002d529
Add some initial patterns to simple binary instructions, though they
...
currently don't do anything. This elides patterns for binary operators
that ping on the carry flag, since we don't model it yet.
This patch also removes PPC::SUB, because it is dead.
llvm-svn: 23230
2005-09-02 21:18:00 +00:00
Chris Lattner
06e237f253
turn on dag isel by default
...
llvm-svn: 23226
2005-09-02 19:53:54 +00:00
Jim Laskey
27d628dfc9
Add help support for -mcpu and -mattr.
...
llvm-svn: 23222
2005-09-02 19:27:43 +00:00
Andrew Lenharth
9690a4f321
Pull out Lowering in preperation for multiple ISels. Oh, and get rid of some stuff
...
llvm-svn: 23220
2005-09-02 18:46:02 +00:00
Chris Lattner
aa3b1fcc58
Decouple fsqrt from gpul optimizations, implementing fsqrt.ll.
...
Remove the -enable-gpopt option which is subsumed by feature flags.
llvm-svn: 23218
2005-09-02 18:33:05 +00:00
Jeff Cohen
a6dde9962d
Fix VC++ build errors
...
llvm-svn: 23210
2005-09-02 02:51:42 +00:00
Chris Lattner
763a3a0fa7
Restore this patch now that the latent bug has been fixed
...
llvm-svn: 23209
2005-09-02 01:24:55 +00:00
Chris Lattner
06d440f2ee
Revert the previous patch which causes a mysterious regression in toast.
...
llvm-svn: 23207
2005-09-02 00:47:05 +00:00
Chris Lattner
210975cfbb
Handle any_extend like zext
...
llvm-svn: 23202
2005-09-02 00:16:09 +00:00
Chris Lattner
2493f0e5fd
Handle ANY_EXTEND like ZERO_EXTEND. Simplify the extend/truncate code on
...
the observation that it only has to handle i1 -> i64 and i64 -> i1.
llvm-svn: 23201
2005-09-02 00:15:30 +00:00
Chris Lattner
9ee867b93b
Implement small-arguments.ll:test3 by teaching the DAG optimizer that
...
the results of calls to functions returning small values are properly
sign/zero extended.
llvm-svn: 23198
2005-09-01 23:44:32 +00:00
Chris Lattner
68d15fdfea
Align functions to 16-byte boundaries, to eliminate noise in performance measurements. This improves the performance of 'treeadd' by about 20% with the dag
...
isel, restoring it to the pattern-isel level (which happens to get the alignment right).
llvm-svn: 23194
2005-09-01 23:08:50 +00:00
Chris Lattner
e40a3ccd60
Local labels on darwin apparently start with just 'L', not .L like other
...
platforms. This reduces executable size and makes shark realize the actual
bounds of functions instead of showing each MBB as a function :)
llvm-svn: 23193
2005-09-01 21:48:35 +00:00
Jim Laskey
19058c3989
1. Use SubtargetFeatures in llc/lli.
...
2. Propagate feature "string" to all targets.
3. Implement use of SubtargetFeatures in PowerPCTargetSubtarget.
llvm-svn: 23192
2005-09-01 21:38:21 +00:00
Jim Laskey
3fee6a51a9
This new class provides support for platform specific "features". The intent
...
is to manage processor specific attributes from the command line. See examples
of use in llc/lli and PowerPCTargetSubtarget.
llvm-svn: 23191
2005-09-01 21:36:18 +00:00
Chris Lattner
a305d28cf6
Implement dynamic allocas correctly. In particular, because we were copying
...
directly out of R1 (without using a CopyFromReg, which uses a chain), multiple
allocas were getting CSE'd together, producing bogus code. For this:
int %foo(bool %X, int %A, int %B) {
br bool %X, label %T, label %F
F:
%G = alloca int
%H = alloca int
store int %A, int* %G
store int %B, int* %H
%R = load int* %G
ret int %R
T:
ret int 0
}
We were generating:
_foo:
stwu r1, -16(r1)
stw r31, 4(r1)
or r31, r1, r1
stw r1, 12(r31)
cmpwi cr0, r3, 0
bne cr0, .LBB_foo_2 ; T
.LBB_foo_1: ; F
li r2, 16
subf r2, r2, r1 ;; One alloca
or r1, r2, r2
or r3, r1, r1
or r1, r2, r2
or r2, r1, r1
stw r4, 0(r3)
stw r5, 0(r2)
lwz r3, 0(r3)
lwz r1, 12(r31)
lwz r31, 4(r31)
lwz r1, 0(r1)
blr
.LBB_foo_2: ; T
li r3, 0
lwz r1, 12(r31)
lwz r31, 4(r31)
lwz r1, 0(r1)
blr
Now we generate:
_foo:
stwu r1, -16(r1)
stw r31, 4(r1)
or r31, r1, r1
stw r1, 12(r31)
cmpwi cr0, r3, 0
bne cr0, .LBB_foo_2 ; T
.LBB_foo_1: ; F
or r2, r1, r1
li r3, 16
subf r2, r3, r2 ;; Alloca 1
or r1, r2, r2
or r2, r1, r1
or r6, r1, r1
subf r3, r3, r6 ;; Alloca 2
or r1, r3, r3
or r3, r1, r1
stw r4, 0(r2)
stw r5, 0(r3)
lwz r3, 0(r2)
lwz r1, 12(r31)
lwz r31, 4(r31)
lwz r1, 0(r1)
blr
.LBB_foo_2: ; T
li r3, 0
lwz r1, 12(r31)
lwz r31, 4(r31)
lwz r1, 0(r1)
blr
This fixes Povray and SPASS with the dag isel, the last two failing cases.
Tommorow we will hopefully turn it on by default! :)
llvm-svn: 23190
2005-09-01 21:31:30 +00:00