Reid Spencer
8b9f9b3d60
Update the test case to handle a few more (degenerate) cases and remove
...
the restriction that it is an XFAIL because it now passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21545 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 21:08:34 +00:00
Chris Lattner
6ea9279304
Codegen x < 0 | y < 0 as (x|y) < 0. This allows us to compile this to:
...
_foo:
or r2, r4, r3
srwi r3, r2, 31
blr
instead of:
_foo:
srwi r2, r4, 31
srwi r3, r3, 31
or r3, r2, r3
blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21544 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 21:03:25 +00:00
Chris Lattner
91bd25d9df
Make dominates(A,B) work with post dominators. Patch contributed by
...
Naveen Neelakantam, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21543 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 20:50:33 +00:00
Tanya Lattner
14fc5c1c05
Added question about turning off all optimizations. I think this has been asked once or twice.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21542 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 20:36:56 +00:00
Chris Lattner
a70b66d49e
implement getelementptr.ll:test10
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21541 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 20:17:30 +00:00
Chris Lattner
e3194645fc
rename fn
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21540 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 20:17:16 +00:00
Chris Lattner
27b8598c97
new testcase
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21539 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 20:17:00 +00:00
Chris Lattner
a1198b5254
Correctly handle global-argument aliases induced in main
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21537 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 19:16:31 +00:00
Chris Lattner
63320cc841
Don't mess up SCC traversal when a node has null edges out of it.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21536 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 19:16:17 +00:00
Chris Lattner
69c11bb285
document 'opaque' types
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21535 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 17:34:15 +00:00
Chris Lattner
0f876db7d5
Add feedback from Vikram
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21534 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 15:47:57 +00:00
Reid Spencer
5fe8561bbe
Make sure the target buffer is null terminated so we don't blow up
...
strcat when its called.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21533 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 15:40:35 +00:00
Reid Spencer
0bc07503c8
A test case for testing the StrCatOptimizer, currently XFAILed everywhere.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21532 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 07:29:30 +00:00
Reid Spencer
b7c11e3966
Post-Review Cleanup:
...
* Fix comments at top of file
* Change algorithm for running the call optimizations from n*n to something
closer to n.
* Use a hash_map to store and lookup the optimizations since there will
eventually (or potentially) be a large number of them. This gets lookup
based on the name of the function to O(1). Each CallOptimizer now has a
std::string member named func_name that tracks the name of the function
that it applies to. It is this string that is entered into the hash_map
for fast comparison against the function names encountered in the module.
* Cleanup some style issues pertaining to iterator invalidation
* Don't pass the Function pointer to the OptimizeCall function because if
the optimization needs it, it can get it from the CallInst passed in.
* Add the skeleton for a new CallOptimizer, StrCatOptimizer which will
eventually replace strcat's of constant strings with direct copies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21526 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 03:59:26 +00:00
Reid Spencer
5517b2ba23
Use the %name rather than the "name" format so those familiar with the
...
llvm-dis output don't go blind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21525 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 03:18:19 +00:00
Reid Spencer
a1aad3b0ed
Shut GCC 4.0 up about classes that have virtual functions but a non-virtual
...
destructor. Just add the do-nothing virtual destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21524 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 02:55:55 +00:00
Reid Spencer
bb3d5d246b
Declare a function to create the SimplifyLibCalls pass.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 02:54:00 +00:00
Reid Spencer
a7c049bf6a
A new pass to provide specific optimizations for certain well-known library
...
calls. The pass visits all external functions in the module and determines
if such function calls can be optimized. The optimizations are specific to
the library calls involved. This initial version only optimizes calls to
exit(3) when they occur in main(): it changes them to ret instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21522 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 02:53:12 +00:00
Reid Spencer
a498747842
A test case for the the ExitInMain libcall simplification.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21521 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 02:50:08 +00:00
Reid Spencer
e8f3848639
Older compilers won't like the inline virtual destructor in the header file
...
so we put the destructor in Pass.cpp and make it non-inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21520 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 01:01:35 +00:00
Chris Lattner
fd84c2d89c
fix some bugs
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21515 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 00:38:52 +00:00
Reid Spencer
05bb8831d3
Fix a thinko in the documentation of the splitBasicBlock method. The branch
...
instruction is added to the original block, not the new block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21513 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 00:31:53 +00:00
Reid Spencer
2b2a528374
Shut GCC 4.0 up about classes with virtual functions but no virtual
...
destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21510 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 22:27:20 +00:00
Reid Spencer
628748650f
Shut GCC 4.0 up when it complains about classes with virtual functions that
...
don't have virtual destructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21507 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 22:20:32 +00:00
Reid Spencer
ad1f0cd0cc
Make this readable for newbies and those who can only understand one set of
...
grammar rules for the English language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21503 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 20:56:18 +00:00
Misha Brukman
4e8458d02c
extract has been renamed to llvm-extract to avoid conflicting with another tool
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21501 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 17:46:58 +00:00
Chris Lattner
f52d681657
Eliminate cases where we could << by 64, which is undefined in C.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21500 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 17:46:05 +00:00
Misha Brukman
e50b075b66
There are still uses for spaces in Makefiles -- to make text line up together,
...
regardless of the tab size/stop settings on the developer side
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21499 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 17:43:41 +00:00
Misha Brukman
de03bc07ef
extract has been renamed to llvm-extract to avoid conflicting with another tool
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21498 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 17:36:05 +00:00
Misha Brukman
55d2a1a546
elisp code to help with LLVM code standards compliance
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21497 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 17:09:19 +00:00
Misha Brukman
3d6eea518c
.vimrc file to aid in LLVM coding standards conformance
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21496 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 17:05:04 +00:00
Chris Lattner
a1df33c0ee
Implement xor.ll:test21: select (not C), A, B -> select C, B, A
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21495 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 07:30:14 +00:00
Chris Lattner
6edb7e8c20
Test that xor/select are folded into a select with inverted operands.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21494 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 07:28:53 +00:00
Chris Lattner
64001d0a13
Allow these methods to take a generic Value* to simplify clients. Use
...
const_cast instead of c casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21493 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 07:28:37 +00:00
Chris Lattner
353835447c
allow these to take a generic Value*
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21492 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 07:28:04 +00:00
Chris Lattner
484d3cf0e3
Use getPrimitiveSizeInBits() instead of getPrimitiveSize()*8
...
Completely rework the 'setcc (cast x to larger), y' code. This code has
the advantage of implementing setcc.ll:test19 (being more general than
the previous code) and being correct in all cases.
This allows us to unxfail 2004-11-27-SetCCForCastLargerAndConstant.ll,
and close PR454.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21491 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 06:59:08 +00:00
Chris Lattner
6f8a2461a8
unxfail this.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21490 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 06:55:40 +00:00
Chris Lattner
936a775a1b
add a new testcase which occurs in 181.mcf
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21489 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 06:55:33 +00:00
Misha Brukman
446b5a9dd9
* The aesthetic police is on patrol!!...
...
* ... but it wasn't so busy as to not smell the roses and doxygenify comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21487 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 22:35:26 +00:00
Chris Lattner
3fa94bffcb
Add a helper method
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21486 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 22:20:22 +00:00
Chris Lattner
ea1049139e
Fix a bug in my previous checkin
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21485 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 22:01:39 +00:00
Chris Lattner
e862547a0c
This file is never referenced
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21484 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 22:00:26 +00:00
Chris Lattner
4f0247c10d
Add a method, remove last use of Type.def
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21483 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 22:00:09 +00:00
Chris Lattner
4c5d305b1a
add a method, remove a dead #include
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21482 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 21:59:42 +00:00
Chris Lattner
55f950113b
Types.def is going away
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21481 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 21:59:11 +00:00
Jeff Cohen
9d80930e95
Eliminate tabs and trailing spaces
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21480 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 21:38:35 +00:00
Jeff Cohen
b02fbfc485
Eliminate tabs and trailing spaces
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21479 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 21:26:11 +00:00
Chris Lattner
cc1f24585e
Propagate eq sets through the bu graphs to the cbu and eq graphs, fixing
...
a crash of the sfv on 188.ammp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21478 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 21:11:05 +00:00
Chris Lattner
f1b200b0fb
add a bunch of documentation about the LLVM type resolution machinery
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21475 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 17:27:36 +00:00
Reid Spencer
2c6584a72f
Make the CBackend actually get included in llc by using USEDLIBS instead of
...
USEDLIB as the variable to which "CBackend" is appended. The surrounding
if clause is safe because currently the configure script ensures that the
CBackend target is always added to TARGETS_TO_BUILD. By using a non-hard
coded construct in the makefile, we gain uniformity and the ability to
change the default set of targets by only changing the configure script.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21474 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 17:24:33 +00:00