Re: [llvm-commits] [llvm-gcc-4.2] r46170 - in /llvm-gcc-4.2/trunk/gcc: autom4te.cache/output.0 autom4te.cache/requests autom4te.cache/traces.0 configure configure.ac

2008-01-23 Thread Bill Wendling
On Jan 18, 2008, at 11:53 AM, Devang Patel wrote:
> On Jan 18, 2008, at 11:40 AM, Eric Christopher wrote:
>> On Jan 18, 2008, at 11:35 AM, Devang Patel wrote:
>>
>>>  llvm-gcc-4.2/trunk/gcc/autom4te.cache/output.0
>>>   llvm-gcc-4.2/trunk/gcc/autom4te.cache/requests
>>>   llvm-gcc-4.2/trunk/gcc/autom4te.cache/traces.0
>>
>> Any reason why the auto-cache is checked into svn?
>
>
> No idea. I do not even know how they are used. If you think they are
> not required please remove it.

The autom4te.cache is used during an autoconf run only. They  
shouldn't be checked in.

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


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

2008-01-23 Thread Chris Lattner
Author: lattner
Date: Wed Jan 23 13:01:49 2008
New Revision: 46275

URL: http://llvm.org/viewvc/llvm-project?rev=46275&view=rev
Log:
Fix rdar://5701047, llvm-gcc crashes on this testcase on ppc:

typedef __attribute__((altivec(vector__))) float vFloat;
static const vFloat _minusZero = ((const vFloat) (-0.0f));
vFloat x;
void foo(vFloat f0, vFloat f1) {
  x = vec_vmaddfp(f0, f1, _minusZero);
}

vector_cst's are supposed to be zerofilled if insufficient elements are 
specified.


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=46275&r1=46274&r2=46275&view=diff

==
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Jan 23 13:01:49 2008
@@ -5538,6 +5538,15 @@
 std::vector Elts;
 for (tree elt = TREE_VECTOR_CST_ELTS(exp); elt; elt = TREE_CHAIN(elt))
   Elts.push_back(Convert(TREE_VALUE(elt)));
