summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/phi.ll
Commit message (Collapse)AuthorAge
* 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
* 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
* 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
* Add test cases for Jay's r129641 and fix a 32-bit-centric testcase in a file ↵Frits van Bommel2011-04-16
| | | | | | with a 64-bit datalayout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129643 91177308-0d34-0410-b5e6-96231b3b80d8
* have instcombine preserve nsw/nuw/exact when sinkingChris Lattner2011-02-17
| | | | | | | common operations through a phi. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125790 91177308-0d34-0410-b5e6-96231b3b80d8
* fix instcombine merging GEPs through a PHI to only make theChris Lattner2011-02-17
| | | | | | | result inbounds if all of the inputs are inbounds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125785 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance FoldOpIntoPhi in instcombine to try harder when a phi hasChris Lattner2011-01-16
| | | | | | | | | multiple uses. In some cases, all the uses are the same operation, so instcombine can go ahead and promote the phi. In the testcase this pushes an add out of the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123568 91177308-0d34-0410-b5e6-96231b3b80d8
* In which I discover the existence of loops. Threading an operationDuncan Sands2010-11-16
| | | | | | | | | | | | over a phi node by applying it to each operand may be wrong if the operation and the phi node are mutually interdependent (the testcase has a simple example of this). So only do this transform if it would be correct to perform the operation in each predecessor of the block containing the phi, i.e. if the other operands all dominate the phi. This should fix the FFMPEG snow.c regression reported by İsmail Dönmez. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119347 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach InstructionSimplify the trick of skipping incoming phiDuncan Sands2010-11-15
| | | | | | | values that are equal to the phi itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119161 91177308-0d34-0410-b5e6-96231b3b80d8
* Move PHI tests to phi.ll, out of select.ll.Duncan Sands2010-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119153 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for PR4413, which was apparently fixed at some point in the past.Owen Anderson2010-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112987 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6512, a case where instcombine would incorrectly merge loadsChris Lattner2010-03-05
| | | | | | | from different addr spaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97813 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance PHI slicing to handle the case when a slicable PHI is beginChris Lattner2009-11-09
| | | | | | | used by a chain of other PHIs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86503 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach an instcombine to not pull trunc instructions through PHI nodesChris Lattner2009-11-08
| | | | | | | | | | when both the source and dest are illegal types, since it would cause the phi to grow (for example, we shouldn't transform test14b's phi to a phi on i320). This fixes an infinite loop on i686 bootstrap with phi slicing turned on, so turn it back on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86483 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply r8644[3-5] with only the scary part Chris Lattner2009-11-08
| | | | | | | (SliceUpIllegalIntegerPHI) disabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86480 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert r8644[3-5], they seem to be leading to infinite loops inDaniel Dunbar2009-11-08
| | | | | | llvm-gcc bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86478 91177308-0d34-0410-b5e6-96231b3b80d8
* another more interesting test.Chris Lattner2009-11-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86445 91177308-0d34-0410-b5e6-96231b3b80d8
* feature test for the new transformation in r86443Chris Lattner2009-11-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86444 91177308-0d34-0410-b5e6-96231b3b80d8
* teach a couple of instcombine transformations involving PHIs toChris Lattner2009-11-08
| | | | | | | | | not turn a PHI in a legal type into a PHI of an illegal type, and add a new optimization that breaks up insane integer PHI nodes into small pieces (PR3451). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86443 91177308-0d34-0410-b5e6-96231b3b80d8
* merge phi-merge.ll into phi.llChris Lattner2009-11-01
| | | | | | | | I don't know what Dan wants to do with phi-merge-gep.ll, I'll let him deal with it because instcombine may end up sinking these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85739 91177308-0d34-0410-b5e6-96231b3b80d8
* when merging two loads, make sure to take the min of their alignment,Chris Lattner2009-11-01
| | | | | | | | not the max. This didn't matter until the previous patch because instcombine would refuse to sink loads with differenting alignments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85738 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bug noticed by inspection: when instcombine sinks loads throughChris Lattner2009-11-01
| | | | | | | | | phis, it didn't preserve the alignment of the load. This is a missed optimization of the alignment is high and a miscompilation when the alignment is low. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85736 91177308-0d34-0410-b5e6-96231b3b80d8
* convert to filecheck.Chris Lattner2009-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85734 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
* Teach inst combine to merge GEPs through PHIs. This is reallyChris Lattner2008-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | important because it is sinking the loads using the GEPs, but not the GEPs themselves. This triggers 647 times on 403.gcc and makes the .s file much much nicer. For example before: je LBB1_87 ## bb78 LBB1_62: ## bb77 leal 84(%esi), %eax LBB1_63: ## bb79 movl (%eax), %eax ... LBB1_87: ## bb78 movl $0, 4(%esp) movl %esi, (%esp) call L_make_decl_rtl$stub jmp LBB1_62 ## bb77 after: jne LBB1_63 ## bb79 LBB1_62: ## bb78 movl $0, 4(%esp) movl %esi, (%esp) call L_make_decl_rtl$stub LBB1_63: ## bb79 movl 84(%esi), %eax The input code was (and the GEPs are merged and the PHI is now eliminated by instcombine): br i1 %tmp233, label %bb78, label %bb77 bb77: %tmp234 = getelementptr %struct.tree_node* %t_addr.3, i32 0, i32 0, i32 22 br label %bb79 bb78: call void @make_decl_rtl(%struct.tree_node* %t_addr.3, i8* null) nounwind %tmp235 = getelementptr %struct.tree_node* %t_addr.3, i32 0, i32 0, i32 22 br label %bb79 bb79: %iftmp.12.0.in = phi %struct.rtx_def** [ %tmp235, %bb78 ], [ %tmp234, %bb77 ] %iftmp.12.0 = load %struct.rtx_def** %iftmp.12.0.in git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60322 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove llvm-upgrade and update test cases.Tanya Lattner2008-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47793 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1319:Reid Spencer2007-04-15
| | | | | | | | Make use of the END. facility on all files > 1K so that we aren't wasting CPU cycles searching for RUN: lines that we'll never find. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36059 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1319:Reid Spencer2007-04-14
| | | | | | | Upgrade tests to work with new llvm.exp version of llvm_runtest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36013 91177308-0d34-0410-b5e6-96231b3b80d8
* new testcaseChris Lattner2007-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33233 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the llvm-upgrade program to upgrade llvm assembly.Reid Spencer2006-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32115 91177308-0d34-0410-b5e6-96231b3b80d8
* New testcase: the phi can be eliminated if the casts are sucked into it.Chris Lattner2004-11-14
| | | | | | | | Note that this reduces code size anyway (as well as making further optimizations simpler) so it's always a win. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17739 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typoChris Lattner2004-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17738 91177308-0d34-0410-b5e6-96231b3b80d8
* add a testcase, which we already handleChris Lattner2004-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17737 91177308-0d34-0410-b5e6-96231b3b80d8
* remove bogus testChris Lattner2004-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13827 91177308-0d34-0410-b5e6-96231b3b80d8
* The instruction combining pass removes dead instructions, there is no needChris Lattner2004-02-28
| | | | | | | to run the die pass after it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11942 91177308-0d34-0410-b5e6-96231b3b80d8
* A new testcase for a situation that occurs in 181.mcfChris Lattner2004-02-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11493 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed `as' => `llvm-as', `dis' => `llvm-dis', `link' => `llvm-link'.Misha Brukman2003-09-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8558 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove usage of grep-not scriptChris Lattner2003-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6966 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert scripts from using explicit control flow to use the new grep-not scriptChris Lattner2003-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6955 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new testcases for instcombineChris Lattner2002-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3477 91177308-0d34-0410-b5e6-96231b3b80d8
* New testcase for instcombineChris Lattner2002-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3396 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the testcase more interesting so that DCE does not eliminate it.Chris Lattner2002-05-06
| | | | | | | Use DIE instead of DCE anyway git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2500 91177308-0d34-0410-b5e6-96231b3b80d8
* New testcase for PHI foldingChris Lattner2002-05-06
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2495 91177308-0d34-0410-b5e6-96231b3b80d8