[llvm-commits] CVS: llvm/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll

2007-05-09 Thread Devang Patel


Changes in directory llvm/test/Transforms/LoopUnswitch:

2007-05-09-Unreachable.ll added (r1.1)
---
Log message:

New test.


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

 2007-05-09-Unreachable.ll |   32 
 1 files changed, 32 insertions(+)


Index: llvm/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll
diff -c /dev/null 
llvm/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll:1.1
*** /dev/null   Wed May  9 03:08:56 2007
--- llvm/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll Wed May  9 
03:08:46 2007
***
*** 0 
--- 1,32 
+ ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-unswitch -disable-output
+ ; ModuleID = 'PR1333.bc'
+ 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-pc-linux-gnu"
+   %struct.ada__streams__root_stream_type = type { 
%struct.ada__tags__dispatch_table* }
+   %struct.ada__tags__dispatch_table = type { [1 x i8*] }
+   %struct.quotes__T173s = type { i8, %struct.quotes__T173s__T174s, [2 x 
[1 x double]], [2 x i16], i64, i8 }
+   %struct.quotes__T173s__T174s = type { i8, i8, i8, i16, i16, [2 x [1 x 
double]] }
+ 
+ void @quotes__write_quote() {
+ entry:
+   %tmp606.i = icmp eq i32 0, 0;  [#uses=1]
+   br label %bb
+ 
+ bb:   ; preds = %cond_next73, %bb, %entry
+   br i1 false, label %bb51, label %bb
+ 
+ bb51: ; preds = %cond_next73, %bb
+   br i1 %tmp606.i, label 
%quotes__bid_ask_depth_offset_matrices__get_price.exit, label %cond_true.i
+ 
+ cond_true.i:  ; preds = %bb51
+   unreachable
+ 
+ quotes__bid_ask_depth_offset_matrices__get_price.exit:; preds 
= %bb51
+   br i1 false, label %cond_next73, label %cond_true72
+ 
+ cond_true72:  ; preds = 
%quotes__bid_ask_depth_offset_matrices__get_price.exit
+   unreachable
+ 
+ cond_next73:  ; preds = 
%quotes__bid_ask_depth_offset_matrices__get_price.exit
+   br i1 false, label %bb, label %bb51
+ }



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


[llvm-commits] CVS: llvm/test/Transforms/LoopUnswitch/2007-05-09-tl.ll

2007-05-09 Thread Devang Patel


Changes in directory llvm/test/Transforms/LoopUnswitch:

2007-05-09-tl.ll added (r1.1)
---
Log message:

New test.


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

 2007-05-09-tl.ll |   95 +++
 1 files changed, 95 insertions(+)


Index: llvm/test/Transforms/LoopUnswitch/2007-05-09-tl.ll
diff -c /dev/null llvm/test/Transforms/LoopUnswitch/2007-05-09-tl.ll:1.1
*** /dev/null   Wed May  9 03:19:34 2007
--- llvm/test/Transforms/LoopUnswitch/2007-05-09-tl.ll  Wed May  9 03:19:24 2007
***
*** 0 
--- 1,95 
+ ; RUN: llvm-as < %s |  opt -loop-unswitch -disable-output
+ ; ModuleID = 'PR1333-2.bc'
+ 
+ define void @pp_cxx_expression() {
+ entry:
+   %tmp6 = lshr i32 0, 24  ;  [#uses=1]
+   br label %tailrecurse
+ 
+ tailrecurse:  ; preds = %tailrecurse, %tailrecurse, %entry
+   switch i32 %tmp6, label %bb96 [
+i32 24, label %bb10
+i32 25, label %bb10
+i32 28, label %bb10
+i32 29, label %bb48
+i32 31, label %bb48
+i32 32, label %bb48
+i32 33, label %bb48
+i32 34, label %bb48
+i32 36, label %bb15
+i32 51, label %bb89
+i32 52, label %bb89
+i32 54, label %bb83
+i32 57, label %bb59
+i32 63, label %bb80
+i32 64, label %bb80
+i32 68, label %bb80
+i32 169, label %bb75
+i32 170, label %bb19
+i32 171, label %bb63
+i32 172, label %bb63
+i32 173, label %bb67
+i32 174, label %bb67
+i32 175, label %bb19
+i32 176, label %bb75
+i32 178, label %bb59
+i32 179, label %bb89
+i32 180, label %bb59
+i32 182, label %bb48
+i32 183, label %bb48
+i32 184, label %bb48
+i32 185, label %bb48
+i32 186, label %bb48
+i32 195, label %bb48
+i32 196, label %bb59
+i32 197, label %bb89
+i32 198, label %bb70
+i32 199, label %bb59
+i32 200, label %bb59
+i32 201, label %bb59
+i32 202, label %bb59
+i32 203, label %bb75
+i32 204, label %bb59
+i32 205, label %tailrecurse
+i32 210, label %tailrecurse
+   ]
+ 
+ bb10: ; preds = %tailrecurse, %tailrecurse, %tailrecurse
+   ret void
+ 
+ bb15: ; preds = %tailrecurse
+   ret void
+ 
+ bb19: ; preds = %tailrecurse, %tailrecurse
+   ret void
+ 
+ bb48: ; preds = %tailrecurse, %tailrecurse, %tailrecurse, 
%tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, 
%tailrecurse, %tailrecurse, %tailrecurse
+   ret void
+ 
+ bb59: ; preds = %tailrecurse, %tailrecurse, %tailrecurse, 
%tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse, 
%tailrecurse
+   ret void
+ 
+ bb63: ; preds = %tailrecurse, %tailrecurse
+   ret void
+ 
+ bb67: ; preds = %tailrecurse, %tailrecurse
+   ret void
+ 
+ bb70: ; preds = %tailrecurse
+   ret void
+ 
+ bb75: ; preds = %tailrecurse, %tailrecurse, %tailrecurse
+   ret void
+ 
+ bb80: ; preds = %tailrecurse, %tailrecurse, %tailrecurse
+   ret void
+ 
+ bb83: ; preds = %tailrecurse
+   ret void
+ 
+ bb89: ; preds = %tailrecurse, %tailrecurse, %tailrecurse, %tailrecurse
+   ret void
+ 
+ bb96: ; preds = %tailrecurse
+   ret void
+ }



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


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

2007-05-09 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

LoopUnswitch.cpp updated: 1.68 -> 1.69
---
Log message:

Fix PR1333: http://llvm.org/PR1333 
Testcases :
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049451.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049452.html


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

 LoopUnswitch.cpp |   30 +-
 1 files changed, 25 insertions(+), 5 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.68 
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.69
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.68Wed May  2 20:11:54 2007
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Wed May  9 03:24:12 2007
@@ -396,7 +396,7 @@
   // The new block lives in whichever loop the old one did.
   if (Loop *L = LI->getLoopFor(Old))
 L->addBasicBlockToLoop(New, *LI);
-  
+
   return New;
 }
 
@@ -413,8 +413,30 @@
   }
   
   // If this is a critical edge, let SplitCriticalEdge do it.
-  if (SplitCriticalEdge(BB->getTerminator(), SuccNum, this))
-return LatchTerm->getSuccessor(SuccNum);
+  Loop *OrigDestBBL = 
LI->getLoopFor(BB->getTerminator()->getSuccessor(SuccNum));
+  if (SplitCriticalEdge(BB->getTerminator(), SuccNum)) {
+BasicBlock *NewBB = LatchTerm->getSuccessor(SuccNum);
+
+Loop *BBL = LI->getLoopFor(BB);
+if (!BBL || !OrigDestBBL)
+  return NewBB;
+
+// If edge is inside a loop then NewBB is part of same loop.
+if (BBL == OrigDestBBL)
+  BBL->addBasicBlockToLoop(NewBB, *LI);
+// If edge is entering loop then NewBB is part of outer loop.
+else if (BBL->contains(OrigDestBBL->getHeader()))
+  BBL->addBasicBlockToLoop(NewBB, *LI);
+// If edge is from an inner loop to outer loop then NewBB is part
+// of outer loop.
+else if (OrigDestBBL->contains(BBL->getHeader()))
+  OrigDestBBL->addBasicBlockToLoop(NewBB, *LI);
+// Else edge is connecting two loops and NewBB is part of their parent loop
+else if (Loop *PL = OrigDestBBL->getParentLoop())
+  PL->addBasicBlockToLoop(NewBB, *LI);
+
+return NewBB;
+  }
 
   // If the edge isn't critical, then BB has a single successor or Succ has a
   // single pred.  Split the block.