+
+// The vector should be zero filled if insufficient elements are provided.
+if (Elts.size() < TYPE_VECTOR_SUBPARTS(TREE_TYPE(exp))) {
+  tree EltType = TREE_TYPE(TREE_TYPE(exp));
+  Constant *Zero = Constant::getNullValue(ConvertType(EltType));
+  while (Elts.size() < TYPE_VECTOR_SUBPARTS(TREE_TYPE(exp)))
+Elts.push_back(Zero);
+}
+
 return ConstantVector::get(Elts);
   } else {
 return Constant::getNullValue(ConvertType(TREE_TYPE(exp)));


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


[llvm-commits] [llvm-gcc-4.0] r46276 - /llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

2008-01-23 Thread Chris Lattner
Author: lattner
Date: Wed Jan 23 13:04:14 2008
New Revision: 46276

URL: http://llvm.org/viewvc/llvm-project?rev=46276&view=rev
Log:
Fix rdar://5701047, llvm-gcc crashes on this testcase on ppc:

typedef __attribute__((altivec(vector__))) float vFloat;
static const vFloat _minusZero = ((const vFloat) (-0.0f));
vFloat x;
void foo(vFloat f0, vFloat f1) {
  x = vec_vmaddfp(f0, f1, _minusZero);
}

vector_cst's are supposed to be zerofilled if insufficient elements are 
specified.



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

Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=46276&r1=46275&r2=46276&view=diff

==
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Wed Jan 23 13:04:14 2008
@@ -5962,6 +5962,15 @@
 std::vector Elts;
 for (tree elt = TREE_VECTOR_CST_ELTS(exp); elt; elt = TREE_CHAIN(elt))
   Elts.push_back(Convert(TREE_VALUE(elt)));
+
+// The vector should be zero filled if insufficient elements are provided.
+if (Elts.size() < TYPE_VECTOR_SUBPARTS(TREE_TYPE(exp))) {
+  tree EltType = TREE_TYPE(TREE_TYPE(exp));
+  Constant *Zero = Constant::getNullValue(ConvertType(EltType));
+  while (Elts.size() < TYPE_VECTOR_SUBPARTS(TREE_TYPE(exp)))
+Elts.push_back(Zero);
+}
+
 return ConstantVector::get(Elts);
   } else {
 return Constant::getNullValue(ConvertType(TREE_TYPE(exp)));


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


[llvm-commits] [llvm] r46277 - /llvm/trunk/include/llvm/ADT/ImmutableSet.h

2008-01-23 Thread Ted Kremenek
Author: kremenek
Date: Wed Jan 23 13:57:33 2008
New Revision: 46277

URL: http://llvm.org/viewvc/llvm-project?rev=46277&view=rev
Log:
Added "getRoot()" to ImmutableSet. 

Made ImmutableSet::ImmutableSet(ImutAVLTree* Root) public. (this allows handy
casting between trees and sets).


Modified:
llvm/trunk/include/llvm/ADT/ImmutableSet.h

Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=46277&r1=46276&r2=46277&view=diff

==
--- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Wed Jan 23 13:57:33 2008
@@ -862,14 +862,17 @@
 public:
   typedef typename ValInfo::value_type  value_type;
   typedef typename ValInfo::value_type_ref  value_type_ref;
-  
-private:  
   typedef ImutAVLTree TreeTy;
+
+private:  
   TreeTy* Root;
-  
-  ImmutableSet(TreeTy* R) : Root(R) {}
-  
+
 public:
+  /// Constructs a set from a pointer to a tree root.  In general one
+  /// should use a Factory object to create sets instead of directly
+  /// invoking the constructor, but there are cases where make this
+  /// constructor public is useful.
+  explicit ImmutableSet(TreeTy* R) : Root(R) {}
   
   class Factory {
 typename TreeTy::Factory F;
@@ -924,6 +927,8 @@
 return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
   }
   
+  TreeTy* getRoot() const { return Root; }
+  
   /// isEmpty - Return true if the set contains no elements.
   bool isEmpty() const { return !Root; }
   


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


[llvm-commits] [llvm] r46280 - in /llvm/trunk/lib: CodeGen/SelectionDAG/LegalizeDAG.cpp Target/ARM/ARMISelLowering.cpp Target/IA64/IA64ISelLowering.cpp Target/PowerPC/PPCISelLowering.cpp Target/Sparc/

2008-01-23 Thread Duncan Sands
Author: baldrick
Date: Wed Jan 23 14:39:46 2008
New Revision: 46280

URL: http://llvm.org/viewvc/llvm-project?rev=46280&view=rev
Log:
The last pieces needed for loading arbitrary
precision integers.  This won't actually work
(and most of the code is dead) unless the new
legalization machinery is turned on.  While
there, I rationalized the handling of i1, and
removed some bogus (and unused) sextload patterns.
For i1, this could result in microscopically
better code for some architectures (not X86).
It might also result in worse code if annotating
with AssertZExt nodes turns out to be more harmful
than helpful.

Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86Instr64bit.td
llvm/trunk/lib/Target/X86/X86InstrInfo.td

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

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Jan 23 14:39:46 2008
@@ -1820,76 +1820,188 @@
   return Op.ResNo ? Tmp4 : Tmp3;
 } else {
   MVT::ValueType SrcVT = LD->getLoadedVT();
-  switch (TLI.getLoadXAction(ExtType, SrcVT)) {
-  default: assert(0 && "This action is not supported yet!");
-  case TargetLowering::Promote:
-assert(SrcVT == MVT::i1 &&
-   "Can only promote extending LOAD from i1 -> i8!");
-Result = DAG.getExtLoad(ExtType, Node->getValueType(0), Tmp1, Tmp2,
-LD->getSrcValue(), LD->getSrcValueOffset(),
-MVT::i8, LD->isVolatile(), LD->getAlignment());
-Tmp1 = Result.getValue(0);
-Tmp2 = Result.getValue(1);
-  break;
-  case TargetLowering::Custom:
-isCustom = true;
-// FALLTHROUGH
-  case TargetLowering::Legal:
-Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, LD->getOffset());
-Tmp1 = Result.getValue(0);
-Tmp2 = Result.getValue(1);
-  
-if (isCustom) {
-  Tmp3 = TLI.LowerOperation(Result, DAG);
-  if (Tmp3.Val) {
-Tmp1 = LegalizeOp(Tmp3);
-Tmp2 = LegalizeOp(Tmp3.getValue(1));
-  }
+  unsigned SrcWidth = MVT::getSizeInBits(SrcVT);
+  int SVOffset = LD->getSrcValueOffset();
+  unsigned Alignment = LD->getAlignment();
+  bool isVolatile = LD->isVolatile();
+
+  if (SrcWidth != MVT::getStoreSizeInBits(SrcVT) &&
+  // Some targets pretend to have an i1 loading operation, and actually
+  // load an i8.  This trick is correct for ZEXTLOAD because the top 7
+  // bits are guaranteed to be zero; it helps the optimizers understand
+  // that these bits are zero.  It is also useful for EXTLOAD, since it
+  // tells the optimizers that those bits are undefined.  It would be
+  // nice to have an effective generic way of getting these benefits...
+  // Until such a way is found, don't insist on promoting i1 here.
+  (SrcVT != MVT::i1 ||
+   TLI.getLoadXAction(ExtType, MVT::i1) == TargetLowering::Promote)) {
+// Promote to a byte-sized load if not loading an integral number of
+// bytes.  For example, promote EXTLOAD:i20 -> EXTLOAD:i24.
+unsigned NewWidth = MVT::getStoreSizeInBits(SrcVT);
+MVT::ValueType NVT = MVT::getIntegerType(NewWidth);
+SDOperand Ch;
+
+// The extra bits are guaranteed to be zero, since we stored them that
+// way.  A zext load from NVT thus automatically gives zext from SrcVT.
+
+ISD::LoadExtType NewExtType =
+  ExtType == ISD::ZEXTLOAD ? ISD::ZEXTLOAD : ISD::EXTLOAD;
+
+Result = DAG.getExtLoad(NewExtType, Node->getValueType(0),
+Tmp1, Tmp2, LD->getSrcValue(), SVOffset,
+NVT, isVolatile, Alignment);
+
+Ch = Result.getValue(1); // The chain.
+
+if (ExtType == ISD::SEXTLOAD)
+  // Having the top bits zero doesn't help when sign extending.
+  Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, Result.getValueType(),
+   Result, DAG.getValueType(SrcVT));
+else if (ExtType == ISD::ZEXTLOAD || NVT == Result.getValueType())
+  // All the top bits are guaranteed to be zero - inform the 
optimizers.
+  Result = DAG.getNode(ISD::AssertZext, Result.getValueType(), Result,
+   DAG.getValueType(SrcVT));
+
+Tmp1 = LegalizeOp(Result);
+Tmp2

[llvm-commits] [llvm-gcc-4.2] r46281 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.h objc/objc-act.c

2008-01-23 Thread Bill Wendling
Author: void
Date: Wed Jan 23 15:41:05 2008
New Revision: 46281

URL: http://llvm.org/viewvc/llvm-project?rev=46281&view=rev
Log:
GCC barfs this to the .s file directly:

.objc_class_name_CrashTestPlugin=0
.globl .objc_class_name_CrashTestPlugin

without creating a tree node or anything. We, on the other hand, are creating a
tree node and outputting:

.globl .objc_class_name_CrashTestPlugin
.zerofill __DATA, __common, .objc_class_name_CrashTestPlugin, 4, 2

This causes a linker crash because it's in the wrong section:

(undefined [lazy bound]) external [no dead strip] 
.objc_class_name_NSObject
 (__TEXT,__text) non-external _-[CrashTestPlugin crash]
00d8 (__DATA,__common) external [no dead strip] 
.objc_class_name_CrashTestPlugin

The .objc_class_name_CrashTestPlugin symbol is bad.  It should look like:

 (absolute) external .objc_class_name_CrashTestPlugin

Because it's barfed out directly to the file, we do the same with a file asm
directive.

Modified:
llvm-gcc-4.2/trunk/gcc/config/darwin.h
llvm-gcc-4.2/trunk/gcc/objc/objc-act.c

Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=46281&r1=46280&r2=46281&view=diff

==
--- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Wed Jan 23 15:41:05 2008
@@ -949,15 +949,31 @@
 /* LLVM LOCAL */
 #endif /*ENABLE_LLVM*/
 
-#define ASM_DECLARE_CLASS_REFERENCE(FILE,NAME) \
-do {   \
-if (FILE) {\
-  fprintf (FILE, "\t");\
-  assemble_name (FILE, NAME);  \
-  fprintf (FILE, "=0\n");  \
-  (*targetm.asm_out.globalize_label) (FILE, NAME); \
-}  \
-   } while (0)
+/* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
+#define ASM_DECLARE_CLASS_REFERENCE(FILE,NAME)  \
+  do {  \
+if (FILE) { \
+  char *Buffer = alloca(strlen(NAME)+30);   \
+  sprintf(Buffer, "\t%s=0", NAME);  \
+  llvm_emit_file_scope_asm(Buffer); \
+  sprintf(Buffer, "\t.globl %s", NAME); \
+  llvm_emit_file_scope_asm(Buffer); \
+}   \
+  } while (0)
+#else
+/* LLVM LOCAL end */
+#define ASM_DECLARE_CLASS_REFERENCE(FILE,NAME)  \
+  do {  \
+if (FILE) { \
+  fprintf (FILE, "\t"); \
+  assemble_name (FILE, NAME);  \
+  fprintf (FILE, "=0\n");   \
+  (*targetm.asm_out.globalize_label) (FILE, NAME);  \
+}   \
+  } while (0)
+/* LLVM LOCAL */
+#endif /*ENABLE_LLVM*/
 
 /* Globalizing directive for a label.  */
 #define GLOBAL_ASM_OP ".globl "

Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=46281&r1=46280&r2=46281&view=diff

==
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jan 23 15:41:05 2008
@@ -18388,12 +18388,6 @@
   else
 return;
 
-  /* LLVM LOCAL begin */
-#ifdef ENABLE_LLVM
-#undef ASM_DECLARE_CLASS_REFERENCE
-#endif
-  /* LLVM LOCAL end */
-  
 #ifdef ASM_DECLARE_CLASS_REFERENCE
   if (flag_next_runtime)
 {


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


[llvm-commits] [llvm-gcc-4.0] r46282 - in /llvm-gcc-4.0/trunk/gcc: config/darwin.h objc/objc-act.c

2008-01-23 Thread Bill Wendling
Author: void
Date: Wed Jan 23 16:14:50 2008
New Revision: 46282

URL: http://llvm.org/viewvc/llvm-project?rev=46282&view=rev
Log:
Backport of r46281:

GCC barfs this to the .s file directly:

   .objc_class_name_CrashTestPlugin=0
   .globl .objc_class_name_CrashTestPlugin

without creating a tree node or anything. We, on the other hand, are creating a
tree node and outputting:

   .globl .objc_class_name_CrashTestPlugin
   .zerofill __DATA, __common, .objc_class_name_CrashTestPlugin, 4, 2

This causes a linker crash because it's in the wrong section:

   (undefined [lazy bound]) external [no dead strip] 
.objc_class_name_NSObject
 (__TEXT,__text) non-external _-[CrashTestPlugin crash]
00d8 (__DATA,__common) external [no dead strip] 
.objc_class_name_CrashTestPlugin

The .objc_class_name_CrashTestPlugin symbol is bad.  It should look like:

 (absolute) external .objc_class_name_CrashTestPlugin

Because it's barfed out directly to the file, we do the same with a file asm
directive.


Modified:
llvm-gcc-4.0/trunk/gcc/config/darwin.h
llvm-gcc-4.0/trunk/gcc/objc/objc-act.c

Modified: llvm-gcc-4.0/trunk/gcc/config/darwin.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/darwin.h?rev=46282&r1=46281&r2=46282&view=diff

==
--- llvm-gcc-4.0/trunk/gcc/config/darwin.h (original)
+++ llvm-gcc-4.0/trunk/gcc/config/darwin.h Wed Jan 23 16:14:50 2008
@@ -1410,15 +1410,31 @@
 /* LLVM LOCAL */
 #endif /*ENABLE_LLVM*/
 
-#define ASM_DECLARE_CLASS_REFERENCE(FILE,NAME) \
-do {   \
-if (FILE) {\
-  fprintf (FILE, "\t");\
-  assemble_name (FILE, NAME);  \
-  fprintf (FILE, "=0\n");  \
-  (*targetm.asm_out.globalize_label) (FILE, NAME); \
-}  \
-   } while (0)
+/* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
+#define ASM_DECLARE_CLASS_REFERENCE(FILE,NAME)  \
+  do {  \
+if (FILE) { \
+  char *Buffer = alloca(strlen(NAME)+30);   \
+  sprintf(Buffer, "\t%s=0", NAME);  \
+  llvm_emit_file_scope_asm(Buffer); \
+  sprintf(Buffer, "\t.globl %s", NAME); \
+  llvm_emit_file_scope_asm(Buffer); \
+}   \
+  } while (0)
+#else
+/* LLVM LOCAL end */
+#define ASM_DECLARE_CLASS_REFERENCE(FILE,NAME)  \
+  do {  \
+if (FILE) { \
+  fprintf (FILE, "\t"); \
+  assemble_name (FILE, NAME);  \
+  fprintf (FILE, "=0\n");   \
+  (*targetm.asm_out.globalize_label) (FILE, NAME);  \
+}   \
+  } while (0)
+/* LLVM LOCAL */
+#endif /*ENABLE_LLVM*/
 
 /* Globalizing directive for a label.  */
 #define GLOBAL_ASM_OP ".globl "

Modified: llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/objc/objc-act.c?rev=46282&r1=46281&r2=46282&view=diff

==
--- llvm-gcc-4.0/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.0/trunk/gcc/objc/objc-act.c Wed Jan 23 16:14:50 2008
@@ -18452,12 +18452,6 @@
   else
 return;
 
-  /* APPLE LOCAL begin LLVM */
-#ifdef ENABLE_LLVM
-#undef ASM_DECLARE_CLASS_REFERENCE
-#endif
-  /* APPLE LOCAL end LLVM */
-  
 #ifdef ASM_DECLARE_CLASS_REFERENCE
   if (flag_next_runtime)
 {


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


[llvm-commits] [llvm] r46283 - /llvm/trunk/include/llvm/Support/GraphWriter.h

2008-01-23 Thread Ted Kremenek
Author: kremenek
Date: Wed Jan 23 16:29:58 2008
New Revision: 46283

URL: http://llvm.org/viewvc/llvm-project?rev=46283&view=rev
Log:
Added special escape sequences "\{", "\}", and "\|" when processing
getNodeLabel(); these sequences allow the user to specify the characters '{',
'}', and '|' in the label, which facilitate breaking the label into multiple
record segments.

Modified:
llvm/trunk/include/llvm/Support/GraphWriter.h

Modified: llvm/trunk/include/llvm/Support/GraphWriter.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GraphWriter.h?rev=46283&r1=46282&r2=46283&view=diff

==
--- llvm/trunk/include/llvm/Support/GraphWriter.h (original)
+++ llvm/trunk/include/llvm/Support/GraphWriter.h Wed Jan 23 16:29:58 2008
@@ -48,8 +48,13 @@
 Str[i] = ' ';
 break;
   case '\\':
-if (i+1 != Str.length() && Str[i+1] == 'l')
-  break;  // don't disturb \l
+if (i+1 != Str.length())
+  switch (Str[i+1]) {
+case 'l': continue; // don't disturb \l
+case '|': case '{': case '}':
+   Str.erase(Str.begin()+i); continue;
+default: break;
+  }
   case '{': case '}':
   case '<': case '>':
   case '|': case '"':


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


[llvm-commits] [llvm] r46286 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h test/CodeGen/X86/byval4.ll test/CodeGen/X86/byva

2008-01-23 Thread Evan Cheng
Author: evancheng
Date: Wed Jan 23 17:17:41 2008
New Revision: 46286

URL: http://llvm.org/viewvc/llvm-project?rev=46286&view=rev
Log:
Let each target decide byval alignment. For X86, it's 4-byte unless the 
aggregare contains SSE vector(s). For x86-64, it's max of 8 or alignment of the 
type.

Added:
llvm/trunk/test/CodeGen/X86/byval6.ll
llvm/trunk/test/CodeGen/X86/byval7.ll
Modified:
llvm/trunk/include/llvm/Target/TargetLowering.h
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.h
llvm/trunk/test/CodeGen/X86/byval4.ll
llvm/trunk/test/CodeGen/X86/byval5.ll

Modified: llvm/trunk/include/llvm/Target/TargetLowering.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=46286&r1=46285&r2=46286&view=diff

==
--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jan 23 17:17:41 2008
@@ -405,6 +405,10 @@
 return VT == MVT::iPTR ? PointerTy : VT;
   }
 
+  /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
+  /// function arguments in the caller parameter area.
+  virtual unsigned getByValTypeAlignment(const Type *Ty) const;
+  
   /// getRegisterType - Return the type of registers that this ValueType will
   /// eventually require.
   MVT::ValueType getRegisterType(MVT::ValueType VT) const {
@@ -433,7 +437,7 @@
 }
 assert(0 && "Unsupported extended type!");
   }
-  
+
   /// hasTargetDAGCombine - If true, the target has custom DAG combine
   /// transformations that it can perform for the specified node.
   bool hasTargetDAGCombine(ISD::NodeType NT) const {

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=46286&r1=46285&r2=46286&view=diff

==
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jan 23 17:17:41 2008
@@ -672,6 +672,46 @@
   allowUnalignedMemoryAccesses = true; // x86 supports it!
 }
 
+/// getMaxByValAlign - Helper for getByValTypeAlignment to determine
+/// the desired ByVal argument alignment.
+static void getMaxByValAlign(const Type *Ty, unsigned &MaxAlign) {
+  if (MaxAlign == 16)
+return;
+  if (const VectorType *VTy = dyn_cast(Ty)) {
+if (VTy->getBitWidth() == 128)
+  MaxAlign = 16;
+else if (VTy->getBitWidth() == 64)
+  if (MaxAlign < 8)
+MaxAlign = 8;
+  } else if (const ArrayType *ATy = dyn_cast(Ty)) {
+unsigned EltAlign = 0;
+getMaxByValAlign(ATy->getElementType(), EltAlign);
+if (EltAlign > MaxAlign)
+  MaxAlign = EltAlign;
+  } else if (const StructType *STy = dyn_cast(Ty)) {
+for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
+  unsigned EltAlign = 0;
+  getMaxByValAlign(STy->getElementType(i), EltAlign);
+  if (EltAlign > MaxAlign)
+MaxAlign = EltAlign;
+  if (MaxAlign == 16)
+break;
+}
+  }
+  return;
+}
+
+/// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
+/// function arguments in the caller parameter area. For X86, aggregates
+/// that contains are placed at 16-byte boundaries while the rest are at
+/// 4-byte boundaries.
+unsigned X86TargetLowering::getByValTypeAlignment(const Type *Ty) const {
+  if (Subtarget->is64Bit())
+return getTargetData()->getABITypeAlignment(Ty);
+  unsigned Align = 4;
+  getMaxByValAlign(Ty, Align);
+  return Align;
+}
 
 /// getPICJumpTableRelocaBase - Returns relocation base for the given PIC
 /// jumptable.

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=46286&r1=46285&r2=46286&view=diff

==
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Wed Jan 23 17:17:41 2008
@@ -322,6 +322,12 @@
 /// getStackPtrReg - Return the stack pointer register we are using: either
 /// ESP or RSP.
 unsigned getStackPtrReg() const { return X86StackPtr; }
+
+/// getByValTypeAlignment - Return the desired alignment for ByVal 
aggregate
+/// function arguments in the caller parameter area. For X86, aggregates
+/// that contains are placed at 16-byte boundaries while the rest are at
+/// 4-byte boundaries.
+virtual unsigned getByValTypeAlignment(const Type *Ty) const;
 
 /// LowerOperation - Provide custom lowering hooks for some operations.
 ///

Modified: llvm/trunk/test/CodeGen/X86/byval4.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval4.ll?rev=46286&r1=46285&r2=46286&view=diff

===

[llvm-commits] [llvm-gcc-4.2] r46290 - /llvm-gcc-4.2/trunk/gcc/regclass.c

2008-01-23 Thread Evan Cheng
Author: evancheng
Date: Wed Jan 23 17:43:35 2008
New Revision: 46290

URL: http://llvm.org/viewvc/llvm-project?rev=46290&view=rev
Log:
Only initialize the tables gimplify needs for llvm.

Modified:
llvm-gcc-4.2/trunk/gcc/regclass.c

Modified: llvm-gcc-4.2/trunk/gcc/regclass.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/regclass.c?rev=46290&r1=46289&r2=46290&view=diff

==
--- llvm-gcc-4.2/trunk/gcc/regclass.c (original)
+++ llvm-gcc-4.2/trunk/gcc/regclass.c Wed Jan 23 17:43:35 2008
@@ -312,9 +312,13 @@
   /* This macro allows the fixed or call-used registers
  and the register classes to depend on target flags.  */
 
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
 #ifdef CONDITIONAL_REGISTER_USAGE
   CONDITIONAL_REGISTER_USAGE;
 #endif
+#endif
+/* LLVM LOCAL end */
 
   /* Compute number of hard regs in each class.  */
 
@@ -324,6 +328,8 @@
   if (TEST_HARD_REG_BIT (reg_class_contents[i], j))
reg_class_size[i]++;
 
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
   /* Initialize the table of subunions.
  reg_class_subunion[I][J] gets the largest-numbered reg-class
  that is contained in the union of classes I and J.  */
@@ -471,6 +477,8 @@
   else if (CALL_REALLY_USED_REGNO_P (i))
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
 }
