[llvm-commits] [llvm] r41116 - /llvm/trunk/test/Linker/link-messages.ll

2007-08-16 Thread Reid Spencer
Author: reid
Date: Thu Aug 16 02:22:43 2007
New Revision: 41116

URL: http://llvm.org/viewvc/llvm-project?rev=41116&view=rev
Log:
Add a test to ensure that obvious link messages are actually produced on 
the standard error.

Added:
llvm/trunk/test/Linker/link-messages.ll

Added: llvm/trunk/test/Linker/link-messages.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/link-messages.ll?rev=41116&view=auto

==
--- llvm/trunk/test/Linker/link-messages.ll (added)
+++ llvm/trunk/test/Linker/link-messages.ll Thu Aug 16 02:22:43 2007
@@ -0,0 +1,11 @@
+; Test that linking two files with the same definition causes an error and
+; that error is printed out.
+; RUN: llvm-as %s -o %t.one.bc -f
+; RUN: llvm-as %s -o %t.two.bc -f
+; RUN: ignore llvm-ld -disable-opt -link-as-library %t.one.bc %t.two.bc \
+; RUN:   -o %t.bc 2>%t.err 
+; RUN: grep "Function is already defined" %t.err
+
+define i32 @bar() {
+   ret i32 0
+}


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


[llvm-commits] [llvm] r41117 - /llvm/trunk/lib/Linker/LinkItems.cpp

2007-08-16 Thread Reid Spencer
Author: reid
Date: Thu Aug 16 02:23:37 2007
New Revision: 41117

URL: http://llvm.org/viewvc/llvm-project?rev=41117&view=rev
Log:
Ensure that error messages a propagated from calls to LinkInModule so they get
reported to the end user.

Modified:
llvm/trunk/lib/Linker/LinkItems.cpp

Modified: llvm/trunk/lib/Linker/LinkItems.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkItems.cpp?rev=41117&r1=41116&r2=41117&view=diff

==
--- llvm/trunk/lib/Linker/LinkItems.cpp (original)
+++ llvm/trunk/lib/Linker/LinkItems.cpp Thu Aug 16 02:23:37 2007
@@ -162,8 +162,9 @@
 if (MemoryBuffer *Buffer = MemoryBuffer::getSTDIN()) {
   M.reset(ParseBitcodeFile(Buffer, &Error));
   delete Buffer;
-  if (!LinkInModule(M.get()))
-return false;
+  if (M.get())
+if (!LinkInModule(M.get(), &Error))
+  return false;
 } else 
   Error = "standard input is empty";
 return error("Cannot link stdin: " + Error);
@@ -195,7 +196,7 @@
   std::auto_ptr M(LoadObject(File));
   if (M.get() == 0)
 return error("Cannot load file '" + File.toString() + "'" + Error);
-  if (LinkInModule(M.get()))
+  if (LinkInModule(M.get(), &Error))
 return error("Cannot link file '" + File.toString() + "'" + Error);
 
   verbose("Linked in file '" + File.toString() + "'");


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


[llvm-commits] [llvm] r41118 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp SimpleRegisterCoalescing.cpp

2007-08-16 Thread Evan Cheng
Author: evancheng
Date: Thu Aug 16 02:24:22 2007
New Revision: 41118

URL: http://llvm.org/viewvc/llvm-project?rev=41118&view=rev
Log:
Fix some kill info update bugs; add hidden option -disable-rematerialization to 
turn off remat for debugging.

Modified:
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp

Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=41118&r1=41117&r2=41118&view=diff

==
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Aug 16 02:24:22 2007
@@ -36,6 +36,12 @@
 #include 
 using namespace llvm;
 
+namespace {
+  // Hidden options for help debugging.
+  cl::opt DisableReMat("disable-rematerialization", 
+  cl::init(false), cl::Hidden);
+}
+
 STATISTIC(numIntervals, "Number of original intervals");
 STATISTIC(numIntervalsAfter, "Number of intervals after coalescing");
 STATISTIC(numFolded   , "Number of loads/stores folded into instructions");
@@ -201,6 +207,9 @@
 /// val# of the specified interval is re-materializable.
 bool LiveIntervals::isReMaterializable(const LiveInterval &li, unsigned ValNum,
MachineInstr *MI) {
+  if (DisableReMat)
+return false;
+
   if (tii_->isTriviallyReMaterializable(MI))
 return true;
 
@@ -610,7 +619,7 @@
 DOUT << " Removing [" << Start << "," << End << "] from: ";
 interval.print(DOUT, mri_); DOUT << "\n";
 interval.removeRange(Start, End);
-interval.addKillForValNum(0, Start-1); // odd # means phi node
+interval.addKillForValNum(0, Start+1); // odd # means phi node
 DOUT << " RESULT: "; interval.print(DOUT, mri_);
 
 // Replace the interval with one of a NEW value number.  Note that this

Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=41118&r1=41117&r2=41118&view=diff

==
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Aug 16 02:24:22 2007
@@ -683,6 +683,8 @@
 RHSValNoAssignments[0] = RHSValID;
 if (RHSVal0DefinedFromLHS != -1) {
   int LHSValId = LHSValNoAssignments[RHSVal0DefinedFromLHS];
+  unsigned DefIdx = RHS.getDefForValNum(0);
+  LiveInterval::removeKill(ValueNumberInfo[LHSValId], DefIdx);
   LHS.addKills(ValueNumberInfo[LHSValId], RHS.getKillsForValNum(0));
 }
   } else {
@@ -797,6 +799,8 @@
 if (LHSValId == -1)
   continue;
 unsigned RHSValId = RHSValNoAssignments[i];
+unsigned DefIdx = RHS.getDefForValNum(i);
+LiveInterval::removeKill(ValueNumberInfo[RHSValId], DefIdx);
 LHS.addKills(ValueNumberInfo[RHSValId], RHS.getKillsForValNum(i));
   }
   for (unsigned i = 0, e = LHSValsDefinedFromRHS.size(); i != e; ++i) {
@@ -804,6 +808,8 @@
 if (RHSValId == -1)
   continue;
 unsigned LHSValId = LHSValNoAssignments[i];
+unsigned DefIdx = LHS.getDefForValNum(i);
+LiveInterval::removeKill(ValueNumberInfo[LHSValId], DefIdx);
 RHS.addKills(ValueNumberInfo[LHSValId], LHS.getKillsForValNum(i));
   }
 


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


[llvm-commits] [llvm] r41119 - /llvm/trunk/include/llvm/CodeGen/LiveInterval.h

2007-08-16 Thread Evan Cheng
Author: evancheng
Date: Thu Aug 16 02:25:37 2007
New Revision: 41119

URL: http://llvm.org/viewvc/llvm-project?rev=41119&view=rev
Log:
Comments.

Modified:
llvm/trunk/include/llvm/CodeGen/LiveInterval.h

Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=41119&r1=41118&r2=41119&view=diff

==
--- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Thu Aug 16 02:25:37 2007
@@ -88,10 +88,14 @@
 /// ValueNumberInfo - If the value number definition is undefined (e.g. phi
 /// merge point), it contains ~0u,x. If the value number is not in use, it
 /// contains ~1u,x to indicate that the value # is not used. 