@@ -571,8 +593,6 @@
 std::vector Preds(pred_begin(ExitBlock), pred_end(ExitBlock));
 
 for (unsigned j = 0, e = Preds.size(); j != e; ++j) {
-  assert(L->contains(Preds[j]) &&
- "All preds of loop exit blocks must be the same loop!");
   BasicBlock* MiddleBlock = SplitEdge(Preds[j], ExitBlock);
   BasicBlock* StartBlock = Preds[j];
   BasicBlock* EndBlock;



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


[llvm-commits] CVS: llvm/test/CFrontend/2007-05-07-NestedStructReturn.c

2007-05-09 Thread Duncan Sands


Changes in directory llvm/test/CFrontend:

2007-05-07-NestedStructReturn.c added (r1.1)
---
Log message:

Testcase for 
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049387.html


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

 2007-05-07-NestedStructReturn.c |   13 +
 1 files changed, 13 insertions(+)


Index: llvm/test/CFrontend/2007-05-07-NestedStructReturn.c
diff -c /dev/null llvm/test/CFrontend/2007-05-07-NestedStructReturn.c:1.1
*** /dev/null   Wed May  9 03:41:36 2007
--- llvm/test/CFrontend/2007-05-07-NestedStructReturn.c Wed May  9 03:41:26 2007
***
*** 0 
--- 1,13 
+ // RUN: %llvmgcc %s -S -fnested-functions -o - | grep {sret *%agg.result}
+ 
+ struct X { int m, n; };
+ 
+ struct X p(int n) {
+   struct X c(int m) {
+ struct X x;
+ x.m = m;
+ x.n = n;
+ return x;
+   }
+   return c(n);
+ }



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


[llvm-commits] beginning unroll improvements

2007-05-09 Thread Dan Gohman
This patch extends the LoopUnroll pass to be able to unroll loops
with unknown trip counts. This is left off by default, and a
command-line option enables it. It also begins to separate loop
unrolling into a utility routine; eventually it might be made usable
from other passes.

It currently works by inserting conditional branches between each
unrolled iteration, unless it proves that the trip count is a
multiple of a constant integer > 1, which it currently only does in
the rare case that the trip count expression is a Mul operator with
a ConstantInt operand. Eventually this information might be provided
by other sources, for example by a pass that peels/splits the loop
for this purpose.

Dan

-- 
Dan Gohman, Cray Inc.
Index: test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll
===
RCS file: test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll
diff -N test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll
--- /dev/null
+++ test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s | opt -loop-unroll -unroll-count=3 | llvm-dis | grep bb72.2
+
+define void @foo(i32 %trips) {
+entry:
+   br label %cond_true.outer
+
+cond_true.outer:
+   %indvar1.ph = phi i32 [ 0, %entry ], [ %indvar.next2, %bb72 ]
+   br label %bb72
+
+bb72:
+   %indvar.next2 = add i32 %indvar1.ph, 1
+   %exitcond3 = icmp eq i32 %indvar.next2, %trips
+   br i1 %exitcond3, label %cond_true138, label %cond_true.outer
+
+cond_true138:
+   ret void
+}
Index: lib/Transforms/Scalar/LoopUnroll.cpp
===
RCS file: /var/cvs/llvm/llvm/lib/Transforms/Scalar/LoopUnroll.cpp,v
retrieving revision 1.46
diff -u -d -r1.46 LoopUnroll.cpp
--- lib/Transforms/Scalar/LoopUnroll.cpp
+++ lib/Transforms/Scalar/LoopUnroll.cpp
@@ -31,6 +31,7 @@
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/MathExtras.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallPtrSet.h"
@@ -39,12 +40,19 @@
 #include 
 using namespace llvm;
 
-STATISTIC(NumUnrolled, "Number of loops completely unrolled");
+STATISTIC(NumCompletelyUnrolled, "Number of loops completely unrolled");
+STATISTIC(NumUnrolled,   "Number of loops unrolled (completely or 
otherwise)");
 
 namespace {
   cl::opt
-  UnrollThreshold("unroll-threshold", cl::init(100), cl::Hidden,
-  cl::desc("The cut-off point for loop unrolling"));
+  UnrollThreshold
+("unroll-threshold", cl::init(100), cl::Hidden,
+ cl::desc("The cut-off point for automatic loop unrolling"));
+
+  cl::opt
+  UnrollCount
+("unroll-count", cl::init(0), cl::Hidden,
+ cl::desc("Use this unroll count for all loops, for testing purposes"));
 
   class VISIBILITY_HIDDEN LoopUnroll : public LoopPass {
 LoopInfo *LI;  // The current loop information
@@ -52,7 +60,13 @@
 static char ID; // Pass ID, replacement for typeid
 LoopUnroll() : LoopPass((intptr_t)&ID) {}
 
+/// A magic value for use with the Threshold parameter to indicate
+/// that the loop unroll should be performed regardless of how much
+/// code expansion would result.
+static const unsigned NoThreshold = UINT_MAX;
+
 bool runOnLoop(Loop *L, LPPassManager &LPM);
+bool unrollLoop(Loop *L, unsigned Count, unsigned Threshold);
 BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB);
 
 /// This transformation requires natural loop information & requires that
@@ -162,43 +176,137 @@
 }
 
 bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
-  bool Changed = false;
   LI = &getAnalysis();
 
+  // Unroll the loop.
+  if (!unrollLoop(L, UnrollCount, UnrollThreshold))
+return false;
+
+  // Update the loop information for this loop.
+  // If we completely unrolled the loop, remove it from the parent.
+  if (L->getNumBackEdges() == 0)
+LPM.deleteLoopFromQueue(L);
+
+  return true;
+}
+
+/// Unroll the given loop by UnrollCount, or by a heuristically-determined
+/// value if Count is zero. If Threshold is non-NULL, it points to
+/// a Threshold value to limit code size expansion. If the loop size would
+/// expand beyond the threshold value, unrolling is suppressed. The return
+/// value is false if no transformations are performed.
+///
+bool LoopUnroll::unrollLoop(Loop *L, unsigned Count, unsigned Threshold) {
+  assert(L->isLCSSAForm());
+
   BasicBlock *Header = L->getHeader();
   BasicBlock *LatchBlock = L->getLoopLatch();
-
   BranchInst *BI = dyn_cast(LatchBlock->getTerminator());
-  if (BI == 0) return Changed;  // Must end in a conditional branch
 
-  ConstantInt *TripCountC = dyn_cast_or_null(L->getTripCount());
-  if (!TripCountC) return Changed;  // Must have constant trip count!
+  DOUT << "Loop Unroll: F[" << Header->getParent()->getName()
+   << "] Loop %" << Header->getName()

[llvm-commits] [127082] Map -dA to -asm-verbose.

2007-05-09 Thread dpatel
Revision: 127082
Author:   dpatel
Date: 2007-05-09 09:58:33 -0700 (Wed, 09 May 2007)

Log Message:
---
Map -dA to -asm-verbose.

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

Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp
===
--- apple-local/branches/llvm/gcc/llvm-backend.cpp  2007-05-09 11:00:59 UTC 
(rev 127081)
+++ apple-local/branches/llvm/gcc/llvm-backend.cpp  2007-05-09 16:58:33 UTC 
(rev 127082)
@@ -107,6 +107,9 @@
 Args.push_back("--disable-fp-elim");
   if (!flag_zero_initialized_in_bss)
 Args.push_back("--nozero-initialized-in-bss");
+  if (flag_debug_asm)
+Args.push_back("--asm-verbose");
+
 // Disabled until PR1224 is resolved.
   //if (flag_exceptions)
   //  Args.push_back("--enable-eh");


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


Re: [llvm-commits] [126997] Fix PR1278.

2007-05-09 Thread Lauro Ramos Venancio

I'm getting an error building the llvm-gcc because this patch was partially
propagated to the svn mirror. The changes in llvm-convert.cpp and
llvm-types.cpp was propagated but the changes in llvm-internals.h wasn't.

The error:
c++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings
-pedantic -Wno-long-long -Wno-variadic-macros -DHAVE_CONFIG_H -Wno-unused
-DTARGET_NAME=\"arm-linux-gnueabi\" -DNDEBUG -DENABLE_LLVM
-D__STDC_LIMIT_MACROS   -I. -I. -I../../gcc -I../../gcc/.
-I../../gcc/../include -I../../gcc/../libcpp/include
-I/home/laurov/llvm/llvm/include -I/home/laurov/llvm/llvm/build/include
../../gcc/llvm-convert.cpp -o llvm-convert.o
../../gcc/llvm-convert.cpp: In function 'void CopyAggregate(llvm::Value*,
llvm::Value*, bool, bool, llvm::BasicBlock*)':
../../gcc/llvm-convert.cpp:1088: error: 'isPaddingElement' was not declared
in this scope
make[1]: *** [llvm-convert.o] Error 1
make[1]: Leaving directory `/home/laurov/llvm/llvm-gcc/build_arm/gcc'
make: *** [all-gcc] Error 2

Lauro
2007/5/8, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:


Revision: 126997
Author:   dpatel
Date: 2007-05-07 23:15:09 -0700 (Mon, 07 May 2007)

Log Message:
---
Fix PR1278.

- While adding padding elements at the end of LLVM struct use
  an array of i32 (instead of an array of i8) if possible.

- Keep track of padding elements at the end of LLVM struct.
  Do not copy them while copying aggregates.

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

Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===
--- apple-local/branches/llvm/gcc/llvm-convert.cpp  2007-05-08
05:09:41 UTC (rev 126996)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp  2007-05-08
06:15:09 UTC (rev 126997)
@@ -1085,6 +1085,8 @@
   } else if (const StructType *STy = dyn_cast(ElTy)) {
 Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
 for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
+  if (isPaddingElement(STy, i))
+continue;
   Constant *Idx = ConstantInt::get(Type::Int32Ty, i);
   Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, "tmp",
CurBB);
   Value *SElPtr = new GetElementPtrInst(SrcPtr, Zero, Idx, "tmp",
CurBB);

Modified: apple-local/branches/llvm/gcc/llvm-internal.h
===
--- apple-local/branches/llvm/gcc/llvm-internal.h   2007-05-08
05:09:41 UTC (rev 126996)
+++ apple-local/branches/llvm/gcc/llvm-internal.h   2007-05-08
06:15:09 UTC (rev 126997)
@@ -96,6 +96,10 @@

struct StructTypeConversionInfo;

+/// Return true if and only if field no. N from struct type T is a
padding
+/// element added to match llvm struct type size and gcc struct type
size.
+bool isPaddingElement(const Type *T, unsigned N);
+
/// TypeConverter - Implement the converter from GCC types to LLVM types.
///
class TypeConverter {

Modified: apple-local/branches/llvm/gcc/llvm-types.cpp
===
--- apple-local/branches/llvm/gcc/llvm-types.cpp2007-05-08
05:09:41 UTC (rev 126996)
+++ apple-local/branches/llvm/gcc/llvm-types.cpp2007-05-08
06:15:09 UTC (rev 126997)
@@ -893,6 +893,7 @@
   std::vector Elements;
   std::vector ElementOffsetInBytes;
   std::vector ElementSizeInBytes;
+  std::vector PaddingElement; // True if field is used for padding
   const TargetData &TD;
   unsigned GCCStructAlignmentInBytes;
   bool Packed; // True if struct is packed
@@ -1071,10 +1072,12 @@

   /// addElement - Add an element to the structure with the specified
type,
   /// offset and size.
-  void addElement(const Type *Ty, uint64_t Offset, uint64_t Size) {
+  void addElement(const Type *Ty, uint64_t Offset, uint64_t Size,
+  bool ExtraPadding = false) {
 Elements.push_back(Ty);
 ElementOffsetInBytes.push_back(Offset);
 ElementSizeInBytes.push_back(Size);
+PaddingElement.push_back(ExtraPadding);
 lastFieldStartsAtNonByteBoundry(false);
 ExtraBitsAvailable = 0;
   }
@@ -1223,7 +1226,25 @@
   }
}

+std::map StructTypeInfoMap;

+/// Return true if and only if field no. N from struct type T is a
padding
+/// element added to match llvm struct type size and gcc struct type
size.
+bool isPaddingElement(const Type *Ty, unsigned index) {
+
+  StructTypeConversionInfo *Info = StructTypeInfoMap[Ty];
+
+  // If info is not available then be conservative and return false.
+  if (!Info)
+return false;
+
+  assert ( Info->Elements.size() == Info->PaddingElement.size()
+   && "Invalid StructTypeConversionInfo");
+  assert ( index < Info->PaddingElement.size()
+   && "Invalid PaddingElement index");
+  return Info->PaddingElement[index];
+}
+
/// getFieldOffsetInBits - Return the offset (in bits) of a FIELD_DECL in
a
/// stru

Re: [llvm-commits] [126997] Fix PR1278.

2007-05-09 Thread Bill
Sorry all. It somehow got dropped from the mirror...It'll be fixed in
the next update...

-bw

On 5/9/07, Lauro Ramos Venancio <[EMAIL PROTECTED]> wrote:
> I'm getting an error building the llvm-gcc because this patch was partially
> propagated to the svn mirror. The changes in llvm-convert.cpp and
> llvm-types.cpp was propagated but the changes in llvm-internals.h wasn't.
>
> The error:
> c++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings
> -pedantic -Wno-long-long -Wno-variadic-macros -DHAVE_CONFIG_H -Wno-unused
> -DTARGET_NAME=\"arm-linux-gnueabi\" -DNDEBUG -DENABLE_LLVM
> -D__STDC_LIMIT_MACROS   -I. -I. -I../../gcc -I../../gcc/.
> -I../../gcc/../include -I../../gcc/../libcpp/include
> -I/home/laurov/llvm/llvm/include
> -I/home/laurov/llvm/llvm/build/include ../../gcc/llvm-
> convert.cpp -o llvm-convert.o
> ../../gcc/llvm-convert.cpp: In function 'void CopyAggregate(llvm::Value*,
> llvm::Value*, bool, bool, llvm::BasicBlock*)':
> ../../gcc/llvm-convert.cpp:1088: error: 'isPaddingElement' was not declared
> in this scope
> make[1]: *** [llvm-convert.o] Error 1
> make[1]: Leaving directory
> `/home/laurov/llvm/llvm-gcc/build_arm/gcc'
> make: *** [all-gcc] Error 2
>
> Lauro
> 2007/5/8, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> > Revision: 126997
> > Author:   dpatel
> > Date: 2007-05-07 23:15:09 -0700 (Mon, 07 May 2007)
> >
> > Log Message:
> > ---
> > Fix PR1278.
> >
> > - While adding padding elements at the end of LLVM struct use
> >   an array of i32 (instead of an array of i8) if possible.
> >
> > - Keep track of padding elements at the end of LLVM struct.
> >   Do not copy them while copying aggregates.
> >
> > Modified Paths:
> > --
> > apple-local/branches/llvm/gcc/llvm-convert.cpp
> > apple-local/branches/llvm/gcc/llvm- internal.h
> > apple-local/branches/llvm/gcc/llvm-types.cpp
> >
> > Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
> >
> ===
> > --- apple-local/branches/llvm/gcc/llvm- convert.cpp
> 2007-05-08 05:09:41 UTC (rev 126996)
> > +++ apple-local/branches/llvm/gcc/llvm-convert.cpp
> 2007-05-08 06:15:09 UTC (rev 126997)
> > @@ -1085,6 +1085,8 @@
> >} else if (const StructType *STy = dyn_cast(ElTy)) {
> >  Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
> >  for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
> > +  if (isPaddingElement(STy, i))
> > +continue;
> >Constant *Idx = ConstantInt::get(Type::Int32Ty, i);
> >Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, "tmp",
> CurBB);
> >Value *SElPtr = new GetElementPtrInst(SrcPtr, Zero, Idx, "tmp",
> CurBB);
> >
> > Modified: apple-local/branches/llvm/gcc/llvm- internal.h
> >
> ===
> > --- apple-local/branches/llvm/gcc/llvm-internal.h
> 2007-05-08 05:09:41 UTC (rev 126996)
> > +++ apple-local/branches/llvm/gcc/llvm-internal.h
> 2007-05-08 06:15:09 UTC (rev 126997)
> > @@ -96,6 +96,10 @@
> >
> > struct StructTypeConversionInfo;
> >
> > +/// Return true if and only if field no. N from struct type T is a
> padding
> > +/// element added to match llvm struct type size and gcc struct type
> size.
> > +bool isPaddingElement(const Type *T, unsigned N);
> > +
> > /// TypeConverter - Implement the converter from GCC types to LLVM types.
> > ///
> > class TypeConverter {
> >
> > Modified: apple-local/branches/llvm/gcc/llvm- types.cpp
> >
> ===
> > --- apple-local/branches/llvm/gcc/llvm-types.cpp
> 2007-05-08 05:09:41 UTC (rev 126996)
> > +++ apple-local/branches/llvm/gcc/llvm-types.cpp
> 2007-05-08 06:15:09 UTC (rev 126997)
> > @@ -893,6 +893,7 @@
> >std::vector Elements;
> >std::vector ElementOffsetInBytes;
> >std::vector ElementSizeInBytes;
> > +  std::vector PaddingElement; // True if field is used for padding
> >const TargetData &TD;
> >unsigned GCCStructAlignmentInBytes;
> >bool Packed; // True if struct is packed
> > @@ -1071,10 +1072,12 @@
> >
> >/// addElement - Add an element to the structure with the specified
> type,
> >/// offset and size.
> > -  void addElement(const Type *Ty, uint64_t Offset, uint64_t Size) {
> > +  void addElement(const Type *Ty, uint64_t Offset, uint64_t Size,
> > +  bool ExtraPadding = false) {
> >  Elements.push_back(Ty);
> >  ElementOffsetInBytes.push_back(Offset);
> >  ElementSizeInBytes.push_back(Size);
> > +PaddingElement.push_back(ExtraPadding);
> >  lastFieldStartsAtNonByteBoundry(false);
> >  ExtraBitsAvailable = 0;
> >}
> > @@ -1223,7 +1226,25 @@
> >}
> > }
> >
> > +std::map StructTypeInfoMap;
> >
> > +/// Return true if and only if field no. N from struct type T is a
> padding
> > +/// element added to match llvm struct type size and gcc struct type
> size.
> > +bool isPaddingElement(const Type *Ty, u

[llvm-commits] CVS: llvm/test/CodeGen/PowerPC/hello.ll

2007-05-09 Thread Evan Cheng


Changes in directory llvm/test/CodeGen/PowerPC:

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

PR1399: http://llvm.org/PR1399  test case.

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

 hello.ll |   12 
 1 files changed, 12 insertions(+)


Index: llvm/test/CodeGen/PowerPC/hello.ll
diff -c /dev/null llvm/test/CodeGen/PowerPC/hello.ll:1.1
*** /dev/null   Wed May  9 14:20:47 2007
--- llvm/test/CodeGen/PowerPC/hello.ll  Wed May  9 14:20:37 2007
***
*** 0 
--- 1,12 
+ ; RUN: llvm-as < %s | llc -march=ppc32
+ ; RUN: llvm-as < %s | llc -march=ppc64
+ ; PR1399
+ 
+ @.str = internal constant [13 x i8] c"Hello World!\00"
+ 
+ define i32 @main() {
+   %tmp2 = tail call i32 @puts( i8* getelementptr ([13 x i8]* @.str, i32 
0, i64 0) )
+   ret i32 0
+ }
+ 
+ declare i32 @puts(i8*)



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


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

2007-05-09 Thread Lauro Ramos Venancio


Changes in directory llvm/docs:

ReleaseNotes.html updated: 1.371 -> 1.372
---
Log message:

Add two ARM known problems. 



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

 ReleaseNotes.html |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)


