summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/JumpThreading/basic.ll
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Temporarily Revert "Add basic loop fusion pass.""Eric Christopher2019-04-171-0/+610
| | | | | | | | The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
* Temporarily Revert "Add basic loop fusion pass."Eric Christopher2019-04-171-610/+0
| | | | | | | | As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. llvm-svn: 358546
* [JumpThreading] Don't restrict cast-traversal to i1Chad Rosier2018-03-091-0/+28
| | | | | | | | | | | | | | | | | | | In r263618, JumpThreading learned to look trough simple cast instructions, but only if the source of those cast instructions was a phi/cmp i1 (in an effort to limit compile time effects). I think this condition is too restrictive. For switches with limited value range, InstCombine will readily introduce an extra trunc instruction to a smaller integer type (e.g. from i8 to i2), leaving us in the somewhat perverse situation that jump-threading would work before running instcombine, but not after. Since instcombine produces this pattern, I think we need to consider it canonical and support it in JumpThreading. In general, for limiting recursion, I think the existing restriction to phi and cmp nodes should be sufficient to avoid looking through unprofitable chains of instructions. Patch by Keno Fischer! Differential Revision: https://reviews.llvm.org/D42262 llvm-svn: 327150
* Fix some misc. -enable-var-scope violationsMatt Arsenault2017-11-131-18/+18
| | | | llvm-svn: 318006
* Revert r300657 due to crashes in stage2 of bootstraps:Chandler Carruth2017-04-191-89/+0
| | | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/2476/steps/build-stage2-LLVMgold.so/logs/stdio http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/15036/steps/build_llvmclang/logs/stdio I've updated the commit thread, reverting to get the bots back to green. Original commit summary: [JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor. llvm-svn: 300662
* [JumpThread] We want to fold (not thread) when all predecessor go to single ↵Xin Tong2017-04-191-0/+89
| | | | | | | | | | | | | | | | BB's successor. . Summary: In case all predecessor go to a single successor of current BB. We want to fold (not thread). Reviewers: efriedma, sanjoy Reviewed By: sanjoy Subscribers: dberlin, majnemer, llvm-commits Differential Revision: https://reviews.llvm.org/D30869 llvm-svn: 300657
* [JumpThreading] See through Cast InstructionsHaicheng Wu2016-03-161-0/+34
| | | | | | To capture more jump-thread opportunity. llvm-svn: 263618
* Revert "[JumpThreading] Simplify Instructions first in ↵Haicheng Wu2016-03-151-50/+0
| | | | | | | | ComputeValueKnownInPredecessors()" Not sure it handles undef properly. llvm-svn: 263605
* [JumpThreading] Simplify Instructions first in ComputeValueKnownInPredecessors()Haicheng Wu2016-02-261-0/+50
| | | | | | This change tries to find more opportunities to thread over basic blocks. llvm-svn: 261981
* [JumpThreading] make jump threading respect convergent annotation.Jingyue Wu2015-08-311-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: JumpThreading shouldn't duplicate a convergent call, because that would move a convergent call into a control-inequivalent location. For example, if (cond) { ... } else { ... } convergent_call(); if (cond) { ... } else { ... } should not be optimized to if (cond) { ... convergent_call(); ... } else { ... convergent_call(); ... } Test Plan: test/Transforms/JumpThreading/basic.ll Patch by Xuetian Weng. Reviewers: resistor, arsenm, jingyue Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12484 llvm-svn: 246415
* Update Transforms tests to use CHECK-LABEL for easier debugging. No ↵Stephen Lin2013-07-141-15/+15
| | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 186268
* Use references to attribute groups on the call/invoke instructions.Bill Wendling2013-02-221-2/+4
| | | | | | | 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. llvm-svn: 175877
* Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ↵Dmitri Gribenko2013-01-011-1/+1
| | | | | | | | | | 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. llvm-svn: 171343
* Add a new attribute, 'noduplicate'. If a function contains a noduplicate ↵James Molloy2012-12-201-0/+36
| | | | | | | | 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). llvm-svn: 170704
* Remove dead option from tests.Owen Anderson2010-09-141-1/+1
| | | | llvm-svn: 113855
* Add a test for the duplicated-conditional situation illutrated by PR5652.Owen Anderson2010-08-311-0/+24
| | | | llvm-svn: 112621
* Add a micro-test for the transforms I added to JumpThreading.Owen Anderson2010-08-311-0/+30
| | | | | | | | | | | | 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. llvm-svn: 112611
* Use LVI to eliminate conditional branches where we've tested a related ↵Owen Anderson2010-08-271-4/+10
| | | | | | | | condition previously. Update tests for this change. This fixes PR5652. llvm-svn: 112270
* 1) Use the new SimplifyInstructionsInBlock routine instead of the copyChris Lattner2010-01-121-6/+1
| | | | | | | | | | | | in JT. 2) When cloning blocks for PHI or xor conditions, use instsimplify to simplify the code as we go. This allows us to squish common cases early in JT which opens up opportunities for subsequent iterations, and allows it to completely simplify the testcase. llvm-svn: 93253
* Teach jump threading to duplicate small blocks when the branchChris Lattner2010-01-121-5/+18
| | | | | | | | | | | | | | | | | | | condition is a xor with a phi node. This eliminates nonsense like this from 176.gcc in several places: LBB166_84: testl %eax, %eax - setne %al - xorb %cl, %al - notb %al - testb $1, %al - je LBB166_85 + je LBB166_69 + jmp LBB166_85 This is rdar://7391699 llvm-svn: 93221
* typoGabor Greif2009-11-121-1/+1
| | | | llvm-svn: 86980
* use getPredicateOnEdge to fold comparisons through PHI nodes,Chris Lattner2009-11-121-0/+32
| | | | | | | which implements GCC PR18046. This also gets us 360 more jump threads on 176.gcc. llvm-svn: 86953
* should not commit when distracted.Chris Lattner2009-11-121-4/+3
| | | | llvm-svn: 86929
* We now thread some impossible condition information with LVI.Chris Lattner2009-11-121-2/+30
| | | | llvm-svn: 86927
* with the new code we can thread non-instruction values. ThisChris Lattner2009-11-121-2/+40
| | | | | | allows us to handle the test10 testcase. llvm-svn: 86924
* move some stuff into DEBUG's and turn on lazy-value-info forChris Lattner2009-11-121-1/+1
| | | | | | the basic.ll testcase. llvm-svn: 86918
* oops, didn't mean to commit this, no harm, but add a todoops, didn't mean to ↵Chris Lattner2009-11-111-0/+1
| | | | | | commit this, no harm, but add a todoo llvm-svn: 86768
* Stub out a new lazy value info pass, which will eventuallyChris Lattner2009-11-111-0/+26
| | | | | | vend value constraint information to the optimizer. llvm-svn: 86767
* implement a TODO by teaching jump threading about "xor x, 1".Chris Lattner2009-11-101-0/+39
| | | | llvm-svn: 86739
* Make jump threading eliminate blocks that just contain phi nodes,Chris Lattner2009-11-101-3/+13
| | | | | | | | debug intrinsics, and an unconditional branch when possible. This reuses the TryToSimplifyUncondBranchFromEmptyBlock function split out of simplifycfg. llvm-svn: 86722
* make jump threading recursively simplify expressions instead of doing it Chris Lattner2009-11-101-0/+32
| | | | | | | | | | | | | | | | | | | just one level deep. On the testcase we go from getting this: F1: ; preds = %T2 %F = and i1 true, %cond ; <i1> [#uses=1] br i1 %F, label %X, label %Y to a fully threaded: F1: ; preds = %T2 br label %Y This changes gets us to the point where we're forming (too many) switch instructions on doug's strswitch testcase. llvm-svn: 86646
* reapply 86289, 86278, 86270, 86267, 86266 & 86264 plus a fixChris Lattner2009-11-071-0/+31
| | | | | | | | | (making pred factoring only happen if threading is guaranteed to be successful). This now survives an X86-64 bootstrap of llvm-gcc. llvm-svn: 86355
* Revert following patches to fix llvmgcc bootstrap.Devang Patel2009-11-071-31/+0
| | | | | | | 86289, 86278, 86270, 86267, 86266 & 86264 Chris, please take a look. llvm-svn: 86321
* Extend jump threading to support much more general threadingChris Lattner2009-11-061-0/+31
| | | | | | | | | | | | | | | | | | | | predicates. This allows us to jump thread things like: _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit119: %tmp1.i24166 = phi i8 [ 1, %bb5.i117 ], [ %tmp1.i24165, %_Z....exit ], [ %tmp1.i24165, %bb4.i114 ] %toBoolnot.i87 = icmp eq i8 %tmp1.i24166, 0 ; <i1> [#uses=1] %tmp4.i90 = icmp eq i32 %tmp2.i, 6 ; <i1> [#uses=1] %or.cond173 = and i1 %toBoolnot.i87, %tmp4.i90 ; <i1> [#uses=1] br i1 %or.cond173, label %bb4.i96, label %_ZN12... Where it is "obvious" that when coming from %bb5.i117 that the 'and' is always false. This triggers a surprisingly high number of times in the testsuite, and gets us closer to generating good code for doug's strswitch testcase. This also make a bunch of other code in jump threading redundant, I'll rip out in the next patch. This survived an enable-checking llvm-gcc bootstrap. llvm-svn: 86264
* when folding duplicate conditions, delete the Chris Lattner2009-10-111-0/+33
| | | | | | now-probably-dead instruction tree feeding it. llvm-svn: 83778
* implement a transformation in jump threading that is currentlyChris Lattner2009-10-111-0/+34
| | | | | | | | | | done by condprop, but do it in a much more general form. The basic idea is that we can do a limited form of tail duplication in the case when we have a branch on a phi. Moving the branch up in to the predecessor block makes instruction selection much easier and encourages chained jump threadings. llvm-svn: 83759
* make jump threading on a phi with undef inputs happen.Chris Lattner2009-10-111-2/+32
| | | | llvm-svn: 83754
* merge two tests.Chris Lattner2009-10-111-1/+19
| | | | llvm-svn: 83751
* simplify some run lines, convert a test to filecheck.Chris Lattner2009-10-111-2/+8
| | | | llvm-svn: 83750
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-111-2/+2
| | | | | | | | 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. llvm-svn: 81537
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-081-2/+2
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-081-2/+2
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* Teach jump threading some more simple tricks:Chris Lattner2008-12-031-0/+22
| | | | | | | | | | | | | | | | 1) have it fold "br undef", which does occur with surprising frequency as jump threading iterates. 2) teach j-t to delete dead blocks. This removes the successor edges, reducing the in-edges of other blocks, allowing recursive simplification. 3) Fold things like: br COND, BBX, BBY BBX: br COND, BBZ, BBW which also happens because jump threading iterates. llvm-svn: 60470
* add a basic testcase.Chris Lattner2008-04-221-0/+31
llvm-svn: 50093
OpenPOWER on IntegriCloud