summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
* Use AttributeSet accessor methods instead of Attribute accessor methods.Bill Wendling2013-01-181-4/+2
| | | | | | | Further encapsulation of the Attribute object. Don't allow direct access to the Attribute object as an aggregate. llvm-svn: 172853
* Push some more methods down to hide the use of the Attribute class.Bill Wendling2013-01-181-4/+2
| | | | | | | | Because the Attribute class is going to stop representing a collection of attributes, limit the use of it as an aggregate in favor of using AttributeSet. This replaces some of the uses for querying the function attributes. llvm-svn: 172844
* Remove trailing spaces.Jakub Staszak2013-01-141-38/+38
| | | | llvm-svn: 172489
* Make sure we don't emit instructions before a landingpad instruction.Bill Wendling2013-01-081-1/+6
| | | | | | PR14782 llvm-svn: 171846
* Move TypeFinder.h into the IR tree, it clearly belongs with the IR library.Chandler Carruth2013-01-071-1/+1
| | | | llvm-svn: 171749
* Make SimplifyCFG simply depend upon TargetTransformInfo and pass itChandler Carruth2013-01-071-37/+37
| | | | | | | | | | | | | through as a reference rather than a pointer. There is always *some* implementation of this available, so this simplifies code by not having to test for whether it is available or not. Further, it turns out there were piles of places where SimplifyCFG was recursing and not passing down either TD or TTI. These are fixed to be more pedantically consistent even though I don't have any particular cases where it would matter. llvm-svn: 171691
* Move TargetTransformInfo to live under the Analysis library. This noChandler Carruth2013-01-071-1/+1
| | | | | | | longer would violate any dependency layering and it is in fact an analysis. =] llvm-svn: 171686
* switch from pointer equality comparison to MDNode::getMostGenericTBAA Chris Lattner2013-01-051-1/+0
| | | | | | when merging two TBAA tags, pointed out by Nuno. llvm-svn: 171627
* Switch SimplifyCFG over to the TargetTransformInfo interface rather thanChandler Carruth2013-01-051-4/+2
| | | | | | the ScalarTargetTransformInfo interface. llvm-svn: 171617
* Sink the AddressingModeMatcher helper class into an anonymous namespaceChandler Carruth2013-01-052-578/+0
| | | | | | | | | | | | next to its only user. This helper relies on TargetLowering information that shouldn't be generally used throughout the Transfoms library, and so it made little sense as a generic utility. This also consolidates the file where we need to remove the remaining uses of TargetLowering in favor of the IR-layer abstract interface in TargetTransformInfo. llvm-svn: 171590
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-0232-154/+154
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Resort the #include lines in include/... and lib/... with theChandler Carruth2013-01-021-1/+1
| | | | | | | | | | utils/sort_includes.py script. Most of these are updating the new R600 target and fixing up a few regressions that have creeped in since the last time I sorted the includes. llvm-svn: 171362
* Fix typo in commentsAlexey Samsonov2012-12-241-1/+1
| | | | llvm-svn: 171021
* Change 'AttrVal' to 'AttrKind' to better reflect that it's a kind of ↵Bill Wendling2012-12-221-12/+12
| | | | | | attribute instead of the value of the attribute. llvm-svn: 170972
* Remove duplicate includes.Roman Divacky2012-12-211-2/+0
| | | | llvm-svn: 170902
* [msan] Remove unreachable blocks before instrumenting a function.Evgeniy Stepanov2012-12-211-0/+41
| | | | llvm-svn: 170883
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-192-35/+35
| | | | | | single attribute in the future. llvm-svn: 170502
* Improve debug info generated with enabled AddressSanitizer.Alexey Samsonov2012-12-121-0/+35
| | | | | | | | | | | | When ASan replaces <alloca instruction> with <offset into a common large alloca>, it should also patch llvm.dbg.declare calls and replace debug info descriptors to mark that we've replaced alloca with a value that stores an address of the user variable, not the user variable itself. See PR11818 for more context. llvm-svn: 169984
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-072-29/+29
| | | | | | in the near future. llvm-svn: 169651
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-0328-124/+124
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Fix non-determinism introduced in r168970 and pointed out by Duncan.Chandler Carruth2012-11-301-5/+13
| | | | | | | | | | | | | We're iterating over a non-deterministically ordered container looking for two saturating flags. To do this correctly, we have to saturate both, and only stop looping if both saturate to their final value. Otherwise, which flag we see first changes the result. This is also a micro-optimization of the previous version as now we don't go into the (possibly expensive) test logic once the first violation of either constraint is detected. llvm-svn: 168989
* Rearrange the comments, control flow, and variable names; noChandler Carruth2012-11-301-7/+14
| | | | | | | | | | | | | | functionality changed. Evan's commit r168970 moved the code that the primary comment in this function referred to to the other end of the function without moving the comment, and there has been a steady creep of "boolean" logic in it that is simpler if handled via early exit. That way each special case can have its own comments. I've also made the variable name a bit more explanatory than "AllFit". This is in preparation to fix the non-deterministic output of this function. llvm-svn: 168988
* Fix logic to determine whether to turn a switch into a lookup table. WhenEvan Cheng2012-11-301-6/+13
| | | | | | | | | the tables cannot fit in registers (i.e. bitmap), do not emit the table if it's using an illegal type. rdar://12779436 llvm-svn: 168970
* instcombine: Migrate puts optimizationsMeador Inge2012-11-291-0/+27
| | | | | | | | | | | | This patch migrates the puts optimizations from the simplify-libcalls pass into the instcombine library call simplifier. All the simplifiers from simplify-libcalls have now been migrated to instcombine. Yay! Just a few other bits to migrate (prototype attribute inference and a few statistics) and simplify-libcalls can finally be put to rest. llvm-svn: 168925
* instcombine: Migrate fputs optimizationsMeador Inge2012-11-291-0/+24
| | | | | | | This patch migrates the fputs optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168893
* instcombine: Migrate fwrite optimizationsMeador Inge2012-11-291-0/+35
| | | | | | | This patch migrates the fwrite optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168892
* instcombine: Migrate fprintf optimizationsMeador Inge2012-11-291-0/+77
| | | | | | | This patch migrates the fprintf optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168891
* Remove the dependent libraries feature.Bill Wendling2012-11-271-4/+0
| | | | | | The dependent libraries feature was never used and has bit-rotted. Remove it. llvm-svn: 168694
* instcombine: Migrate sprintf optimizationsMeador Inge2012-11-271-0/+95
| | | | | | | This patch migrates the sprintf optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168677
* Fix a comment bug in toascii simplifierMeador Inge2012-11-261-1/+1
| | | | | | | When I migrated the toascii simplifier in r168580 Benjamin Kramer noticed a bug in one of the comments that I migrated. llvm-svn: 168605
* instcombine: Migrate printf optimizationsMeador Inge2012-11-261-0/+103
| | | | | | | This patch migrates the printf optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168604
* instcombine: Migrate toascii optimizationsMeador Inge2012-11-261-0/+16
| | | | | | | This patch migrates the toascii optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168580
* instcombine: Migrate isascii optimizationsMeador Inge2012-11-261-0/+17
| | | | | | | This patch migrates the isascii optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168579
* instcombine: Migrate isdigit optimizationsMeador Inge2012-11-261-0/+18
| | | | | | | This patch migrates the isdigit optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168578
* instcombine: Migrate *abs optimizationsMeador Inge2012-11-261-0/+21
| | | | | | | This patch migrates the *abs optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168574
* instcombine: Migrate ffs* optimizationsMeador Inge2012-11-251-0/+46
| | | | | | | This patch migrates the ffs* optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168571
* Make the AttrListPtr object a part of the LLVMContext.Bill Wendling2012-11-201-13/+30
| | | | | | | | | When code deletes the context, the AttributeImpls that the AttrListPtr points to are now invalid. Therefore, instead of keeping a separate managed static for the AttrListPtrs that's reference counted, move it into the LLVMContext and delete it when deleting the AttributeImpls. llvm-svn: 168354
* SimplifyCFG: Don't assume non-null ScalarTargetTransformInfo.Hans Wennborg2012-11-161-1/+2
| | | | | | Patch by Pekka Jääskeläinen! llvm-svn: 168176
* misspellAndrew Trick2012-11-151-3/+3
| | | | llvm-svn: 168058
* whitespaceAndrew Trick2012-11-151-4/+4
| | | | llvm-svn: 168057
* Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko2012-11-151-1/+1
| | | | llvm-svn: 168049
* Figure out <size> argument of llvm.lifetime intrinsics at the moment they ↵Alexey Samsonov2012-11-131-2/+21
| | | | | | are created (during function inlining) llvm-svn: 167821
* instcombine: Migrate math library call simplificationsMeador Inge2012-11-131-3/+262
| | | | | | | | | | | | | | | | | This patch migrates the math library call simplifications from the simplify-libcalls pass into the instcombine library call simplifier. I have typically migrated just one simplifier at a time, but the math simplifiers are interdependent because: 1. CosOpt, PowOpt, and Exp2Opt all depend on UnaryDoubleFPOpt. 2. CosOpt, PowOpt, Exp2Opt, and UnaryDoubleFPOpt all depend on the option -enable-double-float-shrink. These two factors made migrating each of these simplifiers individually more of a pain than it would be worth. So, I migrated them all together. llvm-svn: 167815
* Normalize memcmp constant folding results.Meador Inge2012-11-121-1/+8
| | | | | | | | | | | | | | | | | | | The library call simplifier folds memcmp calls with all constant arguments to a constant. For example: memcmp("foo", "foo", 3) -> 0 memcmp("hel", "foo", 3) -> 1 memcmp("foo", "hel", 3) -> -1 The folding is implemented in terms of the system memcmp that LLVM gets linked with. It currently just blindly uses the value returned from the system memcmp as the folded constant. This patch normalizes the values returned from the system memcmp to (-1, 0, 1) so that we get consistent results across multiple platforms. The test cases were adjusted accordingly. llvm-svn: 167726
* instcombine: Migrate memset optimizationsMeador Inge2012-11-111-0/+21
| | | | | | | This patch migrates the memset optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167689
* instcombine: Migrate memmove optimizationsMeador Inge2012-11-111-0/+21
| | | | | | | This patch migrates the memmove optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167687
* instcombine: Migrate memcpy optimizationsMeador Inge2012-11-111-0/+21
| | | | | | | This patch migrates the memcpy optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167686
* instcombine: Migrate memcmp optimizationsMeador Inge2012-11-111-2/+53
| | | | | | | This patch migrates the memcmp optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167683
* instcombine: Migrate strstr optimizationsMeador Inge2012-11-111-0/+80
| | | | | | | This patch migrates the strstr optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167682
* Add method for replacing instructions to LibCallSimplifierMeador Inge2012-11-111-4/+15
| | | | | | | | | | | | | | | In some cases the library call simplifier may need to replace instructions other than the library call being simplified. In those cases it may be necessary for clients of the simplifier to override how the replacements are actually done. As such, a new overrideable method for replacing instructions was added to LibCallSimplifier. A new subclass of LibCallSimplifier is also defined which overrides the instruction replacement method. This is because the instruction combiner defines its own replacement method which updates the worklist when instructions are replaced. llvm-svn: 167681
OpenPOWER on IntegriCloud