1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
Commit Graph

24932 Commits

Author SHA1 Message Date
Reid Spencer
1e1cfbb6fe 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
ae1c91ec10 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
7e0c2d106e 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
1bf57da16e Expand ret into "CopyToReg;BRIND"
llvm-svn: 28559
2006-05-30 17:33:19 +00:00
Chris Lattner
9da470765e Enable -fno-use-cxa-atexit on darwin/ppc also.
llvm-svn: 28558
2006-05-30 16:38:06 +00:00
Reid Spencer
9159a7e937 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
0ce0aa6544 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
68c8d8b4dd Make doc comment visible in doxygen output. Clarify Type construction.
llvm-svn: 28555
2006-05-30 15:49:30 +00:00
Reid Spencer
d6d062ca7b 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
a79b2a00c1 Properly document the second form of ConstArray::get()
llvm-svn: 28553
2006-05-30 08:26:13 +00:00
Reid Spencer
ce05d51e82 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
ced05ab1b4 Add a note about integer multiplication by constants.
llvm-svn: 28551
2006-05-30 07:37:37 +00:00
Evan Cheng
f7637e403f 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
27b3286714 Add a lea instruction selection test case.
llvm-svn: 28549
2006-05-30 06:53:55 +00:00
Evan Cheng
1891844780 Some new entries about truncate / anyext
llvm-svn: 28548
2006-05-30 06:23:50 +00:00
Reid Spencer
605d7b0bcf 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
ec5b37953c move calltarget to dsa
llvm-svn: 28546
2006-05-29 23:39:48 +00:00
Andrew Lenharth
bc04a6c143 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
439c210c7f Silly cleanup
llvm-svn: 28544
2006-05-29 18:52:52 +00:00
Chris Lattner
39cf538534 silly cleanup
llvm-svn: 28543
2006-05-29 18:52:05 +00:00
Reid Spencer
181a0cc88d 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
bf39add572 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
a51c941d8a Fix file header comment.
llvm-svn: 28540
2006-05-29 18:06:28 +00:00
Reid Spencer
d526d5be09 Remove temporary testing rules.
llvm-svn: 28539
2006-05-29 18:05:59 +00:00
Vladimir Prus
08c8b74864 Reset DEBUG_SYMBOL_TABLE back to 0.
llvm-svn: 28538
2006-05-29 12:54:52 +00:00
Vladimir Prus
8a3a4fb0ba Fix compile error when DEBUG_SYMBOL_TABLE is defined.
llvm-svn: 28537
2006-05-29 12:45:15 +00:00
Reid Spencer
631bd45185 Fix two bugs in the CppWriter.cpp:
1. Return the module from the MakeModule function so it can be verified.
2. Make sure types get generated with their names

llvm-svn: 28536
2006-05-29 02:58:15 +00:00
Reid Spencer
2bd5cd1602 Fix the file's comment block.
llvm-svn: 28535
2006-05-29 02:35:29 +00:00
Reid Spencer
ac33b75511 Fix grammar in a comment.
llvm-svn: 28534
2006-05-29 02:34:34 +00:00
Reid Spencer
1b73ead96d Replace an old C-style cast with a C++ cast (squelch warning)
llvm-svn: 28533
2006-05-29 02:32:43 +00:00
Reid Spencer
671dfd7872 Correct some grammar and describe current reality.
llvm-svn: 28532
2006-05-29 02:31:47 +00:00
Owen Anderson
d084ef3d2e Require both tests to pass.
llvm-svn: 28531
2006-05-29 01:28:16 +00:00
Owen Anderson
288a8b2d78 Update the testcase to check the full extent of LCSSA.
llvm-svn: 28530
2006-05-29 01:07:04 +00:00
Owen Anderson
d46a77c3c8 Add Use replacement. Assuming there is nothing horribly wrong with this, LCSSA
is now theoretically feature-complete.  It has not, however, been thoroughly
test, and is still considered experimental.

llvm-svn: 28529
2006-05-29 01:00:00 +00:00
Reid Spencer
8bd3003e72 Initial Commit of llvm2cpp
This is a safekeeping commit. The program is not finished. It currently
handles modules, types, global variables and function declarations. Blocks
and instructions remain to be done.

llvm-svn: 28528
2006-05-29 00:57:22 +00:00
Owen Anderson
a857559867 Major think-o. Iterate over all live out-of-loop values, and perform the
other calculations on each individually, rather than trying to delay it and do
them all at the end.

