summaryrefslogtreecommitdiff
path: root/test/Transforms/ConstProp
Commit message (Collapse)AuthorAge
* Catch more CHECK that can be converted to CHECK-LABEL in Transforms for ↵Stephen Lin2013-07-14
| | | | | | | | | | | | | | | | | | | | | | | easier debugging. No functionality change. This conversion was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)define\([^@]*\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3define\4@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186269 91177308-0d34-0410-b5e6-96231b3b80d8
* Update Transforms tests to use CHECK-LABEL for easier debugging. No ↵Stephen Lin2013-07-14
| | | | | | | | | | | | | | | | | | | | | | | functionality change. This update was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186268 91177308-0d34-0410-b5e6-96231b3b80d8
* Add newlines at end of test files, no functionality changeStephen Lin2013-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186263 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove this testcase until I can figure out how to properly conditionalize it.Owen Anderson2013-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174591 91177308-0d34-0410-b5e6-96231b3b80d8
* Another attempt at getting the XFAIL line right for this test.Owen Anderson2013-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174588 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix CMake detection of various cmath functions, and XFAIL the test on ↵Owen Anderson2013-02-07
| | | | | | platforms that are known to be missing them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174564 91177308-0d34-0410-b5e6-96231b3b80d8
* Signficantly generalize our ability to constant fold floating point ↵Owen Anderson2013-02-06
| | | | | | intrinsics, including ones on half types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174555 91177308-0d34-0410-b5e6-96231b3b80d8
* ConstantFolding: Add a missing folding that leads to a miscompile.Benjamin Kramer2013-01-24
| | | | | | | | | | We use constant folding to see if an intrinsic evaluates to the same value as a constant that we know. If we don't take the undefinedness into account we get a value that doesn't match the actual implementation, and miscompiled code. This was uncovered by Chandler's simplifycfg changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173356 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/ConstantFolding.cpp: Make ReadDataFromGlobal() and ↵NAKAMURA Takumi2012-11-08
| | | | | | FoldReinterpretLoadFromConstPtr() Big-endian-aware. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167595 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the remaining TCL-style quotes found in the testsuite. This isChandler Carruth2012-07-02
| | | | | | | | | | | | | | | | | 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. =/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159547 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth2012-07-02
| | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159525 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-16
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150664 91177308-0d34-0410-b5e6-96231b3b80d8
* Add r149110 back with a fix for when the vector and the int have the sameRafael Espindola2012-01-27
| | | | | | width. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149151 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r149110 and add a testcase that was crashing since that revision.Rafael Espindola2012-01-27
| | | | | | | Unfortunately I also had to disable constant-pool-sharing.ll the code it tests has been updated to use the IL logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149148 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance constant folding to be able to constant fold bitcast of Chris Lattner2012-01-27
| | | | | | | ConstantVector's to integer type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149110 91177308-0d34-0410-b5e6-96231b3b80d8
* Manually upgrade the test suite to specify the flag to cttz and ctlz.Chandler Carruth2011-12-12
| | | | | | | | | | | | | | | | | | | | | | | I followed three heuristics for deciding whether to set 'true' or 'false': - Everything target independent got 'true' as that is the expected common output of the GCC builtins. - If the target arch only has one way of implementing this operation, set the flag in the way that exercises the most of codegen. For most architectures this is also the likely path from a GCC builtin, with 'true' being set. It will (eventually) require lowering away that difference, and then lowering to the architecture's operation. - Otherwise, set the flag differently dependending on which target operation should be tested. Let me know if anyone has any issue with this pattern or would like specific tests of another form. This should allow the x86 codegen to just iteratively improve as I teach the backend how to differentiate between the two forms, and everything else should remain exactly the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146370 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for constant folding the pow intrinsic.Chad Rosier2011-12-03
| | | | | | rdar://10514247 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145730 91177308-0d34-0410-b5e6-96231b3b80d8
* Prevent library calls from being folded if -fno-builtin has been specified.Chad Rosier2011-12-01
| | | | | | rdar://10500969 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145639 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly byte-swap APInts with bit-widths greater than 64.Richard Smith2011-11-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145111 91177308-0d34-0410-b5e6-96231b3b80d8
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
* implement PR9315, constant folding exp2 in terms of pow (since hosts withoutChris Lattner2011-05-22
| | | | | | | C99 runtimes don't have exp2). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131872 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-15
| | | | | | | | Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant folding support for calls to umul.with.overflow(), basically ↵Frits van Bommel2011-03-27
| | | | | | identical to the smul.with.overflow() code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128379 91177308-0d34-0410-b5e6-96231b3b80d8
* When loading from a constant, fold inttoptr if the integer type and the ↵Anders Carlsson2011-02-06
| | | | | | resulting pointer type both have the same size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124987 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the select optimization recently added to instcombine to constant folding.Nick Lewycky2011-01-29
| | | | | | | | This is the one where one of the branches of the select is another select on the same condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124547 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a constant folding of casts from zero to zero. Fixes PR9011!Nick Lewycky2011-01-21
| | | | | | | | | While here, I'd like to complain about how vector is not an aggregate type according to llvm::Type::isAggregateType(), but they're listed under aggregate types in the LangRef and zero vectors are stored as ConstantAggregateZero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123956 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach constant folding to perform conversions from constant floatingChandler Carruth2011-01-11
| | | | | | | | point values to their integer representation through the SSE intrinsic calls. This is the last part of a README.txt entry for which I have real world examples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123206 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck-ize a test, and move a no-longer calling test case to anotherChandler Carruth2011-01-11
| | | | | | file and make it actually test something... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123205 91177308-0d34-0410-b5e6-96231b3b80d8
* test/Transforms/ConstProp/logicaltest.ll: FileCheck-ize.NAKAMURA Takumi2010-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122620 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ConstantFoldInstruction() how to fold insertvalue and extractvalue.Frits van Bommel2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120316 91177308-0d34-0410-b5e6-96231b3b80d8
* rename test.Chris Lattner2010-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119033 91177308-0d34-0410-b5e6-96231b3b80d8
* filecheckize, remove an old and useless testChris Lattner2010-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119032 91177308-0d34-0410-b5e6-96231b3b80d8
* this test is pretty pointless and "propogation" isn't a word (or so Misha ↵Chris Lattner2010-11-14
| | | | | | claims). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119031 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bug I introduced, no idea how this didn't repro right.Chris Lattner2010-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116462 91177308-0d34-0410-b5e6-96231b3b80d8
* hack to unbreak buildbotsChris Lattner2010-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116461 91177308-0d34-0410-b5e6-96231b3b80d8
* add uadd_ov/usub_ov to apint, consolidate constant foldingChris Lattner2010-10-14
| | | | | | | | | | logic to use the new APInt methods. Among other things this implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold which comes from "clang -ftrapv", originally brought to my attention from PR8221. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116457 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some noise from tests.Chris Lattner2010-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112889 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6197 - infinite recursion in ipsccp due to block addressesChris Lattner2010-02-01
| | | | | | | evaluateICmpRelation wasn't handling blockaddress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94993 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crasher trying to fold each element in a comparison between two vectorsNick Lewycky2010-01-21
| | | | | | | | | | | if one of the vectors didn't have elements (such as undef). Fixes PR 6096. Fix an issue in the constant folder where fcmp (<2 x %ty>, <2 x %ty>) would have <2 x i1> type if constant folding was successful and i1 type if it wasn't. This exposed a related issue in the bitcode reader. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94069 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR5978 by peeling the loop so that we avoid shifting theChris Lattner2010-01-08
| | | | | | | | result int by 8 for the first byte. While normally harmless, if the result is smaller than a byte, this shift is invalid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93018 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR5551 by not ignoring the top level constantexpr whenChris Lattner2009-12-04
| | | | | | | folding a load from constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90545 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a few tests to FileCheck for PR5307.Edward O'Callaghan2009-10-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85171 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR5287, a serious regression from my previous patches. Thanks toChris Lattner2009-10-24
| | | | | | | Duncan for the nice tiny testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84992 91177308-0d34-0410-b5e6-96231b3b80d8
* teach libanalysis to simplify vector loads with bitcast sources. ThisChris Lattner2009-10-23
| | | | | | | | | | | | | | | | | | | | | | | | implements something out of Target/README.txt producing: _foo: ## @foo movl 4(%esp), %eax movapd LCPI1_0, %xmm0 movapd %xmm0, (%eax) ret $4 instead of: _foo: ## @foo movl 4(%esp), %eax movapd _b, %xmm0 mulpd LCPI1_0, %xmm0 addpd _a, %xmm0 movapd %xmm0, (%eax) ret $4 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84942 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance FoldReinterpretLoadFromConstPtr to handle loads of up to 32 Chris Lattner2009-10-23
| | | | | | | bytes (i256). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84941 91177308-0d34-0410-b5e6-96231b3b80d8
* teach libanalysis to fold int and fp loads from almost arbitraryChris Lattner2009-10-23
| | | | | | | | | | | | | | | | | | | | | non-type-safe constant initializers. This sort of thing happens quite a bit for 4-byte loads out of string constants, unions, bitfields, and an interesting endianness check from sqlite, which is something like this: const int sqlite3one = 1; # define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0) # define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1) # define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE) all of these macros now constant fold away. This implements PR3152 and is based on a patch started by Eli, but heavily modified and extended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84936 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach vm core to more aggressively fold 'trunc' constantexprs,Chris Lattner2009-10-17
| | | | | | | | | | | allowing it to simplify the crazy constantexprs in the testcases down to something sensible. This allows -std-compile-opts to completely "devirtualize" the pointers to member functions in the testcase from PR5176. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84368 91177308-0d34-0410-b5e6-96231b3b80d8
* remove # uses from FileCheck lines.Chris Lattner2009-10-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84367 91177308-0d34-0410-b5e6-96231b3b80d8
* rename testChris Lattner2009-10-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84364 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend ConstantFolding to understand signed overflow variantsEvan Phoenix2009-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83338 91177308-0d34-0410-b5e6-96231b3b80d8