oota-llvm.git
17 years agoadd helper
Chris Lattner [Mon, 18 Jun 2007 21:50:49 +0000 (21:50 +0000)]
add helper

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37631 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix quotes in debug messages.
Devang Patel [Mon, 18 Jun 2007 21:32:29 +0000 (21:32 +0000)]
Fix quotes in debug messages.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37630 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agomake ComputeTopDownOrdering significantly faster and use less stack space
Chris Lattner [Mon, 18 Jun 2007 21:28:10 +0000 (21:28 +0000)]
make ComputeTopDownOrdering significantly faster and use less stack space
by making it non-recursive

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37629 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoIn SCEVAddExpr::get, skip over any cast operands before looking for nested
Dan Gohman [Mon, 18 Jun 2007 19:30:09 +0000 (19:30 +0000)]
In SCEVAddExpr::get, skip over any cast operands before looking for nested
add operands after constant operands. The recent change to recognize
sign-extend expressions caused this to be exposed more often.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37628 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake BasicAliasAnalysis correctly register itself. Patch by Devang
Anton Korobeynikov [Mon, 18 Jun 2007 17:13:29 +0000 (17:13 +0000)]
Make BasicAliasAnalysis correctly register itself. Patch by Devang

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37627 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake chain dependencies blue, in addition to being dashed.
Dan Gohman [Mon, 18 Jun 2007 15:30:16 +0000 (15:30 +0000)]
Make chain dependencies blue, in addition to being dashed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37626 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDefine the pushq instruction for x86-64.
Dan Gohman [Mon, 18 Jun 2007 14:12:56 +0000 (14:12 +0000)]
Define the pushq instruction for x86-64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37625 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd keyword explicit.
Dan Gohman [Mon, 18 Jun 2007 14:11:31 +0000 (14:11 +0000)]
Add keyword explicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37624 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoProperly remove duplicate instructions as result of diamond if-conversion. Other...
Evan Cheng [Mon, 18 Jun 2007 08:37:25 +0000 (08:37 +0000)]
Properly remove duplicate instructions as result of diamond if-conversion. Other bug fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37623 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCache the results of dependsOnInvoke()
Owen Anderson [Mon, 18 Jun 2007 04:42:29 +0000 (04:42 +0000)]
Cache the results of dependsOnInvoke()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37622 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix indentation.
Owen Anderson [Mon, 18 Jun 2007 04:31:21 +0000 (04:31 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37621 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDon't perform an expensive check if it's not necessary.
Owen Anderson [Mon, 18 Jun 2007 04:30:44 +0000 (04:30 +0000)]
Don't perform an expensive check if it's not necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37620 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoensure we don't regress on these tests. We generate aweful code in x86-32 for
Chris Lattner [Sun, 17 Jun 2007 23:29:57 +0000 (23:29 +0000)]
ensure we don't regress on these tests.  We generate aweful code in x86-32 for
these though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37619 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoXFAILing until I can fix properly.
Bill Wendling [Sat, 16 Jun 2007 23:57:51 +0000 (23:57 +0000)]
XFAILing until I can fix properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37618 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRevert patch. It regresses:
Bill Wendling [Sat, 16 Jun 2007 23:57:15 +0000 (23:57 +0000)]
Revert patch. It regresses:

define double @test2(i64 %A) {
   %B = bitcast i64 %A to double
   ret double %B
}

$ llvm-as < t.ll | llc -march=x86-64

before:

         .align  4
         .globl  _test2
_test2:
         movd %rdi, %xmm0
         ret

after:

_test2:
         subq $8, %rsp
         movq %rdi, (%rsp)
         movsd (%rsp), %xmm0
         addq $8, %rsp
         ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37617 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix PR1517:
Reid Spencer [Sat, 16 Jun 2007 20:48:27 +0000 (20:48 +0000)]
Fix PR1517:
Use SmallPtrSet instead of std::vector to eliminate duplicate uses in a
function generated with -gen-function. This prevents the output from having
multiple duplicate declarations of constants and gvals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37616 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix PR1516:
Reid Spencer [Sat, 16 Jun 2007 20:33:24 +0000 (20:33 +0000)]
Fix PR1516:
When printing the uses of a function (-gen-function only), make sure to
include the constants referenced by intializers of global variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37615 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCall the correct function name. Patch from Stephane Letz.
Nick Lewycky [Sat, 16 Jun 2007 16:17:35 +0000 (16:17 +0000)]
Call the correct function name. Patch from Stephane Letz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37614 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoReally turn if-converter loose:
Evan Cheng [Sat, 16 Jun 2007 09:34:52 +0000 (09:34 +0000)]
Really turn if-converter loose:
1. Consider all possible ifcvt cases at once. No longer restricted to bottom
   up iterative approach.
2. Sort all possible cases based on a cost function. Perform the most profitable
   ones first invalidate others that target the same blocks.
3. Fixed a number of bugs related to block duplication.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37613 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTestcase for MMX int to MMX register failure.
Bill Wendling [Sat, 16 Jun 2007 06:31:47 +0000 (06:31 +0000)]
Testcase for MMX int to MMX register failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37612 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a failure to bit_convert from integer GPR to MMX register.
Bill Wendling [Sat, 16 Jun 2007 06:17:31 +0000 (06:17 +0000)]
Fix a failure to bit_convert from integer GPR to MMX register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37611 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll by ignoring all instructions...
Owen Anderson [Sat, 16 Jun 2007 00:26:54 +0000 (00:26 +0000)]
Fix test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll by ignoring all instructions that depend on invokes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37610 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTestcase where GVNPRE was getting confused by invoke instructions.
Owen Anderson [Sat, 16 Jun 2007 00:25:10 +0000 (00:25 +0000)]
Testcase where GVNPRE was getting confused by invoke instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37609 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCodegen support (stripped out) for the annotate attribute.
Tanya Lattner [Fri, 15 Jun 2007 22:26:58 +0000 (22:26 +0000)]
Codegen support (stripped out) for the annotate attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37608 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoNot every predicable block can be safely duplicated.
Evan Cheng [Fri, 15 Jun 2007 21:18:05 +0000 (21:18 +0000)]
Not every predicable block can be safely duplicated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37607 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoInstructions with unique labels or embedded jumptables cannot be duplicated during...
Evan Cheng [Fri, 15 Jun 2007 21:15:00 +0000 (21:15 +0000)]
Instructions with unique labels or embedded jumptables cannot be duplicated during ifcvt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37606 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdded CanBeDuplicated(). It returns true if an instruction can be safely duplicated...
Evan Cheng [Fri, 15 Jun 2007 21:13:54 +0000 (21:13 +0000)]
Added CanBeDuplicated(). It returns true if an instruction can be safely duplicated (e.g. during ifcvt).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37605 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agotest case for annotate attribute
Tanya Lattner [Fri, 15 Jun 2007 20:52:47 +0000 (20:52 +0000)]
test case for annotate attribute

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37604 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd local var annotation intrinsic.
Tanya Lattner [Fri, 15 Jun 2007 20:50:54 +0000 (20:50 +0000)]
Add local var annotation intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37603 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFold a binary operator with constant operands when expanding code for a SCEV.
Dan Gohman [Fri, 15 Jun 2007 19:21:55 +0000 (19:21 +0000)]
Fold a binary operator with constant operands when expanding code for a SCEV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37602 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix CodeGen/X86/inline-asm-x-scalar.ll:test4, by retaining regclass info
Chris Lattner [Fri, 15 Jun 2007 19:11:01 +0000 (19:11 +0000)]
Fix CodeGen/X86/inline-asm-x-scalar.ll:test4, by retaining regclass info
for tied register constraints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37601 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agomake this test harder, include a tied register.
Chris Lattner [Fri, 15 Jun 2007 19:09:53 +0000 (19:09 +0000)]
make this test harder, include a tied register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37600 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMachineInstr::isPredicable() is no longer needed.
Evan Cheng [Fri, 15 Jun 2007 19:06:07 +0000 (19:06 +0000)]
MachineInstr::isPredicable() is no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37599 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoNo longer needed.
Evan Cheng [Fri, 15 Jun 2007 19:05:13 +0000 (19:05 +0000)]
No longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37598 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoWorkaround for PR1508.
Duncan Sands [Fri, 15 Jun 2007 19:04:19 +0000 (19:04 +0000)]
Workaround for PR1508.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37597 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse SCEVConstant::get instead of SCEVUnknown::get to create an
Dan Gohman [Fri, 15 Jun 2007 18:00:55 +0000 (18:00 +0000)]
Use SCEVConstant::get instead of SCEVUnknown::get to create an
integer constant SCEV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37596 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix test/Transforms/GVNPRE/2007-06-15-Looping.ll
Owen Anderson [Fri, 15 Jun 2007 17:55:15 +0000 (17:55 +0000)]
Fix test/Transforms/GVNPRE/2007-06-15-Looping.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37595 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a testcase where GVNPRE what getting confused by a loop.
Owen Anderson [Fri, 15 Jun 2007 17:54:05 +0000 (17:54 +0000)]
Add a testcase where GVNPRE what getting confused by a loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37594 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoExtra edges are deleted later if needed.
Evan Cheng [Fri, 15 Jun 2007 17:34:48 +0000 (17:34 +0000)]
Extra edges are deleted later if needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37593 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse "ignore" rather than grep tricks.
Duncan Sands [Fri, 15 Jun 2007 17:13:53 +0000 (17:13 +0000)]
Use "ignore" rather than grep tricks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37592 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a SCEV class and supporting code for sign-extend expressions.
Dan Gohman [Fri, 15 Jun 2007 14:38:12 +0000 (14:38 +0000)]
Add a SCEV class and supporting code for sign-extend expressions.

This created an ambiguity for expandInTy to decide when to use
sign-extension or zero-extension, but it turns out that most of its callers
don't actually need a type conversion, now that LLVM types don't have
explicit signedness. Drop expandInTy in favor of plain expand, and change
the few places that actually need a type conversion to do it themselves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37591 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAllow small blocks to be duplicated to enable if-conversion.
Evan Cheng [Fri, 15 Jun 2007 07:36:12 +0000 (07:36 +0000)]
Allow small blocks to be duplicated to enable if-conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37590 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoGeneralize many transforms to work on ~ of vectors in addition to ~ of
Chris Lattner [Fri, 15 Jun 2007 06:23:19 +0000 (06:23 +0000)]
Generalize many transforms to work on ~ of vectors in addition to ~ of
integer ops.  This implements Transforms/InstCombine/and-or-not.ll
test3/test4, and finishes off PR1510

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37589 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd vector versions of this test
Chris Lattner [Fri, 15 Jun 2007 06:22:32 +0000 (06:22 +0000)]
add vector versions of this test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37588 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agom_not should match vector not
Chris Lattner [Fri, 15 Jun 2007 06:13:47 +0000 (06:13 +0000)]
m_not should match vector not

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37587 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd a Constant::getAllOnesValue helper function, which works on integers
Chris Lattner [Fri, 15 Jun 2007 06:10:53 +0000 (06:10 +0000)]
add a Constant::getAllOnesValue helper function, which works on integers
AND vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37586 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoEnhance BinaryOperator::isNot to support vector not.
Chris Lattner [Fri, 15 Jun 2007 06:04:24 +0000 (06:04 +0000)]
Enhance BinaryOperator::isNot to support vector not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37585 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement two xforms:
Chris Lattner [Fri, 15 Jun 2007 05:58:24 +0000 (05:58 +0000)]
Implement two xforms:
1. ~(~X | Y) === (X & ~Y)
2. (A|B) & ~(A&B) -> A^B

This allows us to transform  ~(~(a|b) | (a&b)) -> a^b.

This implements PR1510 for scalar values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37584 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agotestcase for PR1510
Chris Lattner [Fri, 15 Jun 2007 05:57:20 +0000 (05:57 +0000)]
testcase for PR1510

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37583 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agodelete some obviously dead vector operations, which deletes a few thousand
Chris Lattner [Fri, 15 Jun 2007 05:26:55 +0000 (05:26 +0000)]
delete some obviously dead vector operations, which deletes a few thousand
operations from Duraids example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37582 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoNo really, clear predcessors states.
Evan Cheng [Thu, 14 Jun 2007 23:34:09 +0000 (23:34 +0000)]
No really, clear predcessors states.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37581 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoIf BB is predicated, invalidate its predecessor(s) which would if-convert it. It...
Evan Cheng [Thu, 14 Jun 2007 23:13:19 +0000 (23:13 +0000)]
If BB is predicated, invalidate its predecessor(s) which would if-convert it. It needs to be re-analyzed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37580 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRename MVT::getVectorBaseType to MVT::getVectorElementType.
Dan Gohman [Thu, 14 Jun 2007 22:58:02 +0000 (22:58 +0000)]
Rename MVT::getVectorBaseType to MVT::getVectorElementType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37579 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDo not treat FP_REG_KILL as terminator in branch analysis (X86).
Dale Johannesen [Thu, 14 Jun 2007 22:03:45 +0000 (22:03 +0000)]
Do not treat FP_REG_KILL as terminator in branch analysis (X86).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37578 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix typo.
Evan Cheng [Thu, 14 Jun 2007 21:26:08 +0000 (21:26 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37577 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a target hook to allow loads from constant pools to be rematerialized, and an
Dan Gohman [Thu, 14 Jun 2007 20:50:44 +0000 (20:50 +0000)]
Add a target hook to allow loads from constant pools to be rematerialized, and an
implementation for x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37576 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix some stupid bugs that have effectively disabled if-conversion.
Evan Cheng [Thu, 14 Jun 2007 20:28:52 +0000 (20:28 +0000)]
Fix some stupid bugs that have effectively disabled if-conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37575 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoEliminate some redundant newlines in asm output.
Dan Gohman [Thu, 14 Jun 2007 15:00:27 +0000 (15:00 +0000)]
Eliminate some redundant newlines in asm output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37574 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix typos.
Duncan Sands [Thu, 14 Jun 2007 11:27:07 +0000 (11:27 +0000)]
Fix typos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37573 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd support to tablegen for specifying subregister classes on a per register class...
Christopher Lamb [Wed, 13 Jun 2007 22:20:15 +0000 (22:20 +0000)]
Add support to tablegen for specifying subregister classes on a per register class basis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37572 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoHandle blocks with 2 unconditional branches in AnalyzeBranch.
Dale Johannesen [Wed, 13 Jun 2007 17:59:52 +0000 (17:59 +0000)]
Handle blocks with 2 unconditional branches in AnalyzeBranch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37571 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoOnly correctly lower exception handing intrinsics if exception handling is
Duncan Sands [Wed, 13 Jun 2007 16:53:21 +0000 (16:53 +0000)]
Only correctly lower exception handing intrinsics if exception handling is
turned on.  Likewise for scanning of invokes to mark landing pads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37570 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoIntroduce new SelectionDAG node opcodes VEXTRACT_SUBVECTOR and
Dan Gohman [Wed, 13 Jun 2007 15:12:02 +0000 (15:12 +0000)]
Introduce new SelectionDAG node opcodes VEXTRACT_SUBVECTOR and
VCONCAT_VECTORS. Use these for CopyToReg and CopyFromReg legalizing in
the case that the full register is to be split into subvectors instead
of scalars. This replaces uses of VBIT_CONVERT to present values as
vector-of-vector types in order to make whole subvectors accessible via
BUILD_VECTOR and EXTRACT_VECTOR_ELT.

This is in preparation for adding extended ValueType values, where
having vector-of-vector types is undesirable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37569 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoWhen creating CopyFromReg nodes, always use legal types. And use the
Dan Gohman [Wed, 13 Jun 2007 14:55:16 +0000 (14:55 +0000)]
When creating CopyFromReg nodes, always use legal types. And use the
correct types for the result vector, even though it is currently bitcasted
to a different type immediately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37568 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoThe fix that was applied for PR1224 stops the compiler
Duncan Sands [Wed, 13 Jun 2007 05:51:31 +0000 (05:51 +0000)]
The fix that was applied for PR1224 stops the compiler
crashing but breaks exception handling.  The problem
described in PR1224 is that invoke is a terminator that
can produce a value.  The value may be needed in other
blocks.  The code that writes to registers values needed
in other blocks runs before terminators are lowered (in
this case invoke) so asserted because the value was not
yet available.  The fix that was applied was to do invoke
lowering earlier, before writing values to registers.

The problem this causes is that the code to copy values
to registers can be output after the invoke call.  If
an exception is raised and control is passed to the
landing pad then this copy-code will never execute.  If
the value is needed in some code path reached via the
landing pad then that code will get something bogus.

So revert the original fix and simply skip invoke values
in the general copying to registers code.  Instead copy
the invoke value to a register in the invoke lowering code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37567 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTypo
Evan Cheng [Wed, 13 Jun 2007 00:04:00 +0000 (00:04 +0000)]
Typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37566 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoNow if-converting all 4 variants of triangles.
Evan Cheng [Tue, 12 Jun 2007 23:54:05 +0000 (23:54 +0000)]
Now if-converting all 4 variants of triangles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37565 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll
Owen Anderson [Tue, 12 Jun 2007 22:43:57 +0000 (22:43 +0000)]
Fix test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37564 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a test where phi translation was producing a null result.
Owen Anderson [Tue, 12 Jun 2007 22:42:35 +0000 (22:42 +0000)]
Add a test where phi translation was producing a null result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37563 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoisReachableFromEntry() is not suitable for post dominator.
Devang Patel [Tue, 12 Jun 2007 17:50:25 +0000 (17:50 +0000)]
isReachableFromEntry() is not suitable for post dominator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37562 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove redundant check.
Devang Patel [Tue, 12 Jun 2007 17:35:20 +0000 (17:35 +0000)]
Remove redundant check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37561 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoProtect updateDFSNumbers()
Devang Patel [Tue, 12 Jun 2007 17:30:56 +0000 (17:30 +0000)]
Protect updateDFSNumbers()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37560 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCheck A dominates B and vise versa first while searching for nearest
Devang Patel [Tue, 12 Jun 2007 17:17:57 +0000 (17:17 +0000)]
Check A dominates B and vise versa first while searching for nearest
common dominator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37559 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoone final bugfix
Chris Lattner [Tue, 12 Jun 2007 17:01:15 +0000 (17:01 +0000)]
one final bugfix

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37558 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agomodernize example
Chris Lattner [Tue, 12 Jun 2007 17:00:26 +0000 (17:00 +0000)]
modernize example

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37557 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRefactor some code, and fix test/Transforms/GVNPRE/2007-06-12-NoExit.ll by being...
Owen Anderson [Tue, 12 Jun 2007 16:57:50 +0000 (16:57 +0000)]
Refactor some code, and fix test/Transforms/GVNPRE/2007-06-12-NoExit.ll by being more careful when using
post-dominator information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37556 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTestcase where GVNPRE crashes on functions with no exit nodes.
Owen Anderson [Tue, 12 Jun 2007 16:56:00 +0000 (16:56 +0000)]
Testcase where GVNPRE crashes on functions with no exit nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37555 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSink CmpInst's to their uses to reduce register pressure.
Dale Johannesen [Tue, 12 Jun 2007 16:50:17 +0000 (16:50 +0000)]
Sink CmpInst's to their uses to reduce register pressure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37554 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake DFS number manipulation methods private.
Devang Patel [Tue, 12 Jun 2007 05:49:31 +0000 (05:49 +0000)]
Make DFS number manipulation methods private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37553 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake the run line for this test correct. Thanks to Chris for spotting it.
Owen Anderson [Tue, 12 Jun 2007 04:40:48 +0000 (04:40 +0000)]
Make the run line for this test correct.  Thanks to Chris for spotting it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37552 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoBreak DominatorTree from ETNode.
Devang Patel [Tue, 12 Jun 2007 00:54:38 +0000 (00:54 +0000)]
Break DominatorTree from ETNode.
Remove unused PostETForest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37551 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a few more bugs, including an instance of walking in reverse topological rather...
Owen Anderson [Tue, 12 Jun 2007 00:50:47 +0000 (00:50 +0000)]
Fix a few more bugs, including an instance of walking in reverse topological rather than topological order.  This
fixes a testcase extracted from llvm-test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37550 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a GVN-PRE basic regression test.
Owen Anderson [Tue, 12 Jun 2007 00:49:33 +0000 (00:49 +0000)]
Add a GVN-PRE basic regression test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37549 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse SmallPtrSet instaed of std::set
Devang Patel [Tue, 12 Jun 2007 00:40:51 +0000 (00:40 +0000)]
Use SmallPtrSet instaed of std::set

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37548 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCheck immediate dominators first while searching for nearset common dominator.
Devang Patel [Tue, 12 Jun 2007 00:35:38 +0000 (00:35 +0000)]
Check immediate dominators first while searching for nearset common dominator.
Fix 80 col violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37547 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMaintain DFS number in DomTreeNode itself.
Devang Patel [Tue, 12 Jun 2007 00:14:41 +0000 (00:14 +0000)]
Maintain DFS number in DomTreeNode itself.
This means now ETNodes are not useful anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37546 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd and use DominatorTreeBase::findNearestCommonDominator().
Devang Patel [Mon, 11 Jun 2007 23:31:22 +0000 (23:31 +0000)]
Add and use DominatorTreeBase::findNearestCommonDominator().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37545 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a typo in bswap lowering.
Lauro Ramos Venancio [Mon, 11 Jun 2007 23:16:16 +0000 (23:16 +0000)]
Fix a typo in bswap lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37544 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRestructure code to reduce ifcvt compile time cost.
Evan Cheng [Mon, 11 Jun 2007 22:26:22 +0000 (22:26 +0000)]
Restructure code to reduce ifcvt compile time cost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37543 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSimplify.
Devang Patel [Mon, 11 Jun 2007 21:45:31 +0000 (21:45 +0000)]
Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37542 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agosimplify
Devang Patel [Mon, 11 Jun 2007 21:25:31 +0000 (21:25 +0000)]
simplify

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37541 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSimplify. Dominator Tree is required so always available.
Devang Patel [Mon, 11 Jun 2007 21:18:00 +0000 (21:18 +0000)]
Simplify.  Dominator Tree is required so always available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37540 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoHandle functions with multiple exit blocks properly.
Owen Anderson [Mon, 11 Jun 2007 16:25:17 +0000 (16:25 +0000)]
Handle functions with multiple exit blocks properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37539 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse DominatorTree instead of ETForest.
Devang Patel [Mon, 11 Jun 2007 15:40:48 +0000 (15:40 +0000)]
Use DominatorTree instead of ETForest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37538 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix the build.
Reid Spencer [Sun, 10 Jun 2007 00:19:17 +0000 (00:19 +0000)]
Fix the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37537 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoPerform PRE of comparison operators.
Owen Anderson [Sat, 9 Jun 2007 18:35:31 +0000 (18:35 +0000)]
Perform PRE of comparison operators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37536 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agorename C files to end with .c
Chris Lattner [Sat, 9 Jun 2007 06:10:47 +0000 (06:10 +0000)]
rename C files to end with .c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37535 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofix x86-64 mmx calling convention for real, which passes in integer gprs.
Chris Lattner [Sat, 9 Jun 2007 05:08:10 +0000 (05:08 +0000)]
fix x86-64 mmx calling convention for real, which passes in integer gprs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37534 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofix mmx handling bug
Chris Lattner [Sat, 9 Jun 2007 05:01:50 +0000 (05:01 +0000)]
fix mmx handling bug

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37533 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix edge case.
Nick Lewycky [Sat, 9 Jun 2007 04:20:33 +0000 (04:20 +0000)]
Fix edge case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37532 91177308-0d34-0410-b5e6-96231b3b80d8