summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* Fix PR4254.Torok Edwin2009-05-23
| | | | | | | | | | | | | The DAGCombiner created a negative shiftamount, stored in an unsigned variable. Later the optimizer eliminated the shift entirely as being undefined. Example: (srl (shl X, 56) 48). ShiftAmt is 4294967288. Fix it by checking that the shiftamount is positive, and storing in a signed variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72331 91177308-0d34-0410-b5e6-96231b3b80d8
* available_externall linkage is not local, this was confusing the codegenerator,Torok Edwin2009-05-23
| | | | | | | | | | and it wasn't generating calls through @PLT for these functions. hasLocalLinkage() is now false for available_externally, I attempted to fix the inliner and dce to handle available_externally properly. It passed make check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72328 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test to account for legalization changes; I think this ends up Eli Friedman2009-05-23
| | | | | | | | running an extra DAGCombine pass which improves the code a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72326 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug in FoldFCmp_IntToFP_Cst. If inttofp is a uintofp, use unsigned ↵Evan Cheng2009-05-22
| | | | | | instead of signed integer constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72300 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new codegen pass that normalizes dwarf exception handlingDuncan Sands2009-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code in preparation for code generation. The main thing it does is handle the case when eh.exception calls (and, in a future patch, eh.selector calls) are far away from landing pads. Right now in practice you only find eh.exception calls close to landing pads: either in a landing pad (the common case) or in a landing pad successor, due to loop passes shifting them about. However future exception handling improvements will result in calls far from landing pads: (1) Inlining of rewinds. Consider the following case: In function @f: ... invoke @g to label %normal unwind label %unwinds ... unwinds: %ex = call i8* @llvm.eh.exception() ... In function @g: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... "rethrow exception" Now inline @g into @f. Currently this is turned into: In function @f: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... invoke "rethrow exception" to label %normal unwind label %unwinds unwinds: %ex = call i8* @llvm.eh.exception() ... However we would like to simplify invoke of "rethrow exception" into a branch to the %unwinds label. Then %unwinds is no longer a landing pad, and the eh.exception call there is then far away from any landing pads. (2) Using the unwind instruction for cleanups. It would be nice to have codegen handle the following case: invoke @something to label %continue unwind label %run_cleanups ... handler: ... perform cleanups ... unwind This requires turning "unwind" into a library call, which necessarily takes a pointer to the exception as an argument (this patch also does this unwind lowering). But that means you are using eh.exception again far from a landing pad. (3) Bugpoint simplifications. When bugpoint is simplifying exception handling code it often generates eh.exception calls far from a landing pad, which then causes codegen to assert. Bugpoint then latches on to this assertion and loses sight of the original problem. Note that it is currently rare for this pass to actually do anything. And in fact it normally shouldn't do anything at all given the code coming out of llvm-gcc! But it does fire a few times in the testsuite. As far as I can see this is almost always due to the LoopStrengthReduce codegen pass introducing pointless loop preheader blocks which are landing pads and only contain a branch to another block. This other block contains an eh.exception call. So probably by tweaking LoopStrengthReduce a bit this can be avoided. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72276 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach IndVarSimplify's FixUsesBeforeDefs to handle InvokeInsts byDan Gohman2009-05-22
| | | | | | | | | | | | | | | | assuming that the use of the value is in a block dominated by the "normal" destination. LangRef.html and other documentation sources don't explicitly guarantee this, but it seems to be assumed in other places in LLVM at least. This fixes an assertion failure on the included testcase, which is derived from the Ada testsuite. FixUsesBeforeDefs is a temporary measure which I'm looking to replace with a more capable solution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72266 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a thinko in the code that adapted SCEVMulExpr operands forDan Gohman2009-05-22
| | | | | | | | use in expanding SCEVAddExprs with GEPs. The operands of a SCEVMulExpr need to be multiplied together, not added. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72250 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert this. There's no way to verifiy indirect calls, and an optimizer can turnTorok Edwin2009-05-22
| | | | | | | | indirect call into direct call, thus the verifier would reject something it previously accepted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72249 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify that calling conventions match function prototype.Torok Edwin2009-05-22
| | | | | | | | | | This only rejects mismatches between target specific calling convention and C/LLVM specific calling convention. There are too many fastcc/C, coldcc/cc42 mismatches in the testsuite, these are not reject by the verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72248 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix broken logic in DominatorTreeBase::Split. Part of PR4238.Eli Friedman2009-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72231 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some incorrect logic in DominanceFrontier::splitBlock. Part of Eli Friedman2009-05-21
| | | | | | | | PR4238. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72223 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ValueTracking a new way to analyze PHI nodes, and and teachDan Gohman2009-05-21
| | | | | | | | | Instcombine to be more aggressive about using SimplifyDemandedBits on shift nodes. This allows a shift to be simplified to zero in the included test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72204 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR4235: to build a floating-point value from integer parts, Eli Friedman2009-05-20
| | | | | | | | | | | | | | build an integer and cast that to a float. This fixes a crash caused by trying to split an f32 into two f16's. This changes the behavior in test/CodeGen/XCore/fneg.ll because that testcase now triggers a DAGCombine which converts the fneg into an integer operation. If someone is interested, it's probably possible to tweak the test to generate an actual fneg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72162 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test on non-darwin hosts.Evan Cheng2009-05-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72161 91177308-0d34-0410-b5e6-96231b3b80d8
* Try again. Allow call to immediate address for ELF or when in static ↵Evan Cheng2009-05-20
| | | | | | relocation mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72160 91177308-0d34-0410-b5e6-96231b3b80d8
* Cannot use immediate as call absolute target in PIC mode.Evan Cheng2009-05-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72154 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress the IV reversal transformation in the case that the RHSDan Gohman2009-05-20
| | | | | | | | | of the comparison is defined inside the loop. This fixes a use-before-def problem, because the transformation puts a use of the RHS outside the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72149 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pr4058 and pr4059. Do not split i64 or double arguments between r3 andBob Wilson2009-05-19
| | | | | | | the stack. Patch by Sandeep Patel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72106 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pr4091: Add support for "m" constraint in ARM inline assembly.Bob Wilson2009-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72105 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach SCEVExpander to expand arithmetic involving pointers into GEPDan Gohman2009-05-19
| | | | | | | | | | | | | | | | | instructions. It attempts to create high-level multi-operand GEPs, though in cases where this isn't possible it falls back to casting the pointer to i8* and emitting a GEP with that. Using GEP instructions instead of ptrtoint+arithmetic+inttoptr helps pointer analyses that don't use ScalarEvolution, such as BasicAliasAnalysis. Also, make the AddrModeMatcher more aggressive in handling GEPs. Previously it assumed that operand 0 of a GEP would require a register in almost all cases. It now does extra checking and can do more matching if operand 0 of the GEP is foldable. This fixes a problem that was exposed by SCEVExpander using GEPs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72093 91177308-0d34-0410-b5e6-96231b3b80d8
* Commands beginning with '--' are converted to '-f' by gcc. Blech!Bill Wendling2009-05-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72023 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ScalarEvolution to recognize x^-1 in the case where non-demandedDan Gohman2009-05-18
| | | | | | | bits have been stripped out by instcombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72010 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ScalarEvolution::isLoopGuardedByCond work even when the edgeDan Gohman2009-05-18
| | | | | | | entering a loop is a non-split critical edge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72004 91177308-0d34-0410-b5e6-96231b3b80d8
* Add nounwind to a few tests.Dan Gohman2009-05-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72002 91177308-0d34-0410-b5e6-96231b3b80d8
* Check that the gcc front-end is not doing inliningDuncan Sands2009-05-17
| | | | | | | when not doing unit-at-a-time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71986 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark rotl/rotr as expand. This generates pretty ugly code, but this is ↵Anton Korobeynikov2009-05-17
| | | | | | better than nothing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71976 91177308-0d34-0410-b5e6-96231b3b80d8
* TypoAnton Korobeynikov2009-05-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71975 91177308-0d34-0410-b5e6-96231b3b80d8
* Help DejaGnu avoid pipe-jam by producing less output from certain test cases.Jakob Stoklund Olesen2009-05-16
| | | | | | | | When a test fails with more than a pipeful of output on stdout AND stderr, one of the DejaGnu programs blocks. The problem can be avoided by redirecting stdout to a file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71919 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement !if, analogous to $(if) in GNU make.David Greene2009-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71815 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix tests to not upset DejaGNU.David Greene2009-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71811 91177308-0d34-0410-b5e6-96231b3b80d8
* Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.David Greene2009-05-14
| | | | | | | | | | | Ok, not really, but do support some common LISP functions: * car * cdr * null git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71805 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a !foreach operator analogous to GNU make's $(foreach).David Greene2009-05-14
| | | | | | | | | | | | | | | Use it on dags and lists like this: class decls { string name; } def Decls : decls; class B<list<string> names> : A<!foreach(Decls.name, names, !strconcat(Decls.name, ", Sr."))>; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71803 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a !subst operation simmilar to $(subst) in GNU make to doDavid Greene2009-05-14
| | | | | | | | | | | | | | | | | def/var/string substitution on generic pattern templates. For example: def Type; def v4f32 : Type; def TYPE : Type; class GenType<Type t> { let type = !(subst TYPE, v4f32, t); } def TheType : GenType<TYPE>; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71801 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement !cast.David Greene2009-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71794 91177308-0d34-0410-b5e6-96231b3b80d8
* Add nounwind to this test.Dan Gohman2009-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71734 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove too large testcase.Bill Wendling2009-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71730 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the bookkeeping of the debug scopes back to the place where itBill Wendling2009-05-13
| | | | | | | | | belonged. The variable declaration stuff wasn't happy with it where it was. Sorry that the testcase is so big. Bugpoint wasn't able to reduce it successfully. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71714 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for 71688.Dale Johannesen2009-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71691 91177308-0d34-0410-b5e6-96231b3b80d8
* calls in nothrow functions can be marked nothrow even if the calleeChris Lattner2009-05-13
| | | | | | | | is not known to be nothrow. This allows readnone/readonly functions to be deleted even if we don't know whether the callee can throw. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71676 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4206 - crash in simplify lib callsChris Lattner2009-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71644 91177308-0d34-0410-b5e6-96231b3b80d8
* If header of inner loop is aligned, do not align the outer loop header. We ↵Evan Cheng2009-05-12
| | | | | | don't want to add nops in the outer loop for the sake of aligning the inner loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71609 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach TransferDeadness to delete truly dead instructions if they do not ↵Evan Cheng2009-05-12
| | | | | | produce side effects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71606 91177308-0d34-0410-b5e6-96231b3b80d8
* Add nounwind.Evan Cheng2009-05-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71575 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a stack slot coloring with reg bug: do not update implicit use / def ↵Evan Cheng2009-05-12
| | | | | | when doing forward / backward propagation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71574 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pr4195: When iterating through predecessor blocks, break out of the loopBob Wilson2009-05-12
| | | | | | | | | | | | after finding the (unique) layout predecessor. Sometimes a block may be listed more than once, and processing it more than once in this loop can lead to inconsistent values for FtTBB/FtFBB, since the AnalyzeBranch method does not clear these values. There's no point in continuing the loop regardless. The testcase for this is reduced from the 2003-05-02-DependentPHI SingleSource test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71536 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor the code for collecting IV users out of LSR into an IVUsers class,Dan Gohman2009-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | and generalize it so that it can be used by IndVarSimplify. Implement the base IndVarSimplify transformation code using IVUsers. This removes TestOrigIVForWrap and associated code, as ScalarEvolution now has enough builtin overflow detection and folding logic to handle all the same cases, and more. Run "opt -iv-users -analyze -disable-output" on your favorite loop for an example of what IVUsers does. This lets IndVarSimplify eliminate IV casts and compute trip counts in more cases. Also, this happens to finally fix the remaining testcases in PR1301. Now that IndVarSimplify is being more aggressive, it occasionally runs into the problem where ScalarEvolutionExpander's code for avoiding duplicate expansions makes it difficult to ensure that all expanded instructions dominate all the instructions that will use them. As a temporary measure, IndVarSimplify now uses a FixUsesBeforeDefs function to fix up instructions inserted by SCEVExpander. Fortunately, this code is contained, and can be easily removed once a more comprehensive solution is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71535 91177308-0d34-0410-b5e6-96231b3b80d8
* When forgetting SCEVs for loop PHIs, don't forget SCEVUnknown values.Dan Gohman2009-05-12
| | | | | | | | | | These values aren't analyzable, so they don't care if more information about the loop trip count can be had. Also, SCEVUnknown is used for a PHI while the PHI itself is being analyzed, so it needs to be left in the Scalars map. This fixes a variety of subtle issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71533 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach LSR to optimize more loop exit compares, i.e. change them to use ↵Evan Cheng2009-05-11
| | | | | | | | | postinc iv value. Previously LSR would only optimize those which are in the loop latch block. However, if LSR can prove it is safe (and profitable), it's now possible to change those not in the latch blocks to use postinc values. Also, if the compare is the only use, LSR would place the iv increment instruction before the compare instead in the latch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71485 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4188. TailMerging can't tolerate inexactDale Johannesen2009-05-11
| | | | | | | | sucessor info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71478 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this grep line a little more specific so that it doesn'tDan Gohman2009-05-11
| | | | | | | accidentally match something unrelated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71458 91177308-0d34-0410-b5e6-96231b3b80d8