Re: [llvm-commits] [llvm-gcc-4.2] r47180 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h llvm-types.cpp

2008-02-16 Thread Duncan Sands
Hi Dale,

 Put back fixed version of code to avoid copying
 padding within structs (sometimes).

if this means that ConvertUNION doesn't have to
muck around with fixing up padding elements anymore,
can you please remove that code.

Thanks!

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


Re: [llvm-commits] [llvm] r47204 - in /llvm/trunk: docs/ include/llvm/ include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/Alpha/ lib/Target/X86/ test/CodeGen/Alpha/ test/CodeGen/X8

2008-02-16 Thread Duncan Sands
Hi Andrew,

 +handling llvm.memory.barrier on pre SSE2 cpus
 +
 +should generate:
 +lock ; mov %esp, %esp

the linux kernel uses

lock; addl $0,0(%esp)

I don't know which is better (if any).

Ciao,

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


Re: [llvm-commits] [llvm-gcc-4.2] r47205 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

2008-02-16 Thread Chris Lattner
 I am going to temporarily disable this if that's the case. Please  
 take
 a look.

 Yes please do.  Until ppc has support for memory.barrier, that file
 won't compile.  The builtin was just being ignored before.  I'll see
 about ppc support tomorrow.

Please set it to expand by default (in the TargetLowering ctor).   
Targets that implement it can set it to legal.

Expand for this intrinsic should lower it to a libgcc libcall.

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


[llvm-commits] [llvm] r47211 - /llvm/trunk/docs/GCCFEBuildInstrs.html

2008-02-16 Thread Duncan Sands
Author: baldrick
Date: Sat Feb 16 03:47:41 2008
New Revision: 47211

URL: http://llvm.org/viewvc/llvm-project?rev=47211view=rev
Log:
Try to clarify which compilers can be used for the
build.

Modified:
llvm/trunk/docs/GCCFEBuildInstrs.html

Modified: llvm/trunk/docs/GCCFEBuildInstrs.html
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GCCFEBuildInstrs.html?rev=47211r1=47210r2=47211view=diff

==
--- llvm/trunk/docs/GCCFEBuildInstrs.html (original)
+++ llvm/trunk/docs/GCCFEBuildInstrs.html Sat Feb 16 03:47:41 2008
@@ -92,12 +92,13 @@
   systems without some work./p/li
   lipThe build requires having a compiler that supports Ada, C and C++.
   The Ada front-end is written in Ada so an Ada compiler is needed to
-  build it.  What is more, the Ada compiler must not be more recent
-  than what it is trying to compile, otherwise the build will fail.
-  This rules out gcc-4.3 (but not gcc-4.2) and also the
-  a href=http://libre.adacore.com/;2007 GNAT GPL Edition/a.
-  The LLVM parts of llvm-gcc are written in C++ so a C++
-  compiler is needed to build them.  The rest of gcc is written in C.
+  build it.  Appropriate Ada compilers are gcc-4.2 (or earlier) or the
+  a href=http://libre.adacore.com/;2006 GNAT GPL Edition/a
+  (or earlier).  As a general rule, the Ada compiler used for the
+  build must not be more recent than the Ada compiler it is building.
+  This is why the build fails with gcc-4.3 and the 2007 GNAT GPL Edition.
+  The LLVM parts of llvm-gcc are written in C++ so a C++ compiler is
+  needed to build them.  The rest of gcc is written in C.
   Some linux distributions provide a version of gcc that supports all
   three languages (the Ada part often comes as an add-on package to
   the rest of gcc).  Otherwise it is possible to combine two versions


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


[llvm-commits] [llvm] r47212 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeTypes.h LegalizeTypesExpand.cpp

2008-02-16 Thread Duncan Sands
Author: baldrick
Date: Sat Feb 16 04:29:26 2008
New Revision: 47212

URL: http://llvm.org/viewvc/llvm-project?rev=47212view=rev
Log:
Teach LegalizeTypes how to expand the operands of
br_cc.  This fixes 5 make check failures.

Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=47212r1=47211r2=47212view=diff

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Sat Feb 16 04:29:26 2008
@@ -238,14 +238,15 @@
 
   // Operand Expansion.
   bool ExpandOperand(SDNode *N, unsigned OperandNo);
-  SDOperand ExpandOperand_TRUNCATE(SDNode *N);
   SDOperand ExpandOperand_BIT_CONVERT(SDNode *N);
-  SDOperand ExpandOperand_UINT_TO_FP(SDOperand Source, MVT::ValueType DestTy);
-  SDOperand ExpandOperand_SINT_TO_FP(SDOperand Source, MVT::ValueType DestTy);
+  SDOperand ExpandOperand_BR_CC(SDNode *N);
   SDOperand ExpandOperand_EXTRACT_ELEMENT(SDNode *N);
   SDOperand ExpandOperand_SETCC(SDNode *N);
+  SDOperand ExpandOperand_SINT_TO_FP(SDOperand Source, MVT::ValueType DestTy);
   SDOperand ExpandOperand_STORE(StoreSDNode *N, unsigned OpNo);
-  
+  SDOperand ExpandOperand_TRUNCATE(SDNode *N);
+  SDOperand ExpandOperand_UINT_TO_FP(SDOperand Source, MVT::ValueType DestTy);
+
   void ExpandSetCCOperands(SDOperand NewLHS, SDOperand NewRHS,
ISD::CondCode CCCode);
   

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=47212r1=47211r2=47212view=diff

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Sat Feb 16 
04:29:26 2008
@@ -850,6 +850,8 @@
   Res = ExpandOperand_UINT_TO_FP(N-getOperand(0), N-getValueType(0)); 
   break;
 case ISD::EXTRACT_ELEMENT: Res = ExpandOperand_EXTRACT_ELEMENT(N); break;
+
+case ISD::BR_CC:   Res = ExpandOperand_BR_CC(N); break;
 case ISD::SETCC:   Res = ExpandOperand_SETCC(N); break;
 
 case ISD::STORE:
@@ -976,6 +978,24 @@
   return castConstantSDNode(N-getOperand(1))-getValue() ? Hi : Lo;
 }
 