+#endif
+/* LLVM LOCAL end */
 
   memset (have_regs_of_mode, 0, sizeof (have_regs_of_mode));
   memset (contains_reg_of_mode, 0, sizeof (contains_reg_of_mode));
@@ -486,6 +494,8 @@
   break;
 }
 
+/* LLVM LOCAL begin */
+#ifndef ENABLE_LLVM
   /* Initialize the move cost table.  Find every subset of each class
  and take the maximum cost of moving any subset to any other.  */
 
@@ -542,6 +552,8 @@
may_move_out_cost[m][i][j] = 65536;
  }
   }
+#endif
+/* LLVM LOCAL end */
 }
 
 /* Compute the table of register modes.


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


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

2008-01-23 Thread Evan Cheng
Author: evancheng
Date: Wed Jan 23 17:44:36 2008
New Revision: 46291

URL: http://llvm.org/viewvc/llvm-project?rev=46291&view=rev
Log:
Pointer's are also consider integer types. So %struct.datum = type { i8*, i32 } 
should not be passed by ByVal.

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=46291&r1=46290&r2=46291&view=diff

==
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Wed Jan 23 17:44:36 2008
@@ -681,9 +681,11 @@
 /* Returns true if all elements of the type are integer types. */
 static bool llvm_x86_is_all_integer_types(const Type *Ty) {
   for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
-   I != E; ++I)
-if (!I->get()->isIntOrIntVector())
+   I != E; ++I) {
+const Type *STy = I->get();
+if (!STy->isIntOrIntVector() && STy->getTypeID() != Type::PointerTyID)
   return false;
+  }
   return true;
 }
 


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


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