+///   def   - Instruction # of the definition.
+///   reg   - Source reg iff val# is defined by a copy; zero otherwise.
+///   kills - Instruction # of the kills. If a kill is an odd #, it means
+///   the kill is a phi join point.
 struct VNInfo {
-  unsigned def;  // instruction # of the definition
-  unsigned reg;  // src reg: non-zero iff val# is defined by a copy
-  SmallVector kills;  // instruction #s of the kills
+  unsigned def;
+  unsigned reg;
+  SmallVector kills;
   VNInfo() : def(~1U), reg(0) {};
   VNInfo(unsigned d, unsigned r) : def(d), reg(r) {};
 };


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


[llvm-commits] [test-suite] r41120 - /test-suite/trunk/Makefile.programs

2007-08-16 Thread Evan Cheng
Author: evancheng
Date: Thu Aug 16 02:40:34 2007
New Revision: 41120

URL: http://llvm.org/viewvc/llvm-project?rev=41120&view=rev
Log:
x86 / arm llcbeta is -disable-rematerialization.

Modified:
test-suite/trunk/Makefile.programs

Modified: test-suite/trunk/Makefile.programs
URL: 
http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=41120&r1=41119&r2=41120&view=diff

==
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Thu Aug 16 02:40:34 2007
@@ -221,13 +221,16 @@
 LLCBETAOPTION := -sched=simple 
 endif
 ifeq ($(ARCH),x86)
-LLCBETAOPTION := -regalloc=local -fast
+LLCBETAOPTION := -disable-rematerialization
+#-disable-fp-elim
+#-regalloc=bigblock -fast
 endif
 ifeq ($(ARCH),Sparc)
 LLCBETAOPTION := -enable-sparc-v9-insts
 endif
 ifeq ($(ARCH),ARM)
-LLCBETAOPTION := -enable-arm-if-conversion
+LLCBETAOPTION := -disable-rematerialization
+#-enable-arm-if-conversion
 #-march=thumb
 endif
 ifeq ($(ARCH),THUMB)


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


[llvm-commits] [llvm] r41121 - /llvm/trunk/lib/Linker/LinkItems.cpp

2007-08-16 Thread Reid Spencer
Author: reid
Date: Thu Aug 16 02:47:30 2007
New Revision: 41121

URL: http://llvm.org/viewvc/llvm-project?rev=41121&view=rev
Log:
Improve error handling in the linker by:

1. Eliminate redundant error messages. LinkInFile and LinkInArchive
   already call the error() method in each case so there's no use
   telling the user again that an item couldn't be linked in.

2. Improve the formatting of error messages (separating content).

3. Change the wording for the warning about unrecognized files. Make
   it clear that the file is being ignored.


Modified:
llvm/trunk/lib/Linker/LinkItems.cpp

Modified: llvm/trunk/lib/Linker/LinkItems.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkItems.cpp?rev=41121&r1=41120&r2=41121&view=diff

==
--- llvm/trunk/lib/Linker/LinkItems.cpp (original)
+++ llvm/trunk/lib/Linker/LinkItems.cpp Thu Aug 16 02:47:30 2007
@@ -87,7 +87,7 @@
 case sys::Bitcode_FileType:
   // LLVM ".so" file.
   if (LinkInFile(Pathname, is_native))
-return error("Cannot link file '" + Pathname.toString() + "'");
+return true;
   break;
 
 case sys::Archive_FileType:
@@ -180,24 +180,24 @@
   switch (sys::IdentifyFileType(Magic.c_str(), 64)) {
 default: assert(0 && "Bad file type identification");
 case sys::Unknown_FileType:
-  return warning("Supposed object file '" + File.toString() + 
- "' not recognized as such");
+  return warning("Ignoring file '" + File.toString() + 
+   "' because does not contain bitcode.");
 
 case sys::Archive_FileType:
   // A user may specify an ar archive without -l, perhaps because it
   // is not installed as a library. Detect that and link the archive.
   verbose("Linking archive file '" + File.toString() + "'");
   if (LinkInArchive(File, is_native))
-return error("Cannot link archive '" + File.toString() + "'");
+return true;
   break;
 
 case sys::Bitcode_FileType: {
   verbose("Linking bitcode file '" + File.toString() + "'");
   std::auto_ptr M(LoadObject(File));
   if (M.get() == 0)
-return error("Cannot load file '" + File.toString() + "'" + Error);
+return error("Cannot load file '" + File.toString() + "': " + Error);
   if (LinkInModule(M.get(), &Error))
-return error("Cannot link file '" + File.toString() + "'" + Error);
+return error("Cannot link file '" + File.toString() + "': " + Error);
 
   verbose("Linked in file '" + File.toString() + "'");
   break;


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


[llvm-commits] [llvm-top] r41122 - in /llvm-top/trunk: ./ README.txt

2007-08-16 Thread Reid Spencer
Author: reid
Date: Thu Aug 16 02:58:29 2007
New Revision: 41122

URL: http://llvm.org/viewvc/llvm-project?rev=41122&view=rev
Log:
Update the documentation to include a description of the options command, fix
some typos and relocate some content. 

Set the svn:ignore property to ignore checked out directories.

Modified:
llvm-top/trunk/   (props changed)
llvm-top/trunk/README.txt

Propchange: llvm-top/trunk/

--
--- svn:ignore (original)
+++ svn:ignore Thu Aug 16 02:58:29 2007
@@ -1,3 +1,11 @@
 svn-commit*.tmp
 installed
 .options
+sample
+build.llvm-gcc-4.0
+website
+llvm-gcc-4.0
+test-suite
+build.llvm
+llvm
+support

Modified: llvm-top/trunk/README.txt
URL: 
http://llvm.org/viewvc/llvm-project/llvm-top/trunk/README.txt?rev=41122&r1=41121&r2=41122&view=diff

==
--- llvm-top/trunk/README.txt (original)
+++ llvm-top/trunk/README.txt Thu Aug 16 02:58:29 2007
@@ -20,7 +20,10 @@
   ./get llvm-gcc-4-0
 
 which will check out both llvm and llvm-gcc-4-0 because the latter depends on
-the former. 
+the former.  You can check out any number of modules using the "get" script, 
+for example, like this:
+
+  ./get llvm-gcc-4.0 test-suite stacker
 
 
 In addition to checking out software, there are several more scripts in 
@@ -33,16 +36,19 @@
   get  - check out modules and their dependencies from subversion
   info - get subversion information about one or more modules
   update   - update one or more modules
+  options  - specify options once that are "sticky" for all scripts.
 
   build- configure, compile and link one or more modules
   install  - install one or more modules (presumes build already done)
   clean- clean (remove build products) one or more modules
 
-The first three scripts just work with subversion.  The last three scripts do 
-not dictate how to build, install or clean the modules; that is up to the 
-modules themselves.  The only thing these scripts depend on is a file named 
-ModuleInfo.txt located in each module's top directory. This file can contain 
-the following definitions:
+
+The first four scripts just work with subversion or llvm-top itself.  The last
+three scripts implement an easier method for building, isntalling and cleaning
+the LLVM modules themselves. However, these three do not dictate how to build, 
+install or clean the modules; that is up to the modules themselves.  The only 
+thing these scripts depend on is a file named ModuleInfo.txt located in each 
+module's top directory. This file can contain the following definitions:
 
   DepModule:  - the list of modules this module depends on 
   BuildCmd:   - a command to build (and configure) the module
@@ -61,7 +67,7 @@
 of arguments. The arguments recognized are listed below in the order they
 are recognized by the scripts:
 
-  VEROBSE={verbosity_level}
+  VERBOSE={verbosity_level}
  This controls how verbose the scripts are in their output. The default
  level is 0 which produces no output unless there's an error. At level 1
  you'll get basic confirmation of the action taken. At level 2 you'll get
@@ -89,7 +95,7 @@
  build, install or clean commands.
 
   all
- This is equivalent to specify all modules in the LLVM subversion 
+ This is equivalent to specifying all modules in the LLVM subversion 
  repository. Careful! All the scripts will check out EVERYTHING in the
  repository. 
 
@@ -111,7 +117,7 @@
 
   3. Specify "all" - all modules will be checked out (careful!)
 
-So, for example:
+So, for example, consider:
 
   ./build llvm-gcc-4.0 ENABLE_OPTIMIZED=1 PREFIX=/my/install/dir VERBOSE=1
 
@@ -120,7 +126,7 @@
   1. Check out the llvm-gcc-4.0 module
   2. Check out the core module because llvm-gcc-4.0 depends on core
   3. Check out the support module because core depends on support
-  4. Build the support module in optimized mode and configured to install
+  4. Build the support module in optimized mode and configure it to install
  into /my/install/dir
   5. Build the core module the same way.
   6. Build the llvm-gcc-4.0 module the same way.
@@ -141,12 +147,6 @@
   java - Java Front End (unfinished, out of date)
   poolalloc- The pooled allocator from Chris Lattner's thesis
 
-
-You can check out any number of modules using the "get" script, for example,
-like this:
-
-  ./get llvm-gcc-4.0 test-suite stacker
-
 -
 
 Some Other Useful URLS


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


[llvm-commits] [llvm] r41123 - /llvm/trunk/test/CodeGen/X86/byval.ll

2007-08-16 Thread Rafael Espindola
Author: rafael
Date: Thu Aug 16 08:09:02 2007
New Revision: 41123

URL: http://llvm.org/viewvc/llvm-project?rev=41123&view=rev
Log:
add byval test

Added:
llvm/trunk/test/CodeGen/X86/byval.ll

Added: llvm/trunk/test/CodeGen/X86/byval.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval.ll?rev=41123&view=auto

==
--- llvm/trunk/test/CodeGen/X86/byval.ll (added)
+++ llvm/trunk/test/CodeGen/X86/byval.ll Thu Aug 16 08:09:02 2007
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movq.*8.*rsp.*rax
+
+%struct.s = type { i64, i64, i64 }
+
+define i64 @f(%struct.s* byval %a) {
+entry:
+   %tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
+   %tmp3 = load i64* %tmp2, align 8
+   ret i64 %tmp3
+}


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


[llvm-commits] [llvm] r41124 - in /llvm/trunk: include/llvm/ADT/APInt.h lib/Support/APInt.cpp

2007-08-16 Thread Chris Lattner
Author: lattner
Date: Thu Aug 16 10:56:55 2007
New Revision: 41124

URL: http://llvm.org/viewvc/llvm-project?rev=41124&view=rev
Log:
This adds a bunch of static functions that implement unsigned
two's complement bignum arithmetic.  They could be used to
implement much of APInt, but the idea is they are enough to
implement APFloat as well, which the current APInt interface
is not suited for.

Patch by Neil Booth!


Modified:
llvm/trunk/include/llvm/ADT/APInt.h
llvm/trunk/lib/Support/APInt.cpp

Modified: llvm/trunk/include/llvm/ADT/APInt.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=41124&r1=41123&r2=41124&view=diff

==
--- llvm/trunk/include/llvm/ADT/APInt.h (original)
+++ llvm/trunk/include/llvm/ADT/APInt.h Thu Aug 16 10:56:55 2007
@@ -19,8 +19,16 @@
 #include 
 #include 
 
+#define HOST_CHAR_BIT 8
+#define compileTimeAssert(cond) extern int CTAssert[(cond) ? 1 : -1]
+#define integerPartWidth (HOST_CHAR_BIT * sizeof(llvm::integerPart))
+
 namespace llvm {
 
+  /* An unsigned host type used as a single part of a multi-part
+ bignum.  */
+  typedef uint64_t integerPart;
+
 
//===--===//
 //  APInt Class
 
//===--===//
@@ -1038,6 +1046,124 @@
   return -(*this);
 return *this;
   }
+
+  /// @}
+
+  /// @}
+  /// @name Building-block Operations for APInt and APFloat
+  /// @{
+
+  // These building block operations operate on a representation of
+  // arbitrary precision, two's-complement, bignum integer values.
+  // They should be sufficient to implement APInt and APFloat bignum
+  // requirements.  Inputs are generally a pointer to the base of an
+  // array of integer parts, representing an unsigned bignum, and a
+  // count of how many parts there are.
+
+  /// Sets the least significant part of a bignum to the input value,
+  /// and zeroes out higher parts.  */
+  static void tcSet(integerPart *, integerPart, unsigned int);
+
+  /// Assign one bignum to another.
+  static void tcAssign(integerPart *, const integerPart *, unsigned int);
+
+  /// Returns true if a bignum is zero, false otherwise.
+  static bool tcIsZero(const integerPart *, unsigned int);
+
+  /// Extract the given bit of a bignum; returns 0 or 1.  Zero-based.
+  static int tcExtractBit(const integerPart *, unsigned int bit);
+
+  /// Set the given bit of a bignum.  Zero-based.
+  static void tcSetBit(integerPart *, unsigned int bit);
+
+  /// Returns the bit number of the least or most significant set bit
+  /// of a number.  If the input number has no bits set -1U is
+  /// returned.
+  static unsigned int tcLSB(const integerPart *, unsigned int);
+  static unsigned int tcMSB(const integerPart *, unsigned int);
+
+  /// Negate a bignum in-place.
+  static void tcNegate(integerPart *, unsigned int);
+
+  /// DST += RHS + CARRY where CARRY is zero or one.  Returns the
+  /// carry flag.
+  static integerPart tcAdd(integerPart *, const integerPart *,
+  integerPart carry, unsigned);
+
+  /// DST -= RHS + CARRY where CARRY is zero or one.  Returns the
+  /// carry flag.
+  static integerPart tcSubtract(integerPart *, const integerPart *,
+   integerPart carry, unsigned);
+
+  ///  DST += SRC * MULTIPLIER + PART   if add is true
+  ///  DST  = SRC * MULTIPLIER + PART   if add is false
+  ///
+  ///  Requires 0 <= DSTPARTS <= SRCPARTS + 1.  If DST overlaps SRC
+  ///  they must start at the same point, i.e. DST == SRC.
+  ///
+  ///  If DSTPARTS == SRC_PARTS + 1 no overflow occurs and zero is
+  ///  returned.  Otherwise DST is filled with the least significant
+  ///  DSTPARTS parts of the result, and if all of the omitted higher
+  ///  parts were zero return zero, otherwise overflow occurred and
+  ///  return one.
+  static int tcMultiplyPart(integerPart *dst, const integerPart *src,
+   integerPart multiplier, integerPart carry,
+   unsigned int srcParts, unsigned int dstParts,
+   bool add);
+
+  /// DST = LHS * RHS, where DST has the same width as the operands
+  /// and is filled with the least significant parts of the result.
+  /// Returns one if overflow occurred, otherwise zero.  DST must be
+  /// disjoint from both operands.
+  static int tcMultiply(integerPart *, const integerPart *,
+   const integerPart *, unsigned);
+
+  /// DST = LHS * RHS, where DST has twice the width as the operands.
+  /// No overflow occurs.  DST must be disjoint from both operands.
+  static void tcFullMultiply(integerPart *, const integerPart *,
+const integerPart *, unsigned);
+
+  /// If RHS is zero LHS and REMAINDER are left unchanged, return one.
+  /// Otherwise set LHS to LHS / RHS w

[llvm-commits] [PATCH] JIT support for ARM

2007-08-16 Thread Raul Fernandes Herbster
Multiply instructions are being generated. ARM/JIT runs an application with
no calls to local functions, but library functions calls are supported. I
hope fix such problem soon. Please, send me any feedback.

Thanks in advance, Raul.

-- 
Raul Fernandes Herbster
Embedded and Pervasive Computing Laboratory - embedded.dee.ufcg.edu.br
Electrical Engineering Department - DEE - www.dee.ufcg.edu.br
Electrical Engineering and Informatics Center - CEEI
Federal University of Campina Grande - UFCG - www.ufcg.edu.br
Caixa Postal 10105
58109-970 Campina Grande - PB - Brasil


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


[llvm-commits] [llvm-gcc-4.2] r41125 - /llvm-gcc-4.2/trunk/gcc/fortran/f95-lang.c

2007-08-16 Thread Anton Korobeynikov
Author: asl
Date: Thu Aug 16 16:17:06 2007
New Revision: 41125

URL: http://llvm.org/viewvc/llvm-project?rev=41125&view=rev
Log:
Fix merge conflict. This enables gfortran build on llvm-gcc 4.2 branch

Modified:
llvm-gcc-4.2/trunk/gcc/fortran/f95-lang.c

Modified: llvm-gcc-4.2/trunk/gcc/fortran/f95-lang.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/fortran/f95-lang.c?rev=41125&r1=41124&r2=41125&view=diff

==
--- llvm-gcc-4.2/trunk/gcc/fortran/f95-lang.c (original)
+++ llvm-gcc-4.2/trunk/gcc/fortran/f95-lang.c Thu Aug 16 16:17:06 2007
@@ -175,9 +175,6 @@
 void pointer_int_sum (void);
 void decl_constant_value (void);
 void lookup_name (void);
-tree decl_attributes (tree *ARG_UNUSED (tp),
- tree ARG_UNUSED (p),
- int ARG_UNUSED (s));
 void build_modify_expr (void) { abort (); }
 void iasm_addr (void) { abort (); }
 void iasm_build_bracket (void) { abort (); }
@@ -190,57 +187,8 @@
 void pointer_int_sum (void) { abort (); }
 void decl_constant_value (void) { abort (); }
 void lookup_name (void) { abort (); }
-tree decl_attributes (tree *ARG_UNUSED (tp),
- tree ARG_UNUSED (p),
- int ARG_UNUSED (s))
-{
-  abort ();
-}
 /* APPLE LOCAL end CW asm blocks */
 
-/* APPLE LOCAL begin 4174833 */
-tree objc_is_class_name (tree ARG_UNUSED (arg));
-
-bool objc_method_decl (enum tree_code ARG_UNUSED (opcode));
-bool 
-objc_method_decl (enum tree_code ARG_UNUSED (opcode))
-{
-  return false;
-}
-/* APPLE LOCAL end 4174833 */
-/* APPLE LOCAL begin radar 4441049 */
-tree objc_v2_bitfield_ivar_bitpos (tree);
-
-tree
-objc_v2_bitfield_ivar_bitpos (tree ARG_UNUSED (exp))
-{
-  return 0;
-}
-
-tree objc_v2_component_ref_field_offset (tree);
-
-tree
-objc_v2_component_ref_field_offset (tree ARG_UNUSED (exp))
-{
-  return 0;
-}
-/* APPLE LOCAL end radar 4441049 */ 
-/* APPLE LOCAL begin fariborz 2996215 */
-tree objc_create_init_utf16_var (void);
-tree
-objc_create_init_utf16_var (void)
-{
-  return NULL;
-}
-
-bool objc_anonymous_local_objc_name (const char * ARG_UNUSED (name));
-bool
-objc_anonymous_local_objc_name (const char * ARG_UNUSED (name))
-{
-  return false;
-}
-/* APPLE LOCAL end fariborz 2996215 */
-
 /* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the function
that have names.  Here so we can clear out their names' definitions
at the end of the function.  */


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


[llvm-commits] [llvm] r41126 - in /llvm/trunk: include/llvm/Analysis/MemoryDependenceAnalysis.h lib/Analysis/MemoryDependenceAnalysis.cpp

2007-08-16 Thread Owen Anderson
Author: resistor
Date: Thu Aug 16 16:27:05 2007
New Revision: 41126

URL: http://llvm.org/viewvc/llvm-project?rev=41126&view=rev
Log:
Cache non-local memory dependence analysis.  This is a significant compile
time performance win in most cases.

Modified:
llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=41126&r1=41125&r2=41126&view=diff

==
--- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Thu Aug 16 
16:27:05 2007
@@ -37,12 +37,20 @@
 depMapType;
 depMapType depGraphLocal;
 
+// A map from instructions to their non-local dependencies.
+typedef DenseMap >
+nonLocalDepMapType;
+nonLocalDepMapType depGraphNonLocal;
+
 // A reverse mapping form dependencies to the dependees.  This is
 // used when removing instructions to keep the cache coherent.
-typedef DenseMap >
+typedef DenseMap >
 reverseDepMapType;
 reverseDepMapType reverseDep;
 
+// A reverse mapping form dependencies to the non-local dependees.
+reverseDepMapType reverseDepNonLocal;
+
   public:
 // Special marker indicating that the query has no dependency
 // in the specified block.
@@ -61,7 +69,9 @@
 /// Clean up memory in between runs
 void releaseMemory() {
   depGraphLocal.clear();
+  depGraphNonLocal.clear();
   reverseDep.clear();
+  reverseDepNonLocal.clear();
 }
 
 /// getAnalysisUsage - Does not modify anything.  It uses Value Numbering

Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=41126&r1=41125&r2=41126&view=diff

==
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Thu Aug 16 16:27:05 
2007
@@ -203,6 +203,11 @@
 /// blocks between the query and its dependencies.
 void MemoryDependenceAnalysis::getNonLocalDependency(Instruction* query,
  DenseMap& resp) {
+  if (depGraphNonLocal.count(query)) {
+resp = depGraphNonLocal[query];
+return;
+  }
+  
   // First check that we don't actually have a local dependency.
   Instruction* localDep = getDependency(query);
   if (localDep != NonLocal) {
@@ -212,6 +217,13 @@
   
   // If not, go ahead and search for non-local ones.
   nonLocalHelper(query, query->getParent(), resp);
+  
+  // Update the non-local dependency cache
+  for (DenseMap::iterator I = resp.begin(), E = 
resp.end();
+   I != E; ++I) {
+depGraphNonLocal[query].insert(*I);
+reverseDepNonLocal[I->second].insert(query);
+  }
 }
 
 /// getDependency - Return the instruction on which a memory operation
@@ -380,8 +392,6 @@
   Instruction* newDep = NonLocal;
 
   depMapType::iterator depGraphEntry = depGraphLocal.find(rem);
-  // We assume here that it's not in the reverse map if it's not in
-  // the dep map.  Checking it could be expensive, so don't do it.
 
   if (depGraphEntry != depGraphLocal.end()) {
 if (depGraphEntry->second.first != NonLocal &&
@@ -410,8 +420,18 @@
   // Mark it as unconfirmed as long as it is not the non-local flag
   depGraphLocal[*I] = std::make_pair(newDep, !newDep);
 }
+
 reverseDep.erase(rem);
   }
+  
+  if (depGraphNonLocal.count(rem)) {
+SmallPtrSet& set = reverseDepNonLocal[rem];
+for (SmallPtrSet::iterator I = set.begin(), E = set.end();
+ I != E; ++I)
+  depGraphNonLocal.erase(*I);
+
+reverseDepNonLocal.erase(rem);
+  }
 
   getAnalysis().deleteValue(rem);
 }


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


[llvm-commits] [llvm] r41128 - in /llvm/trunk: include/llvm/CodeGen/ValueTypes.h include/llvm/CodeGen/ValueTypes.td include/llvm/Intrinsics.td lib/VMCore/Verifier.cpp utils/TableGen/CodeGenTarget.cpp

2007-08-16 Thread Dan Gohman
Author: djg
Date: Thu Aug 16 16:57:19 2007
New Revision: 41128

URL: http://llvm.org/viewvc/llvm-project?rev=41128&view=rev
Log:
Add MVT::fAny for overloading intrinsics on floating-point types.

Modified:
llvm/trunk/include/llvm/CodeGen/ValueTypes.h
llvm/trunk/include/llvm/CodeGen/ValueTypes.td
llvm/trunk/include/llvm/Intrinsics.td
llvm/trunk/lib/VMCore/Verifier.cpp
llvm/trunk/utils/TableGen/CodeGenTarget.cpp
llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp

Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=41128&r1=41127&r2=41128&view=diff

==
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Thu Aug 16 16:57:19 2007
@@ -67,6 +67,11 @@
 
 LAST_VALUETYPE =  27,   // This always remains at the end of the list.
 
+// fAny - Any floating-point or vector floating-point value. This is used
+// for intrinsics that have overloadings based on floating-point types.
+// This is only for tblgen's consumption!
+fAny   =  253,   
+
 // iAny - An integer or vector integer value of any bit width. This is
 // used for intrinsics that have overloadings based on integer bit widths.
 // This is only for tblgen's consumption!

Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.td
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.td?rev=41128&r1=41127&r2=41128&view=diff

==
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.td (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.td Thu Aug 16 16:57:19 2007
@@ -49,6 +49,9 @@
 def v4f32  : ValueType<128, 25>;   //  4 x f32 vector value
 def v2f64  : ValueType<128, 26>;   //  2 x f64 vector value
 
+// Pseudo valuetype to represent "float of any format"
+def fAny   : ValueType<0  , 253>;
+
 // Pseudo valuetype to represent "integer of any bit width"
 def iAny   : ValueType<0  , 254>;
 

Modified: llvm/trunk/include/llvm/Intrinsics.td
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=41128&r1=41127&r2=41128&view=diff

==
--- llvm/trunk/include/llvm/Intrinsics.td (original)
+++ llvm/trunk/include/llvm/Intrinsics.td Thu Aug 16 16:57:19 2007
@@ -68,6 +68,7 @@
 
 def llvm_void_ty   : LLVMType;
 def llvm_anyint_ty : LLVMType;
+def llvm_anyfloat_ty   : LLVMType;
 def llvm_i1_ty : LLVMType;
 def llvm_i8_ty : LLVMType;
 def llvm_i16_ty: LLVMType;

Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=41128&r1=41127&r2=41128&view=diff

==
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Thu Aug 16 16:57:19 2007
@@ -1157,6 +1157,20 @@
 CheckFailed("Intrinsic requires even byte width argument", F);
   break;
   }
+} else if (VT == MVT::fAny) {
+  Suffix += ".";
+  if (EltTy != Ty)
+Suffix += "v" + utostr(NumElts);
+  Suffix += MVT::getValueTypeString(MVT::getValueType(EltTy));
+  if (!EltTy->isFloatingPoint()) {
+if (ArgNo == 0)
+  CheckFailed("Intrinsic result type is not "
+  "a floating-point type.", F);
+else
+  CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not "
+  "a floating-point type.", F);
+break;
+  }
 } else if (VT == MVT::iPTR) {
   if (!isa(Ty)) {
 CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not a "

Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=41128&r1=41127&r2=41128&view=diff

==
--- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Thu Aug 16 16:57:19 2007
@@ -44,6 +44,7 @@
   case MVT::i64:   return "MVT::i64";
   case MVT::i128:  return "MVT::i128";
   case MVT::iAny:  return "MVT::iAny";
+  case MVT::fAny:  return "MVT::fAny";
   case MVT::f32:   return "MVT::f32";
   case MVT::f64:   return "MVT::f64";
   case MVT::f80:   return "MVT::f80";
@@ -78,6 +79,7 @@
   case MVT::i64:   return "MVT::i64";
   case MVT::i128:  return "MVT::i128";
   case MVT::iAny:  return "MVT::iAny";
+  case MVT::fAny:  return "MVT::fAny";
   case MVT::f32:   return "MVT::f32";
   case MVT::f64:   return "MVT::f64";
   case MVT::f80:   return "MVT::f80";
@@ -652,7 +654,7 @@
 Record *TyEl = TypeList->getElementAsRecord(i);
 assert(TyEl->isSubClassOf("LLVMType") 

[llvm-commits] [llvm] r41129 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp

2007-08-16 Thread Owen Anderson
Author: resistor
Date: Thu Aug 16 17:02:55 2007
New Revision: 41129

URL: http://llvm.org/viewvc/llvm-project?rev=41129&view=rev
Log:
Add some more comments to GVN.

Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=41129&r1=41128&r2=41129&view=diff

==
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Aug 16 17:02:55 2007
@@ -756,6 +756,7 @@
 PN->addIncoming(val, *PI);
   }
   
+  // Attempt to collapse PHI nodes that are trivially redundant
   Value* v = PN->hasConstantValue();
   if (v) {
 if (Instruction* inst = dyn_cast(v)) {
@@ -804,19 +805,24 @@
 }
   }
 
+  // Cache our phi construction results
   phiMap[orig->getPointerOperand()].insert(PN);
   return PN;
 }
 
+/// processNonLocalLoad - Attempt to eliminate a load whose dependencies are
+/// non-local by performing PHI construction.
 bool GVN::processNonLocalLoad(LoadInst* L,
   SmallVector& toErase) {
   MemoryDependenceAnalysis& MD = getAnalysis();
   
+  // Find the non-local dependencies of the load
   DenseMap deps;
   MD.getNonLocalDependency(L, deps);
   
   DenseMap repl;
   
+  // Filter out useless results (non-locals, etc)
   for (DenseMap::iterator I = deps.begin(), E = 
deps.end();
I != E; ++I)
 if (I->second == MemoryDependenceAnalysis::None) {
@@ -837,6 +843,7 @@
   return false;
 }
   
+  // Use cached PHI construction information from previous runs
   SmallPtrSet& p = phiMap[L->getPointerOperand()];
   for (SmallPtrSet::iterator I = p.begin(), E = p.end();
I != E; ++I) {
@@ -852,6 +859,7 @@
 }
   }
   
+  // Perform PHI construction
   SmallPtrSet visited;
   Value* v = GetValueForBlock(L->getParent(), L, repl, true);
   
@@ -863,6 +871,8 @@
   return true;
 }
 
