Re: [llvm-commits] CVS: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp

2007-05-15 Thread Reid Spencer
On Mon, 2007-05-14 at 23:54 -0700, Chris Lattner wrote:
> > Add a test case for PR1420: http://llvm.org/PR1420
> 
> Further, execution tests should go in llvm-test, not in llvm/test.

I've done this to get it some attention. The corresponding test in
llvm-test has been failing for four months and no one has fixed it. I
don't understand this part of llvm-gcc at all so I thought I'd make a PR
and simplify the test case. 

> 
> -Chris
> 
> >
> > ---
> > Diffs of the changes:  (+35 -0)
> >
> >  2007-05-15-FieldAccess.cpp |   35 +++
> >  1 files changed, 35 insertions(+)
> >
> >
> > Index: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp
> > diff -c /dev/null llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp:1.1
> > *** /dev/null   Tue May 15 01:52:25 2007
> > --- llvm/test/C++Frontend/2007-05-15-FieldAccess.cppTue May 15  
> > 01:52:15 2007
> > ***
> > *** 0 
> > --- 1,35 
> > + // Test case for PR1420
> > + // RUN: %llvmgxx %s -O0 -o %t.exe
> > + // RUN: %t.exe > %t.out
> > + // RUN: grep {sizeof(bitFieldStruct) == 8} %t.out
> > + // RUN: grep {Offset bitFieldStruct.i = 0} %t.out
> > + // RUN: grep {Offset bitFieldStruct.c2 = 7} %t.out
> > + // XFAIL: *
> > +
> > + #include 
> > +
> > + class bitFieldStruct {
> > +   public:
> > + int i;
> > + unsigned char c:7;
> > + int s:17;
> > + char c2;
> > + };
> > +
> > + int main()
> > + {
> > +   printf("sizeof(bitFieldStruct) == %d\n", sizeof(bitFieldStruct));
> > +
> > +   if (sizeof(bitFieldStruct) != 2 * sizeof(int))
> > + printf("bitFieldStruct should be %d but is %d \n",
> > + 2 * sizeof(int), sizeof(bitFieldStruct));
> > +
> > +   bitFieldStruct x;
> > +
> > +   char* xip = (char*) &x.i;
> > +   char* xc2p = (char*) &x.c2;
> > +   printf("Offset bitFieldStruct.i = %d\n", xip - xip);
> > +   printf("Offset bitFieldStruct.c2 = %d\n", xc2p - xip);
> > +
> > +   return 0;
> > + }
> >
> >
> >
> > ___
> > llvm-commits mailing list
> > llvm-commits@cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp

2007-05-15 Thread Chris Lattner

On May 15, 2007, at 12:00 AM, Reid Spencer wrote:

> On Mon, 2007-05-14 at 23:54 -0700, Chris Lattner wrote:
>>> Add a test case for PR1420: http://llvm.org/PR1420
>>
>> Further, execution tests should go in llvm-test, not in llvm/test.
>
> I've done this to get it some attention. The corresponding test in
> llvm-test has been failing for four months and no one has fixed it. I
> don't understand this part of llvm-gcc at all so I thought I'd make  
> a PR
> and simplify the test case.

Both are appreciated very much, but please attach the testcase to the  
bugzilla, instead of checking it in as an xfail.

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp

2007-05-15 Thread Evan Cheng

On May 14, 2007, at 10:57 PM, Chris Lattner wrote:

>> PredicateOperand related bug fix.
>> @@ -2899,7 +2901,7 @@
>>else if (NodeHasOptInFlag)
>>  EndAdjust = "-(HasInFlag?1:0)"; // May have a flag.
>>
>> -  emitCode("for (unsigned i = " + utostr(NumInputs) +
>> +  emitCode("for (unsigned i = " + utostr(NumInputs -
>> NumEAInputs) +
>> ", e = N.getNumOperands()" + EndAdjust + "; i !
>> = e; ++i) {");
>>
>
> Out of curiousity, why is this needed?  Did you hit a bug with
> something when it got selected?

Yes.

>   If the bug was with ISD::Constant's,
> this is a serious bug and this is not the right fix.

Huh? It has nothing to do with ISD::Constants. Remember  
PredicateOperand with ExecuteAlways value is not part of the target  
independent DAG.  So something like this:

def BL : I<(ops i32imm:$func, pred:$p, variable_ops), ...>

The input node should have 2 operands (plus one if it has the  
optional flag) plus the variable ops. The emit code has like this:

   for (unsigned i = 2, e = N.getNumOperands()-(HasInFlag?1:0); i !=  
e; ++i) {
 AddToISelQueue(N.getOperand(i));
 Ops0.push_back(N.getOperand(i));
   }

If we don't discount NumEAInputs (i.e. 1 in this case, to account for  
the single ExecuteAlways value), i's starting value is 3 and that's bad.

Evan

>
> -Chris
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/ReleaseNotes.html

2007-05-15 Thread Nicolas Geoffray


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.375 -> 1.376
---
Log message:

Note on current implementation of ELF32/PPC ABI.



---
Diffs of the changes:  (+3 -1)

 ReleaseNotes.html |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.375 llvm/docs/ReleaseNotes.html:1.376
--- llvm/docs/ReleaseNotes.html:1.375   Mon May 14 01:56:09 2007
+++ llvm/docs/ReleaseNotes.html Tue May 15 04:21:28 2007
@@ -285,6 +285,8 @@
 
 http://llvm.org/PR642";>PowerPC backend does not correctly
 implement ordered FP comparisons.
+The Linux PPC32/ABI support needs testing for the interpreter and static
+compilation, and lacks Dwarf debugging informations.
 
 
 
@@ -608,7 +610,7 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!" />
 
   http://llvm.org/";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/14 06:56:09 $
+  Last modified: $Date: 2007/05/15 09:21:28 $
 
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp

2007-05-15 Thread Duncan Sands


Changes in directory llvm/lib/CodeGen:

DwarfWriter.cpp updated: 1.144 -> 1.145
---
Log message:

The index into the actions table is a ULEB128 not a SLEB128.


---
Diffs of the changes:  (+1 -1)

 DwarfWriter.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.144 
llvm/lib/CodeGen/DwarfWriter.cpp:1.145
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.144  Sun May 13 12:30:11 2007
+++ llvm/lib/CodeGen/DwarfWriter.cppTue May 15 08:54:14 2007
@@ -2975,7 +2975,7 @@
   SizeSites += M*(sizeof(int32_t) +   // Site start.
   sizeof(int32_t) +   // Site length.
   sizeof(int32_t) +   // Landing pad.
-  Asm->SizeSLEB128(FirstAction)); // Action.
+  Asm->SizeULEB128(FirstAction)); // Action.
 }
 
 // Final tallies.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp

2007-05-15 Thread LLVM


Changes in directory llvm/test/C++Frontend:

2007-05-15-FieldAccess.cpp (r1.1) removed
---
Log message:

Don't put test cases into regression test suite before the bug is fixed.


---
Diffs of the changes:  (+0 -0)

 0 files changed



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-05-15-InfiniteRecursion.ll

2007-05-15 Thread Lauro Ramos Venancio


Changes in directory llvm/test/CodeGen/Generic:

2007-05-15-InfiniteRecursion.ll added (r1.1)
---
Log message:

Fix an infinite recursion in GetNegatedExpression.


---
Diffs of the changes:  (+90 -0)

 2007-05-15-InfiniteRecursion.ll |   90 
 1 files changed, 90 insertions(+)


