aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Fold things like "phi [add (a,b), add(c,d)]" into two phi's and one add.Chris Lattner2006-11-011-3/+57
| | | | | | | This triggers thousands of times on multisource. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31341 91177308-0d34-0410-b5e6-96231b3b80d8
* generalize the fix for PR977 to also fixChris Lattner2006-10-311-28/+26
| | | | | | | Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31317 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR977 and Transforms/LCSSA/2006-10-31-UnreachableBlock.llChris Lattner2006-10-311-1/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31315 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SimplifyCFG/2006-10-29-InvokeCrash.ll, a crash compiling QT.Chris Lattner2006-10-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31284 91177308-0d34-0410-b5e6-96231b3b80d8
* add option to isCriticalEdgeChris Lattner2006-10-281-3/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31258 91177308-0d34-0410-b5e6-96231b3b80d8
* break edges more intelligentlyChris Lattner2006-10-281-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31257 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose a smarter way to break critical edges.Chris Lattner2006-10-281-5/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31256 91177308-0d34-0410-b5e6-96231b3b80d8
* SplitCriticalEdge checks to see if an edge is critical, don't check twiceChris Lattner2006-10-281-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31255 91177308-0d34-0410-b5e6-96231b3b80d8
* prepare for a change I'm about to makeChris Lattner2006-10-281-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31248 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code a bit by changing instances of:Reid Spencer2006-10-261-47/+27
| | | | | | | | | InsertNewInstBefore(new CastInst(Val, ValTy, Val->GetName()), I) into: InsertCastBefore(Val, ValTy, I) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31204 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-10-264-135/+256
| | | | | | | | | Make necessary changes to support DIV -> [SUF]Div. This changes llvm to have three division instructions: signed, unsigned, floating point. The bytecode and assembler are bacwards compatible, however. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 2006-10-25-AddSetCC. A relational operator (like setlt) can neverNick Lewycky2006-10-261-27/+46
| | | | | | | produce an EQ property. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31193 91177308-0d34-0410-b5e6-96231b3b80d8
* Resurrect r1.25.Nick Lewycky2006-10-251-117/+154
| | | | | | | Fix and comment the "or", "and" and "xor" transformations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31189 91177308-0d34-0410-b5e6-96231b3b80d8
* hide symbols properlyChris Lattner2006-10-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31184 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.llChris Lattner2006-10-241-5/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31151 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert back to r1.21, which was the last revision of predsimplify thatChris Lattner2006-10-241-134/+109
| | | | | | | passes llvm-gcc bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31146 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle fallout from the recent branch-on-undef changes. This fixesChris Lattner2006-10-231-1/+24
| | | | | | | Prolangs-C/agrep and SCCP/2006-10-23-IPSCCP-Crash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31132 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the Backwards operation. Resolving now works at the time when aNick Lewycky2006-10-231-90/+102
| | | | | | | | property is added by running through the list of uses of the value and adding resolved properties to the property set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31126 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix similar missing optimization opportunity in XOR.Nick Lewycky2006-10-221-13/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31123 91177308-0d34-0410-b5e6-96231b3b80d8
* Whoops! Add missing NULL check.Nick Lewycky2006-10-221-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31121 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle "if ((x|y) != 0)" for ints like we do for bools. Fixes missedNick Lewycky2006-10-221-10/+13
| | | | | | | optimization opportunity pointed out by Chris Lattner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31118 91177308-0d34-0410-b5e6-96231b3b80d8
* AllocaInst can't return a null pointer. Fixes missed optimizationNick Lewycky2006-10-221-0/+6
| | | | | | | opportunity pointed out by Andrew Lewycky. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31115 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a workaround for PR962, disabling the more aggressive form of thisChris Lattner2006-10-221-0/+8
| | | | | | | transformation. This speeds up a C++ app 2.25x. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31113 91177308-0d34-0410-b5e6-96231b3b80d8
* 3 Changes:Chris Lattner2006-10-221-24/+35
| | | | | | | | | | | 1. Better document what is going on here. 2. Only hack on one branch per iteration, making the results less conservative. 3. Handle the problematic case by marking edges executable instead of by playing with value lattice states. This is far less pessimistic, and fixes SCCP/ipsccp-gvar.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31106 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-extract should remove module-level asmChris Lattner2006-10-201-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31086 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an ugly problem in SCCP. This fixes Benchmarks/Misc-C++/mandel-text.cppChris Lattner2006-10-201-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31073 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix miscompilation of MallocBench/espresso which code review pointed outChris Lattner2006-10-201-1/+1
| | | | | | | but apparently didn't make it into the final patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31070 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-10-2023-453/+492
| | | | | | | | | This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
* While creating mask, use 1ULL instead of 1.Devang Patel2006-10-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31062 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SimplifyCFG/2006-10-19-UncondDiv.ll by disabling a bad xform.Chris Lattner2006-10-201-23/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31061 91177308-0d34-0410-b5e6-96231b3b80d8
* It is OK to remove extra cast if operation is EQ/NE even though sourceDevang Patel2006-10-191-2/+3
| | | | | | | and destination sign may not match but other conditions are met. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31056 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo Typo.Devang Patel2006-10-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31055 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Devang Patel2006-10-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31054 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug in PR454 resolution. Added new test case.Devang Patel2006-10-191-1/+15
| | | | | | | This fixes llvmAsmParser.cpp miscompile by llvm on PowerPC Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31053 91177308-0d34-0410-b5e6-96231b3b80d8
* Undo Chris' last patch, it caused a regression.Reid Spencer2006-10-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30991 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a buggy check that accidentally disabled this xformChris Lattner2006-10-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30967 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace custom dispatch code with two uses of InstVisitor. ImprovesNick Lewycky2006-10-121-93/+113
| | | | | | | compile-time performance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30896 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement SROA of unions with mixed pointers/integers in them. This implementsChris Lattner2006-10-081-10/+16
| | | | | | | PR892 and Transforms/ScalarRepl/union-pointer.ll:test2 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30825 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Transforms/ScalarRepl/union-pointer.ll:testChris Lattner2006-10-081-9/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30823 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new SimplifyDemandedVectorElts method, which works similarly toChris Lattner2006-10-051-8/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SimplifyDemandedBits. The idea is that some operations can be simplified if not all of the computed elements are needed. Some targets (like x86) have a large number of intrinsics that operate on a single element, but pass other elts through unmodified. If those other elements are not needed, the intrinsics can be simplified to scalar operations, and insertelement ops can be removed. This turns (f.e.): ushort %Convert_sse(float %f) { %tmp = insertelement <4 x float> undef, float %f, uint 0 ; <<4 x float>> [#uses=1] %tmp10 = insertelement <4 x float> %tmp, float 0.000000e+00, uint 1 ; <<4 x float>> [#uses=1] %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, uint 2 ; <<4 x float>> [#uses=1] %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, uint 3 ; <<4 x float>> [#uses=1] %tmp28 = tail call <4 x float> %llvm.x86.sse.sub.ss( <4 x float> %tmp12, <4 x float> < float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1] %tmp37 = tail call <4 x float> %llvm.x86.sse.mul.ss( <4 x float> %tmp28, <4 x float> < float 5.000000e-01, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1] %tmp48 = tail call <4 x float> %llvm.x86.sse.min.ss( <4 x float> %tmp37, <4 x float> < float 6.553500e+04, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1] %tmp59 = tail call <4 x float> %llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> zeroinitializer ) ; <<4 x float>> [#uses=1] %tmp = tail call int %llvm.x86.sse.cvttss2si( <4 x float> %tmp59 ) ; <int> [#uses=1] %tmp69 = cast int %tmp to ushort ; <ushort> [#uses=1] ret ushort %tmp69 } into: ushort %Convert_sse(float %f) { entry: %tmp28 = sub float %f, 1.000000e+00 ; <float> [#uses=1] %tmp37 = mul float %tmp28, 5.000000e-01 ; <float> [#uses=1] %tmp375 = insertelement <4 x float> undef, float %tmp37, uint 0 ; <<4 x float>> [#uses=1] %tmp48 = tail call <4 x float> %llvm.x86.sse.min.ss( <4 x float> %tmp375, <4 x float> < float 6.553500e+04, float undef, float undef, float undef > ) ; <<4 x float>> [#uses=1] %tmp59 = tail call <4 x float> %llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> < float 0.000000e+00, float undef, float undef, float undef > ) ; <<4 x float>> [#uses=1] %tmp = tail call int %llvm.x86.sse.cvttss2si( <4 x float> %tmp59 ) ; <int> [#uses=1] %tmp69 = cast int %tmp to ushort ; <ushort> [#uses=1] ret ushort %tmp69 } which improves codegen from: _Convert_sse: movss LCPI1_0, %xmm0 movss 4(%esp), %xmm1 subss %xmm0, %xmm1 movss LCPI1_1, %xmm0 mulss %xmm0, %xmm1 movss LCPI1_2, %xmm0 minss %xmm0, %xmm1 xorps %xmm0, %xmm0 maxss %xmm0, %xmm1 cvttss2si %xmm1, %eax andl $65535, %eax ret to: _Convert_sse: movss 4(%esp), %xmm0 subss LCPI1_0, %xmm0 mulss LCPI1_1, %xmm0 movss LCPI1_2, %xmm1 minss %xmm1, %xmm0 xorps %xmm1, %xmm1 maxss %xmm1, %xmm0 cvttss2si %xmm0, %eax andl $65535, %eax ret This is just a first step, it can be extended in many ways. Testcase here: Transforms/InstCombine/vec_demanded_elts.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30752 91177308-0d34-0410-b5e6-96231b3b80d8
* This case isn't implemented yet. It seems unlikely to be needed, but if itChris Lattner2006-10-041-4/+2
| | | | | | | ever is, we want to get an assert instead of silent bad codegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30716 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify logic further.Nick Lewycky2006-10-031-17/+8
| | | | | | | | Ensure that we copy KnownProperties before calling visitBasicBlock, else we may leak properties into blocks where they don't belong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30705 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify, now that predsimplify depends on break-crit-edges.Nick Lewycky2006-10-031-26/+8
| | | | | | | Fix SwitchInst where dest-block is the same as one of the cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30700 91177308-0d34-0410-b5e6-96231b3b80d8
* Move break-crit-edges before the predicate simplifier. Allows us toNick Lewycky2006-10-031-7/+3
| | | | | | | optimize in more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30699 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert previous patch. Still breaking things.Evan Cheng2006-10-031-49/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30698 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR932 and Analysis/Dominators/2006-10-02-BreakCritEdges.ll:Chris Lattner2006-10-031-15/+112
| | | | | | | | The critical edge block dominates the dest block if the destblock dominates all edges other than the one incoming from the critical edge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30696 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug from r1.391 of this file, where we checked the size instead ofChris Lattner2006-10-011-2/+2
| | | | | | | | the alignment when promoting allocations. This implements InstCombine/cast.ll:test32 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30682 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix debug outputChris Lattner2006-09-301-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30680 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement SRA of heap allocations.Chris Lattner2006-09-301-10/+266
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30679 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some ifdef'd out debug infoChris Lattner2006-09-301-3/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30676 91177308-0d34-0410-b5e6-96231b3b80d8