+/// processLoad - Attempt to eliminate a load, first by eliminating it
+/// locally, and then attempting non-local elimination if that fails.
 bool GVN::processLoad(LoadInst* L,
  DenseMap& lastLoad,
  SmallVector& toErase) {
@@ -891,6 +901,8 @@
   
   bool deletedLoad = false;
   
+  // Walk up the dependency chain until we either find
+  // a dependency we can use, or we can't walk any further
   while (dep != MemoryDependenceAnalysis::None &&
  dep != MemoryDependenceAnalysis::NonLocal &&
  (isa(dep) || isa(dep))) {
@@ -946,6 +958,7 @@
   
   unsigned num = VN.lookup_or_add(I);
   
+  // Collapse PHI nodes
   if (PHINode* p = dyn_cast(I)) {
 Value* constVal = p->hasConstantValue();
 
@@ -966,6 +979,7 @@
 toErase.push_back(p);
   }
 }
+  // Perform value-number based elimination
   } else if (currAvail.test(num)) {
 Value* repl = find_leader(currAvail, num);
 


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


[llvm-commits] [llvm] r41130 - /llvm/trunk/lib/VMCore/Verifier.cpp

2007-08-16 Thread Dan Gohman
Author: djg
Date: Thu Aug 16 17:06:45 2007
New Revision: 41130

URL: http://llvm.org/viewvc/llvm-project?rev=41130&view=rev
Log:
Fix the verification for overloaded intrinsic types. Check that they are
what they're supposed to be before using them.

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

Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=41130&r1=41129&r2=41130&view=diff

==
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Thu Aug 16 17:06:45 2007
@@ -1144,6 +1144,15 @@
 }
   }
 } else if (VT == MVT::iAny) {
+  if (!EltTy->isInteger()) {
+if (ArgNo == 0)
+  CheckFailed("Intrinsic result type is not "
+  "an integer type.", F);
+else
+  CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not "
+  "an integer type.", F);
+break;
+  }
   unsigned GotBits = cast(EltTy)->getBitWidth();
   Suffix += ".";
   if (EltTy != Ty)
