summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Refactor/genericize this, no functionality changeChris Lattner2006-01-231-16/+30
| | | | llvm-svn: 25525
* Make iostream #inclusion explicitChris Lattner2006-01-2219-2/+20
| | | | llvm-svn: 25514
* Make this more efficient in the following ways:Chris Lattner2006-01-221-22/+37
| | | | | | | | | 1. Do not statically construct a map when the program starts up, this is expensive and cannot be optimized. Instead, create a list. 2. Do not insert entries for all function in the module into a hashmap that lives the full life of the compiler. llvm-svn: 25512
* Add explicit #includes of <iostream>Chris Lattner2006-01-224-0/+4
| | | | llvm-svn: 25509
* Several non-functionality changing changes:Chris Lattner2006-01-221-311/+151
| | | | | | | | | 1. Use the varargs version of getOrInsertFunction to simplify code. 2. remove #include 3. Reduce the number of #ifdef's. 4. remove extraneous vertical whitespace. llvm-svn: 25508
* ConstantFoldLoadThroughGEPConstantExpr wasn't handling pointers toRobert Bocchino2006-01-191-9/+22
| | | | | | packed types correctly. llvm-svn: 25470
* For PR696:Reid Spencer2006-01-191-0/+9
| | | | | | | | Don't do floor->floorf conversion if floorf is not available. This checks the compiler's host, not its target, which is incorrect for cross-compilers Not sure that's important as we don't build many cross-compilers. llvm-svn: 25456
* Implement casts.ll:test26: a cast from float -> double -> integer, doesn'tChris Lattner2006-01-191-2/+11
| | | | | | need the float->double part. llvm-svn: 25452
* If not internalizing, don't mark llvm.global[cd]tors const, as a fix for aChris Lattner2006-01-191-2/+5
| | | | | | hypothetical future boog. llvm-svn: 25430
* Don't internalize llvm.global[cd]tor unless there are uses of it. ThisChris Lattner2006-01-191-3/+9
| | | | | | unbreaks front-ends that don't use __main (like the new CFE). llvm-svn: 25429
* Make sure that cloning a module clones its target triple and dependentChris Lattner2006-01-181-3/+7
| | | | | | library list as well. This should help bugpoint. llvm-svn: 25424
* Constant folding support for the insertelement operation.Robert Bocchino2006-01-171-0/+3
| | | | llvm-svn: 25407
* Lowerpacked and SCCP support for the insertelement operation.Robert Bocchino2006-01-172-8/+66
| | | | llvm-svn: 25406
* Clean up the FFS optimization code, and make it correctly create the appropriateChris Lattner2006-01-171-41/+43
| | | | | | | unsigned llvm.cttz.* intrinsic, fixing the 2005-05-11-Popcount-ffs-fls regression last night. llvm-svn: 25398
* For PR411:Reid Spencer2006-01-161-5/+16
| | | | | | | | | | | | | | | | This patch is an incremental step towards supporting a flat symbol table. It de-overloads the intrinsic functions by providing type-specific intrinsics and arranging for automatically upgrading from the old overloaded name to the new non-overloaded name. Specifically: llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64 llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64 llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64 llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64 llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64 New code should not use the overloaded intrinsic names. Warnings will be emitted if they are used. llvm-svn: 25366
* fix a crash due to missing parensChris Lattner2006-01-161-1/+1
| | | | llvm-svn: 25363
* This pass has never worked correctly. Remove.Chris Lattner2006-01-161-629/+0
| | | | llvm-svn: 25349
* Let the inliner update the callgraph to reflect the changes it makes, insteadChris Lattner2006-01-141-12/+2
| | | | | | of doing it ourselves. This fixes Transforms/Inline/2006-01-14-CallGraphUpdate.ll llvm-svn: 25321
* Teach the inliner to update the CallGraph itself, and have it add edges toChris Lattner2006-01-141-4/+53
| | | | | | llvm.stacksave/restore when it inserts calls to them. llvm-svn: 25320
* FunctionPass's cannot do IPO things.Chris Lattner2006-01-141-4/+0
| | | | llvm-svn: 25315
* Add bswap intrinsics as documented in the Language ReferenceNate Begeman2006-01-141-0/+3
| | | | llvm-svn: 25309
* Added instcombine support for extractelement.Robert Bocchino2006-01-131-1/+54
| | | | llvm-svn: 25299
* it is ok to dce stacksave.Chris Lattner2006-01-131-0/+1
| | | | llvm-svn: 25295
* Do a simple instcombine xforms to delete llvm.stackrestore cases.Chris Lattner2006-01-131-0/+33
| | | | llvm-svn: 25294
* Simplify this a tiny bit by using the new IntrinsicInst functionality.Chris Lattner2006-01-131-7/+12
| | | | llvm-svn: 25292
* Permit inlining functions that contain dynamic allocations now thatChris Lattner2006-01-131-27/+4
| | | | | | | InlineFunction handles this case safely. This implements Transforms/Inline/dynamic_alloca_test.ll. llvm-svn: 25288
* If inlining a call to a function that contains dynamic allocas, wrap theChris Lattner2006-01-131-0/+30
| | | | | | resultant code with llvm.stacksave/llvm.stackrestore intrinsics. llvm-svn: 25286
* Use ClonedCodeInfo to avoid another walk over the inlined code, this thisChris Lattner2006-01-131-2/+4
| | | | | | time in common C cases. llvm-svn: 25285
* Use the ClonedCodeInfo object to avoid scans of the inlined code whenChris Lattner2006-01-131-62/+67
| | | | | | | it doesn't contain any calls. This is a fairly common case for C++ code, so it will probably speed up the inliner marginally in these cases. llvm-svn: 25284
* Refactor a bunch of invoke handling stuff out into a new functionChris Lattner2006-01-131-88/+108
| | | | | | "HandleInlinedInvoke". No functionality change. llvm-svn: 25283
* Allow the code cloning interfaces to capture some important info about theChris Lattner2006-01-131-11/+35
| | | | | | code being cloned if the client wants. llvm-svn: 25281
* Fix a bug I noticed by inspection: if the first instruction in the inlinedChris Lattner2006-01-131-5/+3
| | | | | | | | function was not an alloca, we wouldn't check the entry block for any allocas, leading to increased stack space in some cases. In practice, allocas are almost always at the top of the block, so this was never noticed. llvm-svn: 25280
* Fix 80 column violationsChris Lattner2006-01-131-2/+3
| | | | llvm-svn: 25279
* Preserve and update ETForest. Patch by Daniel BerlinChris Lattner2006-01-111-0/+5
| | | | llvm-svn: 25203
* Switch these to using ETForest instead of DominatorSet to compute itself.Chris Lattner2006-01-112-10/+11
| | | | | | Patch written by Daniel Berlin! llvm-svn: 25202
* Switch this to using ETForest instead of DominatorSet to compute itself.Chris Lattner2006-01-111-16/+16
| | | | | | Patch written by Daniel Berlin! llvm-svn: 25201
* Added support for the extractelement operation.Robert Bocchino2006-01-101-0/+2
| | | | llvm-svn: 25181
* Added lower packed support for the extractelement operation.Robert Bocchino2006-01-102-0/+43
| | | | llvm-svn: 25180
* Teach loopsimplify to update et-forest. Patch contributed by Daniel Berlin!Chris Lattner2006-01-091-0/+19
| | | | llvm-svn: 25153
* fix some 176.gcc miscompilation from my previous patch.Chris Lattner2006-01-071-7/+33
| | | | llvm-svn: 25137
* silence some bogus gcc warnings on fenrisChris Lattner2006-01-061-10/+11
| | | | llvm-svn: 25130
* Enhance the shift-shift folding code to allow a no-op cast to occur in betweenChris Lattner2006-01-061-55/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the shifts. This allows us to fold this (which is the 'integer add a constant' sequence from cozmic's scheme compmiler): int %x(uint %anf-temporary776) { %anf-temporary777 = shr uint %anf-temporary776, ubyte 1 %anf-temporary800 = cast uint %anf-temporary777 to int %anf-temporary804 = shl int %anf-temporary800, ubyte 1 %anf-temporary805 = add int %anf-temporary804, -2 %anf-temporary806 = or int %anf-temporary805, 1 ret int %anf-temporary806 } into this: int %x(uint %anf-temporary776) { %anf-temporary776 = cast uint %anf-temporary776 to int %anf-temporary776.mask1 = add int %anf-temporary776, -2 %anf-temporary805 = or int %anf-temporary776.mask1, 1 ret int %anf-temporary805 } note that instcombine already knew how to eliminate the AND that the two shifts fold into. This is tested by InstCombine/shift.ll:test26 -Chris llvm-svn: 25128
* Simplify the code a bit moreChris Lattner2006-01-061-3/+5
| | | | llvm-svn: 25126
* Extract a bunch of code out of visitShiftInst into FoldShiftByConstant. NoChris Lattner2006-01-061-180/+189
| | | | | | functionality changes. llvm-svn: 25125
* Pull inline methods out of the pass class definition to make it easier toChris Lattner2006-01-031-78/+88
| | | | | | | | read the code. Do not internalize debugger anchors. llvm-svn: 25067
* getting there...Duraid Madina2005-12-261-0/+1
| | | | llvm-svn: 25021
* Fix Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll, a crash on undefinedChris Lattner2005-12-141-2/+2
| | | | | | behavior in 126.gcc on big-endian systems. llvm-svn: 24708
* Improve ResolveFunctions to:Reid Spencer2005-12-131-13/+15
| | | | | | | | | a) use better local variable names (OldMT -> OldFT) where "M" is used to mean "Function" (perhaps it was previously "Method"?) b) print out the module identifier in a warning message so that it is possible to track down in which module the error occurred. llvm-svn: 24698
* Implement a little hack for parity with GCC on crafty. This speeds upChris Lattner2005-12-121-2/+277
| | | | | | | | | | | | | | | | | | | | | | 186.crafty by about 16% (from 15.109s to 13.045s) on my system. This turns allocas with unions/casts into scalars. For example crafty has something like this: union doub { unsigned short i[4]; long long d; }; int f(long long a) { return ((union doub){.d=a}).i[1]; } Instead of generating loads and stores to an alloca, we now promote the whole thing to a scalar long value. This implements: Transforms/ScalarRepl/AggregatePromote.ll llvm-svn: 24667
* getRawValue zero extens for unsigned values, use getsextvalue so that weChris Lattner2005-12-051-3/+3
| | | | | | | know that small negative values fit into the immediate field of addressing modes. llvm-svn: 24608
OpenPOWER on IntegriCloud