+SDOperand DAGTypeLegalizer::ExpandOperand_BR_CC(SDNode *N) {
+  SDOperand NewLHS = N-getOperand(2), NewRHS = N-getOperand(3);
+  ISD::CondCode CCCode = castCondCodeSDNode(N-getOperand(1))-get();
+  ExpandSetCCOperands(NewLHS, NewRHS, CCCode);
+
+  // If ExpandSetCCOperands returned a scalar, we need to compare the result
+  // against zero to select between true and false values.
+  if (NewRHS.Val == 0) {
+NewRHS = DAG.getConstant(0, NewLHS.getValueType());
+CCCode = ISD::SETNE;
+  }
+
+  // Update N to have the operands specified.
+  return DAG.UpdateNodeOperands(SDOperand(N, 0), N-getOperand(0),
+DAG.getCondCode(CCCode), NewLHS, NewRHS,
+N-getOperand(4));
+}
+
 SDOperand DAGTypeLegalizer::ExpandOperand_SETCC(SDNode *N) {
   SDOperand NewLHS = N-getOperand(0), NewRHS = N-getOperand(1);
   ISD::CondCode CCCode = castCondCodeSDNode(N-getOperand(2))-get();


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


[llvm-commits] [llvm] r47213 - in /llvm/trunk/lib: CodeGen/SelectionDAG/LegalizeDAG.cpp Target/ARM/ARMISelLowering.cpp Target/CBackend/CBackend.cpp Target/CellSPU/SPUISelLowering.cpp Target/IA64/IA64I

2008-02-16 Thread Andrew Lenharth
Author: alenhar2
Date: Sat Feb 16 08:46:26 2008
New Revision: 47213

URL: http://llvm.org/viewvc/llvm-project?rev=47213view=rev
Log:
I cannot find a libgcc function for this builtin.  Therefor expanding it to a 
noop (which is how it use to be treated).  If someone who knows the x86 backend 
better than me could tell me how to get a lock prefix on an instruction, that 
would be nice to complete x86 support.

Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/CBackend/CBackend.cpp
llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=47213r1=47212r2=47213view=diff

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat Feb 16 08:46:26 2008
@@ -1135,11 +1135,21 @@
 
   case ISD::MEMBARRIER: {
 assert(Node-getNumOperands() == 6  Invalid MemBarrier node!);
-SDOperand Ops[6];
-Ops[0] = LegalizeOp(Node-getOperand(0));  // Legalize the chain.
-for (int x = 1; x  6; ++x)
-  Ops[x] = PromoteOp(Node-getOperand(x));
-Result = DAG.UpdateNodeOperands(Result, Ops[0], 6);
+switch (TLI.getOperationAction(ISD::MEMBARRIER, MVT::Other)) {
+default: assert(0  This action is not supported yet!);
+case TargetLowering::Legal: {
+  SDOperand Ops[6];
+  Ops[0] = LegalizeOp(Node-getOperand(0));  // Legalize the chain.
+  for (int x = 1; x  6; ++x)
+Ops[x] = PromoteOp(Node-getOperand(x));
+  Result = DAG.UpdateNodeOperands(Result, Ops[0], 6);
+  break;
+}
+case TargetLowering::Expand:
+  //There is no libgcc call for this op
+  Result = Node-getOperand(0);  // Noop
+break;
+}
 break;
   }
 

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=47213r1=47212r2=47213view=diff

==
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Sat Feb 16 08:46:26 2008
@@ -210,6 +210,7 @@
   setOperationAction(ISD::STACKSAVE,  MVT::Other, Expand); 
   setOperationAction(ISD::STACKRESTORE,   MVT::Other, Expand);
   setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32  , Expand);
+  setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
 
   if (!Subtarget-hasV6Ops()) {
 setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i16, Expand);

Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=47213r1=47212r2=47213view=diff

==
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Sat Feb 16 08:46:26 2008
@@ -2459,6 +2459,7 @@
 if (Function *F = CI-getCalledFunction())
   switch (F-getIntrinsicID()) {
   case Intrinsic::not_intrinsic:
+  case Intrinsic::memory_barrier:
   case Intrinsic::vastart:
   case Intrinsic::vacopy:
   case Intrinsic::vaend:
@@ -2544,6 +2545,9 @@
 WroteCallee = true;
 break;
   }
+  case Intrinsic::memory_barrier:
+Out  0; __sync_syncronize();
+return;
   case Intrinsic::vastart:
 Out  0; ;
 

Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=47213r1=47212r2=47213view=diff

==
--- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Sat Feb 16 08:46:26 2008
@@ -181,7 +181,8 @@
   setOperationAction(ISD::MEMMOVE, MVT::Other, Expand);
   setOperationAction(ISD::MEMSET, MVT::Other, Expand);
   setOperationAction(ISD::MEMCPY, MVT::Other, Expand);
-  
+  setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand);
+
   // PowerPC has no SREM/UREM instructions
   setOperationAction(ISD::SREM, MVT::i32, Expand);
   setOperationAction(ISD::UREM, MVT::i32, Expand);

Modified: llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp?rev=47213r1=47212r2=47213view=diff


[llvm-commits] [llvm-gcc-4.2] r47214 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

2008-02-16 Thread Andrew Lenharth
Author: alenhar2
Date: Sat Feb 16 08:47:29 2008
New Revision: 47214

URL: http://llvm.org/viewvc/llvm-project?rev=47214view=rev
Log:
reenable, as no backend should crash on the intrinsic now

Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=47214r1=47213r2=47214view=diff

==
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sat Feb 16 08:47:29 2008
@@ -4293,6 +4293,18 @@
 return true;
   }
 
+  case BUILT_IN_SYNCHRONIZE: {
+// We assume like gcc appears to, that this only applies to cached memory.
+Value* C[5];
+C[0] = C[1] = C[2] = C[3] = ConstantInt::get(Type::Int1Ty, 1);
+C[4] = ConstantInt::get(Type::Int1Ty, 0);
+   
+Builder.CreateCall(Intrinsic::getDeclaration(TheModule, 
+ Intrinsic::memory_barrier),
+   C, C + 5);
+return true;
+  }
+
 #if 1  // FIXME: Should handle these GCC extensions eventually.
 case BUILT_IN_APPLY_ARGS:
 case BUILT_IN_APPLY:


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


[llvm-commits] [llvm-gcc-4.2] r47218 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp

2008-02-16 Thread Chris Lattner
Author: lattner
Date: Sat Feb 16 14:29:46 2008
New Revision: 47218

URL: http://llvm.org/viewvc/llvm-project?rev=47218view=rev
Log:
Fix missing symbol error, patch by Robert G. Jakabosky,
for PR1711

Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp

Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=47218r1=47217r2=47218view=diff