@@ -1158,10 +1167,6 @@
   break;
   }
 } else if (VT == MVT::fAny) {
-  Suffix += ".";
-  if (EltTy != Ty)
-Suffix += "v" + utostr(NumElts);
-  Suffix += MVT::getValueTypeString(MVT::getValueType(EltTy));
   if (!EltTy->isFloatingPoint()) {
 if (ArgNo == 0)
   CheckFailed("Intrinsic result type is not "
@@ -1171,10 +1176,18 @@
   "a floating-point type.", F);
 break;
   }
+  Suffix += ".";
+  if (EltTy != Ty)
+Suffix += "v" + utostr(NumElts);
+  Suffix += MVT::getValueTypeString(MVT::getValueType(EltTy));
 } else if (VT == MVT::iPTR) {
   if (!isa(Ty)) {
-CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not a "
-"pointer and a pointer is required.", F);
+if (ArgNo == 0)
+  CheckFailed("Intrinsic result type is not a "
+  "pointer and a pointer is required.", F);
+else
+  CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " is not a "
+  "pointer and a pointer is required.", F);
 break;
   }
 } else if (MVT::isVector(VT)) {


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


[llvm-commits] [llvm] r41131 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp

2007-08-16 Thread Owen Anderson
Author: resistor
Date: Thu Aug 16 17:51:56 2007
New Revision: 41131

URL: http://llvm.org/viewvc/llvm-project?rev=41131&view=rev
Log:
Factor out some code into a helper function.

Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=41131&r1=41130&r2=41131&view=diff

==
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Aug 16 17:51:56 2007
@@ -672,6 +672,7 @@
 bool top_level = false);
 void dump(DenseMap& d);
 bool iterateOnFunction(Function &F);
