[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86ISelLowering.h X86InstrSSE.td

2007-01-04 Thread Evan Cheng


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.310 -> 1.311
X86ISelLowering.h updated: 1.81 -> 1.82
X86InstrSSE.td updated: 1.174 -> 1.175
---
Log message:

With SSE2, expand FCOPYSIGN to a series of SSE bitwise operations.

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

 X86ISelLowering.cpp |   65 
 X86ISelLowering.h   |   11 
 X86InstrSSE.td  |   25 
 3 files changed, 93 insertions(+), 8 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.310 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.311
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.310   Wed Jan  3 11:24:59 2007
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Fri Jan  5 01:55:56 2007
@@ -250,9 +250,6 @@
 setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64, Expand);
   setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32  , Expand);
 
-  setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
-  setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
-
   if (X86ScalarSSE) {
 // Set up the FP register classes.
 addRegisterClass(MVT::f32, X86::FR32RegisterClass);
@@ -266,6 +263,10 @@
 setOperationAction(ISD::FNEG , MVT::f64, Custom);
 setOperationAction(ISD::FNEG , MVT::f32, Custom);
 
+// Use ANDPD and ORPD to simulate FCOPYSIGN.
+setOperationAction(ISD::FCOPYSIGN, MVT::f64, Custom);
+setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
+
 // We don't support sin/cos/fmod
 setOperationAction(ISD::FSIN , MVT::f64, Expand);
 setOperationAction(ISD::FCOS , MVT::f64, Expand);
@@ -283,7 +284,9 @@
 // Set up the FP register classes.
 addRegisterClass(MVT::f64, X86::RFPRegisterClass);
 
-setOperationAction(ISD::UNDEF, MVT::f64, Expand);
+setOperationAction(ISD::UNDEF, MVT::f64, Expand);
+setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
+setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
 
 if (!UnsafeFPMath) {
   setOperationAction(ISD::FSIN   , MVT::f64  , Expand);
@@ -4123,6 +4126,56 @@
   return DAG.getNode(X86ISD::FXOR, VT, Op.getOperand(0), Mask);
 }
 
+SDOperand X86TargetLowering::LowerFCOPYSIGN(SDOperand Op, SelectionDAG &DAG) {
+  MVT::ValueType VT = Op.getValueType();
+  MVT::ValueType SrcVT = Op.getOperand(1).getValueType();
+  const Type *SrcTy =  MVT::getTypeForValueType(SrcVT);
+  // First get the sign bit of second operand.
+  std::vector CV;
+  if (SrcVT == MVT::f64) {
+CV.push_back(ConstantFP::get(SrcTy, BitsToDouble(1ULL << 63)));
+CV.push_back(ConstantFP::get(SrcTy, 0.0));
+  } else {
+CV.push_back(ConstantFP::get(SrcTy, BitsToFloat(1U << 31)));
+CV.push_back(ConstantFP::get(SrcTy, 0.0));
+CV.push_back(ConstantFP::get(SrcTy, 0.0));
+CV.push_back(ConstantFP::get(SrcTy, 0.0));
+  }
+  Constant *CS = ConstantStruct::get(CV);
+  SDOperand CPIdx = DAG.getConstantPool(CS, getPointerTy(), 4);
+  std::vector Tys;
+  Tys.push_back(VT);
+  Tys.push_back(MVT::Other);
+  SmallVector Ops;
+  Ops.push_back(DAG.getEntryNode());
+  Ops.push_back(CPIdx);
+  Ops.push_back(DAG.getSrcValue(NULL));
+  SDOperand Mask = DAG.getNode(X86ISD::LOAD_PACK, Tys, &Ops[0], Ops.size());
+  SDOperand SignBit = DAG.getNode(X86ISD::FAND, SrcVT, Op.getOperand(1), Mask);
+
+  // Shift sign bit right or left if the two operands have different types.
+  if (MVT::getSizeInBits(SrcVT) > MVT::getSizeInBits(VT)) {
+// Op0 is MVT::f32, Op1 is MVT::f64.
+SignBit = DAG.getNode(ISD::SCALAR_TO_VECTOR, MVT::v2f64, SignBit);
+SignBit = DAG.getNode(X86ISD::FSRL, MVT::v2f64, SignBit,
+  DAG.getConstant(32, MVT::i32));
+SignBit = DAG.getNode(ISD::BIT_CONVERT, MVT::v4f32, SignBit);
+SignBit = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::f32, SignBit,
+  DAG.getConstant(0, getPointerTy()));
+  } else if (MVT::getSizeInBits(SrcVT) < MVT::getSizeInBits(VT)) {
+// Op0 is MVT::f64, Op1 is MVT::f32.
+SignBit = DAG.getNode(ISD::SCALAR_TO_VECTOR, MVT::v4f32, SignBit);
+SignBit = DAG.getNode(X86ISD::FSHL, MVT::v4f32, SignBit,
+  DAG.getConstant(32, MVT::i32));
+SignBit = DAG.getNode(ISD::BIT_CONVERT, MVT::v2f64, SignBit);
+SignBit = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::f64, SignBit,
+  DAG.getConstant(0, getPointerTy()));
+  }
+
+  // Or the first operand with the sign bit.
+  return DAG.getNode(X86ISD::FOR, VT, Op.getOperand(0), SignBit);
+}
+
 SDOperand X86TargetLowering::LowerSETCC(SDOperand Op, SelectionDAG &DAG,
 SDOperand Chain) {
   assert(Op.getValueType() == MVT::i8 && "SetCC type must be 8-bit integer");
@@ -4955,6 +5008,7 @@
   case ISD::FP_TO_SINT: return LowerFP_TO_SINT(Op, DAG);
   case ISD::FABS:   return LowerFABS(Op, DAG);
   case ISD::FNEG:   return LowerFNEG(Op, DAG);
+  case ISD::FCOPYSIGN:  

[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2007-01-04 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.580 -> 1.581
---
Log message:

Implement InstCombine/vec_shuffle.ll:%test7, simplifying shuffles with 
undef operands.


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

 InstructionCombining.cpp |   24 +++-
 1 files changed, 23 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.580 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.581
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.580   Thu Jan  4 
21:04:57 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Jan  5 01:36:08 2007
@@ -8833,8 +8833,30 @@
   if (isa(SVI.getOperand(2)))
 return ReplaceInstUsesWith(SVI, UndefValue::get(SVI.getType()));
   
-  // TODO: If we have shuffle(x, undef, mask) and any elements of mask refer to
+  // If we have shuffle(x, undef, mask) and any elements of mask refer to
   // the undef, change them to undefs.
+  if (isa(SVI.getOperand(1))) {
+// Scan to see if there are any references to the RHS.  If so, replace them
+// with undef element refs and set MadeChange to true.
+for (unsigned i = 0, e = Mask.size(); i != e; ++i) {
+  if (Mask[i] >= e && Mask[i] != 2*e) {
+Mask[i] = 2*e;
+MadeChange = true;
+  }
+}
+
+if (MadeChange) {
+  // Remap any references to RHS to use LHS.
+  std::vector Elts;
+  for (unsigned i = 0, e = Mask.size(); i != e; ++i) {
+if (Mask[i] == 2*e)
+  Elts.push_back(UndefValue::get(Type::Int32Ty));
+else
+  Elts.push_back(ConstantInt::get(Type::Int32Ty, Mask[i]));
+  }
+  SVI.setOperand(2, ConstantPacked::get(Elts));
+}
+  }
   
   // Canonicalize shuffle(x,x,mask) -> shuffle(x, undef,mask')
   // Canonicalize shuffle(undef,x,mask) -> shuffle(x, undef,mask').



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


[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll

2007-01-04 Thread Chris Lattner


Changes in directory llvm/test/Regression/Transforms/InstCombine:

vec_shuffle.ll updated: 1.6 -> 1.7
---
Log message:

new test


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

 vec_shuffle.ll |4 
 1 files changed, 4 insertions(+)


Index: llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll
diff -u llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll:1.6 
llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll:1.7
--- llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll:1.6  Fri Jan 
 5 01:34:41 2007
+++ llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll  Fri Jan  5 
01:35:24 2007
@@ -42,3 +42,7 @@
 ret float %tmp34
 }
 
+define <4 x float> %test7(<4 x float> %tmp45.i) {
+%tmp1642.i = shufflevector <4 x float> %tmp45.i, <4 x float> undef, <4 
x i32> < i32 0, i32 1, i32 6, i32 7 >
+ret <4 x float> %tmp1642.i
+}



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


[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll

2007-01-04 Thread Chris Lattner


Changes in directory llvm/test/Regression/Transforms/InstCombine:

vec_shuffle.ll updated: 1.5 -> 1.6
---
Log message:

manually upgrade this testcase


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

 vec_shuffle.ll |   54 +++---
 1 files changed, 27 insertions(+), 27 deletions(-)


Index: llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll
diff -u llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll:1.5 
llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll:1.6
--- llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll:1.5  Fri Dec 
 1 22:23:09 2006
+++ llvm/test/Regression/Transforms/InstCombine/vec_shuffle.ll  Fri Jan  5 
01:34:41 2007
@@ -1,44 +1,44 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 
vector_shuffle
+; RUN: llvm-as < %s | opt -instcombine -disable-output &&
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep vector_shuffle
 
 %T = type <4 x float>
 
 implementation
 
-%T %test1(%T %v1) {
-  %v2 = shufflevector %T %v1, %T undef, <4 x uint> 
+define %T %test1(%T %v1) {
+  %v2 = shufflevector %T %v1, %T undef, <4 x i32> 
   ret %T %v2
 }
 
-%T %test2(%T %v1) {
-  %v2 = shufflevector %T %v1, %T %v1, <4 x uint> 
+define %T %test2(%T %v1) {
+  %v2 = shufflevector %T %v1, %T %v1, <4 x i32> 
   ret %T %v2
 }
 
-float %test3(%T %A, %T %B, float %f) {
-%C = insertelement %T %A, float %f, uint 0
-%D = shufflevector %T %C, %T %B, <4 x uint> 
-%E = extractelement %T %D, uint 1
+define float %test3(%T %A, %T %B, float %f) {
+%C = insertelement %T %A, float %f, i32 0
+%D = shufflevector %T %C, %T %B, <4 x i32> 
+%E = extractelement %T %D, i32 1
 ret float %E
 }
 
-int %test4(<4 x int> %X) {
-%tmp152.i53899.i = shufflevector <4 x int> %X, <4 x int> undef, <4 x 
uint> zeroinitializer
-%tmp34 = extractelement <4 x int> %tmp152.i53899.i, uint 0
-ret int %tmp34
-}
-
-int %test5(<4 x int> %X) {
-%tmp152.i53899.i = shufflevector <4 x int> %X, <4 x int> undef, <4 x 
uint> 
-%tmp34 = extractelement <4 x int> %tmp152.i53899.i, uint 0
-ret int %tmp34
-}
-
-float %test6(<4 x float> %X) {
-%X = cast <4 x float> %X to <4 x int>
-%tmp152.i53899.i = shufflevector <4 x int> %X, <4 x int> undef, <4 x 
uint> zeroinitializer
-%tmp152.i53900.i = cast <4 x int> %tmp152.i53899.i to <4 x float>
-%tmp34 = extractelement <4 x float> %tmp152.i53900.i, uint 0
+define i32 %test4(<4 x i32> %X) {
+%tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x 
i32> zeroinitializer
+%tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0
+ret i32 %tmp34
+}
+
+define i32 %test5(<4 x i32> %X) {
+%tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x 
i32> 
+%tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0
+ret i32 %tmp34
+}
+
+define float %test6(<4 x float> %X) {
+%X = bitcast <4 x float> %X to <4 x i32>
+%tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x 
i32> zeroinitializer
+%tmp152.i53900.i = bitcast <4 x i32> %tmp152.i53899.i to <4 x float>
+%tmp34 = extractelement <4 x float> %tmp152.i53900.i, i32 0
 ret float %tmp34
 }
 



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


[llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/Makefile

2007-01-04 Thread Evan Cheng


Changes in directory llvm-test/External/SPEC/CFP2006:

Makefile updated: 1.3 -> 1.4
---
Log message:

Filter out Fortran tests if fortran compiler isn't available.

---
Diffs of the changes:  (+22 -5)

 Makefile |   27 ++-
 1 files changed, 22 insertions(+), 5 deletions(-)


Index: llvm-test/External/SPEC/CFP2006/Makefile
diff -u llvm-test/External/SPEC/CFP2006/Makefile:1.3 
llvm-test/External/SPEC/CFP2006/Makefile:1.4
--- llvm-test/External/SPEC/CFP2006/Makefile:1.3Thu Sep  7 19:59:14 2006
+++ llvm-test/External/SPEC/CFP2006/MakefileFri Jan  5 01:18:45 2007
@@ -6,21 +6,38 @@
 
 LEVEL = ../../..
 
+## C Programs
 PARALLEL_DIRS :=  \
+433.milc  \
+444.namd  \
+447.dealII\
+470.lbm
+
+ifdef USE_F95
+PARALLEL_DIRS +=  \
 410.bwaves\
 416.gamess\
-433.milc  \
 434.zeusmp\
 435.gromacs   \
 436.cactusADM \
 437.leslie3d  \
-444.namd  \
-447.dealII\
 454.calculix  \
 459.GemsFDTD  \
-470.lbm   \
 481.wrf
-
+else
+ifdef USE_F2C
+PARALLEL_DIRS +=  \
+410.bwaves\
+416.gamess\
+434.zeusmp\
+435.gromacs   \
+436.cactusADM \
+437.leslie3d  \
+454.calculix  \
+459.GemsFDTD  \
+481.wrf
+endif
+endif   # End USE_F95
 
 # These compile but need other things to run:
 #   450.soplex- enter.cc:535, works at -O0, not at -O2



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


[llvm-commits] CVS: llvm-test/configure

2007-01-04 Thread Evan Cheng


Changes in directory llvm-test:

configure updated: 1.42 -> 1.43
---
Log message:

Auto-generate configure.

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

 configure |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)


Index: llvm-test/configure
diff -u llvm-test/configure:1.42 llvm-test/configure:1.43
--- llvm-test/configure:1.42Mon Dec  4 14:37:53 2006
+++ llvm-test/configure Fri Jan  5 01:06:00 2007
@@ -20452,6 +20452,7 @@
 
 { echo "$as_me:$LINENO: checking sanity for program f95" >&5
 echo $ECHO_N "checking sanity for program f95... $ECHO_C" >&6; }
+sanity="0"
 sanity_path=`which f95 2>/dev/null`
 if test "$?" -eq 0 -a -x "$sanity_path" ; then
   sanity=`f95 -V 2>&1 | grep "NAGWare Fortran 95"`
@@ -20477,12 +20478,17 @@
 echo "${ECHO_T}not found" >&6; }
 fi
 
-if test "$sanity" -eq "0" ; then
+if test -z "$sanity" ; then
   USE_F95=
 
 else
-  USE_F95=USE_F95=1
+  if test "$sanity" -eq "0" ; then
+USE_F95=
 
+  else
+USE_F95=USE_F95=1
+
+  fi
 fi
 
 { echo "$as_me:$LINENO: checking for ANSI C header files" >&5



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


[llvm-commits] CVS: llvm-test/autoconf/configure.ac

2007-01-04 Thread Evan Cheng


Changes in directory llvm-test/autoconf:

configure.ac updated: 1.40 -> 1.41
---
Log message:

Add an extra check for f95 sanity. It seems some versions of autoconf may end
up generate code that does not initialize $sanity to 0.


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

 configure.ac |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)


Index: llvm-test/autoconf/configure.ac
diff -u llvm-test/autoconf/configure.ac:1.40 
llvm-test/autoconf/configure.ac:1.41
--- llvm-test/autoconf/configure.ac:1.40Mon Dec  4 14:37:53 2006
+++ llvm-test/autoconf/configure.ac Fri Jan  5 01:05:12 2007
@@ -150,10 +150,14 @@
 dnl Check for the NAG f95 FORTRAN -> C translator
 FIND_STD_PROGRAM(f95,,libf97.dylib,[nag fortran])
 CHECK_PROGRAM_SANITY([f95],[-V],[NAGWare Fortran 95],1)
-if test "$sanity" -eq "0" ; then
+if test -z "$sanity" ; then
   AC_SUBST(USE_F95,[[]])
 else
-  AC_SUBST(USE_F95,[USE_F95=1])
+  if test "$sanity" -eq "0" ; then
+AC_SUBST(USE_F95,[[]])
+  else
+AC_SUBST(USE_F95,[USE_F95=1])
+  fi
 fi
 
 dnl Checks for header files.



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


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/add.ll

2007-01-04 Thread Chris Lattner

On Jan 4, 2007, at 7:19 PM, Reid Spencer wrote:

> On Thu, 2007-01-04 at 21:03 -0600, Chris Lattner wrote:
>>
>> Changes in directory llvm/test/Regression/Transforms/InstCombine:
>>
>> add.ll updated: 1.33 -> 1.34
>> ---
>> Log message:
>>
>> llvm upgrade doesn't accept 'define'
>
> I would prefer it if you not use llvm-upgrade for new test cases.

Seems reasonable.  This was a large testcase that I didn't feel like  
upgrading, but next time I add to one, I will manually upgrade the  
whole thing.

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


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/add.ll

2007-01-04 Thread Reid Spencer
On Thu, 2007-01-04 at 21:03 -0600, Chris Lattner wrote:
> 
> Changes in directory llvm/test/Regression/Transforms/InstCombine:
> 
> add.ll updated: 1.33 -> 1.34
> ---
> Log message:
> 
> llvm upgrade doesn't accept 'define'

I would prefer it if you not use llvm-upgrade for new test cases.

> 
> 
> ---
> Diffs of the changes:  (+2 -1)
> 
>  add.ll |3 ++-
>  1 files changed, 2 insertions(+), 1 deletion(-)
> 
> 
> Index: llvm/test/Regression/Transforms/InstCombine/add.ll
> diff -u llvm/test/Regression/Transforms/InstCombine/add.ll:1.33 
> llvm/test/Regression/Transforms/InstCombine/add.ll:1.34
> --- llvm/test/Regression/Transforms/InstCombine/add.ll:1.33   Thu Jan  4 
> 20:16:36 2007
> +++ llvm/test/Regression/Transforms/InstCombine/add.llThu Jan  4 
> 21:03:27 2007
> @@ -1,5 +1,6 @@
>  ; This test makes sure that add instructions are properly eliminated.
>  
> +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
>  ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v 
> OK | not grep add
>  
>  implementation
> @@ -240,7 +241,7 @@
>  ret ubyte %C
>  }
>  
> -define i32 %test34(i32 %a) {  ;; -> -1
> +i32 %test34(i32 %a) {  ;; -> -1
>  %tmpnot = xor i32 %a, -1
>  %tmp2 = add i32 %tmpnot, %a
>  ret i32 %tmp2
> 
> 
> 
> ___
> 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/Transforms/Scalar/InstructionCombining.cpp

2007-01-04 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.579 -> 1.580
---
Log message:

fold things like a^b != c^a -> b != c.  This implements 
InstCombine/xor.ll:test27


---
Diffs of the changes:  (+33 -12)

 InstructionCombining.cpp |   45 +
 1 files changed, 33 insertions(+), 12 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.579 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.580
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.579   Thu Jan  4 
20:17:46 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jan  4 21:04:57 2007
@@ -5173,30 +5173,51 @@
   }
   
   if (I.isEquality()) {
-Value *A, *B;
-if (match(Op0, m_Xor(m_Value(A), m_Value(B))) &&
-(A == Op1 || B == Op1)) {
-  // (A^B) == A  ->  B == 0
-  Value *OtherVal = A == Op1 ? B : A;
-  return new ICmpInst(I.getPredicate(), OtherVal,
-  Constant::getNullValue(A->getType()));
-} else if (match(Op1, m_Xor(m_Value(A), m_Value(B))) &&
-   (A == Op0 || B == Op0)) {
+Value *A, *B, *C, *D;
+if (match(Op0, m_Xor(m_Value(A), m_Value(B {
+  if (A == Op1 || B == Op1) {// (A^B) == A  ->  B == 0
+Value *OtherVal = A == Op1 ? B : A;
+return new ICmpInst(I.getPredicate(), OtherVal,
+Constant::getNullValue(A->getType()));
+  }
+
+  if (match(Op1, m_Xor(m_Value(C), m_Value(D {
+// A^c1 == C^c2 --> A == C^(c1^c2)
+if (ConstantInt *C1 = dyn_cast(B))
+  if (ConstantInt *C2 = dyn_cast(D))
+if (Op1->hasOneUse()) {
+  Constant *NC = ConstantExpr::getXor(C1, C2);
+  Instruction *Xor = BinaryOperator::createXor(C, NC, "tmp");
+  return new ICmpInst(I.getPredicate(), A,
+  InsertNewInstBefore(Xor, I));
+}
+
+// A^B == A^D -> B == D
+if (A == C) return new ICmpInst(I.getPredicate(), B, D);
+if (A == D) return new ICmpInst(I.getPredicate(), B, C);
+if (B == C) return new ICmpInst(I.getPredicate(), A, D);
+if (B == D) return new ICmpInst(I.getPredicate(), A, C);
+  }
+}
+
+if (match(Op1, m_Xor(m_Value(A), m_Value(B))) &&
+(A == Op0 || B == Op0)) {
   // A == (A^B)  ->  B == 0
   Value *OtherVal = A == Op0 ? B : A;
   return new ICmpInst(I.getPredicate(), OtherVal,
   Constant::getNullValue(A->getType()));
-} else if (match(Op0, m_Sub(m_Value(A), m_Value(B))) && A == Op1) {
+}
+if (match(Op0, m_Sub(m_Value(A), m_Value(B))) && A == Op1) {
   // (A-B) == A  ->  B == 0
   return new ICmpInst(I.getPredicate(), B,
   Constant::getNullValue(B->getType()));
-} else if (match(Op1, m_Sub(m_Value(A), m_Value(B))) && A == Op0) {
+}
+if (match(Op1, m_Sub(m_Value(A), m_Value(B))) && A == Op0) {
   // A == (A-B)  ->  B == 0
   return new ICmpInst(I.getPredicate(), B,
   Constant::getNullValue(B->getType()));
 }
 
-Value *C, *D;
 // (X&Z) == (Y&Z) -> (X^Y) & Z == 0
 if (Op0->hasOneUse() && Op1->hasOneUse() &&
 match(Op0, m_And(m_Value(A), m_Value(B))) && 



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


[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/xor.ll

2007-01-04 Thread Chris Lattner


Changes in directory llvm/test/Regression/Transforms/InstCombine:

xor.ll updated: 1.18 -> 1.19
---
Log message:

new testcase


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

 xor.ll |9 +
 1 files changed, 9 insertions(+)


Index: llvm/test/Regression/Transforms/InstCombine/xor.ll
diff -u llvm/test/Regression/Transforms/InstCombine/xor.ll:1.18 
llvm/test/Regression/Transforms/InstCombine/xor.ll:1.19
--- llvm/test/Regression/Transforms/InstCombine/xor.ll:1.18 Fri Dec  1 
22:23:09 2006
+++ llvm/test/Regression/Transforms/InstCombine/xor.ll  Thu Jan  4 21:03:51 2007
@@ -181,3 +181,12 @@
 ret int %tmp4
 }
 
+
+i32 %test27(i32 %b, i32 %c, i32 %d) {
+%tmp2 = xor i32 %d, %b
+%tmp5 = xor i32 %d, %c
+%tmp = icmp eq i32 %tmp2, %tmp5
+%tmp6 = zext bool %tmp to i32
+ret i32 %tmp6
+}
+



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


[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/add.ll

2007-01-04 Thread Chris Lattner


Changes in directory llvm/test/Regression/Transforms/InstCombine:

add.ll updated: 1.33 -> 1.34
---
Log message:

llvm upgrade doesn't accept 'define'


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

 add.ll |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/test/Regression/Transforms/InstCombine/add.ll
diff -u llvm/test/Regression/Transforms/InstCombine/add.ll:1.33 
llvm/test/Regression/Transforms/InstCombine/add.ll:1.34
--- llvm/test/Regression/Transforms/InstCombine/add.ll:1.33 Thu Jan  4 
20:16:36 2007
+++ llvm/test/Regression/Transforms/InstCombine/add.ll  Thu Jan  4 21:03:27 2007
@@ -1,5 +1,6 @@
 ; This test makes sure that add instructions are properly eliminated.
 
+; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v OK 
| not grep add
 
 implementation
@@ -240,7 +241,7 @@
 ret ubyte %C
 }
 
-define i32 %test34(i32 %a) {  ;; -> -1
+i32 %test34(i32 %a) {  ;; -> -1
 %tmpnot = xor i32 %a, -1
 %tmp2 = add i32 %tmpnot, %a
 ret i32 %tmp2



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


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2007-01-04 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.578 -> 1.579
---
Log message:

Compile X + ~X to -1.  This implements Instcombine/add.ll:test34



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

 InstructionCombining.cpp |8 +++-
 1 files changed, 7 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.578 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.579
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.578   Wed Jan  3 
23:23:51 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jan  4 20:17:46 2007
@@ -1871,10 +1871,16 @@
   if (dyn_castFoldableMul(RHS, C2) == LHS)
 return BinaryOperator::createMul(LHS, AddOne(C2));
 
+  // X + ~X --> -1   since   ~X = -X-1
+  if (dyn_castNotVal(LHS) == RHS ||
+  dyn_castNotVal(RHS) == LHS)
+return ReplaceInstUsesWith(I, ConstantInt::getAllOnesValue(I.getType()));
+  
 
   // (A & C1)+(B & C2) --> (A & C1)|(B & C2) iff C1&C2 == 0
   if (match(RHS, m_And(m_Value(), m_ConstantInt(C2
-if (Instruction *R = AssociativeOpt(I, AddMaskingAnd(C2))) return R;
+if (Instruction *R = AssociativeOpt(I, AddMaskingAnd(C2)))
+  return R;
 
   if (ConstantInt *CRHS = dyn_cast(RHS)) {
 Value *X = 0;



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


[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/add.ll

2007-01-04 Thread Chris Lattner


Changes in directory llvm/test/Regression/Transforms/InstCombine:

add.ll updated: 1.32 -> 1.33
---
Log message:

new testcase


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

 add.ll |6 ++
 1 files changed, 6 insertions(+)


Index: llvm/test/Regression/Transforms/InstCombine/add.ll
diff -u llvm/test/Regression/Transforms/InstCombine/add.ll:1.32 
llvm/test/Regression/Transforms/InstCombine/add.ll:1.33
--- llvm/test/Regression/Transforms/InstCombine/add.ll:1.32 Fri Dec  1 
22:23:09 2006
+++ llvm/test/Regression/Transforms/InstCombine/add.ll  Thu Jan  4 20:16:36 2007
@@ -240,3 +240,9 @@
 ret ubyte %C
 }
 
+define i32 %test34(i32 %a) {  ;; -> -1
+%tmpnot = xor i32 %a, -1
+%tmp2 = add i32 %tmpnot, %a
+ret i32 %tmp2
+}
+



___
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/SelectionDAGISel.cpp

2007-01-04 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.339 -> 1.340
---
Log message:

GEP subscript is interpreted as a signed value.

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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.339 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.340
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.339Thu Jan  4 
16:22:37 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Thu Jan  4 19:46:20 2007
@@ -1703,7 +1703,7 @@
   if (ConstantInt *CI = dyn_cast(Idx)) {
 if (CI->getZExtValue() == 0) continue;
 uint64_t Offs = 
-TD->getTypeSize(Ty)*cast(CI)->getZExtValue();
+TD->getTypeSize(Ty)*cast(CI)->getSExtValue();
 N = DAG.getNode(ISD::ADD, N.getValueType(), N, 
getIntPtrConstant(Offs));
 continue;
   }



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


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

2007-01-04 Thread Reid Spencer


Changes in directory llvm/docs:

LangRef.html updated: 1.186 -> 1.187
---
Log message:

Correct the documentation for function declarations. They can have dllimport
or extern_weak linkage as well as "externally visible".


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

 LangRef.html |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)


Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.186 llvm/docs/LangRef.html:1.187
--- llvm/docs/LangRef.html:1.186Thu Jan  4 10:43:23 2007
+++ llvm/docs/LangRef.html  Thu Jan  4 18:59:10 2007
@@ -495,8 +495,10 @@
 variable and was linked with this one, one of the two would be renamed,
 preventing a collision.  Since "main" and "puts" are
 external (i.e., lacking any linkage declarations), they are accessible
-outside of the current module.  It is illegal for a function declaration
-to have any linkage type other than "externally visible".
+outside of the current module.
+It is illegal for a function declaration
+to have any linkage type other than "externally visible", dllimport,
+or extern_weak.
 
 
 
@@ -4501,7 +4503,7 @@
 
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.org";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/01/04 16:43:23 $
+  Last modified: $Date: 2007/01/05 00:59:10 $
 
 
 



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


[llvm-commits] Fix K&R prototype handling

2007-01-04 Thread Chris Lattner

This patch causes us to compile functions like:

p1 (f2, l)
float f2; short l;  {
  printf("%d\n", l);
}

into:

define i32 %p1(double %f2, i32 %l) {

instead of:

define i32 %p1(float %f2, i16 %l) {

due to K&R promotion rules.  This fixes a miscompilation of  
SingleSource/UnitTests/2007-01-04-KNR-Args.c on PowerPC at -O0.


-Chris


Index: llvm-convert.cpp
===
--- llvm-convert.cpp(revision 122009)
+++ llvm-convert.cpp(working copy)
@@ -211,12 +211,15 @@ namespace {
   if (ArgVal->getType() != LLVMTy) {
 // If this is just a mismatch between integer types, this could be due
 // to K&R prototypes, where the forward proto defines the arg as int 
and
-// the actual impls is a short or char.
-assert(ArgVal->getType()->isIntegral() && LLVMTy->isIntegral() &&
+// the actual impls is a short or char.  Likewise for double -> float.
+assert(ArgVal->getType()->isIntegral() == LLVMTy->isIntegral() &&
+   (ArgVal->getType() == Type::Int32Ty ||
+ArgVal->getType() == Type::DoubleTy) &&
"Lowerings don't match?");
-bool isSigned = type == 0 ? true : !TYPE_UNSIGNED(type);
-ArgVal = CastInst::createIntegerCast(ArgVal, LLVMTy, isSigned,
- NameStack.back(), CurBB);
+if (ArgVal->getType() == Type::Int32Ty)
+  ArgVal = new TruncInst(ArgVal, LLVMTy, NameStack.back(), CurBB);
+else
+  ArgVal = new FPTruncInst(ArgVal, LLVMTy, NameStack.back(), CurBB);
   }
   assert(!LocStack.empty());
   Value *Loc = LocStack.back();
Index: llvm-types.cpp
===
--- llvm-types.cpp  (revision 122009)
+++ llvm-types.cpp  (working copy)
@@ -474,10 +474,11 @@ namespace {
 const Type *&RetTy;
 std::vector &ArgTypes;
 unsigned &CallingConv;
+bool KNRPromotion;
   public:
 FunctionTypeConversion(const Type *&retty, std::vector &AT,
-   unsigned &CC)
-  : RetTy(retty), ArgTypes(AT), CallingConv(CC) {
+   unsigned &CC, bool KNR)
+  : RetTy(retty), ArgTypes(AT), CallingConv(CC), KNRPromotion(KNR) {
   CallingConv = CallingConv::C;
 }
 
@@ -512,6 +513,16 @@ namespace {
 }
 
 void HandleScalarArgument(const llvm::Type *LLVMTy, tree type) {
+  if (KNRPromotion) {
+if (LLVMTy == Type::FloatTy) {
+  ArgTypes.push_back(Type::DoubleTy);
+  return;
+} else if (LLVMTy == Type::Int16Ty || LLVMTy == Type::Int8Ty ||
+   LLVMTy == Type::BoolTy) {
+  ArgTypes.push_back(Type::Int32Ty);
+  return;
+}
+  }
   ArgTypes.push_back(LLVMTy);
 }
   };
@@ -528,7 +539,7 @@ ConvertArgListToFnType(tree ReturnType, 
   std::vector ArgTys;
   const Type *RetTy;
   
-  FunctionTypeConversion Client(RetTy, ArgTys, CallingConv);
+  FunctionTypeConversion Client(RetTy, ArgTys, CallingConv, true /*K&R*/);
   TheLLVMABI ABIConverter(Client);
   
   ABIConverter.HandleReturnType(ReturnType);
@@ -542,7 +553,7 @@ const FunctionType *TypeConverter::Conve
   const Type *RetTy = 0;
   std::vector ArgTypes;
   bool isVarArg = false;
-  FunctionTypeConversion Client(RetTy, ArgTypes, CallingConv);
+  FunctionTypeConversion Client(RetTy, ArgTypes, CallingConv, true /*not 
K&R*/);
   TheLLVMABI ABIConverter(Client);
   
   ABIConverter.HandleReturnType(TREE_TYPE(type));
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/2007-01-04-KNR-Args.c

2007-01-04 Thread Chris Lattner


Changes in directory llvm-test/SingleSource/UnitTests:

2007-01-04-KNR-Args.c added (r1.1)
---
Log message:

new testcase


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

 2007-01-04-KNR-Args.c |   19 +++
 1 files changed, 19 insertions(+)


Index: llvm-test/SingleSource/UnitTests/2007-01-04-KNR-Args.c
diff -c /dev/null llvm-test/SingleSource/UnitTests/2007-01-04-KNR-Args.c:1.1
*** /dev/null   Thu Jan  4 17:23:19 2007
--- llvm-test/SingleSource/UnitTests/2007-01-04-KNR-Args.c  Thu Jan  4 
17:23:08 2007
***
*** 0 
--- 1,19 
+ #include 
+ 
+ p1 (c, f1, s, d1, i, f2, l, d2)
+ char c; float f1; short s; double d1; int i; float f2; long l; double d2;
+ {
+   printf("%c %f %d %f %d %f %d %f\n", c, f1, s, d1,i, f2, l, d2);
+ }
+ 
+ void p2 (char c, float f1, short s, double d1, int i, float f2, long l, 
double d2)
+ {
+   printf("%c %f %d %f %d %f %d %f\n", c, f1, s, d1,i, f2, l, d2);
+ }
+ 
+ int main(int argc, const char *argv[]) {
+   p1 ('a', 4.0, 1, 5.0, 2, 4.0, 3, 5.0);
+   p2 ('a', 4.0, 1, 5.0, 2, 4.0, 3, 5.0);
+   return 0;
+ }
+ 



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


[llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll

2007-01-04 Thread Chris Lattner


Changes in directory llvm/test/Regression/CodeGen/PowerPC:

2007-01-04-ArgExtension.ll updated: 1.1 -> 1.2
---
Log message:

add missing flags


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

 2007-01-04-ArgExtension.ll |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll
diff -u llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll:1.1 
llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll:1.2
--- llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll:1.1 Thu Jan 
 4 16:22:07 2007
+++ llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll Thu Jan 
 4 17:18:14 2007
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | llc | grep extsb &&
-; RUN: llvm-as < %s | llc | grep extsh
+; RUN: llvm-as < %s | llc -march=ppc32 | grep extsb &&
+; RUN: llvm-as < %s | llc -march=ppc32 | grep extsh
 
 define i32 %p1(i8 %c, i16 %s) {
 entry:



___
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/SelectionDAGISel.cpp

2007-01-04 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.338 -> 1.339
---
Log message:

fix PowerPC/2007-01-04-ArgExtension.ll, a bug handling K&R prototypes with
the recent signless changes.


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

 SelectionDAGISel.cpp |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.338 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.339
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.338Wed Jan  3 
10:49:33 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Thu Jan  4 16:22:37 2007
@@ -2955,10 +2955,12 @@
 case Promote: {
   SDOperand Op(Result, i++);
   if (MVT::isInteger(VT)) {
-unsigned AssertOp = ISD::AssertSext;
-if (FTy->paramHasAttr(Idx, FunctionType::ZExtAttribute))
-  AssertOp = ISD::AssertZext;
-Op = DAG.getNode(AssertOp, Op.getValueType(), Op, 
DAG.getValueType(VT));
+if (FTy->paramHasAttr(Idx, FunctionType::SExtAttribute))
+  Op = DAG.getNode(ISD::AssertSext, Op.getValueType(), Op,
+   DAG.getValueType(VT));
+else if (FTy->paramHasAttr(Idx, FunctionType::ZExtAttribute))
+  Op = DAG.getNode(ISD::AssertZext, Op.getValueType(), Op,
+   DAG.getValueType(VT));
 Op = DAG.getNode(ISD::TRUNCATE, VT, Op);
   } else {
 assert(MVT::isFloatingPoint(VT) && "Not int or FP?");



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


[llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll

2007-01-04 Thread Chris Lattner


Changes in directory llvm/test/Regression/CodeGen/PowerPC:

2007-01-04-ArgExtension.ll added (r1.1)
---
Log message:

new testcase


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

 2007-01-04-ArgExtension.ll |   10 ++
 1 files changed, 10 insertions(+)


Index: llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll
diff -c /dev/null 
llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll:1.1
*** /dev/null   Thu Jan  4 16:22:17 2007
--- llvm/test/Regression/CodeGen/PowerPC/2007-01-04-ArgExtension.ll Thu Jan 
 4 16:22:07 2007
***
*** 0 
--- 1,10 
+ ; RUN: llvm-as < %s | llc | grep extsb &&
+ ; RUN: llvm-as < %s | llc | grep extsh
+ 
+ define i32 %p1(i8 %c, i16 %s) {
+ entry:
+ %tmp = sext i8 %c to i32;  [#uses=1]
+ %tmp1 = sext i16 %s to i32  ;  [#uses=1]
+ %tmp2 = add i32 %tmp1, %tmp ;  [#uses=1]
+ ret i32 %tmp2
+ }



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


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

2007-01-04 Thread Chris Lattner


Changes in directory llvm/docs:

ProgrammersManual.html updated: 1.100 -> 1.101
---
Log message:

Fix broken links, reported by Baptiste Lepilleur


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

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


Index: llvm/docs/ProgrammersManual.html
diff -u llvm/docs/ProgrammersManual.html:1.100 
llvm/docs/ProgrammersManual.html:1.101
--- llvm/docs/ProgrammersManual.html:1.100  Tue Dec 19 22:23:36 2006
+++ llvm/docs/ProgrammersManual.htmlThu Jan  4 16:01:45 2007
@@ -944,7 +944,7 @@
 
 
 Frequently, we might have an instance of the Value Class and we want to
+href="/doxygen/classllvm_1_1Value.html">Value Class and we want to
 determine which Users use the Value.  The list of all
 Users of a particular Value is called a def-use chain.
 For example, let's say we have a Function* named F to a
@@ -1225,7 +1225,7 @@
 
 You can use Value::replaceAllUsesWith and
 User::replaceUsesOfWith to change more than one use at a time.  See 
the
-doxygen documentation for the Value Class
+doxygen documentation for the Value 
Class
 and User Class, respectively, 
for more
 information.
 
@@ -1669,7 +1669,7 @@
 
 #include "llvm/Value.h"
  
-doxygen info: Value Class
+doxygen info: Value Class
 
 The Value class is the most important class in the LLVM Source
 base.  It represents a typed value that may be used (among other things) as an
@@ -2569,7 +2569,7 @@
   mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.org";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2006/12/20 04:23:36 $
+  Last modified: $Date: 2007/01/04 22:01:45 $
 
 
 



___
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/LegalizeDAG.cpp

2007-01-04 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.451 -> 1.452
---
Log message:

Expand fcopysign to a series of bitwise of operations when it's profitable to
do so.

---
Diffs of the changes:  (+46 -19)

 LegalizeDAG.cpp |   65 +++-
 1 files changed, 46 insertions(+), 19 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.451 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.452
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.451 Tue Jan  2 22:22:32 2007
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Thu Jan  4 15:56:39 2007
@@ -528,6 +528,35 @@
 }
 
 
+/// ExpandFCOPYSIGNToBitwiseOps - Expands fcopysign to a series of bitwise
+/// operations.
+static
+SDOperand ExpandFCOPYSIGNToBitwiseOps(SDNode *Node, MVT::ValueType NVT,
+  SelectionDAG &DAG, TargetLowering &TLI) {
+  MVT::ValueType SrcVT = Node->getOperand(1).getValueType();
+  MVT::ValueType SrcNVT = (SrcVT == MVT::f64) ? MVT::i64 : MVT::i32;
+  // First get the sign bit of second operand.
+  SDOperand Mask = (SrcVT == MVT::f64)
+? DAG.getConstantFP(BitsToDouble(1ULL << 63), SrcVT)
+: DAG.getConstantFP(BitsToFloat(1U << 31), SrcVT);
+  Mask = DAG.getNode(ISD::BIT_CONVERT, SrcNVT, Mask);
+  SDOperand SignBit= DAG.getNode(ISD::BIT_CONVERT, SrcNVT, 
Node->getOperand(1));
+  SignBit = DAG.getNode(ISD::AND, SrcNVT, SignBit, Mask);
+  // Shift right or sign-extend it if the two operands have different types.
+  int SizeDiff = MVT::getSizeInBits(SrcNVT) - MVT::getSizeInBits(NVT);
+  if (SizeDiff > 0) {
+SignBit = DAG.getNode(ISD::SRL, SrcNVT, SignBit,
+  DAG.getConstant(SizeDiff, TLI.getShiftAmountTy()));
+SignBit = DAG.getNode(ISD::TRUNCATE, NVT, SignBit);
+  } else if (SizeDiff < 0)
+SignBit = DAG.getNode(ISD::SIGN_EXTEND, NVT, SignBit);
+  // Or the first operand with the sign bit.
+  SDOperand Result = DAG.getNode(ISD::BIT_CONVERT, NVT, Node->getOperand(0));
+  Result = DAG.getNode(ISD::OR, NVT, Result, SignBit);
+  return Result;
+}
+
+
 /// LegalizeOp - We know that the specified value has a legal type.
 /// Recursively ensure that the operands have legal types, then return the
 /// result.
@@ -2314,10 +2343,12 @@
   if (Tmp1.Val) Result = Tmp1;
   break;
 case TargetLowering::Legal: break;
-case TargetLowering::Expand:
+case TargetLowering::Expand: {
   // If this target supports fabs/fneg natively, do this efficiently.
-  if (TLI.isOperationLegal(ISD::FABS, Tmp1.getValueType()) &&
-  TLI.isOperationLegal(ISD::FNEG, Tmp1.getValueType())) {
+  if (TLI.getOperationAction(ISD::FABS, Tmp1.getValueType()) ==
+ TargetLowering::Legal &&
+  TLI.getOperationAction(ISD::FNEG, Tmp1.getValueType()) ==
+ TargetLowering::Legal) {
 // Get the sign bit of the RHS.
 MVT::ValueType IVT = 
   Tmp2.getValueType() == MVT::f32 ? MVT::i32 : MVT::i64;
@@ -2337,24 +2368,14 @@
   }
   
   // Otherwise, do bitwise ops!
-  
-  // copysign -> copysignf/copysign libcall.
-  const char *FnName;
-  if (Node->getValueType(0) == MVT::f32) {
-FnName = "copysignf";
-if (Tmp2.getValueType() != MVT::f32)  // Force operands to match type.
-  Result = DAG.UpdateNodeOperands(Result, Tmp1, 
-DAG.getNode(ISD::FP_ROUND, MVT::f32, 
Tmp2));
-  } else {
-FnName = "copysign";
-if (Tmp2.getValueType() != MVT::f64)  // Force operands to match type.
-  Result = DAG.UpdateNodeOperands(Result, Tmp1, 
-   DAG.getNode(ISD::FP_EXTEND, MVT::f64, 
Tmp2));
-  }
-  SDOperand Dummy;
-  Result = ExpandLibCall(FnName, Node, false/*sign irrelevant*/, Dummy);
+  MVT::ValueType NVT = 
+Node->getValueType(0) == MVT::f32 ? MVT::i32 : MVT::i64;
+  Result = ExpandFCOPYSIGNToBitwiseOps(Node, NVT, DAG, TLI);
+  Result = DAG.getNode(ISD::BIT_CONVERT, Node->getValueType(0), Result);
+  Result = LegalizeOp(Result);
   break;
 }
+}
 break;
 
   case ISD::ADDC:
@@ -5123,6 +5144,12 @@
   ExpandOp(Lo, Lo, Hi);
 break;
   }
+  case ISD::FCOPYSIGN: {
+Lo = ExpandFCOPYSIGNToBitwiseOps(Node, NVT, DAG, TLI);
+if (getTypeAction(NVT) == Expand)
+  ExpandOp(Lo, Lo, Hi);
+break;
+  }
   case ISD::SINT_TO_FP:
   case ISD::UINT_TO_FP: {
 bool isSigned = Node->getOpcode() == ISD::SINT_TO_FP;



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


Re: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp

2007-01-04 Thread Reid Spencer
On Thu, 2007-01-04 at 10:58 -0800, Chris Lattner wrote:
> There is a typo in the function header (lossleslly) of  
> Type::canLosslesslyBitCastTo:
> 
> 
> // canLosslesllyBitCastTo - Return true if this type can be converted to
> // 'Ty' without any reinterpretation of bits.  For example, uint to int.
> //

That's already been fixed.

Reid.


signature.asc
Description: This is a digitally signed message part
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp

2007-01-04 Thread Reid Spencer
On Thu, 2007-01-04 at 10:58 -0800, Chris Lattner wrote:
> There is a typo in the function header (lossleslly) of  
> Type::canLosslesslyBitCastTo:
> 
> 
> // canLosslesllyBitCastTo - Return true if this type can be converted to
> // 'Ty' without any reinterpretation of bits.  For example, uint to int.
> //

Okay.

> 
> >// At this point we have only various mismatches of the first  
> > class types
> >// remaining and ptr->ptr. Just select the lossless conversions.  
> > Everything
> >// else is not lossless.
> 
> This comment needs to be updated.
> 
> > -  switch (getTypeID()) {
> > -  case Type::UByteTyID:   return Ty == Type::SByteTy;
> > -  case Type::SByteTyID:   return Ty == Type::UByteTy;
> > -  case Type::UShortTyID:  return Ty == Type::ShortTy;
> > -  case Type::ShortTyID:   return Ty == Type::UShortTy;
> > -  case Type::UIntTyID:return Ty == Type::IntTy;
> > -  case Type::IntTyID: return Ty == Type::UIntTy;
> > -  case Type::ULongTyID:   return Ty == Type::LongTy;
> > -  case Type::LongTyID:return Ty == Type::ULongTy;
> > -  case Type::PointerTyID: return isa(Ty);
> > -  default:
> > -break;
> > -  }
> > +  if (getTypeID() == Type::PointerTyID)
> > +return isa(Ty);
> >return false;  // Other types have no identity values
> >  }
> 
> What is Type::canLosslesslyBitCastTo used by now?  Can we just  
> eliminate it?

InstCombine. 

> 
> 
> > +FunctionType::ParameterAttributes
> > +FunctionType::getParamAttrs(unsigned Idx) const {
> > +  if (!ParamAttrs)
> > +return ParameterAttributes(0);
> > +  if (Idx > ParamAttrs->size())
> > +return ParameterAttributes(0);
> > +  return (*ParamAttrs)[Idx];
> > +}
> 
> Why does this map an out-of-range index onto attr 0?  Shouldn't this  
> be an assert?

No, I'm trying to save space. If you don't set any attributes or don't
set them on all the parameters then it isn't an error, you just get
"none Set". In a subsequent patch I made this clear by returning
NoAttributeSet enum (has value 0).

This saves space by not requiring the ParamAttrs vector to have an entry
for each parameter and not requiring it to even be allocated if there
aren't any parameter attributes.



> 
> -Chris
> 
> 


signature.asc
Description: This is a digitally signed message part
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp

2007-01-04 Thread Chris Lattner
There is a typo in the function header (lossleslly) of  
Type::canLosslesslyBitCastTo:


// canLosslesllyBitCastTo - Return true if this type can be converted to
// 'Ty' without any reinterpretation of bits.  For example, uint to int.
//

>// At this point we have only various mismatches of the first  
> class types
>// remaining and ptr->ptr. Just select the lossless conversions.  
> Everything
>// else is not lossless.

This comment needs to be updated.

> -  switch (getTypeID()) {
> -  case Type::UByteTyID:   return Ty == Type::SByteTy;
> -  case Type::SByteTyID:   return Ty == Type::UByteTy;
> -  case Type::UShortTyID:  return Ty == Type::ShortTy;
> -  case Type::ShortTyID:   return Ty == Type::UShortTy;
> -  case Type::UIntTyID:return Ty == Type::IntTy;
> -  case Type::IntTyID: return Ty == Type::UIntTy;
> -  case Type::ULongTyID:   return Ty == Type::LongTy;
> -  case Type::LongTyID:return Ty == Type::ULongTy;
> -  case Type::PointerTyID: return isa(Ty);
> -  default:
> -break;
> -  }
> +  if (getTypeID() == Type::PointerTyID)
> +return isa(Ty);
>return false;  // Other types have no identity values
>  }

What is Type::canLosslesslyBitCastTo used by now?  Can we just  
eliminate it?


> +FunctionType::ParameterAttributes
> +FunctionType::getParamAttrs(unsigned Idx) const {
> +  if (!ParamAttrs)
> +return ParameterAttributes(0);
> +  if (Idx > ParamAttrs->size())
> +return ParameterAttributes(0);
> +  return (*ParamAttrs)[Idx];
> +}

Why does this map an out-of-range index onto attr 0?  Shouldn't this  
be an assert?

-Chris


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


Re: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y

2007-01-04 Thread Reid Spencer
Chris,

Yes, this looks fine.

On Thu, 2007-01-04 at 12:46 -0600, Chris Lattner wrote:
> 
> Changes in directory llvm/tools/llvm-upgrade:
> 
> UpgradeParser.y updated: 1.31 -> 1.32
> ---
> Log message:
> 
> If we hit a parse error, emit something bad to the output stream.  This 
> ensures that
>  llvm-upgrade < foo | llvm-as | llvm-dis
> 
> will fail if llvm-upgrade fails.
> 
> 
> 
> ---
> Diffs of the changes:  (+2 -0)
> 
>  UpgradeParser.y |2 ++
>  1 files changed, 2 insertions(+)
> 
> 
> Index: llvm/tools/llvm-upgrade/UpgradeParser.y
> diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.31 
> llvm/tools/llvm-upgrade/UpgradeParser.y:1.32
> --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.31  Wed Jan  3 17:43:55 2007
> +++ llvm/tools/llvm-upgrade/UpgradeParser.y   Thu Jan  4 12:45:51 2007
> @@ -72,6 +72,7 @@
>  
>if (yyparse()) {
>  std::cerr << "Parse failed.\n";
> +out << "llvm-upgrade parse failed.\n";
>  exit(1);
>}
>  }
> @@ -1597,5 +1598,6 @@
>else
>  errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
>std::cerr << "llvm-upgrade: " << errMsg << '\n';
> +  *O << "llvm-upgrade parse failed.\n";
>exit(1);
>  }
> 
> 
> 
> ___
> 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/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise.ll

2007-01-04 Thread Chris Lattner
On Jan 4, 2007, at 10:42 AM, Reid Spencer wrote:
> On Thu, 2007-01-04 at 09:54 -0800, Chris Lattner wrote:
>> Perhaps in addition to returning an error code, llvm-upgrade should
>> emit something like "parse failed" to the output stream, so that
>> later llvm-as's will die.
>
> How about we make llvm-as produce at least a warning and a non-zero
> result code when the input is empty. That way we don't mask the error
> and it isn't masked even if the source doesn't come from llvm-upgrade?

Except that an empty .ll file should be legal.  I just checked in a  
patch to llvm-upgrade, is it ok?

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


[llvm-commits] fix LTGT_EXPR

2007-01-04 Thread Chris Lattner

Applied:

Index: llvm-convert.cpp
===
--- llvm-convert.cpp(revision 121795)
+++ llvm-convert.cpp(working copy)
@@ -571,7 +571,7 @@ Value *TreeToLLVM::Emit(tree exp, Value
case UNGT_EXPR: Result = EmitCompare(exp, 0, 0,  
FCmpInst::FCMP_UGT); break;
case UNGE_EXPR: Result = EmitCompare(exp, 0, 0,  
FCmpInst::FCMP_UGE); break;
case UNEQ_EXPR: Result = EmitCompare(exp, 0, 0,  
FCmpInst::FCMP_UEQ); break;
-  case LTGT_EXPR: Result = EmitCompare(exp, 0, 0,  
FCmpInst::FCMP_UNE); break;
+  case LTGT_EXPR: Result = EmitCompare(exp, 0, 0,  
FCmpInst::FCMP_ONE); break;
case PLUS_EXPR: Result = EmitBinOp(exp, DestLoc,  
Instruction::Add);break;
case MINUS_EXPR:Result = EmitBinOp(exp, DestLoc,  
Instruction::Sub);break;
case MULT_EXPR: Result = EmitBinOp(exp, DestLoc,  
Instruction::Mul);break;

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


[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y

2007-01-04 Thread Chris Lattner


Changes in directory llvm/tools/llvm-upgrade:

UpgradeParser.y updated: 1.31 -> 1.32
---
Log message:

If we hit a parse error, emit something bad to the output stream.  This ensures 
that
 llvm-upgrade < foo | llvm-as | llvm-dis

will fail if llvm-upgrade fails.



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

 UpgradeParser.y |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/tools/llvm-upgrade/UpgradeParser.y
diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.31 
llvm/tools/llvm-upgrade/UpgradeParser.y:1.32
--- llvm/tools/llvm-upgrade/UpgradeParser.y:1.31Wed Jan  3 17:43:55 2007
+++ llvm/tools/llvm-upgrade/UpgradeParser.y Thu Jan  4 12:45:51 2007
@@ -72,6 +72,7 @@
 
   if (yyparse()) {
 std::cerr << "Parse failed.\n";
+out << "llvm-upgrade parse failed.\n";
 exit(1);
   }
 }
@@ -1597,5 +1598,6 @@
   else
 errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
   std::cerr << "llvm-upgrade: " << errMsg << '\n';
+  *O << "llvm-upgrade parse failed.\n";
   exit(1);
 }



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


Re: [llvm-commits] [llvm-gcc] SETCC Removal Patch (Please Commit)

2007-01-04 Thread Chris Lattner

On Jan 4, 2007, at 10:04 AM, Reid Spencer wrote:

> On Thu, 2007-01-04 at 09:56 -0800, Chris Lattner wrote:
>> On Jan 4, 2007, at 9:45 AM, Reid Spencer wrote:
>
>>
>> != and == are currently right (UNE and OEQ).  It's islessgreater
>> (LTGT_EXPR) that is wrong.
>
> Okay, can you just fix it then? I don't have a head version of your
> repository from which to make a patch for it and its probably a one  
> line
> change.

Good point, will do.

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


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise.ll

2007-01-04 Thread Reid Spencer
On Thu, 2007-01-04 at 09:54 -0800, Chris Lattner wrote:

> Perhaps in addition to returning an error code, llvm-upgrade should  
> emit something like "parse failed" to the output stream, so that  
> later llvm-as's will die.

How about we make llvm-as produce at least a warning and a non-zero
result code when the input is empty. That way we don't mask the error
and it isn't masked even if the source doesn't come from llvm-upgrade?

> 
> -Chris

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


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise.ll

2007-01-04 Thread Chris Lattner
>> Perhaps in addition to returning an error code, llvm-upgrade should
>> emit something like "parse failed" to the output stream, so that
>> later llvm-as's will die.
>
> Actually, it looks like there was something seriously broken locally
> in my tree.  Cleaning llvm-upgrade and rebuilding it seems to have
> cleared up many of the issues, but I still have some failures, e.g.
> in Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll:
>
> $ ../../../TestRunner.sh 2006-12-08-Ptr-ICmp-Branch.ll

Ah, you're way ahead of me.  Updating fixed it, thanks Reid!

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


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise.ll

2007-01-04 Thread Chris Lattner

On Jan 4, 2007, at 9:54 AM, Chris Lattner wrote:

>
> On Jan 4, 2007, at 9:49 AM, Chris Lattner wrote:
>
>>
>> llvm-upgrade gets a parse error on this testcase, so it's not being
>> tested at all.  This appears to be an llvm-upgrade bug:
>>
>>   $ llvm-upgrade 2002-03-21-MissedRaise.ll
>> llvm-upgrade: parse error
>> 2002-03-21-MissedRaise.ll:7:  while reading token: '%Hash'
>
> This actually affects a lot of testcases in the suite, leading me to
> believe that the testsuite isn't actually testing many programs.
> Reid, can you run llvm-upgrade on all the .ll files in llvm/test and
> figure out which ones it barfs on?
>
> This is a serious problem.  For example Regression/Transforms/
> LevelRaise/2003-05-01-CallCast.ll is reported as succeeding because
> llvm-upgrade fails to parse the input.  This means that there may be
> many tests failing and we don't know it because the failures are  
> masked.
>
> Perhaps in addition to returning an error code, llvm-upgrade should
> emit something like "parse failed" to the output stream, so that
> later llvm-as's will die.

Actually, it looks like there was something seriously broken locally  
in my tree.  Cleaning llvm-upgrade and rebuilding it seems to have  
cleared up many of the issues, but I still have some failures, e.g.  
in Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll:

$ ../../../TestRunner.sh 2006-12-08-Ptr-ICmp-Branch.ll
 TEST '2006-12-08-Ptr-ICmp-Branch.ll' FAILED!  

Command:
llvm-upgrade < 2006-12-08-Ptr-ICmp-Branch.ll | llvm-as | opt - 
simplifycfg | llvm-dis
Output:
llvm-as: :54,0: Reference to an invalid definition: 'tmp.s' of  
type 'i32'
opt: Standard Input is empty!
llvm-dis: Standard Input is empty!


Sorry for the confusion.

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


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise.ll

2007-01-04 Thread Reid Spencer
Chris, 

Here is what llvm-upgrade produces for this test case:

%Hash = type { { uint, sbyte*, \2 }**, int( uint )*, int }*
%hash = type { { uint, sbyte*, \2 }**, int( uint )*, int }
%hash_el = type { uint, sbyte*, \2 }*
implementation
define %Hash "MakeHash"(int %size, int( uint )* %map) {
%reg112 = malloc sbyte, uint 24
%reg115 = malloc sbyte, uint 96
%cast237 = bitcast sbyte* %reg112 to sbyte**
store sbyte* %reg115, sbyte** %cast237
%cast246 = bitcast sbyte* %reg112 to %Hash
ret %Hash %cast246

}

It does not fail. Are you sure you're working with TOT? There have been
changes made as late as yesterday that are needed in order for it to
work correctly.

Reid.

On Thu, 2007-01-04 at 09:54 -0800, Chris Lattner wrote:
> On Jan 4, 2007, at 9:49 AM, Chris Lattner wrote:
> 
> >
> > llvm-upgrade gets a parse error on this testcase, so it's not being
> > tested at all.  This appears to be an llvm-upgrade bug:
> >
> >   $ llvm-upgrade 2002-03-21-MissedRaise.ll
> > llvm-upgrade: parse error
> > 2002-03-21-MissedRaise.ll:7:  while reading token: '%Hash'
> 
> This actually affects a lot of testcases in the suite, leading me to  
> believe that the testsuite isn't actually testing many programs.   
> Reid, can you run llvm-upgrade on all the .ll files in llvm/test and  
> figure out which ones it barfs on?
> 
> This is a serious problem.  For example Regression/Transforms/ 
> LevelRaise/2003-05-01-CallCast.ll is reported as succeeding because  
> llvm-upgrade fails to parse the input.  This means that there may be  
> many tests failing and we don't know it because the failures are masked.
> 
> Perhaps in addition to returning an error code, llvm-upgrade should  
> emit something like "parse failed" to the output stream, so that  
> later llvm-as's will die.
> 
> -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


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll

2007-01-04 Thread Chris Lattner

This is another testcase which isn't being tested because llvm- 
upgrade apparently doesn't support "target".

-Chris

On Dec 29, 2006, at 12:02 PM, Reid Spencer wrote:

>
>
> Changes in directory llvm/test/Regression/Transforms/SimplifyCFG:
>
> 2006-12-08-Ptr-ICmp-Branch.ll updated: 1.1 -> 1.2
> ---
> Log message:
>
> Update tests that need to be run through llvm-upgrade. This is  
> necessary
> for upcoming changes to the llvm assembly grammar.
>
>
> ---
> Diffs of the changes:  (+1 -1)
>
>  2006-12-08-Ptr-ICmp-Branch.ll |2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
>
>
> Index: llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr- 
> ICmp-Branch.ll
> diff -u llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr- 
> ICmp-Branch.ll:1.1 llvm/test/Regression/Transforms/SimplifyCFG/ 
> 2006-12-08-Ptr-ICmp-Branch.ll:1.2
> --- llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp- 
> Branch.ll:1.1 Sat Dec 23 00:05:41 2006
> +++ llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp- 
> Branch.ll Fri Dec 29 14:01:32 2006
> @@ -1,4 +1,4 @@
> -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis
> +; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis
>  ; ModuleID = 'bugpoint-tooptimize.bc'
>  target datalayout = "e-p:32:32"
>  target endian = little
>
>
>
> ___
> 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] [llvm-gcc] SETCC Removal Patch (Please Commit)

2007-01-04 Thread Reid Spencer
On Thu, 2007-01-04 at 09:56 -0800, Chris Lattner wrote:
> On Jan 4, 2007, at 9:45 AM, Reid Spencer wrote:

> 
> != and == are currently right (UNE and OEQ).  It's islessgreater  
> (LTGT_EXPR) that is wrong.

Okay, can you just fix it then? I don't have a head version of your
repository from which to make a patch for it and its probably a one line
change.

> 
> -Chris

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


Re: [llvm-commits] [llvm-gcc] SETCC Removal Patch (Please Commit)

2007-01-04 Thread Chris Lattner

On Jan 4, 2007, at 9:45 AM, Reid Spencer wrote:

> On Thu, 2007-01-04 at 09:37 -0800, Chris Lattner wrote:
>> On Dec 22, 2006, at 10:08 PM, Reid Spencer wrote:
>>
>>> All,
>>>
>>> As the SetCondInst instruction has been replaced with the new  
>>> FCmpInst
>>> and ICmpInst instrucitons in LLVM, the attached patch compensates  
>>> for
>>> this in llvm-gcc. Since the Apple developers are unlikely to commit
>>> this
>>> for over a week, if you're working over the holidays you'll need to
>>> apply this manually to your llvm-gcc tree.
>>
>> This patch is incorrect for many FP comparisons.  It looks like
>> you've fixed almost all of them in later patches.  However LTGT_EXPR
>> should be FCMP_ONE, not FCMP_UNE, and that is still in mainline.
>
> This is something that was changed recently because it broke something
> for Rafael and he indicates that gcc was doing, essentially an  
> FCMP_UNE.
> I thought != was supposed to be UNE while == was supposed to be  
> ONE. You
> made that comment to me in a previous review.

!= and == are currently right (UNE and OEQ).  It's islessgreater  
(LTGT_EXPR) that is wrong.

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


[llvm-commits] CVS: llvm/docs/CommandGuide/llvmc.pod

2007-01-04 Thread Reid Spencer


Changes in directory llvm/docs/CommandGuide:

llvmc.pod updated: 1.12 -> 1.13
---
Log message:

Document this tool as experimental and list its deficiencies.


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

 llvmc.pod |   31 ---
 1 files changed, 28 insertions(+), 3 deletions(-)


Index: llvm/docs/CommandGuide/llvmc.pod
diff -u llvm/docs/CommandGuide/llvmc.pod:1.12 
llvm/docs/CommandGuide/llvmc.pod:1.13
--- llvm/docs/CommandGuide/llvmc.pod:1.12   Thu Apr 20 09:17:47 2006
+++ llvm/docs/CommandGuide/llvmc.podThu Jan  4 11:55:11 2007
@@ -2,7 +2,7 @@
 
 =head1 NAME
 
-llvmc - The LLVM Compiler Driver
+llvmc - The LLVM Compiler Driver (experimental)
 
 =head1 SYNOPSIS
 
@@ -12,8 +12,8 @@
 
 B is a configurable driver for invoking other LLVM (and non-LLVM) tools
 in order to compile, optimize and link software for multiple languages. For
-those familiar with FSF's B tool, it is very similar.  B has the
-following goals:
+those familiar with FSF's B tool, it is very similar.  Please note that
+B is considered an experimental tool.  B has the following goals:
 
 =over
 
@@ -395,6 +395,31 @@
 status, pending actions will be discarded and B will return the
 same result code as the failing compilation tool.
 
+=head1 DEFICIENCIES
+
+B is considered an experimental LLVM tool because it has these
+deficiencies: 
+
+=over
+
+=item Insufficient support for native linking
+
+Because B doesn't handle native linking, neither can B
+
+=item Poor configuration support
+
+The support for configuring new languages, etc. is weak. There are many
+command line configurations that cannot be achieved with the current
+support. Furthermore the grammar is cumbersome for configuration files.
+Please see L for further details.
+
+=item Does not handle target specific configurations
+
+This is one of the major deficiencies, also addressed in 
+L
+
+=back
+
 =head1 SEE ALSO
 
 L, L, L, L, 



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


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise.ll

2007-01-04 Thread Chris Lattner

On Jan 4, 2007, at 9:49 AM, Chris Lattner wrote:

>
> llvm-upgrade gets a parse error on this testcase, so it's not being
> tested at all.  This appears to be an llvm-upgrade bug:
>
>   $ llvm-upgrade 2002-03-21-MissedRaise.ll
> llvm-upgrade: parse error
> 2002-03-21-MissedRaise.ll:7:  while reading token: '%Hash'

This actually affects a lot of testcases in the suite, leading me to  
believe that the testsuite isn't actually testing many programs.   
Reid, can you run llvm-upgrade on all the .ll files in llvm/test and  
figure out which ones it barfs on?

This is a serious problem.  For example Regression/Transforms/ 
LevelRaise/2003-05-01-CallCast.ll is reported as succeeding because  
llvm-upgrade fails to parse the input.  This means that there may be  
many tests failing and we don't know it because the failures are masked.

Perhaps in addition to returning an error code, llvm-upgrade should  
emit something like "parse failed" to the output stream, so that  
later llvm-as's will die.

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


[llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h

2007-01-04 Thread Chris Lattner


Changes in directory llvm/include/llvm:

DerivedTypes.h updated: 1.75 -> 1.76
---
Log message:

remove the 'protected' workaround now that we don't care about gcc 2.95 anymore.
Reid already did this for FunctionType, this just cleans the rest up.


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

 DerivedTypes.h |   39 ---
 1 files changed, 39 deletions(-)


Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.75 
llvm/include/llvm/DerivedTypes.h:1.76
--- llvm/include/llvm/DerivedTypes.h:1.75   Sat Dec 30 23:22:12 2006
+++ llvm/include/llvm/DerivedTypes.hThu Jan  4 11:50:42 2007
@@ -186,16 +186,7 @@
   friend class TypeMap;
   StructType(const StructType &);   // Do not implement
   const StructType &operator=(const StructType &);  // Do not implement
-
-protected:
-  /// This should really be private, but it squelches a bogus warning
-  /// from GCC to make them protected:  warning: `class StructType' only
-  /// defines private constructors and has no friends
-  ///
-  /// Private ctor - Only can be created by a static member...
-  ///
   StructType(const std::vector &Types, bool isPacked);
-
 public:
   /// StructType::get - This static method is the primary way to create a
   /// StructType.
@@ -282,15 +273,7 @@
 
   ArrayType(const ArrayType &);   // Do not implement
   const ArrayType &operator=(const ArrayType &);  // Do not implement
-protected:
-  /// This should really be private, but it squelches a bogus warning
-  /// from GCC to make them protected:  warning: `class ArrayType' only
-  /// defines private constructors and has no friends
-  ///
-  /// Private ctor - Only can be created by a static member...
-  ///
   ArrayType(const Type *ElType, uint64_t NumEl);
-
 public:
   /// ArrayType::get - This static method is the primary way to construct an
   /// ArrayType
@@ -318,15 +301,7 @@
 
   PackedType(const PackedType &);   // Do not implement
   const PackedType &operator=(const PackedType &);  // Do not implement
-protected:
-  /// This should really be private, but it squelches a bogus warning
-  /// from GCC to make them protected:  warning: `class PackedType' only
-  /// defines private constructors and has no friends
-  ///
-  /// Private ctor - Only can be created by a static member...
-  ///
   PackedType(const Type *ElType, unsigned NumEl);
-
 public:
   /// PackedType::get - This static method is the primary way to construct an
   /// PackedType
@@ -359,14 +334,7 @@
   friend class TypeMap;
   PointerType(const PointerType &);   // Do not implement
   const PointerType &operator=(const PointerType &);  // Do not implement
-protected:
-  // This should really be private, but it squelches a bogus warning
-  // from GCC to make them protected:  warning: `class PointerType' only
-  // defines private constructors and has no friends
-
-  // Private ctor - Only can be created by a static member...
   PointerType(const Type *ElType);
-
 public:
   /// PointerType::get - This is the only way to construct a new pointer type.
   static PointerType *get(const Type *ElementType);
@@ -388,14 +356,7 @@
 class OpaqueType : public DerivedType {
   OpaqueType(const OpaqueType &);   // DO NOT IMPLEMENT
   const OpaqueType &operator=(const OpaqueType &);  // DO NOT IMPLEMENT
-protected:
-  /// This should really be private, but it squelches a bogus warning
-  /// from GCC to make them protected:  warning: `class OpaqueType' only
-  /// defines private constructors and has no friends
-  ///
-  /// Private ctor - Only can be created by a static member...
   OpaqueType();
-
 public:
   /// OpaqueType::get - Static factory method for the OpaqueType class...
   ///



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


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise.ll

2007-01-04 Thread Chris Lattner

llvm-upgrade gets a parse error on this testcase, so it's not being  
tested at all.  This appears to be an llvm-upgrade bug:

  $ llvm-upgrade 2002-03-21-MissedRaise.ll
llvm-upgrade: parse error
2002-03-21-MissedRaise.ll:7:  while reading token: '%Hash'

-Chris

On Dec 29, 2006, at 12:02 PM, Reid Spencer wrote:

>
>
> Changes in directory llvm/test/Regression/Transforms/LevelRaise:
>
> 2002-03-21-MissedRaise.ll updated: 1.8 -> 1.9
> ---
> Log message:
>
> Update tests that need to be run through llvm-upgrade. This is  
> necessary
> for upcoming changes to the llvm assembly grammar.
>
>
> ---
> Diffs of the changes:  (+1 -1)
>
>  2002-03-21-MissedRaise.ll |2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
>
>
> Index: llvm/test/Regression/Transforms/LevelRaise/2002-03-21- 
> MissedRaise.ll
> diff -u llvm/test/Regression/Transforms/LevelRaise/2002-03-21- 
> MissedRaise.ll:1.8 llvm/test/Regression/Transforms/LevelRaise/ 
> 2002-03-21-MissedRaise.ll:1.9
> --- llvm/test/Regression/Transforms/LevelRaise/2002-03-21- 
> MissedRaise.ll:1.8Wed Dec  6 22:20:23 2006
> +++ llvm/test/Regression/Transforms/LevelRaise/2002-03-21- 
> MissedRaise.llFri Dec 29 14:01:32 2006
> @@ -2,7 +2,7 @@
>  ; LevelRaise should eliminate all cast instructions from this  
> testcase.
>  ;
>  ; XFAIL: *
> -; RUN: llvm-as < %s | opt -raise | llvm-dis | notcast
> +; RUN: llvm-upgrade < %s | llvm-as | opt -raise | llvm-dis | notcast
>
>   %Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
>   %hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int }
>
>
>
> ___
> 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/test/Regression/Transforms/LevelRaise/2002-02-11-ArrayShape.ll

2007-01-04 Thread Chris Lattner


Changes in directory llvm/test/Regression/Transforms/LevelRaise:

2002-02-11-ArrayShape.ll (r1.7) removed
---
Log message:

remove xfailed test that depends on obsolete argument to lli


---
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


Re: [llvm-commits] [llvm-gcc] SETCC Removal Patch (Please Commit)

2007-01-04 Thread Reid Spencer
On Thu, 2007-01-04 at 09:37 -0800, Chris Lattner wrote:
> On Dec 22, 2006, at 10:08 PM, Reid Spencer wrote:
> 
> > All,
> >
> > As the SetCondInst instruction has been replaced with the new FCmpInst
> > and ICmpInst instrucitons in LLVM, the attached patch compensates for
> > this in llvm-gcc. Since the Apple developers are unlikely to commit  
> > this
> > for over a week, if you're working over the holidays you'll need to
> > apply this manually to your llvm-gcc tree.
> 
> This patch is incorrect for many FP comparisons.  It looks like  
> you've fixed almost all of them in later patches.  However LTGT_EXPR  
> should be FCMP_ONE, not FCMP_UNE, and that is still in mainline.

This is something that was changed recently because it broke something
for Rafael and he indicates that gcc was doing, essentially an FCMP_UNE.
I thought != was supposed to be UNE while == was supposed to be ONE. You
made that comment to me in a previous review.

In any event, its easy enough to fix.

Reid.

> 
> -Chris

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


Re: [llvm-commits] [llvm-gcc] SETCC Removal Patch (Please Commit)

2007-01-04 Thread Chris Lattner

On Dec 22, 2006, at 10:08 PM, Reid Spencer wrote:

> All,
>
> As the SetCondInst instruction has been replaced with the new FCmpInst
> and ICmpInst instrucitons in LLVM, the attached patch compensates for
> this in llvm-gcc. Since the Apple developers are unlikely to commit  
> this
> for over a week, if you're working over the holidays you'll need to
> apply this manually to your llvm-gcc tree.

This patch is incorrect for many FP comparisons.  It looks like  
you've fixed almost all of them in later patches.  However LTGT_EXPR  
should be FCMP_ONE, not FCMP_UNE, and that is still in mainline.

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


[llvm-commits] [llvm-gcc4] Second round of get rid of massive macro (PowerPC.)

2007-01-04 Thread Jim Laskey

Combined patch [checked in.]  Waiting for reviews.

-- Jim



rs6000.patch
Description: Binary data


smime.p7s
Description: S/MIME cryptographic signature
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] [llvm-gcc4]First round of get rid of massive macro (PowerPC.)

2007-01-04 Thread Reid Spencer
That is *such* a welcome change :)

Reid.

On Thu, 2007-01-04 at 11:41 -0400, Jim Laskey wrote:
> This is just a start.  Next round will clean up #includes and macro  
> usage.
> 
> -- Jim
> 
> 
> ___
> 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/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll

2007-01-04 Thread Reid Spencer


Changes in directory llvm/test/Regression/Transforms/SimplifyCFG:

2006-12-08-Ptr-ICmp-Branch.ll updated: 1.3 -> 1.4
---
Log message:

Remove a manual renaming of a variable that was introduced before
llvm-upgrade could properly handle collapsed type planes.


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

 2006-12-08-Ptr-ICmp-Branch.ll |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll
diff -u 
llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll:1.3 
llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll:1.4
--- 
llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll:1.3   
Sun Dec 31 00:02:00 2006
+++ llvm/test/Regression/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll   
Thu Jan  4 10:46:46 2007
@@ -56,7 +56,7 @@
 
 bb: ; preds = %bb33
 %tmp = load %struct.FILE** %f_addr  ; <%struct.FILE*> 
[#uses=1]
-%tmp.r = call int %_IO_getc( %struct.FILE* %tmp ) ;  
[#uses=1]
+%tmp = call int %_IO_getc( %struct.FILE* %tmp ) ;  
[#uses=1]
 %tmp6 = call int %tolower( int %tmp )   ;  [#uses=1]
 %tmp6 = trunc int %tmp6 to sbyte;  [#uses=1]
 store sbyte %tmp6, sbyte* %c



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


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

2007-01-04 Thread Reid Spencer


Changes in directory llvm/docs:

LangRef.html updated: 1.185 -> 1.186
---
Log message:

Clean up usage of "unsigned" and "signed" in the documentation to indicate
only that specific instructions regard their operands as signed and 
unsigned not that the operands *are* signed or unsigned.


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

 LangRef.html |   43 ++-
 1 files changed, 22 insertions(+), 21 deletions(-)


Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.185 llvm/docs/LangRef.html:1.186
--- llvm/docs/LangRef.html:1.185Wed Jan  3 23:19:58 2007
+++ llvm/docs/LangRef.html  Thu Jan  4 10:43:23 2007
@@ -857,12 +857,12 @@
 
   [40 x i32 ]
   [41 x i32 ]
-  [40 x i32]
+  [40 x i8]
 
 
-  Array of 40 integer values.
-  Array of 41 integer values.
-  Array of 40 unsigned integer values.
+  Array of 40 32-bit integer values.
+  Array of 41 32-bit integer values.
+  Array of 40 8-bit integer values.
 
   
 
@@ -872,12 +872,12 @@
 
   [3 x [4 x i32]]
   [12 x [10 x float]]
-  [2 x [3 x [4 x i32]]]
+  [2 x [3 x [4 x i16]]]
 
 
-  3x4 array of integer values.
+  3x4 array of 32-bit integer values.
   12x10 array of single precision floating point values.
-  2x3x4 array of unsigned integer values.
+  2x3x4 array of 16-bit integer  values.
 
   
 
@@ -927,7 +927,7 @@
   
 i32 (i8*, ...)
 A vararg function that takes at least one 
-  pointer to i8  (signed char in C), 
+  pointer to i8  (char in C), 
   which returns an integer.  This is the signature for printf in 
   LLVM.
 
@@ -1054,12 +1054,12 @@
 
   <4 x i32>
   <8 x float>
-  <2 x i32>
+  <2 x i64>
 
 
-  Packed vector of 4 integer values.
+  Packed vector of 4 32-bit integer values.
   Packed vector of 8 floating-point values.
-  Packed vector of 2 unsigned integer values.
+  Packed vector of 2 64-bit integer values.
 
   
 
@@ -1123,7 +1123,7 @@
   Integer constants
 
   Standard integers (such as '4') are constants of the integer type.  Negative numbers may be used with signed
+  href="#t_integer">integer type.  Negative numbers may be used with 
   integer types.
   
 
@@ -1770,8 +1770,9 @@
 Semantics:
 The value produced is the integer or floating point product of the
 two operands.
-There is no signed vs unsigned multiplication.  The appropriate
-action is taken based on the type of the operand.
+Because the operands are the same width, the result of an integer
+multiplication is the same whether the operands should be deemed unsigned or
+signed.
 Example:
    = mul i32 4, %var  ; yields {i32}:result = 4 
* %var
 
@@ -2127,9 +2128,9 @@
  href="#t_integer">integer type.  The second argument must be an 
'i8' type.
 
 Semantics:
-This instruction always performs a logical shift right operation, regardless
-of whether the arguments are unsigned or not. The var2 most 
significant
-bits will be filled with zero bits after the shift.
+This instruction always performs a logical shift right operation. The 
+var2 most significant bits will be filled with zero bits after the 
+shift.
 
 Example:
 
@@ -4387,7 +4388,7 @@
 
 
 The only argument is the value to be counted.  The argument may be of any
-unsigned integer type.  The return type must match the argument type.
+integer type.  The return type must match the argument type.
 
 
 Semantics:
@@ -4423,7 +4424,7 @@
 
 
 The only argument is the value to be counted.  The argument may be of any
-unsigned integer type. The return type must match the argument type.
+integer type. The return type must match the argument type.
 
 
 Semantics:
@@ -4463,7 +4464,7 @@
 
 
 The only argument is the value to be counted.  The argument may be of any
-unsigned integer type.  The return type must match the argument type.
+integer type.  The return type must match the argument type.
 
 
 Semantics:
@@ -4500,7 +4501,7 @@
 
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.org";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/01/04 05:19:58 $
+  Last modified: $Date: 2007/01/04 16:43:23 $
 
 
 



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


[llvm-commits] [llvm-gcc4]First round of get rid of massive macro (PowerPC.)

2007-01-04 Thread Jim Laskey
This is just a start.  Next round will clean up #includes and macro  
usage.


-- Jim




rs6000.patch
Description: Binary data




smime.p7s
Description: S/MIME cryptographic signature
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/ctors_dtors.ll

2007-01-04 Thread Lauro Ramos Venancio


Changes in directory llvm/test/Regression/CodeGen/ARM:

ctors_dtors.ll added (r1.1)
---
Log message:

Add test for constructor and destructor sections. 


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

 ctors_dtors.ll |   16 
 1 files changed, 16 insertions(+)


Index: llvm/test/Regression/CodeGen/ARM/ctors_dtors.ll
diff -c /dev/null llvm/test/Regression/CodeGen/ARM/ctors_dtors.ll:1.1
*** /dev/null   Thu Jan  4 08:41:43 2007
--- llvm/test/Regression/CodeGen/ARM/ctors_dtors.ll Thu Jan  4 08:41:33 2007
***
*** 0 
--- 1,16 
+ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -o %t.s -f &&
+ ; RUN: grep '\.section \.ctors,"aw",.progbits' %t.s | grep % &&
+ ; RUN: grep '\.section \.dtors,"aw",.progbits' %t.s | grep %
+ 
+ %llvm.global_ctors = appending global [1 x { int, void ()* }] [ { int, void 
()* } { int 65535, void ()* %__mf_init } ]; <[1 x { int, void 
()* }]*> [#uses=0]
+ %llvm.global_dtors = appending global [1 x { int, void ()* }] [ { int, void 
()* } { int 65535, void ()* %__mf_fini } ]; <[1 x { int, void 
()* }]*> [#uses=0]
+ 
+ void %__mf_init() {
+ entry:
+   ret void
+ }
+ 
+ void %__mf_fini() {
+ entry:
+   ret void
+ }



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


[llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/extloadi1.ll

2007-01-04 Thread Lauro Ramos Venancio


Changes in directory llvm/test/Regression/CodeGen/ARM:

extloadi1.ll added (r1.1)
---
Log message:

Add extload(i1) test.


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

 extloadi1.ll |   22 ++
 1 files changed, 22 insertions(+)


Index: llvm/test/Regression/CodeGen/ARM/extloadi1.ll
diff -c /dev/null llvm/test/Regression/CodeGen/ARM/extloadi1.ll:1.1
*** /dev/null   Thu Jan  4 08:27:31 2007
--- llvm/test/Regression/CodeGen/ARM/extloadi1.ll   Thu Jan  4 08:27:21 2007
***
*** 0 
--- 1,22 
+ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm
+ 
+ %handler_installed.6144.b = external global bool;  
[#uses=1]
+ 
+ 
+ void %__mf_sigusr1_respond() {
+ entry:
+   %tmp8.b = load bool* %handler_installed.6144.b  ;  
[#uses=1]
+   br bool false, label %cond_true7, label %cond_next
+ 
+ cond_next:; preds = %entry
+   br bool %tmp8.b, label %bb, label %cond_next3
+ 
+ cond_next3:   ; preds = %cond_next
+   ret void
+ 
+ bb:   ; preds = %cond_next
+   ret void
+ 
+ cond_true7:   ; preds = %entry
+   ret void
+ }



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


[llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/fcopysign.ll

2007-01-04 Thread Lauro Ramos Venancio


Changes in directory llvm/test/Regression/CodeGen/ARM:

fcopysign.ll added (r1.1)
---
Log message:

Add test for FCOPYSIGN.


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

 fcopysign.ll |   21 +
 1 files changed, 21 insertions(+)


Index: llvm/test/Regression/CodeGen/ARM/fcopysign.ll
diff -c /dev/null llvm/test/Regression/CodeGen/ARM/fcopysign.ll:1.1
*** /dev/null   Thu Jan  4 08:24:42 2007
--- llvm/test/Regression/CodeGen/ARM/fcopysign.ll   Thu Jan  4 08:24:32 2007
***
*** 0 
--- 1,21 
+ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm
+ 
+ define csretcc void %__divsc3({ float, float }* %agg.result, float %a, float 
%b, float %c, float %d) {
+ entry:
+   br bool false, label %bb, label %cond_next375
+ 
+ bb:   ; preds = %entry
+   %tmp81 = tail call float %copysignf( float 0x7FF0, float %c 
)   ;  [#uses=1]
+   %tmp87 = mul float %tmp81, %b   ;  [#uses=1]
+   br label %cond_next375
+ 
+ cond_next375: ; preds = %bb, %entry
+   %y.1 = phi float [ %tmp87, %bb ], [ 0.00e+00, %entry ]  
;  [#uses=0]
+   ret void
+ }
+ 
+ declare float %fabsf(float)
+ 
+ declare bool %llvm.isunordered.f32(float, float)
+ 
+ declare float %copysignf(float, float)



___
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/ARMISelDAGToDAG.cpp

2007-01-04 Thread Lauro Ramos Venancio


Changes in directory llvm/lib/Target/ARM:

ARMISelDAGToDAG.cpp updated: 1.96 -> 1.97
---
Log message:

Expand SELECT (f32/f64) and FCOPYSIGN (f32/f64).


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

 ARMISelDAGToDAG.cpp |5 +
 1 files changed, 5 insertions(+)


Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.96 
llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.97
--- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.96Sun Dec 31 12:52:39 2006
+++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Thu Jan  4 08:01:38 2007
@@ -67,6 +67,8 @@
   setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1 , Expand);
 
   setOperationAction(ISD::SELECT, MVT::i32, Expand);
+  setOperationAction(ISD::SELECT, MVT::f32, Expand);
+  setOperationAction(ISD::SELECT, MVT::f64, Expand);
 
   setOperationAction(ISD::SETCC, MVT::i32, Expand);
   setOperationAction(ISD::SETCC, MVT::f32, Expand);
@@ -104,6 +106,9 @@
   setOperationAction(ISD::ConstantFP, MVT::f64, Expand);
   setOperationAction(ISD::ConstantFP, MVT::f32, Expand);
 
+  setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
+  setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
+
   setStackPointerRegisterToSaveRestore(ARM::R13);
 
   setSchedulingPreference(SchedulingForRegPressure);



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


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

2007-01-04 Thread Bill Wendling


Changes in directory llvm/docs:

CodingStandards.html updated: 1.33 -> 1.34
---
Log message:

Removed reference to "cnull" because typical users shouldn't need to use
it.


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

 CodingStandards.html |8 +---
 1 files changed, 1 insertion(+), 7 deletions(-)


Index: llvm/docs/CodingStandards.html
diff -u llvm/docs/CodingStandards.html:1.33 llvm/docs/CodingStandards.html:1.34
--- llvm/docs/CodingStandards.html:1.33 Sun Dec 17 05:40:40 2006
+++ llvm/docs/CodingStandards.html  Thu Jan  4 02:38:04 2007
@@ -538,12 +538,6 @@
   llvm::cin >> Var;
 
 
-  N/A
-  llvm::cnull >> Var;
-N.B. Eats up argument Var outputting
-nothing.
-
-
   std::ostream
   llvm::OStream
 
@@ -765,7 +759,7 @@
 
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.org";>LLVM Compiler Infrastructure
-  Last modified: $Date: 2006/12/17 11:40:40 $
+  Last modified: $Date: 2007/01/04 08:38:04 $
 
 
 



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


Re: [llvm-commits] CVS: llvm/docs/GettingStarted.html

2007-01-04 Thread Bill Wendling
On Jan 3, 2007, at 11:08 PM, Chris Lattner wrote:

>
>
> Changes in directory llvm/docs:
>
> GettingStarted.html updated: 1.150 -> 1.151
> ---
> Log message:
>
> ding dong llvm-gcc3 is dead
>
>
YAY THANK GOD


-bw



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