summaryrefslogtreecommitdiff
path: root/test/Transforms/JumpThreading
Commit message (Collapse)AuthorAge
* TBAA: remove !tbaa from testing cases if not used.Manman Ren2013-04-30
| | | | | | | | This will make it easier to turn on struct-path aware TBAA since the metadata format will change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180796 91177308-0d34-0410-b5e6-96231b3b80d8
* Use references to attribute groups on the call/invoke instructions.Bill Wendling2013-02-22
| | | | | | | | Listing all of the attributes for the callee of a call/invoke instruction is way too much and makes the IR unreadable. Use references to attributes instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175877 91177308-0d34-0410-b5e6-96231b3b80d8
* Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ↵Dmitri Gribenko2013-01-01
| | | | | | | | | | | ModuleID This is done to avoid odd test failures, like the one fixed in r171243. My previous regex was not good enough to find these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171343 91177308-0d34-0410-b5e6-96231b3b80d8
* Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ↵Dmitri Gribenko2012-12-30
| | | | | | | | | ModuleID This is done to avoid odd test failures, like the one fixed in r171243. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171250 91177308-0d34-0410-b5e6-96231b3b80d8
* Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ↵Dmitri Gribenko2012-12-30
| | | | | | | | | ModuleID This is done to avoid odd test failures, like the one fixed in r171243. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171246 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new attribute, 'noduplicate'. If a function contains a noduplicate ↵James Molloy2012-12-20
| | | | | | | | | | call, the call cannot be duplicated - Jump threading, loop unrolling, loop unswitching, and loop rotation are inhibited if they would duplicate the call. Similarly inlining of the function is inhibited, if that would duplicate the call (in particular inlining is still allowed when there is only one callsite and the function has internal linkage). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170704 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test case for PR14233.Chandler Carruth2012-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167224 91177308-0d34-0410-b5e6-96231b3b80d8
* JumpThreading: when default destination is the destination of some cases in aManman Ren2012-09-05
| | | | | | | | | | switch, make sure we include the value for the cases when calculating edge value from switch to the default destination. rdar://12241132 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163270 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix assertion in jump threading (PR13405).Richard Osborne2012-07-20
| | | | | | | | | | GetBestDestForJumpOnUndef() assumes there is at least 1 successor, which isn't true if the block ends in an indirect branch with no successors. Fix this by bailing out earlier in this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160546 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
* formatting change: strip debug info from testJoel Jones2012-05-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156551 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem with incomplete equality testing of PHINodes in Joel Jones2012-05-10
| | | | | | | | | | | | | | | | | | | | | | Instruction::IsIdenticalToWhenDefined. This manifested itself when inlining two calls to the same function. The inlined function had a switch statement that returned one of a set of global variables. Without this modification, the two phi instructions that chose values from the branches of the switch instruction inlined from the callee were considered equivalent and jump-threading replaced a load for the first switch value with a phi selecting from the second switch, thereby producing incorrect code. This patch has been tested with "make check-all", "lnt runteste nt", and llvm self-hosted, and on the original program that had this problem, wireshark. <rdar://problem/11025519> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156548 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance jump threading to preserve TBAA information when PRE'ing loads,Chris Lattner2012-03-13
| | | | | | | | fixing rdar://11039258, an issue that came up when inspecting clang's bootstrapped codegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152635 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
* Upgrade syntax of tests using volatile instructions to use 'load volatile' ↵Chris Lattner2011-11-27
| | | | | | instead of 'volatile load', which is archaic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145171 91177308-0d34-0410-b5e6-96231b3b80d8
* Move "atomic" and "volatile" designations on instructions after the opcodeEli Friedman2011-08-12
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137527 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
* Fix an infinite alternation in JumpThreading where two transforms would ↵Owen Anderson2011-04-14
| | | | | | | | | | | repeatedly undo each other. The solution is to perform more aggressive constant folding to make one of the edges just folded away rather than trying to thread it. Fixes <rdar://problem/9284786>. Discovered with CSmith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129538 91177308-0d34-0410-b5e6-96231b3b80d8
* PR9446: RecursivelyDeleteTriviallyDeadInstructions can delete the instructionEli Friedman2011-04-02
| | | | | | | | | | | | | after the given instruction; make sure to handle that case correctly. (It's difficult to trigger; the included testcase involves a dead block, but I don't think that's a requirement.) While I'm here, get rid of the unnecessary warning about SimplifyInstructionsInBlock, since it should work correctly as far as I know. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128782 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR9331. Simplified version of a patch by Jakub Staszak.Duncan Sands2011-03-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127243 91177308-0d34-0410-b5e6-96231b3b80d8
* prevent jump threading from merging blocks when their address isChris Lattner2011-02-18
| | | | | | | | | | | | | | | | | | | taken (and used!). This prevents merging the blocks (invalidating the block addresses) in a case like this: #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) void foo() { printf("%p\n", _THIS_IP_); printf("%p\n", _THIS_IP_); printf("%p\n", _THIS_IP_); } which fixes PR4151. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125829 91177308-0d34-0410-b5e6-96231b3b80d8
* Tolerate degenerate phi nodes that can occur in the middle of optimizationNick Lewycky2011-02-10
| | | | | | | passes. Fixes PR9112. Patch by Jakub Staszak! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125319 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r124518 with fix. Watch out for invalidated iterator.Evan Cheng2011-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124526 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r124518. It broke Linux self-host.Evan Cheng2011-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124522 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r124462 with fixes. Tail recursion elim will now dup ret into ↵Evan Cheng2011-01-29
| | | | | | unconditional predecessor to enable TCE on demand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124518 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r124462. There are a few big regressions that I need to fix first.Evan Cheng2011-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124478 91177308-0d34-0410-b5e6-96231b3b80d8
* - Stop simplifycfg from duplicating "ret" instructions into unconditionalEvan Cheng2011-01-28
| | | | | | | | | branches. PR8575, rdar://5134905, rdar://8911460. - Allow codegen tail duplication to dup small return blocks after register allocation is done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124462 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach jump threading to "look through" a select when the branch direction of ↵Frits van Bommel2010-12-15
| | | | | | | | | a terminator depends on it. When it sees a promising select it now tries to figure out whether the condition of the select is known in any of the predecessors and if so it maps the operands appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121859 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement jump threading of 'indirectbr' by keeping track of whether we're ↵Frits van Bommel2010-12-06
| | | | | | looking for ConstantInt*s or BlockAddress*s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121066 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR8247: JumpThreading can cause a block to become unreachable while ↵Owen Anderson2010-09-29
| | | | | | | | | | | still having predecessor, if it is part of a self-loop. Because of this, we cannot use the Simplify* APIs, as they can assert-fail on unreachable code. Since it's not easy to determine if a given threading will cause a block to become unreachable, simply defer simplifying simplification to later InstCombine and/or DCE passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115082 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead option from tests.Owen Anderson2010-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113855 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge 2010-08-31-InfiniteRecursion.ll into crash.ll.Owen Anderson2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112635 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for the duplicated-conditional situation illutrated by PR5652.Owen Anderson2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112621 91177308-0d34-0410-b5e6-96231b3b80d8
* Manually reduce this testcase.Owen Anderson2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112615 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a micro-test for the transforms I added to JumpThreading.Owen Anderson2010-08-31
| | | | | | | | | | | | | I have not been able to find a way to test each in isolation, for a few reasons: 1) The ability to look-through non-i1 BinaryOperator's requires the ability to look through non-constant ICmps in order for it to ever trigger. 2) The ability to do LVI-powered PHI value determination only matters in cases that ProcessBranchOnPHI can't handle. Since it already handles all the cases without other instructions in the def-use chain between the PHI and the branch, it requires the ability to look through ICmps and/or BinaryOperators as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112611 91177308-0d34-0410-b5e6-96231b3b80d8
* More Chris-inspired JumpThreading fixes: use ConstantExpr to correctly ↵Owen Anderson2010-08-31
| | | | | | | | | | constant-fold undef, and be more careful with its return value. This actually exposed an infinite recursion bug in ComputeValueKnownInPredecessors which theoretically already existed (in JumpThreading's handling of and/or of i1's), but never manifested before. This patch adds a tracking set to prevent this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112589 91177308-0d34-0410-b5e6-96231b3b80d8
* Use LVI to eliminate conditional branches where we've tested a related ↵Owen Anderson2010-08-27
| | | | | | | | | condition previously. Update tests for this change. This fixes PR5652. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112270 91177308-0d34-0410-b5e6-96231b3b80d8
* Make JumpThreading smart enough to properly thread StrSwitch when it's ↵Owen Anderson2010-08-26
| | | | | | compiled with clang++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112198 91177308-0d34-0410-b5e6-96231b3b80d8
* In the default address space, any GEP off of null results in a trap value if ↵Owen Anderson2010-08-25
| | | | | | | | | | you try to load it. Thus, any load in the default address space that completes implies that the base value that it GEP'd from was not null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112015 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR7755: knowing something about an inval for a predChris Lattner2010-08-18
| | | | | | | | | | from the LHS should disable reconsidering that pred on the RHS. However, knowing something about the pred on the RHS shouldn't disable subsequent additions on the RHS from happening. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111349 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a test with malformed IR. Not sure why this didn't fail before.Owen Anderson2010-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109422 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR7647, handling the case when 'To' ends up being Chris Lattner2010-07-15
| | | | | | | | | | | mutated by recursive simplification. This also enhances ReplaceAndSimplifyAllUses to actually do a real RAUW at the end of it, which updates any value handles pointing to "From" to start pointing to "To". This seems useful for debug info and random other VH users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108415 91177308-0d34-0410-b5e6-96231b3b80d8
* if jump threading is able to infer interesting values on bothChris Lattner2010-07-12
| | | | | | | | | the LHS and RHS of an and/or instruction, don't multiply add known predecessor values. This fixes the crash on testcase from PR7498 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108114 91177308-0d34-0410-b5e6-96231b3b80d8
* jump threading can't split a critical edge from an indirectbr. ThisChris Lattner2010-06-14
| | | | | | | fixes PR7356. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105950 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6743, a case where we'd delete an instruction before using itChris Lattner2010-04-10
| | | | | | | in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100937 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6305 by handling BlockAddress in a helper functionChris Lattner2010-02-15
| | | | | | | called by jump threading. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96263 91177308-0d34-0410-b5e6-96231b3b80d8
* Make jump threading honor x|undef -> true and x&undef -> false,Chris Lattner2010-02-11
| | | | | | | instead of considering x|undef -> x, which may not be true. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95850 91177308-0d34-0410-b5e6-96231b3b80d8
* third bug from PR6119: the xor dupe extension allowsChris Lattner2010-01-23
| | | | | | | | | for arbitrary terminators in predecessors, don't assume it is a conditional or uncond branch. The testcase shows an example where they can happen with switches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94323 91177308-0d34-0410-b5e6-96231b3b80d8
* add an early out to ProcessBranchOnXOR to speed it up,Chris Lattner2010-01-23
| | | | | | | | | handle the case when we can infer an input to the xor from all inputs that agree, instead of going into an infinite loop. Another part of PR6199 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94321 91177308-0d34-0410-b5e6-96231b3b80d8