+Value* CollapsePhi(PHINode* p);
   };
   
   char GVN::ID = 0;
@@ -723,6 +724,21 @@
   printf("}\n");
 }
 
+Value* GVN::CollapsePhi(PHINode* p) {
+  DominatorTree &DT = getAnalysis();
+  Value* constVal = p->hasConstantValue();
+  
+  if (constVal) {
+if (Instruction* inst = dyn_cast(constVal)) {
+  if (DT.dominates(inst, p))
+return inst;
+} else {
+  return constVal;
+}
+  }
+  
+  return 0;
+}
 
 /// GetValueForBlock - Get the value to use within the specified basic block.
 /// available values are in Phis.
@@ -757,52 +773,23 @@
   }
   
   // Attempt to collapse PHI nodes that are trivially redundant
-  Value* v = PN->hasConstantValue();
+  Value* v = CollapsePhi(PN);
   if (v) {
-if (Instruction* inst = dyn_cast(v)) {
-  DominatorTree &DT = getAnalysis();  
-  if (DT.dominates(inst, PN)) {
-MemoryDependenceAnalysis& MD = getAnalysis();
-
-MD.removeInstruction(PN);
-PN->replaceAllUsesWith(inst);
-
-SmallVector toRemove;
-for (DenseMap::iterator I = Phis.begin(),
- E = Phis.end(); I != E; ++I)
-  if (I->second == PN)
-toRemove.push_back(I->first);
-for (SmallVector::iterator I = toRemove.begin(),
- E= toRemove.end(); I != E; ++I)
-  Phis[*I] = inst;
+MemoryDependenceAnalysis& MD = getAnalysis();
 
-PN->eraseFromParent();
+MD.removeInstruction(PN);
+PN->replaceAllUsesWith(v);
 
-Phis[BB] = inst;
+for (DenseMap::iterator I = Phis.begin(),
+ E = Phis.end(); I != E; ++I)
+  if (I->second == PN)
+I->second = v;
 
-return inst;
-  }
-} else {
-  MemoryDependenceAnalysis& MD = getAnalysis();
-
-  MD.removeInstruction(PN);
-  PN->replaceAllUsesWith(v);
-
-  SmallVector toRemove;
-  for (DenseMap::iterator I = Phis.begin(),
-   E = Phis.end(); I != E; ++I)
-if (I->second == PN)
-  toRemove.push_back(I->first);
-  for (SmallVector::iterator I = toRemove.begin(),
-   E= toRemove.end(); I != E; ++I)
-Phis[*I] = v;
+PN->eraseFromParent();
 
-  PN->eraseFromParent();
+Phis[BB] = v;
 
-  Phis[BB] = v;
-
-  return v;
-}
+return v;
   }
 
   // Cache our phi construction results