2008-01-23 Thread Tanya Lattner


Changes in directory llvm-www:

robots.txt updated: 1.4 -> 1.5
---
Log message:

Disallow viewvc.


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

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


Index: llvm-www/robots.txt
diff -u llvm-www/robots.txt:1.4 llvm-www/robots.txt:1.5
--- llvm-www/robots.txt:1.4 Wed Jul 19 12:51:05 2006
+++ llvm-www/robots.txt Wed Jan 23 17:56:51 2008
@@ -5,3 +5,4 @@
 Disallow: /stats
 Disallow: /testresults/X86
 Disallow: /nightlytest
+Disallow: /viewvc



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


[llvm-commits] [llvm] r46292 - in /llvm/trunk/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp TargetLowering.cpp

2008-01-23 Thread Evan Cheng
Author: evancheng
Date: Wed Jan 23 18:22:01 2008
New Revision: 46292

URL: http://llvm.org/viewvc/llvm-project?rev=46292&view=rev
Log:
Forgot these.

Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=46292&r1=46291&r2=46292&view=diff

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jan 23 
18:22:01 2008
@@ -3917,8 +3917,7 @@
   Flags |= ISD::ParamFlags::ByVal;
   const PointerType *Ty = cast(I->getType());
   const Type *ElementTy = Ty->getElementType();
