summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
...
* merge two very similar functions into one that has a bool argument.Chris Lattner2010-12-131-47/+26
| | | | llvm-svn: 121678
* don't bother handling non-canonical icmp'sChris Lattner2010-12-131-11/+9
| | | | llvm-svn: 121676
* inline a function, making the result much simpler.Chris Lattner2010-12-131-27/+11
| | | | llvm-svn: 121675
* Fix my previous patch to handle a degenerate case that the llvm-gccChris Lattner2010-12-131-0/+16
| | | | | | bootstrap buildbot tripped over. llvm-svn: 121674
* convert some methods to be static functionsChris Lattner2010-12-131-25/+23
| | | | llvm-svn: 121673
* zap two more std::sorts.Chris Lattner2010-12-131-2/+2
| | | | llvm-svn: 121672
* fix a fairly serious oversight with switch formation fromChris Lattner2010-12-131-1/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or'd conditions. Previously we'd compile something like this: int crud (unsigned char c) { return c == 62 || c == 34 || c == 92; } into: switch i8 %c, label %lor.rhs [ i8 62, label %lor.end i8 34, label %lor.end ] lor.rhs: ; preds = %entry %cmp8 = icmp eq i8 %c, 92 br label %lor.end lor.end: ; preds = %entry, %entry, %lor.rhs %0 = phi i1 [ true, %entry ], [ %cmp8, %lor.rhs ], [ true, %entry ] %lor.ext = zext i1 %0 to i32 ret i32 %lor.ext which failed to merge the compare-with-92 into the switch. With this patch we simplify this all the way to: switch i8 %c, label %lor.rhs [ i8 62, label %lor.end i8 34, label %lor.end i8 92, label %lor.end ] lor.rhs: ; preds = %entry br label %lor.end lor.end: ; preds = %entry, %entry, %entry, %lor.rhs %0 = phi i1 [ true, %entry ], [ false, %lor.rhs ], [ true, %entry ], [ true, %entry ] %lor.ext = zext i1 %0 to i32 ret i32 %lor.ext which is much better for codegen's switch lowering stuff. This kicks in 33 times on 176.gcc (for example) cutting 103 instructions off the generated code. llvm-svn: 121671
* convert an std::sort to array_pod_sort.Chris Lattner2010-12-131-2/+8
| | | | llvm-svn: 121669
* move the "br (X == 0 | X == 1), T, F" -> switch optimization to a newChris Lattner2010-12-131-57/+56
| | | | | | | | | | | location in simplifycfg. In the old days, SimplifyCFG was never run on the entry block, so we had to scan over all preds of the BB passed into simplifycfg to do this xform, now we can just check blocks ending with a condbranch. This avoids a scan over all preds of every simplified block, which should be a significant compile-time perf win on functions with lots of edges. No functionality change. llvm-svn: 121668
* reduce indentation and generally simplify code, no functionality change.Chris Lattner2010-12-131-333/+309
| | | | llvm-svn: 121667
* use getFirstNonPHIOrDbg to simplify this code.Chris Lattner2010-12-131-9/+5
| | | | llvm-svn: 121664
* improve commentChris Lattner2010-12-061-2/+1
| | | | llvm-svn: 120994
* Teach SimplifyCFG to turnFrits van Bommel2010-12-051-2/+72
| | | | | | | | | (indirectbr (select cond, blockaddress(@fn, BlockA), blockaddress(@fn, BlockB))) into (br cond, BlockA, BlockB). llvm-svn: 120943
* remove the pointless check of MemoryUseIntrinsic fromChris Lattner2010-11-301-3/+0
| | | | | | | is trivially dead, since these have side effects. This makes the (misnamed) MemoryUseIntrinsic class dead, so remove it. llvm-svn: 120382
* Replace calls to ConstantFoldInstruction with calls to SimplifyInstructionDuncan Sands2010-11-231-5/+6
| | | | | | | in two places that are really interested in simplified instructions, not constants. llvm-svn: 120044
* Don't keep track of inserted phis in PromoteMemoryToRegister: the informationDuncan Sands2010-11-221-8/+3
| | | | | | is never used. Patch by Cameron Zwarich. llvm-svn: 119963
* Simplify code. No change in functionality.Benjamin Kramer2010-11-201-1/+1
| | | | llvm-svn: 119908
* Factor code for testing whether replacing one value with anotherDuncan Sands2010-11-181-14/+16
| | | | | | | | preserves LCSSA form out of ScalarEvolution and into the LoopInfo class. Use it to check that SimplifyInstruction simplifications are not breaking LCSSA form. Fixes PR8622. llvm-svn: 119727
* Have InlineFunction use SimplifyInstruction rather thanDuncan Sands2010-11-171-9/+11
| | | | | | | | | hasConstantValue. I was leery of using SimplifyInstruction while the IR was still in a half-baked state, which is the reason for delaying the simplification until the IR is fully cooked. llvm-svn: 119494
* Have RemovePredecessorAndSimplify you SimplifyInstructionDuncan Sands2010-11-171-4/+4
| | | | | | rather than hasConstantValue. llvm-svn: 119457
* Have a few places that want to simplify phi nodes use SimplifyInstructionDuncan Sands2010-11-163-8/+11
| | | | | | rather than calling hasConstantValue. No intended functionality change. llvm-svn: 119352
* Inline asm multiple alternative constraints development phase 2 - improved ↵John Thompson2010-10-291-1/+1
| | | | | | basic logic, added initial platform support. llvm-svn: 117667
* Fix PR8445: a block with no predecessors may be the entry block, in which caseDuncan Sands2010-10-241-12/+10
| | | | | | | | | it isn't unreachable and should not be zapped. The check for the entry block was missing in one case: a block containing a unwind instruction. While there, do some small cleanups: "M" is not a great name for a Function* (it would be more appropriate for a Module*), change it to "Fn"; use Fn in more places. llvm-svn: 117224
* Switch attribute macros to use 'LLVM_' as a prefix. We retain the old namesChandler Carruth2010-10-231-1/+2
| | | | | | until other LLVM projects using these are cleaned up. llvm-svn: 117200
* Passes do not need to recursively initialize passes that they preserve, ifOwen Anderson2010-10-192-6/+0
| | | | | | | they do not also require them. This allows us to reduce inter-pass linkage dependencies. llvm-svn: 116854
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-197-12/+21
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Transfer debug loc to lowered call.Devang Patel2010-10-181-0/+2
| | | | | | Patch by Alexander Herz! llvm-svn: 116733
* Fix PR8313 by changing ValueToValueMap use a TrackingVH.Rafael Espindola2010-10-132-8/+14
| | | | llvm-svn: 116390
* Be more consistent in using ValueToValueMapTy.Rafael Espindola2010-10-133-13/+12
| | | | llvm-svn: 116387
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-123-3/+25
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Now with fewer extraneous semicolons!Owen Anderson2010-10-078-8/+8
| | | | llvm-svn: 115996
* Next step on the getting-rid-of-static-ctors train: begin adding per-libraryOwen Anderson2010-10-072-0/+37
| | | | | | | initialization functions that initialize the set of passes implemented in that library. Add C bindings for these functions as well. llvm-svn: 115927
* Move the pass initialization helper functions into the llvm namespace, and addOwen Anderson2010-10-071-3/+2
| | | | | | | a header declaring them all. This is also where we will declare per-library pass-set initializer functions down the road. llvm-svn: 115900
* Removed a bunch of unnecessary target_link_libraries.Oscar Fuentes2010-09-281-1/+0
| | | | llvm-svn: 114999
* Get rid of pop_macro warnings on MSVC.Michael J. Spencer2010-09-241-9/+10
| | | | llvm-svn: 114750
* Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."Michael J. Spencer2010-09-131-6/+1
| | | | | | | | | | This reverts commit r113632 Conflicts: cmake/modules/AddLLVM.cmake llvm-svn: 113819
* Added skeleton for inline asm multiple alternative constraint support.John Thompson2010-09-131-21/+5
| | | | llvm-svn: 113766
* typoesGabor Greif2010-09-102-3/+3
| | | | llvm-svn: 113647
* CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.Michael J. Spencer2010-09-101-1/+6
| | | | llvm-svn: 113632
* Fix LoopSimplify to notify ScalarEvolution when splitting a loop backedgeDan Gohman2010-09-041-1/+10
| | | | | | | into an inner loop, as the new loop iteration may differ substantially. This fixes PR8078. llvm-svn: 113057
* Reapply commit 112699, speculatively reverted by echristo, sinceDuncan Sands2010-09-022-14/+12
| | | | | | | | | I'm sure it is harmless. Original commit message: If PrototypeValue is erased in the middle of using the SSAUpdator then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112810
* Speculatively revert 112699 and 112702, they seem to be causingEric Christopher2010-09-012-12/+14
| | | | | | self host errors on clang-x86-64. llvm-svn: 112719
* If PrototypeValue is erased in the middle of using the SSAUpdatorDuncan Sands2010-09-012-14/+12
| | | | | | | then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112699
* implement SSAUpdater::RewriteUseAfterInsertions, a helpful form of RewriteUse.Chris Lattner2010-08-291-0/+16
| | | | llvm-svn: 112409
* remove the ABCD and SSI passes. They don't have any clients thatChris Lattner2010-08-282-434/+0
| | | | | | | I'm aware of, aren't maintained, and LVI will be replacing their value. nlewycky approved this on irc. llvm-svn: 112355
* Reapply r112091 and r111922, support for metadata linking, with aDan Gohman2010-08-264-51/+84
| | | | | | | | | | | | | | fix: add a flag to MapValue and friends which indicates whether any module-level mappings are being made. In the common case of inlining, no module-level mappings are needed, so MapValue doesn't need to examine non-function-local metadata, which can be very expensive in the case of a large module with really deep metadata (e.g. a large C++ program compiled with -g). This flag is a little awkward; perhaps eventually it can be moved into the ClonedCodeInfo class. llvm-svn: 112190
* Revert r111922, "MapValue support for MDNodes. This is similar to r109117,Daniel Dunbar2010-08-261-27/+8
| | | | | | | except ...", it is causing *massive* performance regressions when building Clang with itself (-O3 -g). llvm-svn: 112158
* Revert r112091, "Remap metadata attached to instructions when remappingDaniel Dunbar2010-08-262-12/+16
| | | | | | individual ...", which depends on r111922, which I am reverting. llvm-svn: 112157
* Remap metadata attached to instructions when remapping individualDan Gohman2010-08-252-16/+12
| | | | | | instructions, not when remapping modules. llvm-svn: 112091
* Use MapValue in the Linker instead of having a private functionDan Gohman2010-08-244-32/+3
| | | | | | | | which does the same thing. This eliminates redundant code and handles MDNodes better. MDNode linking still doesn't fully work yet though. llvm-svn: 111941
OpenPOWER on IntegriCloud