summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyLibCalls
Commit message (Collapse)AuthorAgeFilesLines
* Fix the remaining TCL-style quotes found in the testsuite. This isChandler Carruth2012-07-029-9/+9
| | | | | | | | | | | | | | | | | another mechanical change accomplished though the power of terrible Perl scripts. I have manually switched some "s to 's to make escaping simpler. While I started this to fix tests that aren't run in all configurations, the massive number of tests is due to a really frustrating fragility of our testing infrastructure: things like 'grep -v', 'not grep', and 'expected failures' can mask broken tests all too easily. Essentially, I'm deeply disturbed that I can change the testsuite so radically without causing any change in results for most platforms. =/ llvm-svn: 159547
* Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth2012-07-029-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | This was done through the aid of a terrible Perl creation. I will not paste any of the horrors here. Suffice to say, it require multiple staged rounds of replacements, state carried between, and a few nested-construct-parsing hacks that I'm not proud of. It happens, by luck, to be able to deal with all the TCL-quoting patterns in evidence in the LLVM test suite. If anyone is maintaining large out-of-tree test trees, feel free to poke me and I'll send you the steps I used to convert things, as well as answer any painful questions etc. IRC works best for this type of thing I find. Once converted, switch the LLVM lit config to use ShTests the same as Clang. In addition to being able to delete large amounts of Python code from 'lit', this will also simplify the entire test suite and some of lit's architecture. Finally, the test suite runs 33% faster on Linux now. ;] For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s llvm-svn: 159525
* revert my previous commit (r159173), since as Eli pointed out, it's ↵Nuno Lopes2012-06-251-1/+1
| | | | | | perfectly ok to mark realloc as noalias llvm-svn: 159175
* do not set realloc() as NotAlias, since it can return the same pointer. This ↵Nuno Lopes2012-06-251-1/+1
| | | | | | whole thing should be upgraded to use the MemoryBuiltin interface anyway.. llvm-svn: 159173
* revert my previous patches that introduced an additional parameter to the ↵Nuno Lopes2012-05-222-4/+4
| | | | | | | | objectsize intrinsic. After a lot of discussion, we realized it's not the best option for run-time bounds checking llvm-svn: 157255
* FileCheck-ify, apropos of nothingJoel Jones2012-05-181-4/+4
| | | | llvm-svn: 157051
* Teach SimplifyLibCalls about stpcpy.David Majnemer2012-05-151-0/+43
| | | | llvm-svn: 156815
* change the objectsize intrinsic signature: add a 3rd parameter to denote the ↵Nuno Lopes2012-05-091-2/+2
| | | | | | | | maximum runtime performance penalty that the user is willing to accept. This commit only adds the parameter. Code taking advantage of it will follow. llvm-svn: 156473
* FileCheckify, un-XFAIL SimplifyLibCalls/floor testJoe Groff2012-04-181-10/+31
| | | | | | Fixes build on MSVC llvm-svn: 154970
* Move win32 SimplifyLibcall test under TransformsJoe Groff2012-04-181-0/+275
| | | | llvm-svn: 154967
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-162-3/+1
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* Turn cos(-x) into cos(x). Patch by Alexander Malyshev!Nick Lewycky2011-12-271-0/+14
| | | | llvm-svn: 147291
* Give string constants generated by IRBuilder private linkage.Benjamin Kramer2011-12-221-1/+1
| | | | | | Fixes PR11640. llvm-svn: 147144
* Only replace fwrite with fputc, if the return value is unused.Joerg Sonnenberger2011-12-121-0/+13
| | | | llvm-svn: 146411
* Add support for custom names for library functions in TargetLibraryInfo. ↵Eli Friedman2011-11-171-0/+30
| | | | | | | | | | Add a custom name for fwrite and fputs on x86-32 OSX. Make SimplifyLibCalls honor the custom names for fwrite and fputs. Fixes <rdar://problem/9815881>. llvm-svn: 144876
* SimplifyLibCalls: Use IRBuilder.CreateGlobalString when creating a string ↵Benjamin Kramer2011-10-291-2/+3
| | | | | | | | for printf->puts, which correctly sets the unnamed_addr bit on the resulting GlobalVariable. Fixes PR11264. llvm-svn: 143289
* "@string = constant i8 0" is a value i8* string of length zero. Analyze thatNick Lewycky2011-10-201-0/+6
| | | | | | correctly in GetStringLength, fixing PR11181! llvm-svn: 142558
* Fixed quoting on default data layout option.Lang Hames2011-10-171-1/+1
| | | | llvm-svn: 142286
* PR11061: Make simplifylibcalls fold strcmp("", x) correctly.Eli Friedman2011-10-052-44/+124
| | | | | | While I'm here, fix the related issue with strncmp, add some actual tests for strcmp and strncmp, and start using StringRef::compare for constant folding instead of using strcmp/strncmp so that the optimized IR isn't dependent on the host's implementation of strcmp. llvm-svn: 141227
* Stop emitting instructions with the name "tmp" they eat up memory and have ↵Benjamin Kramer2011-09-271-6/+6
| | | | | | | | to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. llvm-svn: 140634
* Move "atomic" and "volatile" designations on instructions after the opcodeEli Friedman2011-08-121-11/+11
| | | | | | | | | | of the instruction. Note that this change affects the existing non-atomic load and store instructions; the parser now accepts both forms, and the change is noted in the release notes. llvm-svn: 137527
* rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which isChris Lattner2011-06-181-11/+10
| | | | | | | | | for pre-2.9 bitcode files. We keep x86 unaligned loads, movnt, crc32, and the target indep prefetch change. As usual, updating the testsuite is a PITA. llvm-svn: 133337
* Preserve line number information while simplifying libcalls.Devang Patel2011-03-091-0/+24
| | | | llvm-svn: 127362
* Optimize fprintf -> iprintf if there are no floating point argumentsRichard Osborne2011-03-031-0/+21
| | | | | | and siprintf is available on the target. llvm-svn: 126940
* Optimize sprintf -> siprintf if there are no floating point argumentsRichard Osborne2011-03-031-0/+21
| | | | | | and siprintf is available on the target. llvm-svn: 126937
* Optimize printf -> iprintf if there are no floating point argumentsRichard Osborne2011-03-031-0/+29
| | | | | | | and iprintf is available on the target. Currently iprintf is only marked as being available on the XCore. llvm-svn: 126935
* Delete obsolete test.Dan Gohman2011-02-281-46/+0
| | | | llvm-svn: 126680
* SimplifyLibCalls: Add missing legalize check on various printf to puts andDaniel Dunbar2011-02-121-7/+20
| | | | | | putchar transforms, their return values are not compatible. llvm-svn: 125442
* tests: FileCheckizeDaniel Dunbar2011-02-121-3/+5
| | | | llvm-svn: 125441
* Revert r64460. strtol and friends cannot be marked readonly, even withDan Gohman2010-12-171-1/+1
| | | | | | | | | a null endptr argument, because they may write to errno. This fixes a seflhost miscompile observed on Linux targets when TBAA was enabled. llvm-svn: 122014
* Add a puts optimization that converts puts() to putchar('\n').Anders Carlsson2010-11-301-0/+15
| | | | llvm-svn: 120398
* Fix a typo.Anders Carlsson2010-11-301-1/+1
| | | | llvm-svn: 120394
* Rename this test to FPuts.ll since it actually tests fputs.Anders Carlsson2010-11-301-0/+0
| | | | llvm-svn: 120393
* Fix some broken CHECK lines.Benjamin Kramer2010-11-291-1/+1
| | | | llvm-svn: 120332
* test/Transforms/SimplifyLibCalls/floor.ll: Mark as XFAIL:win32 due to lack ↵NAKAMURA Takumi2010-10-281-0/+2
| | | | | | of nearbyintf on MSVC. [PR8466] llvm-svn: 117529
* Add constant folding for strspn and strcspn to SimplifyLibCalls.Benjamin Kramer2010-09-301-0/+41
| | | | llvm-svn: 115116
* Add strpbrk folding to SimplifyLibCalls.Benjamin Kramer2010-09-291-0/+25
| | | | llvm-svn: 115111
* Simplify the loop in StrChrOptimizer. FileCheckize test.Benjamin Kramer2010-09-291-14/+14
| | | | llvm-svn: 115095
* Teach SimplifyLibCalls how to optimize strrchr.Benjamin Kramer2010-09-291-0/+23
| | | | llvm-svn: 115091
* Make sure that simplify libcalls does not replace a call with one callingRafael Espindola2010-06-161-0/+16
| | | | | | convention with a new call with a different calling convention. llvm-svn: 106134
* simplify-libcalls: fold strncmp(x, y, 1) -> memcmp(x, y, 1)Benjamin Kramer2010-06-161-0/+7
| | | | | | | The memcmp will be optimized further and even the pathological case 'strstr(x, "x") == x' generates optimal code now. llvm-svn: 106097
* simplify-libcalls: fold strstr(a, b) == a -> strncmp(a, b, strlen(b)) == 0Benjamin Kramer2010-06-151-0/+12
| | | | llvm-svn: 106047
* The memcpy intrinsic only takes i8* for %src and %dst, so cast them to thatNick Lewycky2010-05-311-0/+20
| | | | | | first. Fixes PR7265. llvm-svn: 105206
* Properly promote operands when optimizing a single-character memcmp.Benjamin Kramer2010-05-251-1/+13
| | | | llvm-svn: 104648
* Reapply address space patch after fixing an issue in MemCopyOptimizer.Mon P Wang2010-04-041-1/+1
| | | | | | | Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) llvm-svn: 100304
* Revert r100191 since it breaks objc in clang Mon P Wang2010-04-021-1/+1
| | | | llvm-svn: 100199
* Reapply address space patch after fixing an issue in MemCopyOptimizer.Mon P Wang2010-04-021-1/+1
| | | | | | | Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) llvm-svn: 100191
* Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.Bob Wilson2010-03-301-1/+1
| | | | llvm-svn: 99948
* Added support for address spaces and added a isVolatile field to memcpy, ↵Mon P Wang2010-03-301-1/+1
| | | | | | | | | memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) A update of langref will occur in a subsequent checkin. llvm-svn: 99928
* Teach simplify libcall to transform __strcpy_chk to __memcpy_chk to enable ↵Evan Cheng2010-03-231-20/+27
| | | | | | optimizations down stream. llvm-svn: 99282
OpenPOWER on IntegriCloud