Commit Graph

25050 Commits

Author SHA1 Message Date
Reid Spencer de2daad0ac Major reorganization and extension of the code. The diff on this will be a
mess as functions were moved around into a better ordering. The code was
extended to provide various -gen-* options to better control what the
generated output should be. Currently it is possible to generate entire
modules (three different ways), functions, global variables, and types.

llvm-svn: 28589
2006-05-31 17:31:38 +00:00
Reid Spencer 9fef163d19 Make the getNamedFunction and getNamedGlobal methods be const. They don't
change the module in any way and we should enforce that.

llvm-svn: 28588
2006-05-31 16:40:28 +00:00
Vladimir Prus 735e3f76a8 Clarify type naming.
llvm-svn: 28587
2006-05-31 16:03:20 +00:00
Vladimir Prus c1eae29b91 Improve InstVisitor docs.
llvm-svn: 28586
2006-05-31 15:30:18 +00:00
Evan Cheng 9d91caa053 Eliminate a memory leak.
llvm-svn: 28585
2006-05-31 07:13:03 +00:00
Evan Cheng 64d2846017 visitVBinOp: Can't fold divide by zero!
llvm-svn: 28584
2006-05-31 06:08:35 +00:00
Reid Spencer 03977ec9b1 Don't generate module definitions when the -fragment option is given.
llvm-svn: 28583
2006-05-31 04:43:19 +00:00
Evan Cheng 8abf45e22d Select vector_shuffle v1, undef <2, 3, ?, ?> to MOVHLPS.
llvm-svn: 28582
2006-05-31 00:51:37 +00:00
Evan Cheng 550cb663e8 Remove dead code.
llvm-svn: 28581
2006-05-31 00:50:42 +00:00
Evan Cheng 6821bbb1ea Update vector extract test cases.
llvm-svn: 28580
2006-05-31 00:48:09 +00:00
Evan Cheng ddced95d8f A new entry
llvm-svn: 28579
2006-05-30 23:56:31 +00:00
Evan Cheng 57399704b3 MAXP{D|S} and MINP{D|S} are commutable.
llvm-svn: 28578
2006-05-30 23:47:30 +00:00
Evan Cheng c0f90bef47 Commute shufps / shufpd.
llvm-svn: 28577
2006-05-30 23:34:30 +00:00
Reid Spencer b5ddb66ce0 1. No need to thwart this test with an environment variable. Turning it off
is the default and handled by the makefile system and runtest
2. Redirect stderr of llvm-as and llvm2cpp so that warning messages about
   instrinsics don't cause Tcl to report the run as failed.

llvm-svn: 28576
2006-05-30 23:07:17 +00:00
Evan Cheng f21045a5cd Somehow I lost a condition when I was shuffling some code around. Anyway,
only transform a shufps to pshufd when the first two operands are the same.

llvm-svn: 28575
2006-05-30 22:13:36 +00:00
Evan Cheng c8c172eaae Fix a build breaker.
llvm-svn: 28574
2006-05-30 21:45:53 +00:00
Evan Cheng a4fc5b8699 Oops. PSHUFD is only available with SSE2.
llvm-svn: 28573
2006-05-30 21:30:59 +00:00
Chris Lattner a5d4587296 Add a note
llvm-svn: 28572
2006-05-30 21:29:15 +00:00
Chris Lattner b9342afa56 Always reserve space for 8 spilled GPRs. GCC apparently assumes that this
space will be available, even if the callee isn't varargs.

llvm-svn: 28571
2006-05-30 21:21:04 +00:00
Reid Spencer c3b9370754 llvm2cpp is ready to be compiled so add it to the makefile, but make it
optional.

llvm-svn: 28570
2006-05-30 21:20:55 +00:00
Reid Spencer ad7da68343 Add the new command line arguments.
llvm-svn: 28569
2006-05-30 21:19:29 +00:00
Reid Spencer 30945ca559 Fix more bugs. This version now passes all of the Feature test except for
a floating point conversion problem with NAN in intrinsics.ll. llvm2cpp
makes an attempt to provide the correct conversion, based on the
implementation in the CBackend writer, but it doesn't get NAN correct.

llvm-svn: 28568
2006-05-30 21:18:23 +00:00
Evan Cheng baace007a3 Added a test case for parameter passing of vector values.
llvm-svn: 28567
2006-05-30 20:37:00 +00:00
Evan Cheng 1ec0e4233e Fix the test failure on non-Darwin targets.
llvm-svn: 28566
2006-05-30 20:35:46 +00:00
Evan Cheng 66f849bd7b Allow shufps x, x, mask to be converted to pshufd x, mask to save a move.
llvm-svn: 28565
2006-05-30 20:26:50 +00:00
Evan Cheng b33e54ead7 Remove bogus comment.
llvm-svn: 28564
2006-05-30 20:24:48 +00:00
Reid Spencer f9aa688f5b Add llvm2cpp program.
llvm-svn: 28563
2006-05-30 19:56:31 +00:00
Reid Spencer 82ebabafde Provide a simpler interface for getting a ConstantArray from a character
string. Instead of specifying the length, just specify whether the user
wants a terminating null or not. The default is "true" to retain the same
behavior as previously provided by this function.