Index: llvm/docs/ReleaseNotes.html
diff -u llvm/docs/ReleaseNotes.html:1.371 llvm/docs/ReleaseNotes.html:1.372
--- llvm/docs/ReleaseNotes.html:1.371   Wed May  9 01:23:58 2007
+++ llvm/docs/ReleaseNotes.html Wed May  9 14:31:58 2007
@@ -66,7 +66,7 @@
 We took this as an opportunity to
 break backwards compatibility with the LLVM 1.x bytecode and .ll file format.
 If you have LLVM 1.9 .ll files that you would like to upgrade to LLVM 2.x, we 
-recommend the use of the stand alone llvm-upgrade
+recommend the use of the stand alone llvm-upgrade
 tool.  We intend to keep compatibility with .ll and .bc formats within the 2.x
 release series, like we did within the 1.x series.
 There are several significant change to the LLVM IR and internal APIs, such
@@ -344,8 +344,11 @@
 
 
 
-The ARM backend is currently in early development stages, it is not 
-ready for production use.
+The Thumb mode works only on ARMv6 or higher processors. On sub-ARMv6
+processors, any thumb program compiled with LLVM crashes or produces wrong
+results. (http://llvm.org/PR1388";>PR1388)
+Compilation for ARM Linux OABI (old ABI) is supported, but not fully 
tested.
+
 
 
 
@@ -597,7 +600,7 @@
   src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!" />
 
   http://llvm.org/";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/09 06:23:58 $
+  Last modified: $Date: 2007/05/09 19:31:58 $
 
 
 



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


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

2007-05-09 Thread Anton Korobeynikov


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.449 -> 1.450
---
Log message:

Do not assert, when case range split metric is zero and JTs are not allowed: 
just emit binary tree in this case. This 
fixes PR1403: http://llvm.org/PR1403 .


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

 SelectionDAGISel.cpp |   17 -
 1 files changed, 12 insertions(+), 5 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.449 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.450
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.449Mon May  7 
15:49:28 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Wed May  9 15:07:09 2007
@@ -1462,6 +1462,11 @@
   return true;
 }
 