llvm-svn: 28527
2006-05-28 19:33:28 +00:00
Reid Spencer
97be29a3b4 Fix a problem where dejagnu won't accept the value of global tcl variable
"libdir" for some reason. Changing to llvmlibsdir instead fixes it.

llvm-svn: 28526
2006-05-28 07:22:42 +00:00
Reid Spencer
30094a399d Provide an infrastructure for testing the llvm2cpp program (yet to be
committed). This infrastructure is only activated when RUNLLVM2CPP=1 is
specified on the make command line. Currently it is only supported in the
Feature test suite.

llvm-svn: 28525
2006-05-28 04:21:40 +00:00
Owen Anderson
703f6baab0 Make LCSSA insert proper Phi nodes throughout the rest of the CFG by computing
the iterated Dominance Frontier of the loop-closure Phi's.  This is the
second phase of the LCSSA pass.  The third phase (coming soon) will be to
update all uses of loop variables to use the loop-closure Phi's instead.

llvm-svn: 28524
2006-05-27 18:47:11 +00:00
Chris Lattner
0189e09b89 Fix some regression from the inliner patch I committed last night. This fixes
ldecod, lencod, and SPASS.

llvm-svn: 28523
2006-05-27 17:28:13 +00:00
Chris Lattner
0f467023c2 Fix pastos in comments
llvm-svn: 28522
2006-05-27 06:57:55 +00:00
Chris Lattner
04d52ee9a2 Switch the inliner over to using CloneAndPruneFunctionInto. This effectively
makes it so that it constant folds instructions on the fly.  This is good
for several reasons:

0. Many instructions are constant foldable after inlining, particularly if
   inlining a call with constant arguments.
1. Without this, the inliner has to allocate memory for all of the instructions
   that can be constant folded, then a subsequent pass has to delete them.  This
   gets the job done without this extra work.
2. This makes the inliner *pass* a bit more aggressive: in particular, it
   partially solves a phase order issue where the inliner would inline lots
   of code that folds away to nothing, but think that the resultant function
   is big because of this code that will be gone.  Now the code never exists.

This is the first part of a 2-step process.  The second part will be smart
enough to see when this implicit constant folding propagates a constant into
a branch or switch instruction, making CFG edges dead.

This implements Transforms/Inline/inline_constprop.ll

llvm-svn: 28521
2006-05-27 01:28:04 +00:00
Chris Lattner
e1552475d3 Ignore generated files
llvm-svn: 28520
2006-05-27 01:23:30 +00:00
Chris Lattner
12c9d54f79 Implement a new method, CloneAndPruneFunctionInto, as documented.
llvm-svn: 28519
2006-05-27 01:22:24 +00:00
Chris Lattner
fcb019fcb6 Implement a new method: CloneAndPruneFunctionInto, as documented.
llvm-svn: 28518
2006-05-27 01:21:50 +00:00
Chris Lattner
1835cfb302 Refactor some code to expose an interface to constant fold and instruction given it's opcode, typeand operands.
llvm-svn: 28517
2006-05-27 01:18:04 +00:00
Chris Lattner
c8b9439f3a Add an interface to constant fold and instruction given it's opcode, type
and operands.

llvm-svn: 28516
2006-05-27 01:17:40 +00:00
Chris Lattner
2a1f1bb6d5 New testcase: check that the inliner constant folds instructions on the
fly if it can.

llvm-svn: 28515
2006-05-27 01:16:22 +00:00
Chris Lattner
d8bd52bfd2 Fix a nasty dag combiner bug that caused nondeterminstic crashes (MY FAVORITE!):
SimplifySelectOps would eliminate a Select, delete it, then return true.

The clients would see that it did something and return null.

The top level would see a null return, and decide that nothing happened,
proceeding to process the node in other ways: boom.

The fix is simple: clients of SimplifySelectOps should return the select
node itself.

In order to catch really obnoxious boogs like this in the future, add an
assert that nodes are not deleted.  We do this by checking for a sentry node
type that the SDNode dtor sets when a node is destroyed.

llvm-svn: 28514
2006-05-27 00:43:02 +00:00
Chris Lattner
990b00b325 Add a new sentry node type, allowing assertions to catch trivial
use-after-deleted errors.

llvm-svn: 28513
2006-05-27 00:40:15 +00:00