llvm-svn: 28562
2006-05-30 18:15:07 +00:00
Evan Cheng d12c97d23a Make sure the register pressure reduction schedulers work for non-uniform
latency targets, e.g. PPC32.

llvm-svn: 28561
2006-05-30 18:05:39 +00:00
Evan Cheng 61e9f0d680 When a priority_queue is empty, the behavior of top() operator is
non-deterministic. Returns NULL when it's empty!

llvm-svn: 28560
2006-05-30 18:04:34 +00:00
Rafael Espindola 5bc60da112 Expand ret into "CopyToReg;BRIND"
llvm-svn: 28559
2006-05-30 17:33:19 +00:00
Chris Lattner 11c25cfa13 Enable -fno-use-cxa-atexit on darwin/ppc also.
llvm-svn: 28558
2006-05-30 16:38:06 +00:00
Reid Spencer b0cffafb59 Undo a patch that breaks llvm-as because the warning message is written to
stdout when the output of llvm-as is also written to stdout. We'll have to
fix tcl some other way.

llvm-svn: 28557
2006-05-30 16:34:59 +00:00
Reid Spencer b5c64fc3b6 Write the WARNING message to cout instead of cerr. Writing to cerr causes
Tcl to claim that the program had an error and thus produces errors in
the dejagnu testing when its really just a warning.

llvm-svn: 28556
2006-05-30 16:05:59 +00:00
Vladimir Prus 413441b9c9 Make doc comment visible in doxygen output. Clarify Type construction.
llvm-svn: 28555
2006-05-30 15:49:30 +00:00
Reid Spencer 37cf1765ed Fix many small bugs in llvm2cpp. This patch gets llvm2cpp working with
everything except PHI nodes and one odd recurse/opaque type situation.
PHI nodes forward reference INSTRUCTIONS (aaaaaaaahhhhhhh!) :)

llvm-svn: 28554
2006-05-30 10:21:41 +00:00
Reid Spencer 84504f215b Properly document the second form of ConstArray::get()
llvm-svn: 28553
2006-05-30 08:26:13 +00:00
Reid Spencer 6f61453ff8 Adjust the interface to ConstantArray::get. The previous
implementation always added a null byte to the end of the string. It turns
out that this is not always wanted. By adding a length parameter we preserve
this behavior when length==0 (default value) but also allow other lengths
(not null terminated) to be created.

llvm-svn: 28552
2006-05-30 08:23:18 +00:00
Evan Cheng 02420144ab Add a note about integer multiplication by constants.
llvm-svn: 28551
2006-05-30 07:37:37 +00:00
Evan Cheng 734e1e241b A addressing mode folding enhancement:
Fold c2 in (x << c1) | c2 where (c2 < c1)
e.g.
int test(int x) {
  return (x << 3) + 7;
}

This can be codegen'd as:
leal 7(,%eax,8), %eax

llvm-svn: 28550
2006-05-30 06:59:36 +00:00
Evan Cheng 905e88caaa Add a lea instruction selection test case.
llvm-svn: 28549
2006-05-30 06:53:55 +00:00
Evan Cheng 749138582e Some new entries about truncate / anyext
llvm-svn: 28548
2006-05-30 06:23:50 +00:00
Reid Spencer c267698f23 First complete version of llvm2cpp that doesn't crash on any of the Feature
tests. The output in a few cases still doesn't compile, however.

llvm-svn: 28547
2006-05-30 03:43:49 +00:00
Andrew Lenharth c3cff44880 move calltarget to dsa
llvm-svn: 28546
2006-05-29 23:39:48 +00:00
Andrew Lenharth e465381401 Since there was interest on the mailing list, this is a utility pass that
uses DSA to make find targets of calls.  It provides a very convinient
interface to DSA results to do things with indirect calls, such as
write a devirtualizer (which I have and may commit one of these days).

llvm-svn: 28545
2006-05-29 22:58:38 +00:00
Chris Lattner d65928994a Silly cleanup
llvm-svn: 28544
2006-05-29 18:52:52 +00:00
Chris Lattner dc0b3afcdd silly cleanup
llvm-svn: 28543
2006-05-29 18:52:05 +00:00
Reid Spencer 131ca2869c Fix a bug with diffing the wrong files. Make output more readable.
llvm-svn: 28542
2006-05-29 18:09:38 +00:00
Reid Spencer c194e7e843 Next batch of implementation:
1. Get rid of old AsmWriter cruft that's not needed.
2. Implement several instructions. Enough to get by globalvars.ll and
   alignment.ll in the Feature test suite.
3. Handle constants properly (don't repeat definitions).
4. Make the output compatible with llvm-dis for diff purposes.

llvm-svn: 28541
2006-05-29 18:08:06 +00:00
Reid Spencer 4967fa722d Fix file header comment.
llvm-svn: 28540
2006-05-29 18:06:28 +00:00