-  unsigned FrameAlign =
-  Log2_32(getTargetData()->getCallFrameTypeAlignment(ElementTy));
+  unsigned FrameAlign = Log2_32(getByValTypeAlignment(ElementTy));
   unsigned FrameSize  = getTargetData()->getABITypeSize(ElementTy);
   Flags |= (FrameAlign << ISD::ParamFlags::ByValAlignOffs);
   Flags |= (FrameSize  << ISD::ParamFlags::ByValSizeOffs);
@@ -4047,8 +4046,7 @@
   Flags |= ISD::ParamFlags::ByVal;
   const PointerType *Ty = cast(Args[i].Ty);
   const Type *ElementTy = Ty->getElementType();
-  unsigned FrameAlign =
-  Log2_32(getTargetData()->getCallFrameTypeAlignment(ElementTy));
+  unsigned FrameAlign = Log2_32(getByValTypeAlignment(ElementTy));
   unsigned FrameSize  = getTargetData()->getABITypeSize(ElementTy);
   Flags |= (FrameAlign << ISD::ParamFlags::ByValAlignOffs);
   Flags |= (FrameSize  << ISD::ParamFlags::ByValSizeOffs);

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=46292&r1=46291&r2=46292&view=diff

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Jan 23 18:22:01 
2008
@@ -414,6 +414,12 @@
   return 1;
 }
 
+/// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
+/// function arguments in the caller parameter area.
+unsigned TargetLowering::getByValTypeAlignment(const Type *Ty) const {
+  return Log2_32(TD->getCallFrameTypeAlignment(Ty));
+}
+
 SDOperand TargetLowering::getPICJumpTableRelocBase(SDOperand Table,
SelectionDAG &DAG) const {
   if (usesGlobalOffsetTable())


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


[llvm-commits] [llvm-gcc-4.2] r46293 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c

2008-01-23 Thread Dale Johannesen
Author: johannes
Date: Wed Jan 23 18:34:12 2008
New Revision: 46293

URL: http://llvm.org/viewvc/llvm-project?rev=46293&view=rev
Log:
Make sure initializers for OBJC_PROTOCOLs don't
get lost at -O0.


Modified:
llvm-gcc-4.2/trunk/gcc/objc/objc-act.c

Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=46293&r1=46292&r2=46293&view=diff

==
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jan 23 18:34:12 2008
@@ -9342,8 +9342,11 @@
   /* Force 4 byte alignment for protocols */
   DECL_ALIGN(decl) = 32;
   DECL_USER_ALIGN(decl) = 1;
-  /* LLVM LOCAL end */
   finish_var_decl (decl, initlist);
+  /* At -O0, we may have emitted references to the decl earlier. */
+  if (!optimize)
+reset_initializer_llvm(decl);
+  /* LLVM LOCAL end */
 }
 }
 
@@ -13638,6 +13641,11 @@
 
   proto_name = synth_id_with_class_suffix ("_OBJC_PROTOCOL", p);
   decl = start_var_decl (objc_protocol_template, proto_name);
+  /* LLVM LOCAL begin */
+  /* Force 4 byte alignment for protocols */
+  DECL_ALIGN(decl) = 32;
+  DECL_USER_ALIGN(decl) = 1;
+  /* LLVM LOCAL end */
 
   PROTOCOL_FORWARD_DECL (p) = decl;
 }


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


[llvm-commits] [llvm] r46295 - in /llvm/trunk: include/llvm/CodeGen/LiveVariables.h include/llvm/CodeGen/MachineInstr.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/LiveVariables.cpp lib/CodeGen/M

2008-01-23 Thread Owen Anderson
Author: resistor
Date: Wed Jan 23 19:10:07 2008
New Revision: 46295

URL: http://llvm.org/viewvc/llvm-project?rev=46295&view=rev
Log:
Move some functionality for adding flags to MachineInstr's into methods on 
MachineInstr rather than LiveVariables.

Modified:
llvm/trunk/include/llvm/CodeGen/LiveVariables.h
llvm/trunk/include/llvm/CodeGen/MachineInstr.h
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
llvm/trunk/lib/CodeGen/LiveVariables.cpp
llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=46295&r1=46294&r2=46295&view=diff

==
--- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Wed Jan 23 19:10:07 2008
@@ -196,26 +196,13 @@
   /// the records for NewMI.
   void instructionChanged(MachineInstr *OldMI, MachineInstr *NewMI);
 
-  /// transferKillDeadInfo - Similar to instructionChanged except it does not
-  /// update live variables internal data structures.
-  static void transferKillDeadInfo(MachineInstr *OldMI, MachineInstr *NewMI,
-   const MRegisterInfo *RegInfo);
-
-  /// addRegisterKilled - We have determined MI kills a register. Look for the
-  /// operand that uses it and mark it as IsKill. If AddIfNotFound is true,
-  /// add a implicit operand if it's not found. Returns true if the operand
-  /// exists / is added.
-  static bool addRegisterKilled(unsigned IncomingReg, MachineInstr *MI,
-const MRegisterInfo *RegInfo,
-bool AddIfNotFound = false);
-
   /// addVirtualRegisterKilled - Add information about the fact that the
   /// specified register is killed after being used by the specified
   /// instruction. If AddIfNotFound is true, add a implicit operand if it's
   /// not found.
   void addVirtualRegisterKilled(unsigned IncomingReg, MachineInstr *MI,
 bool AddIfNotFound = false) {
-if (addRegisterKilled(IncomingReg, MI, RegInfo, AddIfNotFound))
+if (MI->addRegisterKilled(IncomingReg, RegInfo, AddIfNotFound))
   getVarInfo(IncomingReg).Kills.push_back(MI); 
   }
 