==
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Sat Feb 16 14:29:46 2008
@@ -30,6 +30,7 @@
 #include llvm/Instructions.h
 #include llvm/Intrinsics.h
 #include llvm/Module.h
+#include llvm-i386-target.h
 
 extern C {
 #include toplev.h


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


[llvm-commits] [llvm] r47219 - /llvm/trunk/lib/VMCore/ParameterAttributes.cpp

2008-02-16 Thread Duncan Sands
Author: baldrick
Date: Sat Feb 16 14:53:06 2008
New Revision: 47219

URL: http://llvm.org/viewvc/llvm-project?rev=47219view=rev
Log:
Some micro-optimizations.

Modified:
llvm/trunk/lib/VMCore/ParameterAttributes.cpp

Modified: llvm/trunk/lib/VMCore/ParameterAttributes.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ParameterAttributes.cpp?rev=47219r1=47218r2=47219view=diff

==
--- llvm/trunk/lib/VMCore/ParameterAttributes.cpp (original)
+++ llvm/trunk/lib/VMCore/ParameterAttributes.cpp Sat Feb 16 14:53:06 2008
@@ -124,6 +124,7 @@
   if (!PAL) {
 // Strip any instances of ParamAttr::None from modVec before calling 'get'.
 ParamAttrsVector newVec;
+newVec.reserve(modVec.size());
 for (unsigned i = 0, e = modVec.size(); i  e; ++i)
   if (modVec[i].attrs != ParamAttr::None)
 newVec.push_back(modVec[i]);
@@ -175,8 +176,8 @@
   if (NewAttrs == OldAttrs)
 return PAL;
 
-  ParamAttrsVector modVec;
-  modVec.push_back(ParamAttrsWithIndex::get(idx, NewAttrs));
+  ParamAttrsVector modVec(1);
+  modVec[0] = ParamAttrsWithIndex::get(idx, NewAttrs);
   return getModified(PAL, modVec);
 }
 
@@ -188,8 +189,8 @@
   if (NewAttrs == OldAttrs)
 return PAL;
 
-  ParamAttrsVector modVec;
-  modVec.push_back(ParamAttrsWithIndex::get(idx, NewAttrs));
+  ParamAttrsVector modVec(1);
+  modVec[0] = ParamAttrsWithIndex::get(idx, NewAttrs);
   return getModified(PAL, modVec);
 }
 


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


[llvm-commits] [llvm] r47220 - in /llvm/trunk: lib/Transforms/IPO/GlobalOpt.cpp test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll

2008-02-16 Thread Duncan Sands
Author: baldrick
Date: Sat Feb 16 14:56:04 2008
New Revision: 47220

URL: http://llvm.org/viewvc/llvm-project?rev=47220view=rev
Log:
Remove any 'nest' parameter attributes if the function
is not passed as an argument to a trampoline intrinsic.

Added:
llvm/trunk/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll
Modified:
llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp

Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=47220r1=47219r2=47220view=diff

==
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Sat Feb 16 14:56:04 2008
@@ -21,6 +21,7 @@
 #include llvm/Instructions.h
 #include llvm/IntrinsicInst.h
 #include llvm/Module.h
+#include llvm/ParameterAttributes.h
 #include llvm/Pass.h
 #include llvm/Analysis/ConstantFolding.h
 #include llvm/Target/TargetData.h
@@ -46,6 +47,7 @@
 STATISTIC(NumShrunkToBool  , Number of global vars shrunk to booleans);
 STATISTIC(NumFastCallFns   , Number of functions converted to fastcc);
 STATISTIC(NumCtorsEvaluated, Number of static ctors evaluated);
+STATISTIC(NumNestRemoved   , Number of nest attributes removed);
 
 namespace {
   struct VISIBILITY_HIDDEN GlobalOpt : public ModulePass {
@@ -1590,6 +1592,35 @@
   }
 }
 
+static const ParamAttrsList *StripNest(const ParamAttrsList *Attrs) {
+  if (Attrs) {
+for (unsigned i = 0, e = Attrs-size(); i != e; ++i) {
+  uint16_t A = Attrs-getParamAttrsAtIndex(i);
+  if (A  ParamAttr::Nest) {
+Attrs = ParamAttrsList::excludeAttrs(Attrs, Attrs-getParamIndex(i),
+ ParamAttr::Nest);
+// There can be only one.
+break;
+  }
+}
+  }
+
+  return Attrs;
+}
+
+static void RemoveNestAttribute(Function *F) {
+  F-setParamAttrs(StripNest(F-getParamAttrs()));
+  for (Value::use_iterator UI = F-use_begin(), E = F-use_end(); UI != 
E;++UI){
+Instruction *User = castInstruction(*UI);
+if (CallInst *CI = dyn_castCallInst(User)) {
+  CI-setParamAttrs(StripNest(CI-getParamAttrs()));
+} else {
+  InvokeInst *II = castInvokeInst(User);
+  II-setParamAttrs(StripNest(II-getParamAttrs()));
+}
+  }
+}
+
 bool GlobalOpt::OptimizeFunctions(Module M) {
   bool Changed = false;
   // Optimize functions.
@@ -1601,16 +1632,27 @@
   M.getFunctionList().erase(F);
   Changed = true;
   ++NumFnDeleted;
-} else if (F-hasInternalLinkage() 
-   F-getCallingConv() == CallingConv::C   !F-isVarArg() 
-   OnlyCalledDirectly(F)) {
-  // If this function has C calling conventions, is not a varargs
-  // function, and is only called directly, promote it to use the Fast
-  // calling convention.
-  F-setCallingConv(CallingConv::Fast);
-  ChangeCalleesToFastCall(F);
-  ++NumFastCallFns;
-  Changed = true;
+} else if (F-hasInternalLinkage()) {
+  if (F-getCallingConv() == CallingConv::C  !F-isVarArg() 
+  OnlyCalledDirectly(F)) {
+// If this function has C calling conventions, is not a varargs
+// function, and is only called directly, promote it to use the Fast
+// calling convention.
+F-setCallingConv(CallingConv::Fast);
+ChangeCalleesToFastCall(F);
+++NumFastCallFns;
+Changed = true;
+  }
+
+  if (F-getParamAttrs() 
+  F-getParamAttrs()-hasAttrSomewhere(ParamAttr::Nest) 
+  OnlyCalledDirectly(F)) {
+// The function is not used by a trampoline intrinsic, so it is safe
+// to remove the 'nest' attribute.
+RemoveNestAttribute(F);
+++NumNestRemoved;
+Changed = true;
+  }
 }
   }
   return Changed;