@@ -960,24 +947,16 @@
   
   // Collapse PHI nodes
   if (PHINode* p = dyn_cast(I)) {
-Value* constVal = p->hasConstantValue();
+Value* constVal = CollapsePhi(p);
 
 if (constVal) {
-  if (Instruction* inst = dyn_cast(constVal)) {
-DominatorTree &DT = getAnalysis();  
-if (DT.dominates(inst, p)) {
-  for (PhiMapType::iterator PI = phiMap.begin(), PE = phiMap.end();
-   PI != PE; ++PI)
-if (PI->second.count(p))
-  PI->second.erase(p);
+  for (PhiMapType::iterator PI = phiMap.begin(), PE = phiMap.end();
+   PI != PE; ++PI)
+if (PI->second.count(p))
+  PI->second.erase(p);
 
-  p->replaceAllUsesWith(inst);
-  toErase.push_back(p);
-}
-  } else {
-p->replaceAllUsesWith(constVal);
-toErase.push_back(p);
-  }
+  p->replaceAllUsesWith(constVal);
+  toErase.push_back(p);
 }
   // Perform value-number based elimination
   } else if (currAvail.test(num)) {


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


[llvm-commits] [llvm] r41132 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

2007-08-16 Thread Evan Cheng
Author: evancheng
Date: Thu Aug 16 18:46:29 2007
New Revision: 41132

URL: http://llvm.org/viewvc/llvm-project?rev=41132&view=rev
Log:
- If a dynamic_stackalloc alignment requirement is <= stack alignment, then the 
alignment argument is ignored.
- *Always* round up the size of the allocation to multiples of stack
alignment to ensure the stack ptr is never left in an invalid state after a 
dynamic_stackalloc.

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

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

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Aug 16 
18:46:29 2007
@@ -2329,21 +2329,21 @@
   AllocSize = DAG.getNode(ISD::MUL, IntPtr, AllocSize,
   getIntPtrConstant(TySize));
 
-  // Handle alignment.  If the requested alignment is less than the stack
-  // alignment, ignore it and round the size of the allocation up to the stack
-  // alignment size.  If the size is greater than or equal to the stack
-  // alignment, we note this in the DYNAMIC_STACKALLOC node.
+  // Handle alignment.  If the requested alignment is less than or equal to
+  // the stack alignment, ignore it.  If the size is greater than or equal to
+  // the stack alignment, we note this in the DYNAMIC_STACKALLOC node.
   unsigned StackAlign =
 TLI.getTargetMachine().getFrameInfo()->getStackAlignment();
-  if (Align < StackAlign) {
+  if (Align <= StackAlign)
 Align = 0;
-// Add SA-1 to the size.
-AllocSize = DAG.getNode(ISD::ADD, AllocSize.getValueType(), AllocSize,
-getIntPtrConstant(StackAlign-1));
-// Mask out the low bits for alignment purposes.
-AllocSize = DAG.getNode(ISD::AND, AllocSize.getValueType(), AllocSize,
-getIntPtrConstant(~(uint64_t)(StackAlign-1)));
-  }
+
+  // Round the size of the allocation up to the stack alignment size
+  // by add SA-1 to the size.
+  AllocSize = DAG.getNode(ISD::ADD, AllocSize.getValueType(), AllocSize,
+  getIntPtrConstant(StackAlign-1));
+  // Mask out the low bits for alignment purposes.
+  AllocSize = DAG.getNode(ISD::AND, AllocSize.getValueType(), AllocSize,
+  getIntPtrConstant(~(uint64_t)(StackAlign-1)));
 
   SDOperand Ops[] = { getRoot(), AllocSize, getIntPtrConstant(Align) };
   const MVT::ValueType *VTs = DAG.getNodeValueTypes(AllocSize.getValueType(),


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


[llvm-commits] [llvm] r41133 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

2007-08-16 Thread Evan Cheng
Author: evancheng
Date: Thu Aug 16 18:50:06 2007
New Revision: 41133

URL: http://llvm.org/viewvc/llvm-project?rev=41133&view=rev
Log:
If dynamic_stackalloc alignment is > stack alignment, first issue an 
instruction to align the stack ptr before the decrement.

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

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

==
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Aug 16 18:50:06 2007
@@ -15,6 +15,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineJumpTableInfo.h"
+#include "llvm/Target/TargetFrameInfo.h"
 #include "llvm/Target/TargetLowering.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetMachine.h"
@@ -1355,6 +1356,7 @@
   AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
 return Result.getValue(Op.ResNo);
   case ISD::DYNAMIC_STACKALLOC: {
+MVT::ValueType VT = Node->getValueType(0);
 Tmp1 = LegalizeOp(Node->getOperand(0));  // Legalize the chain.
 Tmp2 = LegalizeOp(Node->getOperand(1));  // Legalize the size.
 Tmp3 = LegalizeOp(Node->getOperand(2));  // Legalize the alignment.
@@ -1362,8 +1364,7 @@
 
 Tmp1 = Result.getValue(0);
 Tmp2 = Result.getValue(1);
-switch (TLI.getOperationAction(Node->getOpcode(),
-   Node->getValueType(0))) {
+switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
 default: assert(0 && "This action is not supported yet!");
 case TargetLowering::Expand: {
   unsigned SPReg = TLI.getStackPointerRegisterToSaveRestore();
@@ -1371,9 +1372,15 @@
  " not tell us which reg is the stack pointer!");
   SDOperand Chain = Tmp1.getOperand(0);
   SDOperand Size  = Tmp2.getOperand(1);
-  SDOperand SP = DAG.getCopyFromReg(Chain, SPReg, Node->getValueType(0));
-  Tmp1 = DAG.getNode(ISD::SUB, Node->getValueType(0), SP, Size);// 
Value
-  Tmp2 = DAG.getCopyToReg(SP.getValue(1), SPReg, Tmp1);  // Output 
chain
+  SDOperand SP = DAG.getCopyFromReg(Chain, SPReg, VT);
+  Chain = SP.getValue(1);
+  unsigned Align = cast(Tmp3)->getValue();
+  unsigned StackAlign =
+TLI.getTargetMachine().getFrameInfo()->getStackAlignment();
+  if (Align > StackAlign)
+SP = DAG.getNode(ISD::AND, VT, SP, DAG.getConstant(-Align, VT));
+  Tmp1 = DAG.getNode(ISD::SUB, VT, SP, Size);   // Value
+  Tmp2 = DAG.getCopyToReg(Chain, SPReg, Tmp1);  // Output chain
   Tmp1 = LegalizeOp(Tmp1);
   Tmp2 = LegalizeOp(Tmp2);
   break;


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


[llvm-commits] [llvm] r41134 - /llvm/trunk/test/CodeGen/X86/alloca-align-rounding.ll

2007-08-16 Thread Evan Cheng
Author: evancheng
Date: Thu Aug 16 18:51:28 2007
New Revision: 41134

URL: http://llvm.org/viewvc/llvm-project?rev=41134&view=rev
Log:
Update test: dynamic_stackalloc size *must* be rounded to ensure stack ptr be 
left in a valid state.

Modified:
llvm/trunk/test/CodeGen/X86/alloca-align-rounding.ll

Modified: llvm/trunk/test/CodeGen/X86/alloca-align-rounding.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/alloca-align-rounding.ll?rev=41134&r1=41133&r2=41134&view=diff

==
--- llvm/trunk/test/CodeGen/X86/alloca-align-rounding.ll (original)
+++ llvm/trunk/test/CodeGen/X86/alloca-align-rounding.ll Thu Aug 16 18:51:28 
2007
@@ -1,4 +1,5 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep and
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin | grep and | 
count 1
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=i686-pc-linux | grep and | 
count 3
 
 declare void @bar(<2 x i64>* %n)
 
@@ -7,3 +8,9 @@
   call void @bar(<2 x i64>* %p)
   ret void
 }
+
+define void @foo2(i32 %h) {
+  %p = alloca <2 x i64>, i32 %h, align 32
+  call void @bar(<2 x i64>* %p)
+  ret void
+}


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


[llvm-commits] [llvm] r41135 - /llvm/trunk/test/CodeGen/X86/dyn-stackalloc.ll

2007-08-16 Thread Evan Cheng
Author: evancheng
Date: Thu Aug 16 18:52:23 2007
New Revision: 41135

URL: http://llvm.org/viewvc/llvm-project?rev=41135&view=rev
Log:
New test. Make sure dynamic_stackalloc size is rounded up.

Added:
llvm/trunk/test/CodeGen/X86/dyn-stackalloc.ll

Added: llvm/trunk/test/CodeGen/X86/dyn-stackalloc.ll
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dyn-stackalloc.ll?rev=41135&view=auto

==
--- llvm/trunk/test/CodeGen/X86/dyn-stackalloc.ll (added)
+++ llvm/trunk/test/CodeGen/X86/dyn-stackalloc.ll Thu Aug 16 18:52:23 2007
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | llc -march=x86 | not grep 4294967289
+; RUN: llvm-as < %s | llc -march=x86 | grep 4294967280
+; RUN: llvm-as < %s | llc -march=x86-64 | grep {\\-16}
+
+define void @t() {
+A:
+   br label %entry
+
+entry:
+   %m1 = alloca i32, align 4
+   %m2 = alloca [7 x i8], align 16
+   call void @s( i32* %m1, [7 x i8]* %m2 )
+   ret void
+}
+
+declare void @s(i32*, [7 x i8]*)


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


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

2007-08-16 Thread Chris Lattner


Changes in directory llvm-www:

OpenProjects.html updated: 1.27 -> 1.28
---
Log message:

This has been started.


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

 OpenProjects.html |   11 +--
 1 files changed, 1 insertion(+), 10 deletions(-)


Index: llvm-www/OpenProjects.html
diff -u llvm-www/OpenProjects.html:1.27 llvm-www/OpenProjects.html:1.28
--- llvm-www/OpenProjects.html:1.27 Tue Jul 31 18:59:07 2007
+++ llvm-www/OpenProjects.html  Thu Aug 16 23:47:33 2007
@@ -369,15 +369,6 @@
 output LLVM bytecode. It seems that it can already output .NET
 bytecode, JVM bytecode, and C, so LLVM would ostensibly be another good
 candidate.
-Write a new frontend for C/C++ that isn't GCC based.  Possible starting 
points:
-  
-  http://www.cs.berkeley.edu/~smcpeak/elkhound/sources/elsa/";>Elsa
-  C++ parser, written in C++ and built with a Generalized LR parser
-  generator http://www.cs.berkeley.edu/~smcpeak/elkhound/";>Elkhound
-  http://www.parashift.com/c++-faq-lite/compiler-dependencies.html#faq-38.11";>C++
 yacc grammar by Ed Willink
-  
-
 Write a new frontend for some other language (Java? OCaml? Forth?)
 Write a disassembler for machine code that would use TableGen to output 
 MachineInstrs for transformations, optimizations, etc.
@@ -411,7 +402,7 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
 
   http://llvm.org";>LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/07/31 23:59:07 $
+  Last modified: $Date: 2007/08/17 04:47:33 $
 
 
 



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


[llvm-commits] [llvm] r41137 - in /llvm/trunk: autoconf/configure.ac include/llvm/Config/config.h.in

2007-08-16 Thread Reid Spencer
Author: reid
Date: Fri Aug 17 00:44:59 2007
New Revision: 41137

URL: http://llvm.org/viewvc/llvm-project?rev=41137&view=rev
Log:
Fix PR1606:
The AC_CHECK_HEADER macro was used instead of AC_CHECK_HEADERS. The former does
not automatically add a #define to the configure variables while the latter
does. Consequently, the HAVE_PTHREAD_H symbol was not defined which caused the
Mutex.cpp file to compile to an empty implementation. 

Modified:
llvm/trunk/autoconf/configure.ac
llvm/trunk/include/llvm/Config/config.h.in

Modified: llvm/trunk/autoconf/configure.ac
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=41137&r1=41136&r2=41137&view=diff

==
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Fri Aug 17 00:44:59 2007
@@ -689,10 +689,11 @@
 
 AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h])
 AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h unistd.h utime.h])