@@ -246,21 +233,13 @@
   /// removeVirtualRegistersKilled - Remove all killed info for the specified
   /// instruction.
   void removeVirtualRegistersKilled(MachineInstr *MI);
-  
-  /// addRegisterDead - We have determined MI defined a register without a use.
-  /// Look for the operand that defines it and mark it as IsDead. If
-  /// AddIfNotFound is true, add a implicit operand if it's not found. Returns
-  /// true if the operand exists / is added.
-  static bool addRegisterDead(unsigned IncomingReg, MachineInstr *MI,
-  const MRegisterInfo *RegInfo,
-  bool AddIfNotFound = false);
 
   /// addVirtualRegisterDead - Add information about the fact that the 
specified
   /// register is dead after being used by the specified instruction. If
   /// AddIfNotFound is true, add a implicit operand if it's not found.
   void addVirtualRegisterDead(unsigned IncomingReg, MachineInstr *MI,
   bool AddIfNotFound = false) {
-if (addRegisterDead(IncomingReg, MI, RegInfo, AddIfNotFound))
+if (MI->addRegisterDead(IncomingReg, RegInfo, AddIfNotFound))
 getVarInfo(IncomingReg).Kills.push_back(MI);
   }
 

Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=46295&r1=46294&r2=46295&view=diff

==
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Wed Jan 23 19:10:07 2008
@@ -21,6 +21,7 @@
 namespace llvm {
 
 class TargetInstrDesc;
+class MRegisterInfo;
 
 template  struct ilist_traits;
 template  struct ilist;
@@ -144,6 +145,24 @@
   /// copyPredicates - Copies predicate operand(s) from MI.
   void copyPredicates(const MachineInstr *MI);
 
+  /// addRegisterKilled - We have determined MI kills a register. Look for the
+  /// operand that uses it and mark it as IsKill. If AddIfNotFound is true,
+  /// add a implicit operand if it's not found. Returns true if the operand
+  /// exists / is added.
+  bool addRegisterKilled(unsigned IncomingReg, const MRegisterInfo *RegInfo,
+ bool AddIfNotFound = false);
+  
+  /// addRegisterDead - We have determined MI defined a register without a use.
+  /// Look for the operand that defines it and mark it as IsDead. If
+  /// AddIfNotFound is true, add a implicit operand if it's not found. Returns
+  /// true if the operand exists / is added.
+  bool addRegisterDead(unsigned IncomingReg, const MRegisterInfo *RegInfo,
+

[llvm-commits] [llvm] r46296 - /llvm/trunk/lib/System/Win32/Program.inc

2008-01-23 Thread Anton Korobeynikov
Author: asl
Date: Wed Jan 23 19:20:48 2008
New Revision: 46296

URL: http://llvm.org/viewvc/llvm-project?rev=46296&view=rev
Log:
Fix potential buffer overflow

Modified:
llvm/trunk/lib/System/Win32/Program.inc

Modified: llvm/trunk/lib/System/Win32/Program.inc
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Program.inc?rev=46296&r1=46295&r2=46296&view=diff

==
--- llvm/trunk/lib/System/Win32/Program.inc (original)
+++ llvm/trunk/lib/System/Win32/Program.inc Wed Jan 23 19:20:48 2008
@@ -134,7 +134,7 @@
   }
 
   // Now build the command line.
-  char *command = reinterpret_cast(_alloca(len));
+  char *command = reinterpret_cast(_alloca(len+1));
   char *p = command;
 
   for (unsigned i = 0; args[i]; i++) {


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


[llvm-commits] [llvm-gcc-4.2] r46297 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c

2008-01-23 Thread Dale Johannesen
Author: johannes
Date: Wed Jan 23 19:22:15 2008
New Revision: 46297

URL: http://llvm.org/viewvc/llvm-project?rev=46297&view=rev
Log:
Ensure V2 initializers for OBJC_PROTOCOLs don't
get lost at -O0.


Modified:
llvm-gcc-4.2/trunk/gcc/objc/objc-act.c

Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=46297&r1=46296&r2=46297&view=diff

==
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jan 23 19:22:15 2008
@@ -13625,6 +13625,11 @@
 
UOBJC_PROTOCOL_OPT_CLS_METHODS_decl);
 /* APPLE LOCAL end radar 4695109 */
   finish_var_decl (decl, initlist);
+  /* LLVM LOCAL begin */
+  /* At -O0, we may have emitted references to the decl earlier. */
+  if (!optimize)
+reset_initializer_llvm(decl);
+  /* LLVM LOCAL end */
   /* APPLE LOCAL radar 4533974 - ObjC new protocol */
   objc_add_to_protocol_list_chain (decl);
 }


___
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] r46291 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp

2008-01-23 Thread Chris Lattner
On Jan 23, 2008, at 3:44 PM, Evan Cheng wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=46291&view=rev
> Log:
> Pointer's are also consider integer types. So %struct.datum = type  
> { i8*, i32 } should not be passed by ByVal.

Ok, but please use !isa(STy) instead of using getTypeID  
directly,

-Chris

>
> 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=46291&r1=46290&r2=46291&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ==
> --- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
> +++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Wed Jan 23  
> 17:44:36 2008
> @@ -681,9 +681,11 @@
> /* Returns true if all elements of the type are integer types. */
> static bool llvm_x86_is_all_integer_types(const Type *Ty) {
>   for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty- 
> >subtype_end();
> -   I != E; ++I)
> -if (!I->get()->isIntOrIntVector())
> +   I != E; ++I) {
> +const Type *STy = I->get();
> +if (!STy->isIntOrIntVector() && STy->getTypeID() !=  
> Type::PointerTyID)
>   return false;
> +  }
>   return true;
> }
>
>
>
> ___
> 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] [llvm-gcc-4.0] r46299 - /llvm-gcc-4.0/trunk/gcc/objc/objc-act.c

2008-01-23 Thread Devang Patel
Author: dpatel
Date: Wed Jan 23 20:16:26 2008
New Revision: 46299

URL: http://llvm.org/viewvc/llvm-project?rev=46299&view=rev
Log:
Fix build failure.
objc-act.c:18368: warning: implicit declaration of function 
‘llvm_emit_file_scope_asm’

Modified:
llvm-gcc-4.0/trunk/gcc/objc/objc-act.c

Modified: llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/objc/objc-act.c?rev=46299&r1=46298&r2=46299&view=diff

