Commit Graph

25088 Commits

Author SHA1 Message Date
Owen Anderson 152d063ccb 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 497120ef63 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 633301acea 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 1310e42803 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 67c424e010 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 6b852931a0 Fix pastos in comments
llvm-svn: 28522
2006-05-27 06:57:55 +00:00
Chris Lattner be853d77e9 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 64d8692dee Ignore generated files
llvm-svn: 28520
2006-05-27 01:23:30 +00:00
Chris Lattner 3df13f4f22 Implement a new method, CloneAndPruneFunctionInto, as documented.
llvm-svn: 28519
2006-05-27 01:22:24 +00:00
Chris Lattner 53e97ebd2c Implement a new method: CloneAndPruneFunctionInto, as documented.
llvm-svn: 28518
2006-05-27 01:21:50 +00:00
Chris Lattner bc3c879fcf 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 00bb5f8248 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 1a2a101359 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 8f872d2091 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 608290c299 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
Owen Anderson b4e16996f1 A few small clean-ups, and the addition of an LCSSA statistic.
llvm-svn: 28512
2006-05-27 00:31:37 +00:00
Evan Cheng 21dee4e0b2 Make CALL node consistent with RET node. Signness of value has type MVT::i32
instead of MVT::i1. Either is fine except MVT::i32 is probably a legal type
for most (if not all) platforms while MVT::i1 is not.

llvm-svn: 28511
2006-05-26 23:13:20 +00:00
Evan Cheng a3add0fea8 Change RET node to include signness information of the return values. i.e.
RET chain, value1, sign1, value2, sign2, ...

llvm-svn: 28510
2006-05-26 23:10:12 +00:00
Evan Cheng a2e9953c54 Change RET node to include signness information of the return values. e.g.
RET chain, value1, sign1, value2, sign2

llvm-svn: 28509
2006-05-26 23:09:09 +00:00
Owen Anderson f980a7478f Trivial testcase that LCSSA can already handle.
llvm-svn: 28508
2006-05-26 21:59:20 +00:00
Owen Anderson 6e047ab8fc Fix a copy-and-paste-o that would break some compilers.
llvm-svn: 28507
2006-05-26 21:19:17 +00:00
Owen Anderson f3dd3e2bfd Clean up and refactor LCSSA a bunch. It should also run faster now, though
there's still a lot of work to be done on it.

llvm-svn: 28506
2006-05-26 21:11:53 +00:00
Evan Cheng b92f418408 Vector argument must be passed in memory location aligned on 16-byte boundary.
llvm-svn: 28505
2006-05-26 20:37:47 +00:00
Evan Cheng bfb5ea6875 Mac OS X ABI document lied. The first four XMM registers are used to pass
vector arguments, not three.

llvm-svn: 28504
2006-05-26 19:22:06 +00:00
Chris Lattner dab43b2b0e Implement Transforms/InstCombine/store.ll:test2.
llvm-svn: 28503
2006-05-26 19:19:20 +00:00
Chris Lattner 158dd8aca8 New testcase for trivial DSE
llvm-svn: 28502
2006-05-26 19:18:40 +00:00
Chris Lattner 44a793c3a6 Fix a bug in the bc reader/writer: we were not correctly encoding varargs
nonccc calls (we were dropping the CC and tail flag).  This broke several
FORTRAN programs.

Testcase here: Regression/Assembler/2006-05-26-VarargsCallEncode.ll

llvm-svn: 28501
2006-05-26 18:42:34 +00:00
Chris Lattner 49e7f56e7f New testcase, check that the bc file correctly encodes varargs nonccc calls.
llvm-svn: 28500
2006-05-26 18:41:26 +00:00
Evan Cheng a01e799927 Minor update to make the code more clear
llvm-svn: 28499
2006-05-26 18:39:59 +00:00
Evan Cheng cbfb3d07e0 Update more comments.
llvm-svn: 28498
2006-05-26 18:37:16 +00:00
Evan Cheng 763f9b00f0 Fix some comments.
llvm-svn: 28497
2006-05-26 18:25:43 +00:00
Evan Cheng 83dc51d7ff No need to handle illegal types.
llvm-svn: 28496
2006-05-26 18:22:49 +00:00
Owen Anderson 8eca8910b6 Skeletal LCSSA pass. This is currently non-functional. Expect functionality
and documentation updates soo.

llvm-svn: 28495
2006-05-26 13:58:26 +00:00
Rafael Espindola 87bc1a9b0b On ARM, alignment is in bits
Add lr as a hard coded operand of bx

llvm-svn: 28494
2006-05-26 10:56:17 +00:00
Evan Cheng 70145f2d5e Remove a couple of bogus casts.
llvm-svn: 28493
2006-05-26 08:04:31 +00:00
Evan Cheng 0f5c7936e7 Remove a bogus cast.
llvm-svn: 28492
2006-05-26 08:00:14 +00:00
Evan Cheng 29296b844f Minor bug caught by Ashwin Chandra
llvm-svn: 28491
2006-05-26 06:22:34 +00:00
Chris Lattner 0e47716e69 Transform things like (splat(splat)) -> splat
llvm-svn: 28490
2006-05-26 00:29:06 +00:00
Chris Lattner 12249be286 Introduce a helper function that simplifies interpretation of shuffle masks.
No functionality change.

llvm-svn: 28489
2006-05-25 23:48:38 +00:00
Evan Cheng 8aca43e8da Consistency
llvm-svn: 28488
2006-05-25 23:31:23 +00:00
Chris Lattner 99155be33f Turn (cast (shuffle (cast)) -> shuffle (cast) if it reduces the # casts in
the program.  This exposes more opportunities for the instcombiner, and implements
vec_shuffle.ll:test6

llvm-svn: 28487
2006-05-25 23:24:33 +00:00
Chris Lattner cdfb4cbad8 new testcase
llvm-svn: 28486
2006-05-25 23:23:22 +00:00
Chris Lattner 83f6578b0c extract element from a shuffle vector can be trivially turned into an
extractelement from the SV's source.  This implement vec_shuffle.ll:test[45]

llvm-svn: 28485
2006-05-25 22:53:38 +00:00
Chris Lattner f322bf6297 new testcases
llvm-svn: 28484
2006-05-25 22:52:49 +00:00
Evan Cheng 0421aca87a Some clean up.
llvm-svn: 28483
2006-05-25 22:38:31 +00:00
Chris Lattner dc1614d93e Add support for the missing FP condition codes
llvm-svn: 28482
2006-05-25 22:26:02 +00:00
Evan Cheng 29f805ec65 Remove some dead code.
llvm-svn: 28481
2006-05-25 22:25:52 +00:00
Evan Cheng 2554e3d9ba X86 / Cygwin asm / alignment fixes.
Patch contributed by Anton Korobeynikov!

llvm-svn: 28480
2006-05-25 21:59:08 +00:00
Chris Lattner d0754ad9e6 The patch corresponding to this test had to be reverted as unsafe.
llvm-svn: 28479
2006-05-25 21:25:54 +00:00
Chris Lattner 0853700582 Revert a patch that is unsafe, due to out of range array accesses in inner
array scopes possibly accessing valid memory in outer subscripts.

llvm-svn: 28478
2006-05-25 21:25:12 +00:00