+static inline bool areJTsAllowed(const TargetLowering &TLI) {
+  return (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) ||
+  TLI.isOperationLegal(ISD::BRIND, MVT::Other));
+}
+  
 /// handleJTSwitchCase - Emit jumptable for current switch case range
 bool SelectionDAGLowering::handleJTSwitchCase(CaseRec& CR,
   CaseRecVector& WorkList,
@@ -1478,9 +1483,7 @@
I!=E; ++I)
 TSize += I->size();
 
-  if ((!TLI.isOperationLegal(ISD::BR_JT, MVT::Other) &&
-   !TLI.isOperationLegal(ISD::BRIND, MVT::Other)) ||
-  TSize <= 3)
+  if (!areJTsAllowed(TLI) || TSize <= 3)
 return false;
   
   double Density = (double)TSize / (double)((Last - First) + 1ULL);  
@@ -1622,8 +1625,12 @@
 LSize += J->size();
 RSize -= J->size();
   }
-  // If our case is dense we *really* should handle it earlier!
-  assert((FMetric > 0) && "Should handle dense range earlier!");
+  if (areJTsAllowed(TLI)) {
+// If our case is dense we *really* should handle it earlier!
+assert((FMetric > 0) && "Should handle dense range earlier!");
+  } else {
+Pivot = CR.Range.first + Size/2;
+  }
   
   CaseRange LHSR(CR.Range.first, Pivot);
   CaseRange RHSR(Pivot, CR.Range.second);



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


[llvm-commits] CVS: llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.ll

2007-05-09 Thread Anton Korobeynikov


Changes in directory llvm/test/CodeGen/SPARC:

2007-05-09-JumpTables.ll added (r1.1)
---
Log message:

Do not assert, when case range split metric is zero and JTs are not allowed: 
just emit binary tree in this case. This 
fixes PR1403: http://llvm.org/PR1403 .


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

 2007-05-09-JumpTables.ll |   30 ++
 1 files changed, 30 insertions(+)


Index: llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.ll
diff -c /dev/null llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.ll:1.1
*** /dev/null   Wed May  9 15:07:20 2007
--- llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.llWed May  9 15:07:09 2007
***
*** 0 
--- 1,30 
+ ; RUN: llvm-as < %s | llc -march=sparc
+ 
+ ; We cannot emit jump tables on Sparc, but we should correctly handle this 
case.
+ 
+ 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"
+ 
+ define i32 @foo(i32 %f) {
+ entry:
+   switch i32 %f, label %bb14 [
+i32 0, label %UnifiedReturnBlock
+i32 1, label %bb4
+i32 2, label %bb7
+i32 3, label %bb10
+   ]
+ 
+ bb4:  ; preds = %entry
+   ret i32 2
+ 
+ bb7:  ; preds = %entry
+   ret i32 5
+ 
+ bb10: ; preds = %entry
+   ret i32 9
+ 
+ bb14: ; preds = %entry
+   ret i32 0
+ 
+ UnifiedReturnBlock:   ; preds = %entry
+   ret i32 1
+ }



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


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

2007-05-09 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.301 -> 1.302
---
Log message:

Can't fold the bit_convert is the store is a truncating store.

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

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


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.301 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.302
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.301 Mon May  7 16:36:06 2007
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp   Wed May  9 16:49:47 2007
@@ -3422,8 +3422,8 @@
   SDOperand Ptr   = ST->getBasePtr();
   
   // If this is a store of a bit convert, store the input value if the