==
--- llvm-gcc-4.0/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.0/trunk/gcc/objc/objc-act.c Wed Jan 23 20:16:26 2008
@@ -76,6 +76,9 @@
 #include "langhooks-def.h"
 /* APPLE LOCAL optimization pragmas 3124235/3420242 */
 #include "opts.h"
+#ifdef ENABLE_LLVM
+#include "llvm.h"   /* for reset_initializer_llvm */
+#endif
 
 #define OBJC_VOID_AT_END   void_list_node
 


___
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] r46164 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp

2008-01-23 Thread Evan Cheng
Those are also not passed byval. My commit message should have said  
aggregates not structs.

Evan

On Jan 19, 2008, at 12:47 AM, Duncan Sands wrote:

>> i32 / i64 all integer structs are not passed byval.
>
> What about integer arrays?
>
> Best wishes,
>
> 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] r46164 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp

2008-01-23 Thread Evan Cheng

On Jan 22, 2008, at 11:23 PM, Duncan Sands wrote:
>
> Can you please clarify the roles of llvm-gcc and the code generators
> in getting ABI compatibility.  When generating IR for x86-64, llvm-gcc
> sometimes chops by-value structs into pieces, and sometimes passes the
> struct as a byval parameter.  Since it chops up all-integer structs,
> and this corresponds more or less to what the ABI says, I assumed this
> was an attempt to get ABI correctness.  Especially as the code  
> generators
> don't seem to bother themselves with following the details of the  
> ABI (yet),
> and just push byval parameters onto the stack.  Since you say

If ABI specifies the aggregate should be passed in memory, then llvm- 
gcc passes it byval. Otherwise, it chops up in pieces following the  
ABI specification (only x86-64 uses a mixture of integer and non- 
integer registers).

>
>>> This is an optimization, not a correctness issue
>
> I guess this means that the plan is to teach the codegenerators how to
> pass any aggregate byval in an ABI conformant way (not the case  
> right now),
> but still do some chopping up in the front-end to help the optimizers.
> Of course this chopping up needs to be done carefully so the final  
> result
> squirted out by the codegenerators (once they are ABI conformant)  
> is the
> same as if the chopping had not been done...  Is this chopping  
> really a
> big win?  Is it not possible to get an equivalent level of  
> optimization
> by enhancing alias analysis?

We are only doing thise for small integer aggregates that are not  
passed through registers. This guarantees ABI compliance. Chopping it  
up into small integer pieces ensure the code generator does not make  
a copy of the object (among other potential benefits). One day when  
the code generator is smarter about it then perhaps we can eliminate  
this optimization.

Evan

>
> Ciao,
>
> Duncan.

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


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

2008-01-23 Thread Evan Cheng
Author: evancheng
Date: Wed Jan 23 21:06:59 2008
New Revision: 46301

URL: http://llvm.org/viewvc/llvm-project?rev=46301&view=rev
Log:
Do not use getTypeID().

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=46301&r1=46300&r2=46301&view=diff

==
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Wed Jan 23 21:06:59 2008
@@ -683,7 +683,7 @@
   for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
I != E; ++I) {
 const Type *STy = I->get();
-if (!STy->isIntOrIntVector() && STy->getTypeID() != Type::PointerTyID)
+if (!STy->isIntOrIntVector() && !isa(STy))
   return false;
   }
   return true;


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


[llvm-commits] [llvm] r46302 - /llvm/trunk/runtime/GC/SemiSpace/semispace.c

2008-01-23 Thread Gordon Henriksen
Author: gordon
Date: Wed Jan 23 23:16:36 2008
New Revision: 46302

URL: http://llvm.org/viewvc/llvm-project?rev=46302&view=rev
Log:
Fixing the stack walker.

Modified:
llvm/trunk/runtime/GC/SemiSpace/semispace.c

Modified: llvm/trunk/runtime/GC/SemiSpace/semispace.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/runtime/GC/SemiSpace/semispace.c?rev=46302&r1=46301&r2=46302&view=diff

==
--- llvm/trunk/runtime/GC/SemiSpace/semispace.c (original)
+++ llvm/trunk/runtime/GC/SemiSpace/semispace.c Wed Jan 23 23:16:36 2008
@@ -97,25 +97,28 @@
  * FIXME: This should be in a code-generator specific library, but for now this
  * will work for all code generators.
  */
+typedef struct FrameMap FrameMap;
 struct FrameMap {
   int32_t NumRoots; // Number of roots in stack frame.
   int32_t NumMeta;  // Number of metadata descriptors. May be < NumRoots.
   void *Meta[]; // May be absent for roots without metadata.
 };
 