Index: llvm/test/CodeGen/Generic/2007-05-15-InfiniteRecursion.ll
diff -c /dev/null llvm/test/CodeGen/Generic/2007-05-15-InfiniteRecursion.ll:1.1
*** /dev/null   Tue May 15 12:05:53 2007
--- llvm/test/CodeGen/Generic/2007-05-15-InfiniteRecursion.ll   Tue May 15 
12:05:43 2007
***
*** 0 
--- 1,90 
+ ; RUN: llvm-as < %s | llc
+ 
+   %struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* }
+   %struct.AVCodec = type { i8*, i32, i32, i32, i32 
(%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32, i8*)*, i32 
(%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32*, i8*, 
i32)*, i32, %struct.AVCodec*, void (%struct.AVCodecContext*)*, 
%struct.AVRational*, i32* }
+   %struct.AVCodecContext = type { %struct.AVClass*, i32, i32, i32, i32, 
i32, i8*, i32, %struct.AVRational, i32, i32, i32, i32, i32, void 
(%struct.AVCodecContext*, %struct.AVFrame*, i32*, i32, i32, i32)*, i32, i32, 
i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, 
i32, %struct.AVCodec*, i8*, i32, i32, void (%struct.AVCodecContext*, i8*, i32, 
i32)*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, [32 x i8], i32, i32, 
i32, i32, i32, i32, i32, float, i32, i32 (%struct.AVCodecContext*, 
%struct.AVFrame*)*, void (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, 
i32, i32, i32, i8*, i8*, float, float, i32, %struct.RcOverride*, i32, i8*, i32, 
i32, i32, float, float, float, float, i32, float, float, float, float, float, 
i32, i32, i32, i32*, i32, i32, i32, i32, %struct.AVRational, %struct.AVFrame*, 
i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 
i32, i32 (%struct.AVCodecContext*, i32*)*, i32, i32, i32, i32, i32, i32, i8*, 
i32, i3!
 2, i32, i32, i32, i32, i16*, i16*, i32, i32, i32, i32, 
%struct.AVPaletteControl*, i32, i32 (%struct.AVCodecContext*, 
%struct.AVFrame*)*, i32, i32, i32, i32, i32, i32, i32, i32 
(%struct.AVCodecContext*, i32 (%struct.AVCodecContext*, i8*)*, i8**, i32*, 
i32)*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 
i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, 
i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 
i32, i32, i32, i32, i32, i64 }
+   %struct.AVEvalExpr = type opaque
+   %struct.AVFrame = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, 
i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, 
[4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x 
i8*] }
+   %struct.AVOption = type opaque
+   %struct.AVPaletteControl = type { i32, [256 x i32] }
+   %struct.AVPanScan = type { i32, i32, i32, [3 x [2 x i16]] }
+   %struct.AVRational = type { i32, i32 }
+   %struct.DSPContext = type { void (i16*, i8*, i32)*, void (i16*, i8*, 
i8*, i32)*, void (i16*, i8*, i32)*, void (i16*, i8*, i32)*, void (i16*, i8*, 
i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i8*, i32, 
i32, i32, i32, i32)*, void (i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, 
i32, i32, i32, i32)*, void (i16*)*, i32 (i8*, i32)*, i32 (i8*, i32)*, [5 x i32 
(i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 
(i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 
(i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 
(i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 
(i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 
(i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 
(i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 
(i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32!
  (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 
(i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], i32 (i8*, 
i16*, i32)*, [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, 
i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, 
i32, i32)*]], [2 x void (i8*, i8*, i8*, i32, i32)*], [11 x void (i8*, i8*, i32, 
i32, i32)*], [11 x void (i8*, i8*, i32, i32, i32)*], [2 x [16 x void (i8*, i8*, 
i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, 
i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [8 x void (i8*, i8*, i32)*], [3 x 
void (i8*, i8*, i32, i32, i32, i32)*], [3 x void (i8*, i8*, i32, i32, i32, 
i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [4 x [16 x void (i8*, i8*, 
i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, 
i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [10 x void

[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

2007-05-15 Thread Lauro Ramos Venancio


Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.303 -> 1.304
---
Log message:

Fix an infinite recursion in GetNegatedExpression.


---
Diffs of the changes:  (+1 -1)

 DAGCombiner.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.303 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.304
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.303 Mon May 14 17:04:50 2007
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp   Tue May 15 12:05:43 2007
@@ -449,7 +449,7 @@
   case ISD::FP_ROUND:
   case ISD::FSIN:
 return DAG.getNode(Op.getOpcode(), Op.getValueType(),
-   GetNegatedExpression(Op, DAG));
+   GetNegatedExpression(Op.getOperand(0), DAG));
   }
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

2007-05-15 Thread Chris Lattner
> Fix an infinite recursion in GetNegatedExpression.

Doh, thanks a lot Lauro!

-Chris

>
>
> ---
> Diffs of the changes:  (+1 -1)
>
>  DAGCombiner.cpp |2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
>
>
> Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
> diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.303 llvm/ 
> lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.304
> --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.303   Mon May 14  
> 17:04:50 2007
> +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue May 15  
> 12:05:43 2007
> @@ -449,7 +449,7 @@
>case ISD::FP_ROUND:
>case ISD::FSIN:
>  return DAG.getNode(Op.getOpcode(), Op.getValueType(),
> -   GetNegatedExpression(Op, DAG));
> +   GetNegatedExpression(Op.getOperand(0), DAG));
>}
>  }
>
>
>
>
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp

2007-05-15 Thread Chris Lattner
>>   If the bug was with ISD::Constant's,
>> this is a serious bug and this is not the right fix.
>
> Huh? It has nothing to do with ISD::Constants. Remember
> PredicateOperand with ExecuteAlways value is not part of the target
> independent DAG.  So something like this:
>
> def BL : I<(ops i32imm:$func, pred:$p, variable_ops), ...>
>
> The input node should have 2 operands (plus one if it has the
> optional flag) plus the variable ops. The emit code has like this:
>
>for (unsigned i = 2, e = N.getNumOperands()-(HasInFlag?1:0); i !=
> e; ++i) {
>  AddToISelQueue(N.getOperand(i));
>  Ops0.push_back(N.getOperand(i));
>}
>
> If we don't discount NumEAInputs (i.e. 1 in this case, to account for
> the single ExecuteAlways value), i's starting value is 3 and that's  
> bad.

Ahhh, so you're trying to avoid stepping on operands that don't  
exist... you're not trying to avoid selecting some operands that do  
exist?  If so, that makes sense :)

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CFrontend/nested-functions.c

2007-05-15 Thread Chris Lattner


Changes in directory llvm/test/CFrontend:

nested-functions.c added (r1.1)
---
Log message:

new testcase


---
Diffs of the changes:  (+10 -0)

 nested-functions.c |   10 ++
 1 files changed, 10 insertions(+)


Index: llvm/test/CFrontend/nested-functions.c
diff -c /dev/null llvm/test/CFrontend/nested-functions.c:1.1
*** /dev/null   Tue May 15 15:30:07 2007
--- llvm/test/CFrontend/nested-functions.c  Tue May 15 15:29:56 2007
***
*** 0 
--- 1,10 
+ // RUN: %llvmgcc -S %s -o -  -fnested-functions
+ void Bork() {
+   void Fork(const int *src, int size) {
+ int i = 1;
+ int x;
+ 
+ while (i < size)
+   x = src[i];
+   }
+ }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [127290] Fix a bug handling nested functions, due to LLVM' s handled_component_p working

2007-05-15 Thread clattner
Revision: 127290
Author:   clattner
Date: 2007-05-15 13:30:21 -0700 (Tue, 15 May 2007)

Log Message:
---
Fix a bug handling nested functions, due to LLVM's handled_component_p working
a bit differently.  This fixes an infinite recursion on
test/CFrontend/nested-functions.c

Modified Paths:
--
apple-local/branches/llvm/gcc/tree-nested.c

Modified: apple-local/branches/llvm/gcc/tree-nested.c
===
--- apple-local/branches/llvm/gcc/tree-nested.c 2007-05-15 17:00:03 UTC (rev 
127289)
+++ apple-local/branches/llvm/gcc/tree-nested.c 2007-05-15 20:30:21 UTC (rev 
127290)
@@ -882,7 +882,15 @@
 of whether a NOP_EXPR or VIEW_CONVERT_EXPR needs a simple value.  */
   wi->val_only = true;
   wi->is_lhs = false;
+  /* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+  /* Support the "array ref with pointer base" extension. */
+  for (; handled_component_p (t) || TREE_CODE(t) == ARRAY_REF;
+   tp = &TREE_OPERAND (t, 0), t = *tp)
+#else
   for (; handled_component_p (t); tp = &TREE_OPERAND (t, 0), t = *tp)
+#endif
+  /* APPLE LOCAL end LLVM */
{
  if (TREE_CODE (t) == COMPONENT_REF)
walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference, wi,
@@ -1017,7 +1025,16 @@
   save_val_only = wi->val_only;
   wi->val_only = true;
   wi->is_lhs = false;
+  
+  /* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+  /* Support the "array ref with pointer base" extension. */
+  for (; handled_component_p (t) || TREE_CODE(t) == ARRAY_REF;
+   tp = &TREE_OPERAND (t, 0), t = *tp)
+#else
   for (; handled_component_p (t); tp = &TREE_OPERAND (t, 0), t = *tp)
+#endif
+  /* APPLE LOCAL end LLVM */
{
  if (TREE_CODE (t) == COMPONENT_REF)
walk_tree (&TREE_OPERAND (t, 2), convert_local_reference, wi,


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CFrontend/nested-functions.c

2007-05-15 Thread Chris Lattner


Changes in directory llvm/test/CFrontend:

nested-functions.c updated: 1.1 -> 1.2
---
Log message:

add PR number and testcase from the PR.


---
Diffs of the changes:  (+8 -0)

 nested-functions.c |8 
 1 files changed, 8 insertions(+)


Index: llvm/test/CFrontend/nested-functions.c
diff -u llvm/test/CFrontend/nested-functions.c:1.1 
llvm/test/CFrontend/nested-functions.c:1.2
--- llvm/test/CFrontend/nested-functions.c:1.1  Tue May 15 15:29:56 2007
+++ llvm/test/CFrontend/nested-functions.c  Tue May 15 15:40:25 2007
@@ -1,4 +1,6 @@
 // RUN: %llvmgcc -S %s -o -  -fnested-functions
+// PR1274
+
 void Bork() {
   void Fork(const int *src, int size) {
 int i = 1;
@@ -8,3 +10,9 @@
   x = src[i];
   }
 }
+
+void foo(void *a){
+  inline void foo_bar() {
+a += 1;
+  }
+}



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp

2007-05-15 Thread Dale Johannesen


Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.52 -> 1.53
---
Log message:

Remove extra CFG edges before doing these passes; it makes them happier.


---
Diffs of the changes:  (+16 -1)

 BranchFolding.cpp |   17 -
 1 files changed, 16 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.52 
llvm/lib/CodeGen/BranchFolding.cpp:1.53
--- llvm/lib/CodeGen/BranchFolding.cpp:1.52 Thu May 10 18:59:23 2007
+++ llvm/lib/CodeGen/BranchFolding.cpp  Tue May 15 16:19:17 2007
@@ -73,6 +73,12 @@
   char BranchFolder::ID = 0;
 }
 
+static bool CorrectExtraCFGEdges(MachineBasicBlock &MBB, 
+ MachineBasicBlock *DestA,
+ MachineBasicBlock *DestB,
+ bool isCond, 
+ MachineFunction::iterator FallThru);
+
 FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); }
 
 /// RemoveDeadBlock - Remove the specified dead machine basic block from the
@@ -106,12 +112,21 @@
   TII = MF.getTarget().getInstrInfo();
   if (!TII) return false;
 
+  // Fix CFG.  The later algorithms expect it to be right.
+  bool EverMadeChange = false;
+  for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; I++) {
+MachineBasicBlock *MBB = I, *TBB = 0, *FBB = 0;
+std::vector Cond;
+if (!TII->AnalyzeBranch(*MBB, TBB, FBB, Cond))
+  EverMadeChange |= CorrectExtraCFGEdges(*MBB, TBB, FBB, 
+!Cond.empty(), next(I));
+  }
+
   RegInfo = MF.getTarget().getRegisterInfo();
   RS = RegInfo->requiresRegisterScavenging(MF) ? new RegScavenger() : NULL;
 
   MMI = getAnalysisToUpdate();
 
-  bool EverMadeChange = false;
   bool MadeChangeThisIteration = true;
   while (MadeChangeThisIteration) {
 MadeChangeThisIteration = false;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-05-15 Thread Jeff Cohen


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.140 -> 1.141
---
Log message:

I won't be able to attend.

---
Diffs of the changes:  (+4 -10)

 DevMtgMay2007.html |   14 --
 1 files changed, 4 insertions(+), 10 deletions(-)


Index: llvm-www/DevMtgMay2007.html
diff -u llvm-www/DevMtgMay2007.html:1.140 llvm-www/DevMtgMay2007.html:1.141
--- llvm-www/DevMtgMay2007.html:1.140   Mon May 14 16:14:57 2007
+++ llvm-www/DevMtgMay2007.html Tue May 15 17:29:06 2007
@@ -144,15 +144,10 @@
 brief introduction to some of the novel security capabilities that our
  architecture can enable.
 
-14:1014:30Jeff Cohen
-  Using LLVM For The Jolt Compiler. Jeff will share his
-experiences in using the LLVM Compiler Infrastructure as the basis for
-the Jolt Language's compiler.
-
-14:3015:00Steve Naroff
+14:1014:40Steve Naroff
   Objective-C. Improvements to the Objective-C front end.
 
-Break15:0015:30Everyone
+Break14:4015:30Everyone
   Inter-session afternoon break (yes, napping's allowed at this one).
   
 
@@ -288,7 +283,6 @@
 Owen AndersonIndependent
 Ryan BrownGoogle
 Evan ChengApple Inc.
-Jeff CohenIndependent
 Josh ConnerApple Inc.
 John CriswellUIUC
 Mike EnglerAdobe Systems Incorporated.
@@ -338,7 +332,7 @@
   
 
   
-  Total confirmed: 45
+  Total confirmed: 44
   
 Unconfirmed Attendees
 NameOrganization
@@ -357,6 +351,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/05/14 21:14:57 $
+Last modified: $Date: 2007/05/15 22:29:06 $
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/developers.txt

2007-05-15 Thread Reid Spencer


Changes in directory llvm-www:

developers.txt updated: 1.13 -> 1.14
---
Log message:

Add Rafael.


---
Diffs of the changes:  (+1 -0)

 developers.txt |1 +
 1 files changed, 1 insertion(+)


Index: llvm-www/developers.txt
diff -u llvm-www/developers.txt:1.13 llvm-www/developers.txt:1.14
--- llvm-www/developers.txt:1.13Mon Apr  2 11:54:45 2007
+++ llvm-www/developers.txt Tue May 15 17:52:47 2007
@@ -7,6 +7,7 @@
 Evan   Cheng   href=mailto:[EMAIL PROTECTED]   img=PhotoEvan.jpg   
width=152   height=198  alt=Grawp
 Jeff   Cohen   href=http://jolt-lang.org/  img=PhotoJeffCohen.jpg  
width=165   height=134  alt=jeffc
 John   Criswellhref=http://www.bigw.org/~jcriswel/ 
img=PhotoJohn.gif   width=76height=76   alt=Dogbert
+Rafael  Espindola   href=mailto:[EMAIL PROTECTED]  img=PhotoRafael.jpg 
width=174   height=200  alt=Rafael
 Alkis  Evlogimenos href=http://alkis.evlogimenos.com   
img=PhotoAlkis.jpg  width=200   height=170  alt=alkis
 Brian  Gaeke   href=http://netfiles.uiuc.edu/gaeke/www/
img=PhotoBrian.png  width=155   height=163  alt=brg
 PatrickJenkins href=http://www.patjenk.comimg=PhotoPatJenk.jpg 
width=200  width=173  height=130  alt=PatJenk



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/img/PhotoRafael.jpg

2007-05-15 Thread Reid Spencer


Changes in directory llvm-www/img:

PhotoRafael.jpg added (r1.1)
---
Log message:

Add Rafael.


---
Diffs of the changes:  (+0 -0)

 PhotoRafael.jpg |0 
 1 files changed


Index: llvm-www/img/PhotoRafael.jpg



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-05-15 Thread Reid Spencer


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.141 -> 1.142
---
Log message:

Confirm Lang Hames.


---
Diffs of the changes:  (+4 -4)

 DevMtgMay2007.html |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm-www/DevMtgMay2007.html
diff -u llvm-www/DevMtgMay2007.html:1.141 llvm-www/DevMtgMay2007.html:1.142
--- llvm-www/DevMtgMay2007.html:1.141   Tue May 15 17:29:06 2007
+++ llvm-www/DevMtgMay2007.html Tue May 15 18:06:45 2007
@@ -291,6 +291,7 @@
 Han GaoAdobe Systems Incorporated.
 Dan GohmanCray Inc.
 Stuart HastingsApple Inc.
+Lang HamesUniversity of Sydney
 Robert HundtGoogle
 Dale JohannesenApple Inc.
 Christopher LambAgeia Technologies, Inc.
@@ -332,16 +333,15 @@
   
 
   
-  Total confirmed: 44
+  Total confirmed: 45
   
 Unconfirmed Attendees
 NameOrganization
-Lang HamesUniversity of Sydney
 Michael McCrackenUCSD, Ph.D. Candidate
 Kelly WilsonUniversity of Calgary
 Unconfirmed 1NASA, Ames
   
-  Total unconfirmed: 4
+  Total unconfirmed: 3
 
 
 
@@ -351,6 +351,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/05/15 22:29:06 $
+Last modified: $Date: 2007/05/15 23:06:45 $
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CFrontend/2007-05-15-PaddingElement.c

2007-05-15 Thread Devang Patel


Changes in directory llvm/test/CFrontend:

2007-05-15-PaddingElement.c added (r1.1)
---
Log message:

New test.


---
Diffs of the changes:  (+23 -0)

 2007-05-15-PaddingElement.c |   23 +++
 1 files changed, 23 insertions(+)


Index: llvm/test/CFrontend/2007-05-15-PaddingElement.c
diff -c /dev/null llvm/test/CFrontend/2007-05-15-PaddingElement.c:1.1
*** /dev/null   Tue May 15 18:44:37 2007
--- llvm/test/CFrontend/2007-05-15-PaddingElement.c Tue May 15 18:44:27 2007
***
*** 0 
--- 1,23 
+ // PR 1419
+ 
+ // RUN: %llvmgcc -xc  -O2 %s -c -o - | llvm-dis | grep "ret i32 1"
+ struct A {
+   short x;
+   long long :0;
+ };
+ 
+ struct B {
+   char a;
+   char b;
+   unsigned char i;
+ };
+ 
+ union X { struct A a; struct B b; };
+ 
+ int check(void) {
+   union X x, y;
+ 
+   y.b.i = 0xff;
+   x = y;
+   return (x.b.i == 0xff);
+ }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [127292] Fix PR 1419

2007-05-15 Thread dpatel
Revision: 127292
Author:   dpatel
Date: 2007-05-15 16:46:37 -0700 (Tue, 15 May 2007)

Log Message:
---
Fix PR 1419
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070514/049641.html

Modified Paths:
--
apple-local/branches/llvm/gcc/llvm-types.cpp

Modified: apple-local/branches/llvm/gcc/llvm-types.cpp
===
--- apple-local/branches/llvm/gcc/llvm-types.cpp2007-05-15 23:37:35 UTC 
(rev 127291)
+++ apple-local/branches/llvm/gcc/llvm-types.cpp2007-05-15 23:46:37 UTC 
(rev 127292)
@@ -1245,6 +1245,29 @@
   return Info->PaddingElement[index];
 }
 
+/// OldTy and NewTy are union members. If they are representing
+/// structs then adjust their PaddingElement bits. Padding
+/// field in one struct may not be a padding field in another
+/// struct.
+void adjustPaddingElement(const Type *OldTy, const Type *NewTy) {
+
+  StructTypeConversionInfo *OldInfo = StructTypeInfoMap[OldTy];
+  StructTypeConversionInfo *NewInfo = StructTypeInfoMap[NewTy];
+
+  if (!OldInfo || !NewInfo)
+return;
+
+  /// FIXME : Find overlapping padding fields and preserve their
+  /// isPaddingElement bit. For now, clear all isPaddingElement bits.
+  for (unsigned i = 0, size =  NewInfo->PaddingElement.size(); i != size; ++i)
+NewInfo->PaddingElement[i] = false;
+
+  for (unsigned i = 0, size =  OldInfo->PaddingElement.size(); i != size; ++i)
+OldInfo->PaddingElement[i] = false;
+
+}
+
+
 /// getFieldOffsetInBits - Return the offset (in bits) of a FIELD_DECL in a
 /// structure.
 static unsigned getFieldOffsetInBits(tree Field) {
@@ -1606,6 +1629,7 @@
 const Type *TheTy = ConvertType(TREE_TYPE(Field));
 unsigned Size = TD.getTypeSize(TheTy);
 unsigned Align = TD.getABITypeAlignment(TheTy);
+adjustPaddingElement(UnionTy, TheTy);
 if (UnionTy == 0 || Align > MaxAlign 
 || (MaxAlign == Align && Size > MaxSize)) {
   UnionTy = TheTy;


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/DevMtgMay2007.html

2007-05-15 Thread Reid Spencer


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.142 -> 1.143
---
Log message:

Seriously, I do know how to alphabetize if I'm not rushed to go out the door.


---
Diffs of the changes:  (+2 -2)

 DevMtgMay2007.html |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm-www/DevMtgMay2007.html
diff -u llvm-www/DevMtgMay2007.html:1.142 llvm-www/DevMtgMay2007.html:1.143
--- llvm-www/DevMtgMay2007.html:1.142   Tue May 15 18:06:45 2007
+++ llvm-www/DevMtgMay2007.html Tue May 15 20:18:09 2007
@@ -290,8 +290,8 @@
 Tomas EvensenWind River
 Han GaoAdobe Systems Incorporated.
 Dan GohmanCray Inc.
-Stuart HastingsApple Inc.
 Lang HamesUniversity of Sydney
+Stuart HastingsApple Inc.
 Robert HundtGoogle
 Dale JohannesenApple Inc.
 Christopher LambAgeia Technologies, Inc.
@@ -351,6 +351,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/05/15 23:06:45 $
+Last modified: $Date: 2007/05/16 01:18:09 $
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h

2007-05-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/Target:

TargetInstrInfo.h updated: 1.115 -> 1.116
---
Log message:

Add TargetInstrInfo predication hooks.

---
Diffs of the changes:  (+14 -0)

 TargetInstrInfo.h |   14 ++
 1 files changed, 14 insertions(+)


Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.115 
llvm/include/llvm/Target/TargetInstrInfo.h:1.116
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.115Mon May 14 20:21:27 2007
+++ llvm/include/llvm/Target/TargetInstrInfo.h  Tue May 15 20:58:56 2007
@@ -383,6 +383,20 @@
 abort();
   }
 
+  /// isPredicatable - True if the instruction can be converted into a
+  /// predicated instruction.
+  virtual bool isPredicatable(MachineInstr *MI) const {
+return false;
+  }
+
+  /// PredicateInstruction - Convert the instruction into a predicated
+  /// instruction.
+  virtual void PredicateInstruction(MachineInstr *MI,
+std::vector &Cond) const {
+assert(0 && "Target didn't implement PredicateInstruction!");
+abort();
+  }
+
   /// getPointerRegClass - Returns a TargetRegisterClass used for pointer
   /// values.
   virtual const TargetRegisterClass *getPointerRegClass() const {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/CodeGen/Passes.h

2007-05-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/CodeGen:

Passes.h updated: 1.24 -> 1.25
---
Log message:

Initial commit of (very basic) if converter.

---
Diffs of the changes:  (+3 -0)

 Passes.h |3 +++
 1 files changed, 3 insertions(+)


Index: llvm/include/llvm/CodeGen/Passes.h
diff -u llvm/include/llvm/CodeGen/Passes.h:1.24 
llvm/include/llvm/CodeGen/Passes.h:1.25
--- llvm/include/llvm/CodeGen/Passes.h:1.24 Wed Nov 29 01:31:23 2006
+++ llvm/include/llvm/CodeGen/Passes.h  Tue May 15 21:00:02 2007
@@ -81,6 +81,9 @@
   /// branches.
   FunctionPass *createBranchFoldingPass();
 
+  /// IfConverter Pass - This pass performs machine code if conversion.
+  FunctionPass *createIfConverterPass();
+
   /// DebugLabelFoldingPass - This pass prunes out redundant debug labels.  
This
   /// allows a debug emitter to determine if the range of two labels is empty,
   /// by seeing if the labels map to the same reduced label.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp

2007-05-15 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen:

IfConversion.cpp added (r1.1)
---
Log message:

Initial commit of (very basic) if converter.

---
Diffs of the changes:  (+304 -0)

 IfConversion.cpp |  304 +++
 1 files changed, 304 insertions(+)


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -c /dev/null llvm/lib/CodeGen/IfConversion.cpp:1.1
*** /dev/null   Tue May 15 21:01:07 2007
--- llvm/lib/CodeGen/IfConversion.cpp   Tue May 15 21:00:57 2007
***
*** 0 
--- 1,304 
+ //===-- IfConversion.cpp - Machine code if conversion pass. 
---===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by the Evan Cheng and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for 
details.
+ //
+ 
//===--===//
+ //
+ // This file implements the machine instruction level if-conversion pass.
+ //
+ 
//===--===//
+ 
+ #define DEBUG_TYPE "ifconversion"
+ #include "llvm/CodeGen/Passes.h"
+ #include "llvm/CodeGen/MachineModuleInfo.h"
+ #include "llvm/CodeGen/MachineFunctionPass.h"
+ #include "llvm/Target/TargetInstrInfo.h"
+ #include "llvm/Target/TargetMachine.h"
+ #include "llvm/Support/Debug.h"
+ #include "llvm/ADT/Statistic.h"
+ using namespace llvm;
+ 
+ STATISTIC(NumIfConvBBs, "Number of if-converted blocks");
+ 
+ namespace {
+   class IfConverter : public MachineFunctionPass {
+ enum BBICKind {
+   ICInvalid,   // BB data invalid.
+   ICNotClassfied,  // BB data valid, but not classified.
+   ICTriangle,  // BB is part of a triangle sub-CFG.
+   ICDiamond,   // BB is part of a diamond sub-CFG.
+   ICTriangleEntry, // BB is entry of a triangle sub-CFG.
+   ICDiamondEntry   // BB is entry of a diamond sub-CFG.
+ };
+ 
+ /// BBInfo - One per MachineBasicBlock, this is used to cache the result
+ /// if-conversion feasibility analysis. This includes results from
+ /// TargetInstrInfo::AnalyzeBranch() (i.e. TBB, FBB, and Cond), and its
+ /// classification, and common merge block of its successors (if it's a
+ /// diamond shape).
+ struct BBInfo {
+   BBICKind Kind;
+   MachineBasicBlock *EBB;
+   MachineBasicBlock *TBB;
+   MachineBasicBlock *FBB;
+   MachineBasicBlock *CMBB;
+   std::vector Cond;
+   BBInfo() : Kind(ICInvalid), EBB(0), TBB(0), FBB(0), CMBB(0) {}
+ };
+ 
+ /// BBAnalysis - Results of if-conversion feasibility analysis indexed by
+ /// basic block number.
+ std::vector BBAnalysis;
+ 
+ const TargetInstrInfo *TII;
+ bool MadeChange;
+   public:
+ static char ID;
+ IfConverter() : MachineFunctionPass((intptr_t)&ID) {}
+ 
+ virtual bool runOnMachineFunction(MachineFunction &MF);
+ virtual const char *getPassName() const { return "If converter"; }
+ 
+   private:
+ void AnalyzeBlock(MachineBasicBlock *BB);
+ void InitialFunctionAnalysis(MachineFunction &MF,
+  std::vector &Candidates);
+ bool IfConvertDiamond(BBInfo &BBI);
+ bool IfConvertTriangle(BBInfo &BBI);
+ bool isBlockPredicatable(MachineBasicBlock *BB,
+  bool IgnoreTerm = false) const;
+ void PredicateBlock(MachineBasicBlock *BB,
+ std::vector &Cond,
+ bool IgnoreTerm = false);
+ void MergeBlocks(MachineBasicBlock *TBB, MachineBasicBlock *FBB);
+   };
+   char IfConverter::ID = 0;
+ }
+ 
+ FunctionPass *llvm::createIfConverterPass() { return new IfConverter(); }
+ 
+ bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
+   TII = MF.getTarget().getInstrInfo();
+   if (!TII) return false;
+ 
+   MadeChange = false;
+ 
+   MF.RenumberBlocks();
+   unsigned NumBBs = MF.getNumBlockIDs();
+   BBAnalysis.resize(NumBBs);
+ 
+   std::vector Candidates;
+   // Do an intial analysis for each basic block and finding all the potential
+   // candidates to perform if-convesion.
+   InitialFunctionAnalysis(MF, Candidates);
+ 
+   for (unsigned i = 0, e = Candidates.size(); i != e; ++i) {
+ BBInfo &BBI = BBAnalysis[i];
+ switch (BBI.Kind) {
+ default: assert(false && "Unexpected!");
+   break;
+ case ICTriangleEntry:
+   MadeChange |= IfConvertTriangle(BBI);
+   break;
+ case ICDiamondEntry:
+   MadeChange |= IfConvertDiamond(BBI);
+   break;
+ }
+   }
+   return MadeChange;
+ }
+ 
+ static MachineBasicBlock *findFalseBlock(MachineBasicBlock *BB,
+  MachineBasicBlock *TBB) {
+   for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
+  E = BB->succ_end(); SI != E; ++SI) {
+ MachineBasicBlock *SuccBB = *SI;
+ if (SuccBB != TBB)
+   return SuccBB;
+   }
+   return NULL;
+ }
+ 
+ void IfConverter::

[llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.cpp ARMInstrInfo.h ARMTargetMachine.cpp ARMTargetMachine.h

2007-05-15 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMInstrInfo.cpp updated: 1.24 -> 1.25
ARMInstrInfo.h updated: 1.7 -> 1.8
ARMTargetMachine.cpp updated: 1.26 -> 1.27
ARMTargetMachine.h updated: 1.9 -> 1.10
---
Log message:

Hooks for predication support.

---
Diffs of the changes:  (+39 -0)

 ARMInstrInfo.cpp |   22 ++
 ARMInstrInfo.h   |5 +
 ARMTargetMachine.cpp |   11 +++
 ARMTargetMachine.h   |1 +
 4 files changed, 39 insertions(+)


Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp
diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.24 
llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.25
--- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.24   Mon May 14 20:29:07 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.cppTue May 15 21:01:49 2007
@@ -423,6 +423,28 @@
   return false;
 }
 
+bool ARMInstrInfo::isPredicatable(MachineInstr *MI) const {
+  const TargetInstrDescriptor *TID = MI->getInstrDescriptor();
+  if (TID->Flags & M_PREDICATED)
+return true;
+
+  unsigned Opc = MI->getOpcode();
+  return Opc == ARM::B || Opc == ARM::tB;
+}
+
+void ARMInstrInfo::PredicateInstruction(MachineInstr *MI,
+  std::vector &Cond) const 
{
+  unsigned Opc = MI->getOpcode();
+  if (Opc == ARM::B || Opc == ARM::tB) {
+MI->setInstrDescriptor(get(Opc == ARM::B ? ARM::Bcc : ARM::tBcc));
+MI->addImmOperand(Cond[0].getImmedValue());
+return;
+  }
+
+  MachineOperand *PMO = MI->findFirstPredOperand();
+  PMO->setImm(Cond[0].getImmedValue());
+}
+
 
 /// FIXME: Works around a gcc miscompilation with -fstrict-aliasing
 static unsigned getNumJTEntries(const std::vector &JT,


Index: llvm/lib/Target/ARM/ARMInstrInfo.h
diff -u llvm/lib/Target/ARM/ARMInstrInfo.h:1.7 
llvm/lib/Target/ARM/ARMInstrInfo.h:1.8
--- llvm/lib/Target/ARM/ARMInstrInfo.h:1.7  Mon Jan 29 17:45:17 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.h  Tue May 15 21:01:49 2007
@@ -102,6 +102,11 @@
 const std::vector &Cond) const;
   virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
   virtual bool ReverseBranchCondition(std::vector &Cond) const;
+
+  // Predication support.
+  virtual bool isPredicatable(MachineInstr *MI) const;
+  virtual void PredicateInstruction(MachineInstr *MI,
+std::vector &Cond) const;
 };
 
   // Utility routines


Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp
diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.26 
llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.27
--- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.26   Mon Mar 12 20:20:42 2007
+++ llvm/lib/Target/ARM/ARMTargetMachine.cppTue May 15 21:01:49 2007
@@ -17,6 +17,7 @@
 #include "ARM.h"
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
+#include "llvm/CodeGen/Passes.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Target/TargetMachineRegistry.h"
 #include "llvm/Target/TargetOptions.h"
@@ -24,6 +25,8 @@
 
 static cl::opt DisableLdStOpti("disable-arm-loadstore-opti", cl::Hidden,
   cl::desc("Disable load store optimization 
pass"));
+static cl::opt EnableIfConversion("enable-arm-if-conversion", cl::Hidden,
+  cl::desc("Enable if-conversion pass"));
 
 namespace {
   // Register the target.
@@ -85,6 +88,14 @@
   return false;
 }
 
+bool ARMTargetMachine::addPostRegAlloc(FunctionPassManager &PM, bool Fast) {
+  if (Fast || !EnableIfConversion || Subtarget.isThumb())
+return false;
+
+  PM.add(createIfConverterPass());
+  return true;
+}
+
 bool ARMTargetMachine::addPreEmitPass(FunctionPassManager &PM, bool Fast) {
   // FIXME: temporarily disabling load / store optimization pass for Thumb 
mode.
   if (!Fast && !DisableLdStOpti && !Subtarget.isThumb())


Index: llvm/lib/Target/ARM/ARMTargetMachine.h
diff -u llvm/lib/Target/ARM/ARMTargetMachine.h:1.9 
llvm/lib/Target/ARM/ARMTargetMachine.h:1.10
--- llvm/lib/Target/ARM/ARMTargetMachine.h:1.9  Mon Mar 12 20:20:42 2007
+++ llvm/lib/Target/ARM/ARMTargetMachine.h  Tue May 15 21:01:49 2007
@@ -53,6 +53,7 @@
   
   // Pass Pipeline Configuration
   virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
+  virtual bool addPostRegAlloc(FunctionPassManager &PM, bool Fast);
   virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
   virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, 
   std::ostream &Out);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

2007-05-15 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.304 -> 1.305
---
Log message:

Bug fix: should check ABI alignment, not pref. alignment.

---
Diffs of the changes:  (+2 -2)

 DAGCombiner.cpp |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.304 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.305
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.304 Tue May 15 12:05:43 2007
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp   Tue May 15 21:04:50 2007
@@ -2685,7 +2685,7 @@
   TLI.isOperationLegal(ISD::LOAD, VT)) {
 LoadSDNode *LN0 = cast(N0);
 unsigned Align = TLI.getTargetMachine().getTargetData()->
-  getPrefTypeAlignment(getTypeForValueType(VT));
+  getABITypeAlignment(getTypeForValueType(VT));
 unsigned OrigAlign = LN0->getAlignment();
 if (Align <= OrigAlign) {
   SDOperand Load = DAG.getLoad(VT, LN0->getChain(), LN0->getBasePtr(),
@@ -3564,7 +3564,7 @@
 unsigned Align = ST->getAlignment();
 MVT::ValueType SVT = Value.getOperand(0).getValueType();
 unsigned OrigAlign = TLI.getTargetMachine().getTargetData()->
-  getPrefTypeAlignment(getTypeForValueType(SVT));
+  getABITypeAlignment(getTypeForValueType(SVT));
 if (Align <= OrigAlign && TLI.isOperationLegal(ISD::STORE, SVT))
   return DAG.getStore(Chain, Value.getOperand(0), Ptr, ST->getSrcValue(),
   ST->getSrcValueOffset());



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp

2007-05-15 Thread Reid Spencer


Changes in directory llvm/lib/ExecutionEngine/Interpreter:

Execution.cpp updated: 1.181 -> 1.182
---
Log message:

Implement printing of instruction result values when debug info is turned
on. This helps to speed up the debugging time by showing computational 
results as the program executes.


---
Diffs of the changes:  (+21 -0)

 Execution.cpp |   21 +
 1 files changed, 21 insertions(+)


Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.181 
llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.182
--- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.181Thu May  3 
22:37:38 2007
+++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp  Tue May 15 21:05:13 2007
@@ -1338,6 +1338,20 @@
   StackFrame.VarArgs.assign(ArgVals.begin()+i, ArgVals.end());
 }
 
+static void PrintGenericValue(const GenericValue &Val, const Type* Ty) {
+  switch (Ty->getTypeID()) {
+default: assert(0 && "Invalid GenericValue Type");
+case Type::VoidTyID:DOUT << "void"; break;
+case Type::FloatTyID:   DOUT << "float " << Val.FloatVal; break;
+case Type::DoubleTyID:  DOUT << "double " << Val.DoubleVal; break;
+case Type::PointerTyID: DOUT << "void* " << unsigned(Val.PointerVal); 
break;
+case Type::IntegerTyID: 
+  DOUT << "i" << Val.IntVal.getBitWidth() << " " << Val.IntVal.toString(10)
+   << "\n";
+  break;
+  }
+}
+
 void Interpreter::run() {
   while (!ECStack.empty()) {
 // Interpret a single instruction & increment the "PC".
@@ -1349,5 +1363,12 @@
 
 DOUT << "About to interpret: " << I;
 visit(I);   // Dispatch to one of the visit* methods...
+#ifndef NDEBUG
+if (!isa(I) && !isa(I) && 
+I.getType() != Type::VoidTy) {
+  DOUT << "  --> ";
+  PrintGenericValue(SF.Values[&I], I.getType());
+}
+#endif
   }
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp

2007-05-15 Thread Devang Patel


On May 15, 2007, at 7:01 PM, Evan Cheng wrote:


+   if (!BBI.FBB)
+ BBI.FBB = findFalseBlock(BB, BBI.TBB);
+   AnalyzeBlock(BBI.FBB);
+   BBInfo &FBBI = BBAnalysis[BBI.FBB->getNumber()];


If findFalseBlock returns NULL then AnalyzeBlock may crash here.

-
Devang___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp

2007-05-15 Thread Evan Cheng

It shouldn't. :-) I am missing an assert.

This check earlier ensures that the block ends with either a  
conditional branch or a conditional branch + a unconditional branch.

  if (TII->AnalyzeBranch(*BB, BBI.TBB, BBI.FBB, BBI.Cond)
  || !BBI.TBB || BBI.Cond.size() == 0)

BBI.FBB is only NULL if it's the former.

The comments in TargetInstrInfo.h is incorrect. I'll fix.

Thanks,

Evan

On May 15, 2007, at 8:07 PM, Devang Patel wrote:



On May 15, 2007, at 7:01 PM, Evan Cheng wrote:


+   if (!BBI.FBB)
+ BBI.FBB = findFalseBlock(BB, BBI.TBB);
+   AnalyzeBlock(BBI.FBB);
+   BBInfo &FBBI = BBAnalysis[BBI.FBB->getNumber()];


If findFalseBlock returns NULL then AnalyzeBlock may crash here.

-
Devang
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h

2007-05-15 Thread Evan Cheng


Changes in directory llvm/include/llvm/Target:

TargetInstrInfo.h updated: 1.116 -> 1.117
---
Log message:

Fix comments.

---
Diffs of the changes:  (+10 -4)

 TargetInstrInfo.h |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.116 
llvm/include/llvm/Target/TargetInstrInfo.h:1.117
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.116Tue May 15 20:58:56 2007
+++ llvm/include/llvm/Target/TargetInstrInfo.h  Wed May 16 00:09:34 2007
@@ -329,10 +329,16 @@
   ///just return false, leaving TBB/FBB null.
   /// 2. If this block ends with only an unconditional branch, it sets TBB to 
be
   ///the destination block.
-  /// 3. If this block ends with an conditional branch, it returns the 'true'
-  ///destination in TBB, the 'false' destination in FBB, and a list of
-  ///operands that evaluate the condition.  These operands can be passed to
-  ///other TargetInstrInfo methods to create new branches.
+  /// 3. If this block ends with an conditional branch and it falls through to
+  ///an successor block, it sets TBB to be the branch destination block 
and a
+  ///list of operands that evaluate the condition. These
+  ///operands can be passed to other TargetInstrInfo methods to create new
+  ///branches.
+  /// 4. If this block ends with an conditional branch and an unconditional
+  ///block, it returns the 'true' destination in TBB, the 'false' 
destination
+  ///in FBB, and a list of operands that evaluate the condition. These
+  ///operands can be passed to other TargetInstrInfo methods to create new
+  ///branches.
   ///
   /// Note that RemoveBranch and InsertBranch must be implemented to support
   /// cases where this method returns success.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp

2007-05-15 Thread Evan Cheng

Unless I am reading the code wrong... :-)

Evan
On May 15, 2007, at 10:09 PM, Evan Cheng wrote:


It shouldn't. :-) I am missing an assert.

This check earlier ensures that the block ends with either a  
conditional branch or a conditional branch + a unconditional branch.

  if (TII->AnalyzeBranch(*BB, BBI.TBB, BBI.FBB, BBI.Cond)
  || !BBI.TBB || BBI.Cond.size() == 0)

BBI.FBB is only NULL if it's the former.

The comments in TargetInstrInfo.h is incorrect. I'll fix.

Thanks,

Evan

On May 15, 2007, at 8:07 PM, Devang Patel wrote:



On May 15, 2007, at 7:01 PM, Evan Cheng wrote:


+   if (!BBI.FBB)
+ BBI.FBB = findFalseBlock(BB, BBI.TBB);
+   AnalyzeBlock(BBI.FBB);
+   BBInfo &FBBI = BBAnalysis[BBI.FBB->getNumber()];


If findFalseBlock returns NULL then AnalyzeBlock may crash here.

-
Devang
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp

2007-05-15 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen:

IfConversion.cpp updated: 1.1 -> 1.2
---
Log message:

Devang points out that we need an assertion here.

---
Diffs of the changes:  (+2 -0)

 IfConversion.cpp |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.1 
llvm/lib/CodeGen/IfConversion.cpp:1.2
--- llvm/lib/CodeGen/IfConversion.cpp:1.1   Tue May 15 21:00:57 2007
+++ llvm/lib/CodeGen/IfConversion.cpp   Wed May 16 00:11:10 2007
@@ -141,6 +141,8 @@
   
   if (!BBI.FBB)
 BBI.FBB = findFalseBlock(BB, BBI.TBB);  
+  assert(BBI.FBB && "Expected to find the fallthrough block!");
+
   AnalyzeBlock(BBI.FBB);
   BBInfo &FBBI = BBAnalysis[BBI.FBB->getNumber()];
   if (FBBI.Kind != ICNotClassfied)



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp

2007-05-15 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMConstantIslandPass.cpp updated: 1.43 -> 1.44
---
Log message:

Fix comment.

---
Diffs of the changes:  (+1 -1)

 ARMConstantIslandPass.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.43 
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.44
--- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.43  Mon May 14 20:29:07 2007
+++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp   Wed May 16 00:14:06 2007
@@ -112,7 +112,7 @@
 : MI(mi), MaxDisp(maxdisp), isCond(cond), UncondBr(ubr) {}
 };
 
-/// Branches - Keep track of all the immediate branch instructions.
+/// ImmBranches - Keep track of all the immediate branch instructions.
 ///
 std::vector ImmBranches;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/IntrinsicsX86.td

2007-05-15 Thread Chris Lattner


Changes in directory llvm/include/llvm:

IntrinsicsX86.td updated: 1.44 -> 1.45
---
Log message:

add missing mmx intrinsic


---
Diffs of the changes:  (+4 -0)

 IntrinsicsX86.td |4 
 1 files changed, 4 insertions(+)


Index: llvm/include/llvm/IntrinsicsX86.td
diff -u llvm/include/llvm/IntrinsicsX86.td:1.44 
llvm/include/llvm/IntrinsicsX86.td:1.45
--- llvm/include/llvm/IntrinsicsX86.td:1.44 Tue Apr 24 16:18:37 2007
+++ llvm/include/llvm/IntrinsicsX86.td  Wed May 16 01:03:49 2007
@@ -702,6 +702,10 @@
 
 // Misc.
 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
+  def int_x86_mmx_maskmovq : GCCBuiltin<"__builtin_ia32_maskmovq">,
+  Intrinsic<[llvm_void_ty, llvm_v8i8_ty, llvm_v8i8_ty, 
llvm_ptr_ty],
+[IntrWriteMem]>;
+
   def int_x86_mmx_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb">,
   Intrinsic<[llvm_i32_ty, llvm_v8i8_ty], [IntrNoMem]>;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrMMX.td

2007-05-15 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86InstrMMX.td updated: 1.31 -> 1.32
---
Log message:

implement the missing maskmovq mmx intrinsic that akor hit.


---
Diffs of the changes:  (+3 -1)

 X86InstrMMX.td |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86InstrMMX.td
diff -u llvm/lib/Target/X86/X86InstrMMX.td:1.31 
llvm/lib/Target/X86/X86InstrMMX.td:1.32
--- llvm/lib/Target/X86/X86InstrMMX.td:1.31 Tue Apr 24 16:18:37 2007
+++ llvm/lib/Target/X86/X86InstrMMX.td  Wed May 16 01:08:17 2007
@@ -493,7 +493,9 @@
 
 // Misc.
 def MMX_MASKMOVQ : MMXI<0xF7, MRMDestMem, (ops VR64:$src, VR64:$mask),
-"maskmovq {$mask, $src|$src, $mask}", []>;
+"maskmovq {$mask, $src|$src, $mask}",
+[(int_x86_mmx_maskmovq VR64:$src, VR64:$mask, EDI)]>,
+Imp<[EDI],[]>;
 
 
//===--===//
 // Alias Instructions



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CodeGen/X86/2007-05-15-maskmovq.ll

2007-05-15 Thread Chris Lattner


Changes in directory llvm/test/CodeGen/X86:

2007-05-15-maskmovq.ll added (r1.1)
---
Log message:

testcase for maskmovq


---
Diffs of the changes:  (+14 -0)

 2007-05-15-maskmovq.ll |   14 ++
 1 files changed, 14 insertions(+)


Index: llvm/test/CodeGen/X86/2007-05-15-maskmovq.ll
diff -c /dev/null llvm/test/CodeGen/X86/2007-05-15-maskmovq.ll:1.1
*** /dev/null   Wed May 16 01:14:20 2007
--- llvm/test/CodeGen/X86/2007-05-15-maskmovq.llWed May 16 01:14:10 2007
***
*** 0 
--- 1,14 
+ ; RUN: llvm-as < %s | llc -mcpu=yonah
+ 
+ target datalayout = 
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
+ target triple = "i686-apple-darwin8"
+ 
+ define void @test(<1 x i64> %c64, <1 x i64> %mask1, i8* %P) {
+ entry:
+   %tmp4 = bitcast <1 x i64> %mask1 to <8 x i8>; <<8 x i8>> 
[#uses=1]
+   %tmp6 = bitcast <1 x i64> %c64 to <8 x i8>  ; <<8 x i8>> 
[#uses=1]
+   tail call void @llvm.x86.mmx.maskmovq( <8 x i8> %tmp6, <8 x i8> %tmp4, 
i8* %P )
+   ret void
+ }
+ 
+ declare void @llvm.x86.mmx.maskmovq(<8 x i8>, <8 x i8>, i8*)



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

2007-05-15 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.305 -> 1.306
---
Log message:

Use a ptr set instead of a linear search to unique TokenFactor operands.
This fixes PR1423: http://llvm.org/PR1423 


---
Diffs of the changes:  (+13 -10)

 DAGCombiner.cpp |   23 +--
 1 files changed, 13 insertions(+), 10 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.305 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.306
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.305 Tue May 15 21:04:50 2007
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp   Wed May 16 01:37:59 2007
@@ -29,17 +29,18 @@
 
//===--===//
 
 #define DEBUG_TYPE "dagcombine"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/MathExtras.h"
+#include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetLowering.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/Statistic.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/MathExtras.h"
 #include 
 using namespace llvm;
 
@@ -713,10 +714,10 @@
   return N->getOperand(1);
   }
   
-  
-  SmallVector TFs;   // List of token factors to visit.
-  SmallVector Ops;  // Ops for replacing token factor.
-  bool Changed = false;   // If we should replace this token factor.
+  SmallVector TFs; // List of token factors to visit.
+  SmallVector Ops;// Ops for replacing token factor.
+  SmallPtrSet SeenOps; 
+  bool Changed = false; // If we should replace this token factor.
   
   // Start out with this token factor.
   TFs.push_back(N);
@@ -750,9 +751,11 @@
 // Fall thru
 
   default:
-// Only add if not there prior.
-if (std::find(Ops.begin(), Ops.end(), Op) == Ops.end())
+// Only add if it isn't already in the list.
+if (SeenOps.insert(Op.Val))
   Ops.push_back(Op);
+else
+  Changed = true;
 break;
   }
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.cpp ARMInstrInfo.h ARMTargetMachine.cpp ARMTargetMachine.h

2007-05-15 Thread Chris Lattner
> Hooks for predication support.

yay!

> +bool ARMInstrInfo::isPredicatable(MachineInstr *MI) const {
> +  const TargetInstrDescriptor *TID = MI->getInstrDescriptor();
> +  if (TID->Flags & M_PREDICATED)
> +return true;
> +
> +  unsigned Opc = MI->getOpcode();
> +  return Opc == ARM::B || Opc == ARM::tB;
> +}
> +
> +void ARMInstrInfo::PredicateInstruction(MachineInstr *MI,
> +  std::vector  
> &Cond) const {
> +  unsigned Opc = MI->getOpcode();
> +  if (Opc == ARM::B || Opc == ARM::tB) {
> +MI->setInstrDescriptor(get(Opc == ARM::B ? ARM::Bcc :  
> ARM::tBcc));
> +MI->addImmOperand(Cond[0].getImmedValue());
> +return;
> +  }
> +
> +  MachineOperand *PMO = MI->findFirstPredOperand();
> +  PMO->setImm(Cond[0].getImmedValue());
> +}

I don't think there is any reason for this to be virtual and target- 
specific.  In particular, can you please model B/tB the same way PPC  
handles branches (where an uncond branch is just a conditional branch  
where the condition is set to 'always')?  That way, you don't need a  
special case, isPredicatable doesn't need to be virtual, and each  
target doesn't need to implement PredicateInstruction.

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits