summaryrefslogtreecommitdiff
path: root/test/Transforms/SCCP
Commit message (Collapse)AuthorAge
* 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
* Reapply r155682, making constant folding more consistent, with a fix to workDan Gohman2012-04-27
| | | | | | | properly with how the code handles all-undef PHI nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155721 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r155682, "Use ConstantExpr::getExtractElement when constant-folding ↵NAKAMURA Takumi2012-04-27
| | | | | | | | vectors" It broke stage2 build. stage1/clang sometimes crashed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155699 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ConstantExpr::getExtractElement when constant-folding vectorsDan Gohman2012-04-27
| | | | | | | | | | | | | | | | | | | | | | instead of getAggregateElement. This has the advantage of being more consistent and allowing higher-level constant folding to procede even if an inner extract element cannot be folded. Make ConstantFoldInstruction call ConstantFoldConstantExpression on the instruction's operands, making it more consistent with ConstantFoldConstantExpression itself. This makes sure that ConstantExprs get TargetData-aware folding before being handed off as operands for further folding. This causes more expressions to be folded, but due to a known shortcoming in constant folding, this currently has the side effect of stripping a few more nuw and inbounds flags in the non-targetdata side of constant-fold-gep.ll. This is mostly harmless. This fixes rdar://11324230. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155682 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
* Remove all references to the old EH.Bill Wendling2012-01-31
| | | | | | | There was always the current EH. -- Ministry of Truth git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149335 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
* Get rid of an optimization in SCCP which appears to have many issues. ↵Eli Friedman2011-11-11
| | | | | | | | | | | | Specifically, it doesn't handle many cases involving undef correctly, and it is missing other checks which lead to it trying to re-mark a value marked as a constant with a different value. It also appears to trigger very rarely. Fixes PR11357. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144352 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure IPSCCP never marks a tracked call as overdefined in ↵Eli Friedman2011-09-20
| | | | | | | | | | SCCPSolver::ResolvedUndefsIn. If we do, we can end up in a situation where a function is resolved to return a constant, but the caller is marked overdefined, which confuses the code later. <rdar://problem/9956541> (again). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140210 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing newline.Eli Friedman2011-09-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138964 91177308-0d34-0410-b5e6-96231b3b80d8
* Add tests for the transformations SCCP can do on atomic loads and stores ↵Eli Friedman2011-08-31
| | | | | | (which are safe without any modifications). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138902 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the tests to the new EH scheme.Bill Wendling2011-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138891 91177308-0d34-0410-b5e6-96231b3b80d8
* Silly mistake from r137777; restore significant isStructTy() checks. While ↵Eli Friedman2011-08-17
| | | | | | | | | | | | here, be a bit more defensive with unknown instructions. Fixes PR10687. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137836 91177308-0d34-0410-b5e6-96231b3b80d8
* A bunch of misc fixes to SCCPSolver::ResolvedUndefsIn, including a fix to stopEli Friedman2011-08-16
| | | | | | | | | | | making random bad assumptions about instructions which are not explicitly listed. Includes fix for rdar://9956541, a version of "undef ^ undef should return 0 because it's easier than arguing with users". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137777 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor bug in SCCP found by inspection. (I don't think it's possible to hit ↵Eli Friedman2011-08-16
| | | | | | this with a normal pass pipeline, but fixing for completeness.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137755 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
* remove asmparser support for the old getresult instruction, which has been ↵Chris Lattner2011-06-17
| | | | | | subsumed by extractvalue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133247 91177308-0d34-0410-b5e6-96231b3b80d8
* manually upgrade a bunch of tests to modern syntax, and remove some thatChris Lattner2011-06-17
| | | | | | | | are either unreduced or only test old syntax. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133228 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
* fix PR7876: If ipsccp decides that a function's address is takenChris Lattner2010-08-12
| | | | | | | before it rewrites the code, we need to use that in the post-rewrite pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110962 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6940: sitofp(undef) folds to 0.0, not undef.Chris Lattner2010-04-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102358 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a SCCP miscompilation that could happen when aChris Lattner2010-04-09
| | | | | | | | | | forced constant is changed to a constant, we would end up adding the instruction to the wrong worklist, preventing it from being properly revisited. This fixes rdar://7832370 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100837 91177308-0d34-0410-b5e6-96231b3b80d8
* Print empty structs as {} rather than { }.Dan Gohman2010-04-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100787 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6414, a nondeterminism issue in IPSCCP which was becauseChris Lattner2010-02-27
| | | | | | | of a subtle interation in a loop operating in densemap order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97288 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a crash in SCCP handling extractvalue of an array, pointed out andChris Lattner2009-11-10
| | | | | | | tracked down by Stephan Reiter! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86726 91177308-0d34-0410-b5e6-96231b3b80d8
* reimplement multiple return value handling in IPSCCP, making it Chris Lattner2009-11-03
| | | | | | | | more aggressive an correct. This survives building llvm in 64-bit mode with optimizations and the built llvm passes make check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85973 91177308-0d34-0410-b5e6-96231b3b80d8
* fix testChris Lattner2009-11-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85946 91177308-0d34-0410-b5e6-96231b3b80d8
* merge a test into ipsccp-basic. running llvm-ld to get one pass is... bad.Chris Lattner2009-11-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85945 91177308-0d34-0410-b5e6-96231b3b80d8
* fix an IPSCCP bug I introduced when I changed IPSCCP to start working on Chris Lattner2009-11-03
| | | | | | | | | | | functions that don't have local linkage. Basically, we need to be more careful about propagating argument information to functions whose results we aren't tracking. This fixes a miscompilation of LLVMCConfigurationEmitter.cpp when built with an llvm-gcc that has ipsccp enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85923 91177308-0d34-0410-b5e6-96231b3b80d8
* testcase for r85903Chris Lattner2009-11-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85906 91177308-0d34-0410-b5e6-96231b3b80d8
* merge 2008-03-10-sret.ll into ipsccp-basic.ll, and upgrade its syntax.Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85811 91177308-0d34-0410-b5e6-96231b3b80d8
* disable IPSCCP support for multiple return values, it is buggy, so justChris Lattner2009-11-02
| | | | | | | disable it until I can fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85810 91177308-0d34-0410-b5e6-96231b3b80d8
* improve IPSCCP to be able to propagate the result of "!mayBeOverridden"Chris Lattner2009-11-02
| | | | | | | | | | function to calls of that function, regardless of whether it has local linkage or has its address taken. Not escaping should only affect whether we make an aggressive assumption about the arguments to a function, not whether we can track the result of it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85795 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the libanalysis 'ConstantFoldLoadFromConstPtr' functionChris Lattner2009-11-02
| | | | | | | | instead of reinventing SCCP-specific logic. This gives us new powers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85789 91177308-0d34-0410-b5e6-96231b3b80d8
* add a real testcase for PR4313Chris Lattner2009-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84676 91177308-0d34-0410-b5e6-96231b3b80d8
* add a test similar to that needed for PR4313, but that doesn'tChris Lattner2009-10-20
| | | | | | | fail without the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84675 91177308-0d34-0410-b5e6-96231b3b80d8
* the date on this testcase is wrong, it is unreduced, and it passes without ↵Chris Lattner2009-10-20
| | | | | | the fix for PR4313. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84674 91177308-0d34-0410-b5e6-96231b3b80d8
* merge and filecheckizeChris Lattner2009-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84672 91177308-0d34-0410-b5e6-96231b3b80d8
* merge two tests and convert to filecheck.Chris Lattner2009-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84671 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4313: IPSCCP was not setting the lattice value for the invoke instructionTorok Edwin2009-10-20
| | | | | | | | | | | when the invoke had multiple return values: it set the lattice value only on the extractvalue. This caused the invoke's lattice value to remain the default (undefined), and later propagated to extractvalue's operand, which incorrectly introduces undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84637 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate more redundant llvm-as calls.Dan Gohman2009-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81540 91177308-0d34-0410-b5e6-96231b3b80d8
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-11
| | | | | | | | | input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81537 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bunch of spurious failures for people whose home directoryChris Lattner2009-09-11
| | | | | | | is sabre. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81528 91177308-0d34-0410-b5e6-96231b3b80d8
* Use "opt < %s" instead of "opt %s" so that opt doesn't print the testDan Gohman2009-09-08
| | | | | | | filename in the output, which interferes with the tests' grep lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81263 91177308-0d34-0410-b5e6-96231b3b80d8
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81257 91177308-0d34-0410-b5e6-96231b3b80d8
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-08
| | | | | | | of using llvm-as, now that opt supports this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81226 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-04
| | | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
* Use Operands.data() instead of &Operands[0] where Operands is a potentiallyNick Lewycky2009-05-28
| | | | | | | empty SmallVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72512 91177308-0d34-0410-b5e6-96231b3b80d8