- Apr 26, 2005
-
-
Reid Spencer authored
* Change signatures of OptimizeCall and ValidateCalledFunction so they are non-const, allowing the optimization object to be modified. This is in support of caching things used across multiple calls. * Provide two functions for constructing and caching function types * Modify the StrCatOptimization to cache Function objects for strlen and llvm.memcpy so it doesn't regenerate them on each call site. Make sure these are invalidated each time we start the pass. * Handle both a GEP Instruction and a GEP ConstantExpr * Add additional checks to make sure we really are dealing with an arary of sbyte and that all the element initializers are ConstantInt or ConstantExpr that reduce to ConstantInt. * Make sure the GlobalVariable is constant! * Don't use ConstantArray::getString as it can fail and it doesn't give us the right thing. We must check for null bytes in the middle of the array. * Use llvm.memcpy instead of memcpy so we can factor alignment into it. * Don't use void* types in signatures, replace with sbyte* instead. llvm-svn: 21555
-
Jeff Cohen authored
llvm-svn: 21554
-
Reid Spencer authored
llvm-svn: 21553
-
Chris Lattner authored
llvm-svn: 21552
-
- Apr 25, 2005
-
-
Reid Spencer authored
* Don't use std::string for the function names, const char* will suffice * Allow each CallOptimizer to validate the function signature before doing anything * Repeatedly loop over the functions until an iteration produces no more optimizations. This allows one optimization to insert a call that is optimized by another optimization. * Implement the ConstantArray portion of the StrCatOptimization * Provide a template for the MemCpyOptimization * Make ExitInMainOptimization split the block, not delete everything after the return instruction. (This covers revision 1.3 and 1.4, as the 1.3 comments were botched) llvm-svn: 21548
-
Chris Lattner authored
int foo1(int x, int y) { int t1 = x >= 0; int t2 = y >= 0; return t1 & t2; } int foo2(int x, int y) { int t1 = x == -1; int t2 = y == -1; return t1 & t2; } produces: _foo1: or r2, r4, r3 srwi r2, r2, 31 xori r3, r2, 1 blr _foo2: and r2, r4, r3 addic r2, r2, 1 li r2, 0 addze r3, r2 blr instead of: _foo1: srwi r2, r4, 31 xori r2, r2, 1 srwi r3, r3, 31 xori r3, r3, 1 and r3, r2, r3 blr _foo2: addic r2, r4, 1 li r2, 0 addze r2, r2 addic r3, r3, 1 li r3, 0 addze r3, r3 and r3, r2, r3 blr llvm-svn: 21547
-
Reid Spencer authored
* Use a llvm-svn: 21546
-
Reid Spencer authored
the restriction that it is an XFAIL because it now passes. llvm-svn: 21545
-
Chris Lattner authored
_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 llvm-svn: 21544
-
Chris Lattner authored
Naveen Neelakantam, thanks! llvm-svn: 21543
-
Tanya Lattner authored
llvm-svn: 21542
-
Chris Lattner authored
llvm-svn: 21541
-
Chris Lattner authored
llvm-svn: 21540
-
Chris Lattner authored
llvm-svn: 21539
-
Chris Lattner authored
llvm-svn: 21537
-
Chris Lattner authored
llvm-svn: 21536
-
Chris Lattner authored
llvm-svn: 21535
-
Chris Lattner authored
llvm-svn: 21534
-
Reid Spencer authored
strcat when its called. llvm-svn: 21533
-
Reid Spencer authored
llvm-svn: 21532
-
Reid Spencer authored
* 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. llvm-svn: 21526
-
Reid Spencer authored
llvm-dis output don't go blind. llvm-svn: 21525
-
Reid Spencer authored
destructor. Just add the do-nothing virtual destructor. llvm-svn: 21524
-
Reid Spencer authored
llvm-svn: 21523
-
Reid Spencer authored
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. llvm-svn: 21522
-
Reid Spencer authored
llvm-svn: 21521
-
Reid Spencer authored
so we put the destructor in Pass.cpp and make it non-inline. llvm-svn: 21520
-
Chris Lattner authored
llvm-svn: 21515
-
Reid Spencer authored
instruction is added to the original block, not the new block. llvm-svn: 21513
-
Reid Spencer authored
destructor. llvm-svn: 21510
-
Reid Spencer authored
don't have virtual destructors. llvm-svn: 21507
-
- Apr 24, 2005
-
-
Reid Spencer authored
grammar rules for the English language. llvm-svn: 21503
-
Misha Brukman authored
llvm-svn: 21501
-
Chris Lattner authored
llvm-svn: 21500
-
Misha Brukman authored
regardless of the tab size/stop settings on the developer side llvm-svn: 21499
-
Misha Brukman authored
llvm-svn: 21498
-
Misha Brukman authored
llvm-svn: 21497
-
Misha Brukman authored
llvm-svn: 21496
-
Chris Lattner authored
llvm-svn: 21495
-
Chris Lattner authored
llvm-svn: 21494
-