summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the simplify-libcalls pass (finally)Meador Inge2013-06-201-247/+0
| | | | | | | | | | | This commit completely removes what is left of the simplify-libcalls pass. All of the functionality has now been migrated to the instcombine and functionattrs passes. The following C API functions are now NOPs: 1. LLVMAddSimplifyLibCallsPass 2. LLVMPassManagerBuilderSetDisableSimplifyLibCalls llvm-svn: 184459
* simplify-libcalls: Removed unused variableMeador Inge2013-03-211-2/+0
| | | | | | | The 'Modified' variable should have been removed from SimplifyLibCalls in r177619, but was missed. This commit removes it. llvm-svn: 177622
* Move library call prototype attribute inference to functionattrsMeador Inge2013-03-211-701/+0
| | | | | | | | | | | | The simplify-libcalls pass implemented a doInitialization hook to infer function prototype attributes for well-known functions. Given that the simplify-libcalls pass is going away *and* that the functionattrs pass is already in place to deduce function attributes, I am moving this logic to the functionattrs pass. This approach was discussed during patch review: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157465.html. llvm-svn: 177619
* Implement the NoBuiltin attribute.Bill Wendling2013-02-221-1/+1
| | | | | | | | The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should not treat the callee function as a built-in function. I.e., it shouldn't try to replace that function with different code. llvm-svn: 175835
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-4/+4
| | | | | | | | | | | | | | | | | | | | | 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
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-7/+7
| | | | | | | | | | | | | | | | | 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
* Move library call simplification statistic to instcombineMeador Inge2012-11-301-2/+0
| | | | | | | | | The simplify-libcalls pass maintained a statistic to count the number of library calls that have been simplified. Now that library call simplification is being carried out in instcombine the statistic should be moved to there. llvm-svn: 168975
* instcombine: Migrate puts optimizationsMeador Inge2012-11-291-39/+0
| | | | | | | | | | | | 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-27/+0
| | | | | | | 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-38/+1
| | | | | | | 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-93/+1
| | | | | | | This patch migrates the fprintf optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168891
* instcombine: Migrate sprintf optimizationsMeador Inge2012-11-271-98/+0
| | | | | | | This patch migrates the sprintf optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168677
* instcombine: Migrate printf optimizationsMeador Inge2012-11-261-89/+1
| | | | | | | 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-26/+0
| | | | | | | 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-20/+0
| | | | | | | 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-21/+1
| | | | | | | 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-25/+1
| | | | | | | 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-41/+1
| | | | | | | This patch migrates the ffs* optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168571
* instcombine: Migrate math library call simplificationsMeador Inge2012-11-131-248/+1
| | | | | | | | | | | | | | | | | 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
* Delete a stale comment. No functional change.Meador Inge2012-11-121-4/+0
| | | | llvm-svn: 167698
* instcombine: Migrate memset optimizationsMeador Inge2012-11-111-27/+0
| | | | | | | 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-24/+1
| | | | | | | 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-24/+1
| | | | | | | 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-50/+1
| | | | | | | 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-88/+3
| | | | | | | This patch migrates the strstr optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167682
* instcombine: Migrate strcspn optimizationsMeador Inge2012-11-101-37/+1
| | | | | | | This patch migrates the strcspn optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167675
* instcombine: Migrate strspn optimizationsMeador Inge2012-11-081-34/+1
| | | | | | | This patch migrates the strspn optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167568
* Revert the series of commits starting with r166578 which introduced theChandler Carruth2012-11-011-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getIntPtrType support for multiple address spaces via a pointer type, and also introduced a crasher bug in the constant folder reported in PR14233. These commits also contained several problems that should really be addressed before they are re-committed. I have avoided reverting various cleanups to the DataLayout APIs that are reasonable to have moving forward in order to reduce the amount of churn, and minimize the number of commits that were reverted. I've also manually updated merge conflicts and manually arranged for the getIntPtrType function to stay in DataLayout and to be defined in a plausible way after this revert. Thanks to Duncan for working through this exact strategy with me, and Nick Lewycky for tracking down the really annoying crasher this triggered. (Test case to follow in its own commit.) After discussing with Duncan extensively, and based on a note from Micah, I'm going to continue to back out some more of the more problematic patches in this series in order to ensure we go into the LLVM 3.2 branch with a reasonable story here. I'll send a note to llvmdev explaining what's going on and why. Summary of reverted revisions: r166634: Fix a compiler warning with an unused variable. r166607: Add some cleanup to the DataLayout changes requested by Chandler. r166596: Revert "Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this! r166591: Delete a directory that wasn't supposed to be checked in yet. r166578: Add in support for getIntPtrType to get the pointer type based on the address space. llvm-svn: 167221
* instcombine: Migrate strto* optimizationsMeador Inge2012-10-311-31/+1
| | | | | | | This patch migrates the strto* optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167119
* instcombine: Migrate strpbrk optimizationsMeador Inge2012-10-311-40/+0
| | | | | | | This patch migrates the strpbrk optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167105
* instcombine: Migrate strlen optimizationsMeador Inge2012-10-311-44/+1
| | | | | | | This patch migrates the strlen optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167103
* instcombine: Migrate strncpy optimizationsMeador Inge2012-10-311-52/+0
| | | | | | | This patch migrates the strncpy optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 167102
* instcombine: Migrate stpcpy optimizationsMeador Inge2012-10-311-53/+2
| | | | | | | | This patch migrates the stpcpy optimizations from the simplify-libcalls pass into the instcombine library call simplifier. Note that the __stpcpy_chk simplifications were migrated in a previous commit. llvm-svn: 167083
* Add in support for getIntPtrType to get the pointer type based on the ↵Micah Villmow2012-10-241-9/+17
| | | | | | | | | address space. This checkin also adds in some tests that utilize these paths and updates some of the clients. llvm-svn: 166578
* SimplifyLibcalls: The return value of ffsll is always i32, even when the ↵Benjamin Kramer2012-10-191-2/+2
| | | | | | | | input is zero. Fixes PR13028. llvm-svn: 166313
* instcombine: Migrate strcpy optimizationsMeador Inge2012-10-181-46/+1
| | | | | | | | | | | | This patch migrates the strcpy optimizations from the simplify-libcalls pass into the instcombine library call simplifier. Note also that StrCpyChkOpt has been updated with a few simplifications that were being done in the simplify-libcalls version of StrCpyOpt, but not in the migrated implementation of StrCpyOpt. There is no reason to overload StrCpyOpt with fortified and regular simplifications in the new model since there is already a dedicated simplifier for __strcpy_chk. llvm-svn: 166198
* Use the Attributes::get method which takes an AttrVal value directly to ↵Bill Wendling2012-10-161-3/+2
| | | | | | simplify the code a bit. No functionality change. llvm-svn: 166009
* Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling2012-10-151-1/+1
| | | | | | own class named AttrBuilder. No functionality change. llvm-svn: 165960
* Attributes RewriteBill Wendling2012-10-151-1/+1
| | | | | | | | | | Convert the internal representation of the Attributes class into a pointer to an opaque object that's uniqued by and stored in the LLVMContext object. The Attributes class then becomes a thin wrapper around this opaque object. Eventually, the internal representation will be expanded to include attributes that represent code generation options, etc. llvm-svn: 165917
* instcombine: Migrate strcmp and strncmp optimizationsMeador Inge2012-10-151-105/+0
| | | | | | | This patch migrates the strcmp and strncmp optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 165915
* instcombine: Migrate strchr and strrchr optimizationsMeador Inge2012-10-131-91/+0
| | | | | | | This patch migrates the strchr and strrchr optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 165875
* instcombine: Migrate strcat and strncat optimizationsMeador Inge2012-10-131-101/+1
| | | | | | | This patch migrates the strcat and strncat optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 165874
* Remove the final bits of Attributes being declared in the AttributeBill Wendling2012-10-101-1/+3
| | | | | | | namespace. Use the attribute's enum value instead. No functionality change intended. llvm-svn: 165610
* Move TargetData to DataLayout.Micah Villmow2012-10-081-18/+18
| | | | llvm-svn: 165402
* SimplifyLibCalls: Give all safely-shrinkable libcalls the same treatment.Benjamin Kramer2012-08-221-5/+5
| | | | llvm-svn: 162383
* Add a few float shrinking optimizations to SimplifyLibCalls. UnsafeChad Rosier2012-08-221-36/+99
| | | | | | | optimizations are guarded by the -enable-double-float-shrink LLVM option. Last bit of PR13574. Patch by Weiming Zhao <weimingz@codeaurora.org>. llvm-svn: 162368
* Add a new helper function, AddOpt(F1, F1, Opt), as part of PR13574. NoChad Rosier2012-08-221-14/+15
| | | | | | functional change intended. Patch by Weiming Zhao <weimingz@codeaurora.org>. llvm-svn: 162363
* SimplifyLibcalls: Add fabs and trunc to the list of libcalls that are safe ↵Benjamin Kramer2012-08-181-0/+4
| | | | | | to shrink from double to float. llvm-svn: 162173
* do null checks for a few more Emit*() functions.Nuno Lopes2012-07-261-17/+15
| | | | | | Thanks Eli for noticing. llvm-svn: 160787
* make all Emit*() functions consult the TargetLibraryInfo information before ↵Nuno Lopes2012-07-251-40/+50
| | | | | | | | | creating a call to a library function. Update all clients to pass the TLI information around. Previous draft reviewed by Eli. llvm-svn: 160733
OpenPOWER on IntegriCloud