-AC_CHECK_HEADERS([windows.h sys/mman.h sys/param.h sys/resource.h sys/time.h])
+AC_CHECK_HEADERS([windows.h])
+AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h])
 AC_CHECK_HEADERS([sys/types.h malloc/malloc.h mach/mach.h])
 if test "$ENABLE_THREADS" -eq 1 ; then
-  AC_CHECK_HEADER(pthread.h,
+  AC_CHECK_HEADERS(pthread.h,
   AC_SUBST(HAVE_PTHREAD, 1),
   AC_SUBST(HAVE_PTHREAD, 0))
 else

Modified: llvm/trunk/include/llvm/Config/config.h.in
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=41137&r1=41136&r2=41137&view=diff

==
--- llvm/trunk/include/llvm/Config/config.h.in (original)
+++ llvm/trunk/include/llvm/Config/config.h.in Fri Aug 17 00:44:59 2007
@@ -282,6 +282,9 @@
 /* Define to have the %a format string */
 #undef HAVE_PRINTF_A
 
+/* Define to 1 if you have the  header file. */
+#undef HAVE_PTHREAD_H
+
 /* Have pthread_mutex_lock */
 #undef HAVE_PTHREAD_MUTEX_LOCK
 


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


[llvm-commits] [llvm] r41138 - /llvm/trunk/configure

2007-08-16 Thread Reid Spencer
Author: reid
Date: Fri Aug 17 00:45:26 2007
New Revision: 41138

URL: http://llvm.org/viewvc/llvm-project?rev=41138&view=rev
Log:
Regenerate.

Modified:
llvm/trunk/configure

Modified: llvm/trunk/configure
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=41138&r1=41137&r2=41138&view=diff

==
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Fri Aug 17 00:45:26 2007
@@ -28874,11 +28874,179 @@
 done
 
 
+for ac_header in windows.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+  { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+{ ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+   ac_header_compiler=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+ac_cpp_err=$ac_c_preproc_warn_flag
+ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-for ac_header in windows.h sys/mman.h sys/param.h sys/resource.h sys/time.h
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, 
rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the 
preprocessor!" >&2;}
+{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the 
compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ac_header_preproc=yes
+;;
+  no:yes:* )
+{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be 
compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing 
prerequisite headers?" >&5
+echo "$as_me: WA