Added: llvm/trunk/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll?rev=47220view=auto

==
--- llvm/trunk/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll (added)
+++ llvm/trunk/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll Sat Feb 16 
14:56:04 2008
@@ -0,0 +1,57 @@
+; RUN: llvm-as  %s | opt -globalopt | llvm-dis | grep { nest } | count 1
+   %struct.FRAME.nest = type { i32, i32 (i32)* }
+   %struct.__builtin_trampoline = type { [10 x i8] }
[EMAIL PROTECTED] = internal constant [7 x i8] c%d %d\0A\00   ; [7 x 
i8]* [#uses=1]
+
+define i32 @process(i32 (i32)* %func) nounwind  {
+entry:
+   %tmp2 = tail call i32 %func( i32 1 ) nounwind   ; i32 
[#uses=1]
+   ret i32 %tmp2
+}
+
+define internal fastcc i32 @g.1478(%struct.FRAME.nest* nest  %CHAIN.1, i32 %m) 
nounwind  {
+entry:
+   %tmp3 = getelementptr %struct.FRAME.nest* %CHAIN.1, i32 0, i32 0
; i32* [#uses=1]
+   %tmp4 = load i32* %tmp3, align 4 

[llvm-commits] [llvm-gcc-4.2] r47221 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

2008-02-16 Thread Duncan Sands
Author: baldrick
Date: Sat Feb 16 14:59:48 2008
New Revision: 47221

URL: http://llvm.org/viewvc/llvm-project?rev=47221view=rev
Log:
For a nested function, the parent's variables
are like global variables for a normal function.
In particular a 'const' nested function can
reasonably return the address of one.  However
in order to get hold of that address a nested
function needs to read through the static chain
pointer parameter, which is incompatible with
being readnone.  So turn 'const' into readonly
for nested functions.

Modified:
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=47221r1=47220r2=47221view=diff

==
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Sat Feb 16 14:59:48 2008
@@ -1137,7 +1137,14 @@
   // 'sret' functions cannot be 'readnone' or 'readonly'.
   if (ABIConverter.isStructReturn())
 RAttributes = ~(ParamAttr::ReadNone|ParamAttr::ReadOnly);
-  
+
+  // Demote 'readnone' nested functions to 'readonly' since
+  // they may need to read through the static chain.
+  if (static_chain  (RAttributes  ParamAttr::ReadNone)) {
+RAttributes = ~ParamAttr::ReadNone;
+RAttributes |= ParamAttr::ReadOnly;
+  }
+
   // Compute whether the result needs to be zext or sext'd.
   RAttributes |= HandleArgumentExtension(TREE_TYPE(type));
 


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


[llvm-commits] [llvm-gcc-4.2] r47222 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

2008-02-16 Thread Duncan Sands
Author: baldrick
Date: Sat Feb 16 15:01:53 2008
New Revision: 47222

URL: http://llvm.org/viewvc/llvm-project?rev=47222view=rev
Log:
Remove some code originally inspired by
expand_assignment in expr.c.  I don't think
this is needed, and I suspect it's not needed
in expand_assignment either and is just ancient
code that no-one bothered or dared to remove.

Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=47222r1=47221r2=47222view=diff

==
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sat Feb 16 15:01:53 2008
@@ -2714,17 +2714,7 @@
 
 // Non-bitfield aggregate value.
 MemRef NewLoc(LV.Ptr, Alignment, isVolatile);
-
-// In case we are returning the contents of an object which overlaps
-// the place the value is being stored, use a safe function when copying
-// a value through a pointer into a structure value return block.
-if (TREE_CODE (lhs) == RESULT_DECL  TREE_CODE (rhs) == INDIRECT_REF) {
-  MemRef Tmp = CreateTempLoc(ConvertType(TREE_TYPE(rhs)));
-  Emit(rhs, Tmp);
-  EmitAggregateCopy(NewLoc, Tmp, TREE_TYPE(rhs));
-} else {
-  Emit(rhs, NewLoc);
-}
+Emit(rhs, NewLoc);
 
 if (DestLoc)
   EmitAggregateCopy(*DestLoc, NewLoc, TREE_TYPE(exp));


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


Re: [llvm-commits] [llvm-gcc-4.2] r47180 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h llvm-types.cpp

2008-02-16 Thread Dale Johannesen

On Feb 16, 2008, at 12:19 AM, Duncan Sands wrote:

 Hi Dale,

 Put back fixed version of code to avoid copying
 padding within structs (sometimes).

 if this means that ConvertUNION doesn't have to
 muck around with fixing up padding elements anymore,
 can you please remove that code.

I don't know why that code is there (it goes back to the first svn  
checkin) but I don't think anything I did would make it unnecessary.

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


Re: [llvm-commits] [llvm] r47220 - in /llvm/trunk: lib/Transforms/IPO/GlobalOpt.cpp test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll

2008-02-16 Thread Chris Lattner
On Feb 16, 2008, at 12:56 PM, Duncan Sands wrote:
 Remove any 'nest' parameter attributes if the function
 is not passed as an argument to a trampoline intrinsic.

Nice.  Out of curiousity, how does nest do to codegen?

 +static const ParamAttrsList *StripNest(const ParamAttrsList *Attrs) {
 +  if (Attrs) {
 +for (unsigned i = 0, e = Attrs-size(); i != e; ++i) {
 +  uint16_t A = Attrs-getParamAttrsAtIndex(i);
 +  if (A  ParamAttr::Nest) {

How about:
   if ((A  ParamAttr::Nest) == 0) continue;

To avoid indentation in the loop.  Alternatively, maybe ParamAttrsList  
should have a 'find attribute' function that returns the first  
argument that has the specified attribute?

 +static void RemoveNestAttribute(Function *F) {
 +  F-setParamAttrs(StripNest(F-getParamAttrs()));
 +  for (Value::use_iterator UI = F-use_begin(), E = F-use_end();  
 UI != E;++UI){
 +Instruction *User = castInstruction(*UI);

 +if (CallInst *CI = dyn_castCallInst(User)) {

Please use CallSite to handle CallInst/Invoke uniformly.

Thanks Duncan!

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


[llvm-commits] [llvm] r47225 [1/3] - /llvm/trunk/test/Assembler/

2008-02-16 Thread Tanya Lattner
Author: tbrethou
Date: Sat Feb 16 17:27:24 2008
New Revision: 47225

URL: http://llvm.org/viewvc/llvm-project?rev=47225view=rev
Log:
Removing llvm upgrade, so remove tests specific to llvm-upgrade and update the 
tests that used it.

Removed:
llvm/trunk/test/Assembler/2007-01-01-Cast-To-Bool.ll
llvm/trunk/test/Assembler/2007-01-05-Local-Name-Conflict.ll
llvm/trunk/test/Assembler/2007-01-12-Varargs-Upgrade.ll
llvm/trunk/test/Assembler/2007-01-21-UpgradeNoArgs.ll
llvm/trunk/test/Assembler/2007-01-22-UpgradeMalformedShift.ll
llvm/trunk/test/Assembler/2007-01-22-UpgradeMalformedStruct.ll
llvm/trunk/test/Assembler/2007-01-22-UpgradeTypeMapInvalidMemory.ll
llvm/trunk/test/Assembler/2007-01-26-PR1122.ll
llvm/trunk/test/Assembler/2007-01-27-UpgradePointers.ll
llvm/trunk/test/Assembler/2007-02-01-UpgradeShift.ll
llvm/trunk/test/Assembler/2007-02-07-BasicBlockRename.ll
llvm/trunk/test/Assembler/2007-02-07-RenameInternals.ll
llvm/trunk/test/Assembler/2007-02-07-SizedIntTypes.ll
llvm/trunk/test/Assembler/2007-02-07-UpgradeGVarConflict.ll
llvm/trunk/test/Assembler/2007-03-14-UpgradeLocalSignless.ll
Modified:
llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll
llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx
llvm/trunk/test/Assembler/2004-09-29-VerifierIsReallySlow.llx
llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx
llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll
llvm/trunk/test/Assembler/2005-01-03-FPConstantDisassembly.ll
llvm/trunk/test/Assembler/2005-02-09-AsmWriterStoreBug.ll
llvm/trunk/test/Assembler/2005-05-05-OpaqueUndefValues.ll
llvm/trunk/test/Assembler/2005-12-21-ZeroInitVector.ll
llvm/trunk/test/Assembler/2007-01-05-Cmp-ConstExpr.ll
llvm/trunk/test/Assembler/ConstantExprFold.llx
llvm/trunk/test/Assembler/select.ll

Modified: llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll?rev=47225r1=47224r2=47225view=diff

==
--- llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll (original)
+++ llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll Sat Feb 16 
17:27:24 2008
@@ -1,9 +1,10 @@
-; RUN: llvm-upgrade  %s | llvm-as -o /dev/null -f
+; RUN: llvm-as  %s -o /dev/null -f
 
-int *%t1({ float, int }* %X) {
-   %W = getelementptr { float, int }* %X, int 20, uint 1
-   %X = getelementptr { float, int }* %X, uint 20, uint 1
-   %Y = getelementptr { float, int }* %X, long 20, uint 1
-   %Z = getelementptr { float, int }* %X, ulong 20, uint 1
-   ret int* %Y
+define i32* @t1({ float, i32 }* %X) {
+%W = getelementptr { float, i32 }* %X, i32 20, i32 1; 
i32* [#uses=0]
+%X.upgrd.1 = getelementptr { float, i32 }* %X, i64 20, i32 1   
 ; i32* [#uses=0]
+%Y = getelementptr { float, i32 }* %X, i64 20, i32 1; 
i32* [#uses=1]
+%Z = getelementptr { float, i32 }* %X, i64 20, i32 1; 
i32* [#uses=0]
+ret i32* %Y
 }
+

Modified: llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx?rev=47225r1=47224r2=47225view=diff

==
--- llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx (original)
+++ llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx Sat Feb 16 17:27:24 
2008
@@ -1,11 +1,11 @@
-; RUN: llvm-upgrade  %s | llvm-as  /dev/null
-void %t() {
+; RUN: llvm-as  %s  /dev/null
+
+define void @t() {
 entry:
-   ret void
+ ret void
 
-loop:
-%tmp.4.i9 = getelementptr int* null, int %tmp.5.i10
-%tmp.5.i10 = load int* %tmp.4.i9
-br label %loop
+loop:   ; preds = %loop
+ %tmp.4.i9 = getelementptr i32* null, i32 %tmp.5.i10 ; i32* 
[#uses=1]
+ %tmp.5.i10 = load i32* %tmp.4.i9; i32 [#uses=1]
+ br label %loop
 }
-


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


[llvm-commits] [llvm] r47225 [3/3] - /llvm/trunk/test/Assembler/

2008-02-16 Thread Tanya Lattner
Modified: llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx?rev=47225r1=47224r2=47225view=diff

==
--- llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx (original)
+++ llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx Sat Feb 16 
17:27:24 2008
@@ -1,5 +1,5 @@
 ;; The bytecode writer was trying to treat undef values as ConstantArray's when
 ;; they looked like strings.
-;; RUN: llvm-upgrade  %s | llvm-as -o /dev/null -f
-%G = internal global [8 x sbyte] undef
+;; RUN: llvm-as  %s -o /dev/null -f
[EMAIL PROTECTED] = internal global [8 x i8] undef
 

Modified: llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll?rev=47225r1=47224r2=47225view=diff

==
--- llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll (original)
+++ llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll Sat Feb 
16 17:27:24 2008
@@ -1,21 +1,21 @@
-; RUN: llvm-upgrade  %s | llvm-as | opt -inline | llvm-dis | \
+; RUN: llvm-as  %s | opt -inline | llvm-dis | \
 ; RUN:   not grep {%G = alloca int}
 
 ; In this testcase, %bar stores to the global G.  Make sure that inlining does
 ; not cause it to store to the G in main instead.
[EMAIL PROTECTED] = global i32 7   ; i32* [#uses=1]
 
-%G = global int 7
-
-int %main() {
-   %G = alloca int
-   store int 0, int* %G
-   call void %bar()
-   %RV = load int* %G
-   ret int %RV
+define i32 @main() {
+%G = alloca i32 ; i32* [#uses=2]
+store i32 0, i32* %G
+call void @bar( )
+%RV = load i32* %G  ; i32 [#uses=1]
+ret i32 %RV
 }
 
-internal void %bar() {
-   store int 123, int* %G
-   ret void
+define internal void @bar() {
+store i32 123, i32* @G
+ret void
 }
 
+

Modified: llvm/trunk/test/Assembler/2005-01-03-FPConstantDisassembly.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2005-01-03-FPConstantDisassembly.ll?rev=47225r1=47224r2=47225view=diff

==
--- llvm/trunk/test/Assembler/2005-01-03-FPConstantDisassembly.ll (original)
+++ llvm/trunk/test/Assembler/2005-01-03-FPConstantDisassembly.ll Sat Feb 16 
17:27:24 2008
@@ -1,6 +1,6 @@
-; RUN: llvm-upgrade  %s | llvm-as | llvm-dis | grep 1.0
+; RUN: llvm-as  %s | llvm-dis | grep 1.0
 
-double %test() {
+define double @test() {
 ret double 1.0   ;; This should not require hex notation
 }
 

Modified: llvm/trunk/test/Assembler/2005-02-09-AsmWriterStoreBug.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2005-02-09-AsmWriterStoreBug.ll?rev=47225r1=47224r2=47225view=diff

==
--- llvm/trunk/test/Assembler/2005-02-09-AsmWriterStoreBug.ll (original)
+++ llvm/trunk/test/Assembler/2005-02-09-AsmWriterStoreBug.ll Sat Feb 16 
17:27:24 2008
@@ -1,14 +1,14 @@
-; RUN: llvm-upgrade  %s | llvm-as | llvm-dis | llvm-as
+; RUN: llvm-as  %s | llvm-dis | llvm-as
 
 ; Ensure that the asm writer emits types before both operands of the 
 ; store, even though they can be the same.
 
 %RecTy = type %RecTy*
-implementation
 
- void %foo() {
-%A = malloc %RecTy
-%B = malloc %RecTy
-store %RecTy %B, %RecTy %A   ;; Both ops are the same
+define void @foo() {
+%A = malloc %RecTy  ; %RecTy [#uses=1]
+%B = malloc %RecTy  ; %RecTy [#uses=1]
+store %RecTy %B, %RecTy %A
 ret void
 }
+

Modified: llvm/trunk/test/Assembler/2005-05-05-OpaqueUndefValues.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2005-05-05-OpaqueUndefValues.ll?rev=47225r1=47224r2=47225view=diff

==
--- llvm/trunk/test/Assembler/2005-05-05-OpaqueUndefValues.ll (original)
+++ llvm/trunk/test/Assembler/2005-05-05-OpaqueUndefValues.ll Sat Feb 16 
17:27:24 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade  %s | llvm-as | llvm-dis | llvm-as
+; RUN: llvm-as  %s | llvm-dis | llvm-as
 
 %t = type opaque
-%x = global %t undef
[EMAIL PROTECTED] = global %t undef

Modified: llvm/trunk/test/Assembler/2005-12-21-ZeroInitVector.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2005-12-21-ZeroInitVector.ll?rev=47225r1=47224r2=47225view=diff

==
--- llvm/trunk/test/Assembler/2005-12-21-ZeroInitVector.ll (original)
+++ llvm/trunk/test/Assembler/2005-12-21-ZeroInitVector.ll Sat Feb 16 17:27:24 
2008
@@ -1,5 +1,6 @@
-; RUN: llvm-upgrade  %s | llvm-as  /dev/null
+; RUN: llvm-as  

Re: [llvm-commits] [llvm] r47225 [3/3] - /llvm/trunk/test/Assembler/

2008-02-16 Thread Nick Lewycky
Tanya Lattner wrote:
 Modified: llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll
 URL: 
 http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll?rev=47225r1=47224r2=47225view=diff
 
 ==
 --- llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll 
 (original)
 +++ llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll Sat Feb 
 16 17:27:24 2008
 @@ -1,21 +1,21 @@
 -; RUN: llvm-upgrade  %s | llvm-as | opt -inline | llvm-dis | \
 +; RUN: llvm-as  %s | opt -inline | llvm-dis | \
  ; RUN:   not grep {%G = alloca int}

'alloca int' isn't going to happen. alloca i32?

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


[llvm-commits] [llvm] r47227 - in /llvm/trunk/test/Assembler: 2007-02-07-UpgradeCSRETCC.ll ConstantExprFoldCast.llx

2008-02-16 Thread Tanya Lattner
Author: tbrethou
Date: Sat Feb 16 17:55:46 2008
New Revision: 47227

URL: http://llvm.org/viewvc/llvm-project?rev=47227view=rev
Log:
Remove llvm-upgrade and update tests.

Removed:
llvm/trunk/test/Assembler/2007-02-07-UpgradeCSRETCC.ll
Modified:
llvm/trunk/test/Assembler/ConstantExprFoldCast.llx

Removed: llvm/trunk/test/Assembler/2007-02-07-UpgradeCSRETCC.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2007-02-07-UpgradeCSRETCC.ll?rev=47226view=auto

==
--- llvm/trunk/test/Assembler/2007-02-07-UpgradeCSRETCC.ll (original)
+++ llvm/trunk/test/Assembler/2007-02-07-UpgradeCSRETCC.ll (removed)
@@ -1,23 +0,0 @@
-; RUN: llvm-upgrade  %s  /dev/null
-; PR1187
-
-%mystruct = type { int, double }
-%glob = global %mystruct { int 3, double 42.0 }
-%fptr = external global void (i32)*
-
-implementation
-
-csretcc void %nada(%mystruct * %ptr, int %val) {
-  ret void
-}
-
-int %main(int %argc, ubyte** %argv) {
-  %astr = alloca %mystruct
-  call void %nada(%mystruct* %astr, i32 7)
-  %fptr = alloca void (%mystruct*, i32)*
-  %f = load void (%mystruct*, i32)**%fptr
-  call csretcc void %f(%mystruct* %astr, i32 7)
-  store void (%mystruct* , i32)* %nada, void (%mystruct*, i32)** %fptr
-
-  ret int 0
-}

Modified: llvm/trunk/test/Assembler/ConstantExprFoldCast.llx
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/ConstantExprFoldCast.llx?rev=47227r1=47226r2=47227view=diff

==
--- llvm/trunk/test/Assembler/ConstantExprFoldCast.llx (original)
+++ llvm/trunk/test/Assembler/ConstantExprFoldCast.llx Sat Feb 16 17:55:46 2008
@@ -1,14 +1,14 @@
 ; This test checks to make sure that constant exprs fold in some simple 
situations
 
-; RUN: llvm-upgrade  %s | llvm-as | llvm-dis | not grep cast
+; RUN: llvm-as  %s | llvm-dis | not grep cast
 
-%A = global int* cast (sbyte* null to int*)  ; Cast null - fold
-%B = global int** cast (int** %A to int**)   ; Cast to same type - fold
-%C = global int cast (long 42 to int); Integral casts
-%D = global int* cast(float* cast (int* %C to float*) to int*)  ; cast of cast 
ptr-ptr
-%E = global int cast(float* cast (sbyte 5 to float*) to int)  ; int - ptr - 
int
[EMAIL PROTECTED] = global i32* bitcast (i8* null to i32*)  ; Cast null - fold
[EMAIL PROTECTED] = global i32** bitcast (i32** @A to i32**)   ; Cast to same 
type - fold
[EMAIL PROTECTED] = global i32 trunc (i64 42 to i32); Integral casts
[EMAIL PROTECTED] = global i32* bitcast(float*  bitcast (i32* @C to float*) to 
i32*)  ; cast of cast ptr-ptr
[EMAIL PROTECTED] = global i32 ptrtoint(float* inttoptr (i8 5 to float*) to 
i32)  ; i32 - ptr - i32
 
 ; Test folding of binary instrs
-%F = global int* cast(int add (int 5, int -5) to int*)
-%G = global int* cast(int sub (int 5, int 5) to int*)
[EMAIL PROTECTED] = global i32* inttoptr (i32 add (i32 5, i32 -5) to i32*)
[EMAIL PROTECTED] = global i32* inttoptr (i32 sub (i32 5, i32 5) to i32*)
 


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


Re: [llvm-commits] [llvm] r47225 [3/3] - /llvm/trunk/test/Assembler/

2008-02-16 Thread Tanya Lattner

Thanks. Nice catch.  Will update.

-Tanya

On Feb 16, 2008, at 3:49 PM, Nick Lewycky wrote:


Assembler/2004-12-05-LocalGlobalSymtabConflict.ll


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


[llvm-commits] [llvm] r47228 - /llvm/trunk/test/Assembler/ConstantExprFold.llx

2008-02-16 Thread Chris Lattner
Author: lattner
Date: Sat Feb 16 18:09:08 2008
New Revision: 47228

URL: http://llvm.org/viewvc/llvm-project?rev=47228view=rev
Log:
this line was commented out.

Modified:
llvm/trunk/test/Assembler/ConstantExprFold.llx

Modified: llvm/trunk/test/Assembler/ConstantExprFold.llx
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/ConstantExprFold.llx?rev=47228r1=47227r2=47228view=diff

==
--- llvm/trunk/test/Assembler/ConstantExprFold.llx (original)
+++ llvm/trunk/test/Assembler/ConstantExprFold.llx Sat Feb 16 18:09:08 2008
@@ -22,5 +22,5 @@
 global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 0)); 
false
 global i1 icmp slt (i32* getelementptr (%Ty* @B, i64 0, i32 0), 
i32* getelementptr (%Ty* @B, i64 0, i32 1)); 
true
-global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*)) ; 
true
+;global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*)) ; 
true
 


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


[llvm-commits] [llvm] r47229 - /llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll

2008-02-16 Thread Chris Lattner
Author: lattner
Date: Sat Feb 16 18:12:03 2008
New Revision: 47229

URL: http://llvm.org/viewvc/llvm-project?rev=47229view=rev
Log:
this test isn't useful since we added @ notation for globals.

Removed:
llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll

Removed: llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll?rev=47228view=auto

==
--- llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll (original)
+++ llvm/trunk/test/Assembler/2004-12-05-LocalGlobalSymtabConflict.ll (removed)
@@ -1,21 +0,0 @@
-; RUN: llvm-as  %s | opt -inline | llvm-dis | \
-; RUN:   not grep {%G = alloca int}
-
-; In this testcase, %bar stores to the global G.  Make sure that inlining does
-; not cause it to store to the G in main instead.
[EMAIL PROTECTED] = global i32 7   ; i32* [#uses=1]
-
-define i32 @main() {
-%G = alloca i32 ; i32* [#uses=2]
-store i32 0, i32* %G
-call void @bar( )
-%RV = load i32* %G  ; i32 [#uses=1]
-ret i32 %RV
-}
-
-define internal void @bar() {
-store i32 123, i32* @G
-ret void
-}
-
-


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


[llvm-commits] [llvm] r47230 - in /llvm/trunk/test/Bitcode: 2006-12-11-Cast-ConstExpr.ll memcpy.ll

2008-02-16 Thread Tanya Lattner
Author: tbrethou
Date: Sat Feb 16 18:13:09 2008
New Revision: 47230

URL: http://llvm.org/viewvc/llvm-project?rev=47230view=rev
Log:
Remove llvm-upgrade.

Modified:
llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll
llvm/trunk/test/Bitcode/memcpy.ll

Modified: llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll?rev=47230r1=47229r2=47230view=diff

==
--- llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll (original)
+++ llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll Sat Feb 16 18:13:09 
2008
@@ -1,10 +1,10 @@
 ; This test ensures that we get a bitcast constant expression in and out,
 ; not a sitofp constant expression. 
-; RUN: llvm-upgrade  %s | llvm-as | llvm-dis | \
+; RUN: llvm-as  %s | llvm-dis | \
 ; RUN:   grep {bitcast (}
 
-%G = external global int
[EMAIL PROTECTED] = external global i32
 
-float %tryit(int %A) {
-   ret float bitcast( int ptrtoint (int* %G to int) to float)
+define float @tryit(i32 %A) {
+   ret float sitofp( i32 ptrtoint (i32* @G to i32) to float)
 }

Modified: llvm/trunk/test/Bitcode/memcpy.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/memcpy.ll?rev=47230r1=47229r2=47230view=diff

==
--- llvm/trunk/test/Bitcode/memcpy.ll (original)
+++ llvm/trunk/test/Bitcode/memcpy.ll Sat Feb 16 18:13:09 2008
@@ -1,17 +1,21 @@
-; RUN: llvm-upgrade  %s | llvm-as -o /dev/null -f
+; RUN: llvm-as  %s -o /dev/null -f
 
-void %test(int* %P, int* %Q) {
+define void @test(i32* %P, i32* %Q) {
 entry:
-   %tmp.1 = cast int* %P to sbyte* ; sbyte* [#uses=2]
-   %tmp.3 = cast int* %Q to sbyte* ; sbyte* [#uses=3]
-   tail call void %llvm.memcpy.i32( sbyte* %tmp.1, sbyte* %tmp.3, uint 
10, uint 1 )
-   tail call void %llvm.memcpy.i64( sbyte* %tmp.1, sbyte* %tmp.3, ulong 
10, uint 1 )
-   tail call void %llvm.memset.i32( sbyte* %tmp.3, ubyte 14, uint 1, 
uint 0 )
-   tail call void %llvm.memmove.i32( sbyte* %tmp.1, sbyte* %tmp.3, uint 
123124, uint 1 )
-   ret void
+%tmp.1 = bitcast i32* %P to i8* ; i8* [#uses=3]
+%tmp.3 = bitcast i32* %Q to i8* ; i8* [#uses=4]
+tail call void @llvm.memcpy.i32( i8* %tmp.1, i8* %tmp.3, i32 10, 
i32 1 )
+tail call void @llvm.memcpy.i64( i8* %tmp.1, i8* %tmp.3, i64 10, 
i32 1 )
+tail call void @llvm.memset.i32( i8* %tmp.3, i8 14, i32 1, i32 0 )
+tail call void @llvm.memmove.i32( i8* %tmp.1, i8* %tmp.3, i32 123124, 
i32 1 )
+ret void
 }
 
-declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint)
-declare void %llvm.memcpy.i64(sbyte*, sbyte*, ulong, uint)
-declare void %llvm.memset.i32(sbyte*, ubyte, uint, uint)
-declare void %llvm.memmove.i32(sbyte*, sbyte*, uint, uint)
+declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
+
+declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)
+
+declare void @llvm.memset.i32(i8*, i8, i32, i32)
+
+declare void @llvm.memmove.i32(i8*, i8*, i32, i32)
+


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


[llvm-commits] [llvm] r47231 - /llvm/trunk/test/BugPoint/misopt-basictest.ll

2008-02-16 Thread Tanya Lattner
Author: tbrethou
Date: Sat Feb 16 18:15:09 2008
New Revision: 47231

URL: http://llvm.org/viewvc/llvm-project?rev=47231view=rev
Log:
Remove llvm-upgrade

Modified:
llvm/trunk/test/BugPoint/misopt-basictest.ll

Modified: llvm/trunk/test/BugPoint/misopt-basictest.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/misopt-basictest.ll?rev=47231r1=47230r2=47231view=diff

==
--- llvm/trunk/test/BugPoint/misopt-basictest.ll (original)
+++ llvm/trunk/test/BugPoint/misopt-basictest.ll Sat Feb 16 18:15:09 2008
@@ -1,14 +1,10 @@
-; RUN: llvm-upgrade  %s  %t1.ll
-; RUN: bugpoint %t1.ll -dce -bugpoint-deletecalls -simplifycfg
+; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg
 
-%.LC0 = internal global [13 x sbyte] cHello World\0A\00
[EMAIL PROTECTED] = internal global [13 x i8] cHello World\0A\00  ; 
[13 x i8]* [#uses=1]
 
-implementation
+declare i32 @printf(i8*, ...)
 
-declare int %printf(sbyte*, ...)
-
-int %main() {
-call int(sbyte*, ...)* %printf( sbyte* getelementptr ([13 x sbyte]* 
%.LC0, long 0, long 0) )
-ret int 0
+define i32 @main() {
+call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @.LC0, i64 
0, i64 0) ); i32:1 [#uses=0]
+ret i32 0
 }
-


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


[llvm-commits] [llvm] r47232 - /llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll

2008-02-16 Thread Chris Lattner
Author: lattner
Date: Sat Feb 16 18:15:25 2008
New Revision: 47232

URL: http://llvm.org/viewvc/llvm-project?rev=47232view=rev
Log:
fix this test.

Modified:
llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll

Modified: llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll?rev=47232r1=47231r2=47232view=diff

==
--- llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll (original)
+++ llvm/trunk/test/Bitcode/2006-12-11-Cast-ConstExpr.ll Sat Feb 16 18:15:25 
2008
@@ -6,5 +6,5 @@
 @G = external global i32
 
 define float @tryit(i32 %A) {
-   ret float sitofp( i32 ptrtoint (i32* @G to i32) to float)
+   ret float bitcast( i32 ptrtoint (i32* @G to i32) to float)
 }


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


Re: [llvm-commits] [llvm] r47220 - in /llvm/trunk: lib/Transforms/IPO/GlobalOpt.cpp test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll

2008-02-16 Thread Duncan Sands
Hi Chris,

  Remove any 'nest' parameter attributes if the function
  is not passed as an argument to a trampoline intrinsic.
 
 Nice.  Out of curiousity, how does nest do to codegen?

'nest' causes a specific register to be grabbed for the
parameter in calls.  So removing it doesn't do much :)

  +static const ParamAttrsList *StripNest(const ParamAttrsList *Attrs) {
  +  if (Attrs) {
  +for (unsigned i = 0, e = Attrs-size(); i != e; ++i) {
  +  uint16_t A = Attrs-getParamAttrsAtIndex(i);
  +  if (A  ParamAttr::Nest) {
 
 How about:
if ((A  ParamAttr::Nest) == 0) continue;
 
 To avoid indentation in the loop.

OK, if you like.

 Alternatively, maybe ParamAttrsList   
 should have a 'find attribute' function that returns the first  
 argument that has the specified attribute?

I think that would only be useful for attributes that can occur at
most once, i.e. sret and nest, and since sret is always on the first
parameter it's not useful for sret.  I did consider a
removeAttrEverywhere method, but again it didn't seem generally
useful.
 
  +static void RemoveNestAttribute(Function *F) {
  +  F-setParamAttrs(StripNest(F-getParamAttrs()));
  +  for (Value::use_iterator UI = F-use_begin(), E = F-use_end();  
  UI != E;++UI){
  +Instruction *User = castInstruction(*UI);
 
  +if (CallInst *CI = dyn_castCallInst(User)) {
 
 Please use CallSite to handle CallInst/Invoke uniformly.

To create a CallSite don't you first need to get your hands on either a CI
or an II?  Which means doing the dyn_cast and test anyway, to produce the
CallSite (this is annoying, maybe it should be possible to create one from
an Instruction*).  So I don't see that it gains you much.  Also, in
ChangeCalleesToFastCall a few lines above I see that a certain lattner
didn't consider a CallSite useful for the calling convention case :)

Ciao,

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