-  // resultant store does not need a  higher alignment than the original.
-  if (Value.getOpcode() == ISD::BIT_CONVERT) {
+  // resultant store does not need a higher alignment than the original.
+  if (Value.getOpcode() == ISD::BIT_CONVERT && !ST->isTruncatingStore()) {
 unsigned Align = ST->getAlignment();
 MVT::ValueType SVT = Value.getOperand(0).getValueType();
 unsigned OrigAlign = TLI.getTargetMachine().getTargetData()->



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


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

2007-05-09 Thread Evan Cheng


Changes in directory llvm/test/CodeGen/ARM:

fptoint.ll updated: 1.2 -> 1.3
---
Log message:

Can't fold bit_convert into truncating store.

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

 fptoint.ll |8 +++-
 1 files changed, 7 insertions(+), 1 deletion(-)


Index: llvm/test/CodeGen/ARM/fptoint.ll
diff -u llvm/test/CodeGen/ARM/fptoint.ll:1.2 
llvm/test/CodeGen/ARM/fptoint.ll:1.3
--- llvm/test/CodeGen/ARM/fptoint.ll:1.2Mon May  7 16:49:35 2007
+++ llvm/test/CodeGen/ARM/fptoint.llWed May  9 16:54:34 2007
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | not grep fmrs
+; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fmrs | wc -l | 
grep 1
 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | not grep fmrrd
 
 @i = weak global i32 0 ;  [#uses=2]
@@ -39,3 +39,9 @@
store i32 %tmp1, i32* @u
ret void
 }
+
+define void @foo9(double %x) {
+   %tmp = fptoui double %x to i16
+   store i16 %tmp, i16* null
+   ret void
+}



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


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

2007-05-09 Thread Reid Spencer


Changes in directory llvm-www:

DevMtgMay2007.html updated: 1.130 -> 1.131
---
Log message:

Changes requested by Evan.


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

 DevMtgMay2007.html |   11 +--
 1 files changed, 5 insertions(+), 6 deletions(-)


Index: llvm-www/DevMtgMay2007.html
diff -u llvm-www/DevMtgMay2007.html:1.130 llvm-www/DevMtgMay2007.html:1.131
--- llvm-www/DevMtgMay2007.html:1.130   Wed May  9 00:22:49 2007
+++ llvm-www/DevMtgMay2007.html Wed May  9 17:05:36 2007
@@ -105,13 +105,12 @@
 pass manager does and how to use it.
 
 10:5511:10Evan Cheng
-  LLVM Register Allocator. An overview
-  of the current register allocator design and changes to it that are 
-  coming in the future.
+  LLVM Code Generator. An overview of the LLVM generic code
+generator design and changes to it that are coming in the future.
 
 11:1511:35Nick Lewycky
-  Introduction To Predicate Simplifier. A review of the design 
and
-implementation of LLVM's Predicate Simplifier Pass, otherwise known
+  Introduction To Predicate Simplifier. A review of the design 
+and implementation of LLVM's Predicate Simplifier Pass, otherwise known
 as VRP (Value Range Propagation).
   
 
@@ -354,6 +353,6 @@
   src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!">
   http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!">
-Last modified: $Date: 2007/05/09 05:22:49 $
+Last modified: $Date: 2007/05/09 22:05:36 $
 
 



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


[llvm-commits] Fixincludes patch for mingw32

2007-05-09 Thread Anton Korobeynikov
Hello, Everyone.

Please apply attached patch to both llvm-gcc trunk & 2.0 release.
Mingw32 system headers (complex.h) contains inline FP math, which causes
libstdc++ configure to fail due to infinite cycle in llvm-gcc.

Attached patch workarounds this by providing replacement code and
wrapping "bad" places into __NO_MATH_INLINES define, which is default
for all i386 systems now. Patch just adds one new mingw32-specific
fixincludes rule, which executes long sed expression doing all dirty
work :)
diff -r 6cbd996d9f48 fixincludes/fixincl.x
--- a/fixincludes/fixincl.x	Sun May 06 09:02:00 2007 +
+++ b/fixincludes/fixincl.x	Thu May 10 03:20:59 2007 +0400
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Friday July  8, 2005 at 03:33:04 PM PDT
+ * It has been AutoGen-ed  Thursday May 10, 2007 at 03:18:13 AM MSD
  * From the definitionsinclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Jul  8 15:33:04 PDT 2005
+/* DO NOT CVS-MERGE THIS FILE, EITHER Thu May 10 03:18:13 MSD 2007
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -15,7 +15,7 @@
  * certain ANSI-incompatible system header files which are fixed to work
  * correctly with ANSI C and placed in a directory that GNU C will search.
  *
- * This file contains 195 fixup descriptions.
+ * This file contains 196 fixup descriptions.
  *
  * See README for more information.
  *
@@ -26,7 +26,8 @@
  *  
  *  You may redistribute it and/or modify it under the terms of the
  *  GNU General Public License, as published by the Free Software
- *  Foundation; either version 2, or (at your option) any later version.
+ *  Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
  *  
  *  inclhack is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -34,10 +35,10 @@
  *  See the GNU General Public License for more details.
  *  
  *  You should have received a copy of the GNU General Public License
- *  along with inclhack.  See the file "COPYING".  If not,
- *  write to:  The Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330,
- * Boston,  MA  02111-1307, USA.
+ *  along with inclhack.  If not, write to:
+ *  	The Free Software Foundation, Inc.,
+ *  	51 Franklin Street, Fifth Floor
+ *  	Boston, MA  02110-1301, USA.
  */
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -4050,6 +4051,43 @@ static const char* apzMath_Huge_Val_From
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Mingw_Inline_Fp_Math fix
+ */
+tSCC zMingw_Inline_Fp_MathName[] =
+ "mingw_inline_fp_math";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zMingw_Inline_Fp_MathList[] =
+  "|complex.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzMingw_Inline_Fp_MathMachs[] = {
+"i[34567]86-*-mingw*",
+(const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zMingw_Inline_Fp_MathSelect0[] =
+   "[ \\t]*__asm__[ \\t]*\\(\\\"fpatan";
+
+#defineMINGW_INLINE_FP_MATH_TEST_CT  1
+static tTestDesc aMingw_Inline_Fp_MathTests[] = {
+  { TT_EGREP,zMingw_Inline_Fp_MathSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Mingw_Inline_Fp_Math
+ */
+static const char* apzMingw_Inline_Fp_MathPatch[] = { "sed",
+"-e", "/^\\#ifdef[ \\t]*__GNUC__$/,/^\\#endif[ \\t]*\\/*[ \\t]*__GNUC__[ \\t]*$/ { :ack N; /\\n[ \\t]*:/! b ack; s/\\(\\n[ \\t]*double[ \\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\nres = atan((__imag__ _Z) \\/ (__real__ _Z));\\n#else\\n/; s/\\(\\n[ \\t]*float[ \\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\nres = atanf((__imag__ _Z) \\/ (__real__ _Z));\\n#else\\n/; s/\\(\\n[ \\t]*long[ \\t]*double[ \\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\nres = atanl((__imag__ _Z) \\/ (__real__ _Z));\\n#else\\n/; s/\\(\\\"st[(]1[)]\\\"[)];[ \\t]*\\)$/\\1\\n#endif/g }",
+"-e", "s/\\(\\#include[ \\t]*<_mingw.h>\\)/\\1\\n\\#include /",
+(char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Nested_Auth_Des fix
  */
 tSCC zNested_Auth_DesName[] =
@@ -7932,9 +7970,9 @@ static const char* apzX11_SprintfPatch[]
  *
  *  List of all fixes
  */
-#define REGEX_COUNT  234
+#define REGEX_COUNT  235
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT195
+#define FIX_COUNT196
 
 /*
  *  Enumerate the fixes
@@ -8037,6 +8075,7 @@ typedef enum {
 MACHINE_NAME_FIXIDX,
 MATH_EXCEPTION_FIXIDX,
 MATH_HUGE_VAL_FROM_DBL_MAX_FIXIDX,
+MINGW_INLINE_FP_MATH_FIXIDX,
 NESTED_AUTH_DES_FIXIDX,
 NESTED_MOTOROLA_FIXIDX,
 NESTED_SYS_LIMITS_FIXIDX,
@@ -8623,6 +8662,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
  MATH_HUGE_VAL_FROM_DBL_MAX_TEST_CT, FD_MACH_ONLY | FD_SHELL_SCRIPT,
  aMath_Huge_Val_From_Dbl_MaxTests,   apzMath_Huge_Val_F

[llvm-commits] CVS: llvm-test/External/SPEC/CINT2000/186.crafty/Makefile

2007-05-09 Thread Evan Cheng


Changes in directory llvm-test/External/SPEC/CINT2000/186.crafty:

Makefile updated: 1.14 -> 1.15
---
Log message:

Get 186.crafty working on ARM.

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

 Makefile |9 +
 1 files changed, 9 insertions(+)


Index: llvm-test/External/SPEC/CINT2000/186.crafty/Makefile
diff -u llvm-test/External/SPEC/CINT2000/186.crafty/Makefile:1.14 
llvm-test/External/SPEC/CINT2000/186.crafty/Makefile:1.15
--- llvm-test/External/SPEC/CINT2000/186.crafty/Makefile:1.14   Sun Jan 15 
20:27:03 2006
+++ llvm-test/External/SPEC/CINT2000/186.crafty/MakefileWed May  9 
18:41:18 2007
@@ -25,6 +25,15 @@
 ifeq ($(ARCH),Sparc)
CPPFLAGS += -DSUN_BSD
 endif
+ifeq ($(TARGET_ARCH),ARM)
+   CPPFLAGS += -DHAS_LONGLONG
+endif
+ifeq ($(OS),Darwin)
+   CPPFLAGS += -DUNIX -DLINUX
+endif
+ifeq ($(ENDIAN),little)
+   CPPFLAGS += -DLITTLE_ENDIAN_ARCH
+endif
 
 include ../../Makefile.spec2000
 



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


Re: [llvm-commits] Regalloc Refactoring

2007-05-09 Thread David A. Greene
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Evan Cheng wrote:
> Hi,
> 
> The patch seems pretty safe to me. The only thing I am not sure about is:

[snip]

> It's not clear to me if this is the right way to model this pass. After
> all, this is not an analysis pass. Perhaps the right thing to do is to
> model this after the register allocator. Add a createRegisterCoalescer()
> to Passes.cpp which would allow us to choose the one we want. Then
> register the pass in LLVMTargetMachine.cpp. Chris? What do you say?

Yeah, I wasn't sure about that either.  I modeled it after the way that
out-of-ssa conversion is done since LinearScan assumes that coalescing
has been done.

I think your suggestion of createRegisterCoalescer() is the right
solution in the long run.  My goal here was to submit the first phase
of a larger refactoring effort that separated coalescing from
live interval analysis but tried not to do anything else dramatic.

  -Dave

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQl9DgQsI8xjTYs8RAm5mAJ9mOWIQKNX63QHhh46SZDkx2HIW5QCaAtl5
3jHR+bEO1bQ2PGs6W52rhGA=
=ctF+
-END PGP SIGNATURE-
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/README.txt

2007-05-09 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

README.txt updated: 1.167 -> 1.168
---
Log message:

add some notes


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

 README.txt |   28 
 1 files changed, 28 insertions(+)


Index: llvm/lib/Target/X86/README.txt
diff -u llvm/lib/Target/X86/README.txt:1.167 
llvm/lib/Target/X86/README.txt:1.168
--- llvm/lib/Target/X86/README.txt:1.167Sat May  5 17:10:24 2007
+++ llvm/lib/Target/X86/README.txt  Wed May  9 19:08:04 2007
@@ -1094,5 +1094,33 @@
 has this xform, but it is currently disabled until the alignment fields of 
 the load/store nodes are trustworthy.
 
+//===-===//
 
+Sometimes it is better to codegen subtractions from a constant (e.g. 7-x) with
+a neg instead of a sub instruction.  Consider:
+
+int test(char X) { return 7-X; }
+
+we currently produce:
+_test:
+movl $7, %eax
+movsbl 4(%esp), %ecx
+subl %ecx, %eax
+ret
+
+We would use one fewer register if codegen'd as:
+
+movsbl 4(%esp), %eax
+   neg %eax
+add $7, %eax
+ret
+
+Note that this isn't beneficial if the load can be folded into the sub.  In
+this case, we want a sub:
+
+int test(int X) { return 7-X; }
+_test:
+movl $7, %eax
+subl 4(%esp), %eax
+ret
 



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


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

2007-05-09 Thread Dale Johannesen


Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.50 -> 1.51
---
Log message:

Make tail merging handle many more cases (all it can, I think).


---
Diffs of the changes:  (+91 -32)

 BranchFolding.cpp |  123 +++---
 1 files changed, 91 insertions(+), 32 deletions(-)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.50 
llvm/lib/CodeGen/BranchFolding.cpp:1.51
--- llvm/lib/CodeGen/BranchFolding.cpp:1.50 Mon May  7 15:57:21 2007
+++ llvm/lib/CodeGen/BranchFolding.cpp  Wed May  9 20:01:49 2007
@@ -110,7 +110,7 @@
   RS = RegInfo->requiresRegisterScavenging(MF) ? new RegScavenger() : NULL;
 
   MMI = getAnalysisToUpdate();
-  
+
   bool EverMadeChange = false;
   bool MadeChangeThisIteration = true;
   while (MadeChangeThisIteration) {
@@ -336,7 +336,16 @@
   MachineBasicBlock::iterator MBB1I,
   MachineBasicBlock *MBB2,
   MachineBasicBlock::iterator MBB2I,
-  const TargetInstrInfo *TII) {
+  const TargetInstrInfo *TII,
+  MachineBasicBlock *PredBB) {
+  // If one block falls through into the common successor, choose that
+  // one to split; it is one instruction less to do that.
+  if (PredBB) {
+if (MBB1 == PredBB)
+  return true;
+else if (MBB2 == PredBB)
+  return false;
+  }
   // TODO: if we had some notion of which block was hotter, we could split
   // the hot block, so it is the fall-through.  Since we don't have profile 
info
   // make a decision based on which will hurt most to split.
@@ -349,6 +358,31 @@
   return MBB1Time < MBB2Time;
 }
 
+// CurMBB needs to add an unconditional branch to SuccMBB (we removed these
+// branches temporarily for tail merging).  In the case where CurMBB ends
+// with a conditional branch to the next block, optimize by reversing the
+// test and conditionally branching to SuccMBB instead.
+
+static void FixTail(MachineBasicBlock* CurMBB, MachineBasicBlock *SuccBB,
+const TargetInstrInfo *TII) {
+  MachineFunction *MF = CurMBB->getParent();
+  MachineFunction::iterator I = next(MachineFunction::iterator(CurMBB));
+  MachineBasicBlock *TBB = 0, *FBB = 0;
+  std::vector Cond;
+  if (I != MF->end() &&
+  !TII->AnalyzeBranch(*CurMBB, TBB, FBB, Cond)) {
+MachineBasicBlock *NextBB = I;
+if (TBB == NextBB && Cond.size() && !FBB) {
+  if (!TII->ReverseBranchCondition(Cond)) {
+TII->RemoveBranch(*CurMBB);
+TII->InsertBranch(*CurMBB, SuccBB, NULL, Cond);
+return;
+  }
+}
+  }
+  TII->InsertBranch(*CurMBB, SuccBB, NULL, std::vector());
+}
+
 // See if any of the blocks in MergePotentials (which all have a common single
 // successor, or all have no successor) can be tail-merged.  If there is a
 // successor, any blocks in MergePotentials that are not tail-merged and
@@ -375,7 +409,7 @@
 // give up.
 if (CurHash != PrevHash) {
   if (SuccBB && CurMBB != PredBB)
-TII->InsertBranch(*CurMBB, SuccBB, NULL, 
std::vector());
+FixTail(CurMBB, SuccBB, TII);
   MergePotentials.pop_back();
   continue;
 }
@@ -390,6 +424,8 @@
 
 // If the tails don't have at least two instructions in common, see if 
there
 // is anything else in the equivalence class that does match.
+// Since instructions may get combined later (e.g. single stores into
+// store multiple) this measure is not particularly accurate.
 if (CommonTailLen < 2) {
   unsigned FoundMatch = ~0U;
   for (int i = MergePotentials.size()-2;
@@ -408,7 +444,7 @@
   if (FoundMatch == ~0U) {
 // Put the unconditional branch back, if we need one.
 if (SuccBB && CurMBB != PredBB)
-  TII->InsertBranch(*CurMBB, SuccBB, NULL, 
std::vector());
+  FixTail(CurMBB, SuccBB, TII);
 MergePotentials.pop_back();
 continue;
   }
@@ -428,7 +464,7 @@
   }
   
   // Decide whether we want to split CurMBB or MBB2.
-  if (ShouldSplitFirstBlock(CurMBB, BBI1, MBB2, BBI2, TII)) {
+  if (ShouldSplitFirstBlock(CurMBB, BBI1, MBB2, BBI2, TII, PredBB)) {
 CurMBB = SplitMBBAt(*CurMBB, BBI1);
 BBI1 = CurMBB->begin();
 MergePotentials.back().second = CurMBB;
@@ -457,49 +493,69 @@
 }
 
 bool BranchFolder::TailMergeBlocks(MachineFunction &MF) {
-  MadeChange = false;
-  
+
   if (!EnableTailMerge) return false;
-  
+ 
+  MadeChange = false;
+
   // First find blocks with no successors.
+  MergePotentials.clear();
   for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
 if (I->succ_empty())
   MergePotentials.push_back(std::make_pair(HashEndOfMBB(I), I));
   }
-  // See if we can do any crossjumping on those.
+  // See if we can do any tail merging on those.
   MadeChange |= TryMergeBlocks(NULL

[llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-05-09-tailmerge-2.ll

2007-05-09 Thread Dale Johannesen


Changes in directory llvm/test/CodeGen/ARM:

2007-05-09-tailmerge-2.ll added (r1.1)
---
Log message:

Another test for tail mergeing


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

 2007-05-09-tailmerge-2.ll |   66 ++
 1 files changed, 66 insertions(+)


Index: llvm/test/CodeGen/ARM/2007-05-09-tailmerge-2.ll
diff -c /dev/null llvm/test/CodeGen/ARM/2007-05-09-tailmerge-2.ll:1.1
*** /dev/null   Wed May  9 20:04:38 2007
--- llvm/test/CodeGen/ARM/2007-05-09-tailmerge-2.ll Wed May  9 20:04:28 2007
***
*** 0 
--- 1,66 
+ ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*baz | wc 
-l | grep 1
+ ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*quux | wc 
-l | grep 1
+ ; Check that calls to baz and quux are tail-merged.
+ 
+ ; ModuleID = 'tail.c'
+ target datalayout = 
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
+ target triple = "i686-apple-darwin8"
+ 
+ define i32 @f(i32 %i, i32 %q) {
+ entry:
+   %i_addr = alloca i32;  [#uses=2]
+   %q_addr = alloca i32;  [#uses=2]
+   %retval = alloca i32, align 4   ;  [#uses=1]
+   "alloca point" = bitcast i32 0 to i32   ;  [#uses=0]
+   store i32 %i, i32* %i_addr
+   store i32 %q, i32* %q_addr
+   %tmp = load i32* %i_addr;  [#uses=1]
+   %tmp1 = icmp ne i32 %tmp, 0 ;  [#uses=1]
+   %tmp12 = zext i1 %tmp1 to i8;  [#uses=1]
+   %toBool = icmp ne i8 %tmp12, 0  ;  [#uses=1]
+   br i1 %toBool, label %cond_true, label %cond_false
+ 
+ cond_true:; preds = %entry
+   %tmp3 = call i32 (...)* @bar( ) ;  [#uses=0]
+   %tmp4 = call i32 (...)* @baz( i32 5, i32 6 );  
[#uses=0]
+   %tmp7 = load i32* %q_addr   ;  [#uses=1]
+   %tmp8 = icmp ne i32 %tmp7, 0;  [#uses=1]
+   %tmp89 = zext i1 %tmp8 to i8;  [#uses=1]
+   %toBool10 = icmp ne i8 %tmp89, 0;  [#uses=1]
+   br i1 %toBool10, label %cond_true11, label %cond_false15
+ 
+ cond_false:   ; preds = %entry
+   %tmp5 = call i32 (...)* @foo( ) ;  [#uses=0]
+   %tmp6 = call i32 (...)* @baz( i32 5, i32 6 );  
[#uses=0]
+   %tmp27 = load i32* %q_addr  ;  [#uses=1]
+   %tmp28 = icmp ne i32 %tmp27, 0  ;  [#uses=1]
+   %tmp289 = zext i1 %tmp28 to i8  ;  [#uses=1]
+   %toBool210 = icmp ne i8 %tmp289, 0  ;  [#uses=1]
+   br i1 %toBool210, label %cond_true11, label %cond_false15
+ 
+ cond_true11:  ; preds = %cond_next
+   %tmp13 = call i32 (...)* @foo( );  [#uses=0]
+   %tmp14 = call i32 (...)* @quux( i32 3, i32 4 )  ;  
[#uses=0]
+   br label %cond_next18
+ 
+ cond_false15: ; preds = %cond_next
+   %tmp16 = call i32 (...)* @bar( );  [#uses=0]
+   %tmp17 = call i32 (...)* @quux( i32 3, i32 4 )  ;  
[#uses=0]
+   br label %cond_next18
+ 
+ cond_next18:  ; preds = %cond_false15, %cond_true11
+   %tmp19 = call i32 (...)* @bar( );  [#uses=0]
+   br label %return
+ 
+ return:   ; preds = %cond_next18
+   %retval20 = load i32* %retval   ;  [#uses=1]
+   ret i32 %retval20
+ }
+ 
+ declare i32 @bar(...)
+ 
+ declare i32 @baz(...)
+ 
+ declare i32 @foo(...)
+ 
+ declare i32 @quux(...)



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


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

2007-05-09 Thread Tanya Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.449 -> 1.449.2.1
---
Log message:

Merge from mainline PR1403: http://llvm.org/PR1403 


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

 SelectionDAGISel.cpp |   17 -
 1 files changed, 12 insertions(+), 5 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.449 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.449.2.1
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.449Mon May  7 
15:49:28 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Wed May  9 23:42:32 2007
@@ -1462,6 +1462,11 @@
   return true;
 }
 
+static inline bool areJTsAllowed(const TargetLowering &TLI) {
+  return (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) ||
+  TLI.isOperationLegal(ISD::BRIND, MVT::Other));
+}
+  
 /// handleJTSwitchCase - Emit jumptable for current switch case range
 bool SelectionDAGLowering::handleJTSwitchCase(CaseRec& CR,
   CaseRecVector& WorkList,
@@ -1478,9 +1483,7 @@
I!=E; ++I)
 TSize += I->size();
 
-  if ((!TLI.isOperationLegal(ISD::BR_JT, MVT::Other) &&
-   !TLI.isOperationLegal(ISD::BRIND, MVT::Other)) ||
-  TSize <= 3)
+  if (!areJTsAllowed(TLI) || TSize <= 3)
 return false;
   
   double Density = (double)TSize / (double)((Last - First) + 1ULL);  
@@ -1622,8 +1625,12 @@
 LSize += J->size();
 RSize -= J->size();
   }
-  // If our case is dense we *really* should handle it earlier!
-  assert((FMetric > 0) && "Should handle dense range earlier!");
+  if (areJTsAllowed(TLI)) {
+// If our case is dense we *really* should handle it earlier!
+assert((FMetric > 0) && "Should handle dense range earlier!");
+  } else {
+Pivot = CR.Range.first + Size/2;
+  }
   
   CaseRange LHSR(CR.Range.first, Pivot);
   CaseRange RHSR(Pivot, CR.Range.second);



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


[llvm-commits] [release_20] CVS: llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.ll

2007-05-09 Thread Tanya Lattner


Changes in directory llvm/test/CodeGen/SPARC:

2007-05-09-JumpTables.ll added (r1.1.2.2)
---
Log message:

Merging from mainline PR 1403: http://llvm.org/PR1403 


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

 2007-05-09-JumpTables.ll |   30 ++
 1 files changed, 30 insertions(+)


Index: llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.ll
diff -c /dev/null llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.ll:1.1.2.2
*** /dev/null   Wed May  9 23:47:48 2007
--- llvm/test/CodeGen/SPARC/2007-05-09-JumpTables.llWed May  9 23:47:38 2007
***
*** 0 
--- 1,30 
+ ; RUN: llvm-as < %s | llc -march=sparc
+ 
+ ; We cannot emit jump tables on Sparc, but we should correctly handle this 
case.
+ 
+ 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"
+ 
+ define i32 @foo(i32 %f) {
+ entry:
+   switch i32 %f, label %bb14 [
+i32 0, label %UnifiedReturnBlock
+i32 1, label %bb4
+i32 2, label %bb7
+i32 3, label %bb10
+   ]
+ 
+ bb4:  ; preds = %entry
+   ret i32 2
+ 
+ bb7:  ; preds = %entry
+   ret i32 5
+ 
+ bb10: ; preds = %entry
+   ret i32 9
+ 
+ bb14: ; preds = %entry
+   ret i32 0
+ 
+ UnifiedReturnBlock:   ; preds = %entry
+   ret i32 1
+ }



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


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

2007-05-09 Thread Tanya Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.301 -> 1.301.2.1
---
Log message:

Merging from mainline


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

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


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.301 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.301.2.1
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.301 Mon May  7 16:36:06 2007
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp   Wed May  9 23:52:54 2007
@@ -3422,8 +3422,8 @@
   SDOperand Ptr   = ST->getBasePtr();
   
   // If this is a store of a bit convert, store the input value if the
-  // resultant store does not need a  higher alignment than the original.
-  if (Value.getOpcode() == ISD::BIT_CONVERT) {
+  // resultant store does not need a higher alignment than the original.
+  if (Value.getOpcode() == ISD::BIT_CONVERT && !ST->isTruncatingStore()) {
 unsigned Align = ST->getAlignment();
 MVT::ValueType SVT = Value.getOperand(0).getValueType();
 unsigned OrigAlign = TLI.getTargetMachine().getTargetData()->



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


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

2007-05-09 Thread Chris Lattner


Changes in directory llvm/docs:

GettingStarted.html updated: 1.158 -> 1.159
---
Log message:

another version of gcc that miscompiles llvm.


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

 GettingStarted.html |5 -
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/docs/GettingStarted.html
diff -u llvm/docs/GettingStarted.html:1.158 llvm/docs/GettingStarted.html:1.159
--- llvm/docs/GettingStarted.html:1.158 Wed Apr 11 16:28:31 2007
+++ llvm/docs/GettingStarted.html   Thu May 10 00:37:14 2007
@@ -525,6 +525,9 @@
possibly others) does not compile LLVM correctly (it appears that exception 
handling is broken in some cases).  Please download the FSF 3.3.3 or upgrade
to a newer version of GCC.
+GCC 3.4.0 on linux/x86 (32-bit): GCC miscompiles portions of the 
+   code generator, causing an infinite loop in the llvm-gcc build.  Please
+   upgrade to GCC 3.4.2.
 GCC 3.4.x on X86-64/amd64: GCC http://llvm.org/PR1056";>
miscompiles portions of LLVM.
 IA-64 GCC 4.0.0: The IA-64 version of GCC 4.0.0 is known to
@@ -1615,7 +1618,7 @@
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.x10sys.com/rspencer/";>Reid Spencer
   http://llvm.org";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/04/11 21:28:31 $
+  Last modified: $Date: 2007/05/10 05:37:14 $
 
 
 



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


Re: [llvm-commits] CVS: llvm/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll

2007-05-09 Thread Chris Lattner

> + ; ModuleID = 'PR1333.bc'

Can you please change this to just:

; PR1333

?

likewise for the other test.  Thanks Devang,

-Chris

> + 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-pc-linux-gnu"
> + %struct.ada__streams__root_stream_type = type { % 
> struct.ada__tags__dispatch_table* }
> + %struct.ada__tags__dispatch_table = type { [1 x i8*] }
> + %struct.quotes__T173s = type { i8, %struct.quotes__T173s__T174s,  
> [2 x [1 x double]], [2 x i16], i64, i8 }
> + %struct.quotes__T173s__T174s = type { i8, i8, i8, i16, i16, [2 x  
> [1 x double]] }
> +
> + void @quotes__write_quote() {
> + entry:
> + %tmp606.i = icmp eq i32 0, 0;  [#uses=1]
> + br label %bb
> +
> + bb: ; preds = %cond_next73, %bb, %entry
> + br i1 false, label %bb51, label %bb
> +
> + bb51:   ; preds = %cond_next73, %bb
> + br i1 %tmp606.i, label % 
> quotes__bid_ask_depth_offset_matrices__get_price.exit, label % 
> cond_true.i
> +
> + cond_true.i:; preds = %bb51
> + unreachable
> +
> + quotes__bid_ask_depth_offset_matrices__get_price.exit:  ; preds 
> =  
> %bb51
> + br i1 false, label %cond_next73, label %cond_true72
> +
> + cond_true72:; preds = % 
> quotes__bid_ask_depth_offset_matrices__get_price.exit
> + unreachable
> +
> + cond_next73:; preds = % 
> quotes__bid_ask_depth_offset_matrices__get_price.exit
> + br i1 false, label %bb, label %bb51
> + }
>
>
>
> ___
> 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] [127089] Anton Korobeynikov's fixincludes patch for mingw32

2007-05-09 Thread dpatel
Revision: 127089
Author:   dpatel
Date: 2007-05-09 23:21:25 -0700 (Wed, 09 May 2007)

Log Message:
---
Anton Korobeynikov's fixincludes patch for mingw32

Modified Paths:
--
apple-local/branches/llvm/fixincludes/fixincl.x
apple-local/branches/llvm/fixincludes/inclhack.def
apple-local/branches/llvm/fixincludes/mkfixinc.sh

Modified: apple-local/branches/llvm/fixincludes/fixincl.x
===
--- apple-local/branches/llvm/fixincludes/fixincl.x 2007-05-10 04:40:54 UTC 
(rev 127088)
+++ apple-local/branches/llvm/fixincludes/fixincl.x 2007-05-10 06:21:25 UTC 
(rev 127089)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Friday July  8, 2005 at 03:33:04 PM PDT
+ * It has been AutoGen-ed  Thursday May 10, 2007 at 03:18:13 AM MSD
  * From the definitionsinclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Jul  8 15:33:04 PDT 2005
+/* DO NOT CVS-MERGE THIS FILE, EITHER Thu May 10 03:18:13 MSD 2007
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -15,7 +15,7 @@
  * certain ANSI-incompatible system header files which are fixed to work
  * correctly with ANSI C and placed in a directory that GNU C will search.
  *
- * This file contains 195 fixup descriptions.
+ * This file contains 196 fixup descriptions.
  *
  * See README for more information.
  *
@@ -26,7 +26,8 @@
  *  
  *  You may redistribute it and/or modify it under the terms of the
  *  GNU General Public License, as published by the Free Software
- *  Foundation; either version 2, or (at your option) any later version.
+ *  Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
  *  
  *  inclhack is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -34,10 +35,10 @@
  *  See the GNU General Public License for more details.
  *  
  *  You should have received a copy of the GNU General Public License
- *  along with inclhack.  See the file "COPYING".  If not,
- *  write to:  The Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330,
- * Boston,  MA  02111-1307, USA.
+ *  along with inclhack.  If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA  02110-1301, USA.
  */
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -4050,6 +4051,43 @@
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Mingw_Inline_Fp_Math fix
+ */
+tSCC zMingw_Inline_Fp_MathName[] =
+ "mingw_inline_fp_math";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zMingw_Inline_Fp_MathList[] =
+  "|complex.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzMingw_Inline_Fp_MathMachs[] = {
+"i[34567]86-*-mingw*",
+(const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zMingw_Inline_Fp_MathSelect0[] =
+   "[ \\t]*__asm__[ \\t]*\\(\\\"fpatan";
+
+#defineMINGW_INLINE_FP_MATH_TEST_CT  1
+static tTestDesc aMingw_Inline_Fp_MathTests[] = {
+  { TT_EGREP,zMingw_Inline_Fp_MathSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Mingw_Inline_Fp_Math
+ */
+static const char* apzMingw_Inline_Fp_MathPatch[] = { "sed",
+"-e", "/^\\#ifdef[ \\t]*__GNUC__$/,/^\\#endif[ \\t]*\\/*[ \\t]*__GNUC__[ 
\\t]*$/ { :ack N; /\\n[ \\t]*:/! b ack; s/\\(\\n[ \\t]*double[ 
\\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\nres = atan((__imag__ _Z) 
\\/ (__real__ _Z));\\n#else\\n/; s/\\(\\n[ \\t]*float[ 
\\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\nres = atanf((__imag__ _Z) 
\\/ (__real__ _Z));\\n#else\\n/; s/\\(\\n[ \\t]*long[ \\t]*double[ 
\\t]*res;\\)\\n/\\1\\n#ifdef __NO_MATH_INLINES\\nres = atanl((__imag__ _Z) 
\\/ (__real__ _Z));\\n#else\\n/; s/\\(\\\"st[(]1[)]\\\"[)];[ 
\\t]*\\)$/\\1\\n#endif/g }",
+"-e", "s/\\(\\#include[ \\t]*<_mingw.h>\\)/\\1\\n\\#include /",
+(char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Nested_Auth_Des fix
  */
 tSCC zNested_Auth_DesName[] =
@@ -7932,9 +7970,9 @@
  *
  *  List of all fixes
  */
-#define REGEX_COUNT  234
+#define REGEX_COUNT  235
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT195
+#define FIX_COUNT196
 
 /*
  *  Enumerate the fixes
@@ -8037,6 +8075,7 @@
 MACHINE_NAME_FIXIDX,
 MATH_EXCEPTION_FIXIDX,
 MATH_HUGE_VAL_FROM_DBL_MAX_FIXIDX,
+MINGW_INLINE_FP_MATH_FIXIDX,
 NESTED_AUTH_DES_FIXIDX,
 NESTED_MOTOROLA_FIXIDX,
 NESTED_SYS_LIMITS_FIXIDX,
@@ -8623,6 +8662,11 @@
  MATH_HUGE_VAL_FROM_DBL_MAX_TEST_CT, FD_MACH_ONLY | FD_SHELL_SCRIPT,
  aMath_Huge_Val_From_Dbl_MaxTests,   apzMath_Huge_Val_From_Dbl_MaxPatch, 0 
},
 
+  {  zMingw_Inline_Fp_MathName,zMingw_Inline_Fp_MathList,
+ apzMingw_Inlin

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

2007-05-09 Thread Chris Lattner


Changes in directory llvm/docs:

GettingStarted.html updated: 1.159 -> 1.160
---
Log message:

gar.  GCC 3.4.2 also miscompiles llvm at -O3. :(


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

 GettingStarted.html |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)


Index: llvm/docs/GettingStarted.html
diff -u llvm/docs/GettingStarted.html:1.159 llvm/docs/GettingStarted.html:1.160
--- llvm/docs/GettingStarted.html:1.159 Thu May 10 00:37:14 2007
+++ llvm/docs/GettingStarted.html   Thu May 10 01:42:21 2007
@@ -499,8 +499,8 @@
 LLVM is very demanding of the host C++ compiler, and as such tends to expose
 bugs in the compiler.  In particular, several versions of GCC crash when trying
 to compile LLVM.  We routinely use GCC 3.3.3, 3.4.0, and Apple 4.0.1 
-successfully with them (however, see below).  Other versions of GCC will 
-probably work as well.  GCC versions listed
+successfully with them (however, see important notes below).  Other versions 
+of GCC will probably work as well.  GCC versions listed
 here are known to not work.  If you are using one of these versions, please try
 to upgrade your GCC to something more recent.  If you run into a problem with a
 version of GCC not listed here, please mailto:[EMAIL PROTECTED]">let
@@ -526,8 +526,12 @@
handling is broken in some cases).  Please download the FSF 3.3.3 or upgrade
to a newer version of GCC.
 GCC 3.4.0 on linux/x86 (32-bit): GCC miscompiles portions of the 
-   code generator, causing an infinite loop in the llvm-gcc build.  Please
-   upgrade to GCC 3.4.2.
+   code generator, causing an infinite loop in the llvm-gcc build when built
+   with optimizations enabled (i.e. a release build).
+GCC 3.4.2 on linux/x86 (32-bit): GCC miscompiles portions of the 
+   code generator at -O3, as with 3.4.0.  However gcc 3.4.2 (unlike 3.4.0)
+   correctly compiles LLVM at -O2.  A work around is to build release LLVM
+   builds with "make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 ..."
 GCC 3.4.x on X86-64/amd64: GCC http://llvm.org/PR1056";>
miscompiles portions of LLVM.
 IA-64 GCC 4.0.0: The IA-64 version of GCC 4.0.0 is known to
@@ -1618,7 +1622,7 @@
   mailto:[EMAIL PROTECTED]">Chris Lattner
   http://llvm.x10sys.com/rspencer/";>Reid Spencer
   http://llvm.org";>The LLVM Compiler Infrastructure
-  Last modified: $Date: 2007/05/10 05:37:14 $
+  Last modified: $Date: 2007/05/10 06:42:21 $
 
 
 



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