+typedef struct StackEntry StackEntry;
 struct StackEntry {
-  ShadowStackEntry *Next; // Caller's stack entry.
+  StackEntry *Next;   // Caller's stack entry.
   const FrameMap *Map;// Pointer to constant FrameMap.
   void *Roots[];  // Stack roots (in-place array).
 };
 StackEntry *llvm_gc_root_chain;
 
 void llvm_cg_walk_gcroots(void (*FP)(void **Root, void *Meta)) {
-  for (StackEntry *R; R; R = R->Next) {
+  StackEntry *R;
+  for (R = llvm_gc_root_chain; R; R = R->Next) {
 unsigned i, e;
-for (i = 0, e = R->NumMeta; i != e; ++i)
+for (i = 0, e = R->Map->NumMeta; i != e; ++i)
   FP(&R->Roots[i], R->Map->Meta[i]);
-for (e = R->NumRoots; i != e; ++i)
+for (e = R->Map->NumRoots; i != e; ++i)
   FP(&R->Roots[i], NULL);
   }
 }


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


[llvm-commits] [llvm] r46303 - in /llvm/trunk/test/CodeGen/X86: pr1505.ll pr1505b.ll

2008-01-23 Thread Chris Lattner
Author: lattner
Date: Thu Jan 24 00:35:44 2008
New Revision: 46303

URL: http://llvm.org/viewvc/llvm-project?rev=46303&view=rev
Log:
take these with a pr #

Modified:
llvm/trunk/test/CodeGen/X86/pr1505.ll
llvm/trunk/test/CodeGen/X86/pr1505b.ll

Modified: llvm/trunk/test/CodeGen/X86/pr1505.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr1505.ll?rev=46303&r1=46302&r2=46303&view=diff

==
--- llvm/trunk/test/CodeGen/X86/pr1505.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pr1505.ll Thu Jan 24 00:35:44 2008
@@ -1,6 +1,6 @@
 ; RUN: llvm-as < %s | llc -mcpu=i486 | not grep fldl
+; PR1505
 
-; ModuleID = ''
 target datalayout = 
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
 target triple = "i686-apple-darwin8"
 @G = weak global float 0.00e+00;  [#uses=1]

Modified: llvm/trunk/test/CodeGen/X86/pr1505b.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr1505b.ll?rev=46303&r1=46302&r2=46303&view=diff

==
--- llvm/trunk/test/CodeGen/X86/pr1505b.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pr1505b.ll Thu Jan 24 00:35:44 2008
@@ -1,7 +1,7 @@
 ; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstpl | count 3
 ; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstps | count 3
+; PR1505
 
-; ModuleID = ''
 target datalayout = 
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
 target triple = "i686-apple-darwin8"
%"struct.std::basic_ios >" = type { 
%"struct.std::ios_base", 
%"struct.std::basic_ostream >"*, i8, i8, 
%"struct.std::basic_streambuf >"*, 
%"struct.std::ctype"*, 
%"struct.std::num_get > >"*, 
%"struct.std::num_get > >"* }


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


[llvm-commits] [llvm] r46304 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

2008-01-23 Thread Chris Lattner
Author: lattner
Date: Thu Jan 24 00:45:35 2008
New Revision: 46304

URL: http://llvm.org/viewvc/llvm-project?rev=46304&view=rev
Log:
fold fp_round(fp_round(x)) -> fp_round(x).

Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=46304&r1=46303&r2=46304&view=diff

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Jan 24 00:45:35 2008
@@ -3648,6 +3648,15 @@
   if (N0.getOpcode() == ISD::FP_EXTEND && VT == 
N0.getOperand(0).getValueType())
 return N0.getOperand(0);
   
+  // fold (fp_round (fp_round x)) -> (fp_round x)
+  if (N0.getOpcode() == ISD::FP_ROUND) {
+// This is a value preserving truncation if both round's are.
+bool IsTrunc = N->getConstantOperandVal(1) == 1 &&
+   N0.Val->getConstantOperandVal(1) == 1;
+return DAG.getNode(ISD::FP_ROUND, VT, N0.getOperand(0),
+   DAG.getIntPtrConstant(IsTrunc));
+  }
+  
   // fold (fp_round (copysign X, Y)) -> (copysign (fp_round X), Y)
   if (N0.getOpcode() == ISD::FCOPYSIGN && N0.Val->hasOneUse()) {
 SDOperand Tmp = DAG.getNode(ISD::FP_ROUND, VT, N0.getOperand(0), N1);


___
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] r46281 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.h objc/objc-act.c

2008-01-23 Thread Duncan Sands
Hi Bill,

> GCC barfs this to the .s file directly:
> 
> .objc_class_name_CrashTestPlugin=0
> .globl .objc_class_name_CrashTestPlugin

it looks like you write this directly to a file
containing LLVM IR.  I guess this is OK as long
as no-one is using the global in the IR (otherwise
the verifier will barf).  Is that the case?

Thanks,

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


[llvm-commits] [llvm] r46305 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

2008-01-23 Thread Chris Lattner
Author: lattner
Date: Thu Jan 24 01:18:21 2008
New Revision: 46305

URL: http://llvm.org/viewvc/llvm-project?rev=46305&view=rev
Log:
The dag combiner is missing revisiting nodes that it really should, and thus 
leaving
dead stuff around.  This gets fed into the isel pass and causes certain 
foldings from
happening because nodes have extraneous uses floating around.  For example, if 
we turned
foo(bar(x)) -> baz(x), we sometimes left bar(x) around.

Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=46305&r1=46304&r2=46305&view=diff

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Jan 24 01:18:21 2008
@@ -606,6 +606,11 @@
 // Push the new node and any users onto the worklist
 AddToWorkList(RV.Val);
 AddUsersToWorkList(RV.Val);
+
+// Add any uses of the old node to the worklist if they have a single
+// use.  They may be dead after this node is deleted.
+for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
+  AddToWorkList(N->getOperand(i).Val);
   
 // Nodes can be reintroduced into the worklist.  Make sure we do not
 // process a node that has been replaced.


___
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] r46281 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.h objc/objc-act.c

2008-01-23 Thread Bill Wendling
Hi Duncan,

>> GCC barfs this to the .s file directly:
>>
>> .objc_class_name_CrashTestPlugin=0
>> .globl .objc_class_name_CrashTestPlugin
>
> it looks like you write this directly to a file
> containing LLVM IR.  I guess this is OK as long
> as no-one is using the global in the IR (otherwise
> the verifier will barf).  Is that the case?
>
This is what I understand to be happening. The GCC version of this  
doesn't even create a tree node for these, so it shouldn't be  
generating a use of it. I'm taking that to imply that the GCC to LLVM  
converter won't create a use of it.

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


[llvm-commits] [llvm] r46306 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

2008-01-23 Thread Chris Lattner
Author: lattner
Date: Thu Jan 24 01:57:06 2008
New Revision: 46306

URL: http://llvm.org/viewvc/llvm-project?rev=46306&view=rev
Log:
Fix this buggy transformation.  Two observations:
1. we already know the value is dead, so don't bother replacing 
   it with undef.
2. The very case the comment describes actually makes the load
   live which asserts in deletenode.  If we do the replacement
   and the node becomes live, just treat it as new.  This fixes
   a failure on X86/2008-01-16-InvalidDAGCombineXform.ll with
   some local changes in my tree.


Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=46306&r1=46305&r2=46306&view=diff

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Jan 24 01:57:06 2008
@@ -4090,28 +4090,19 @@
 // v1, chain2 = load chain1, loc
 // v2, chain3 = load chain2, loc
 // v3 = add v2, c
-// Now we replace use of v1 with undef, use of chain2 with chain1.
-// ReplaceAllUsesWith() will iterate through uses of the first load and
-// update operands:
-// v1, chain2 = load chain1, loc
-// v2, chain3 = load chain1, loc
-// v3 = add v2, c
-// Now the second load is the same as the first load, SelectionDAG cse
-// will ensure the use of second load is replaced with the first load.
-// v1, chain2 = load chain1, loc
-// v3 = add v1, c
-// Then v1 is replaced with undef and bad things happen.
+// Now we replace use of chain2 with chain1.  This makes the second 
load
+// isomorphic to the one we are deleting, and thus makes this load 
live.
 std::vector NowDead;
-SDOperand Undef = DAG.getNode(ISD::UNDEF, N->getValueType(0));
 DOUT << "\nReplacing.6 "; DEBUG(N->dump(&DAG));
-DOUT << "\nWith: "; DEBUG(Undef.Val->dump(&DAG));
-DOUT << " and 1 other value\n";
-DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Undef, &NowDead);
+DOUT << "\nWith chain: "; DEBUG(Chain.Val->dump(&DAG));
+DOUT << "\n";
 DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 1), Chain, &NowDead);
-removeFromWorkList(N);
 for (unsigned i = 0, e = NowDead.size(); i != e; ++i)
   removeFromWorkList(NowDead[i]);
-DAG.DeleteNode(N);
+if (N->use_empty()) {
+  removeFromWorkList(N);
+  DAG.DeleteNode(N);
+}
 return SDOperand(N, 0);   // Return N so it doesn't get rechecked!
   }
 } else {


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