[llvm-commits] CVS: llvm-test/LICENSE.TXT

2006-02-13 Thread Chris Lattner


Changes in directory llvm-test:

LICENSE.TXT updated: 1.11 -> 1.12
---
Log message:

Add fhourstones


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

 LICENSE.TXT |1 +
 1 files changed, 1 insertion(+)


Index: llvm-test/LICENSE.TXT
diff -u llvm-test/LICENSE.TXT:1.11 llvm-test/LICENSE.TXT:1.12
--- llvm-test/LICENSE.TXT:1.11  Sun Feb 12 00:55:00 2006
+++ llvm-test/LICENSE.TXT   Tue Feb 14 00:12:20 2006
@@ -79,6 +79,7 @@
 JM: llvm-test/MultiSource/Applications/JM
 smg2000:llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000
 Fhourstones:llvm-test/MultiSource/Benchmarks/Fhourstones
+Fhourstones-3.1:llvm-test/MultiSource/Benchmarks/Fhourstones-3.1
 McCat:  llvm-test/MultiSource/Benchmarks/McCat
 Olden:  llvm-test/MultiSource/Benchmarks/Olden
 OptimizerEval:  llvm-test/MultiSource/Benchmarks/OptimizerEval



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


[llvm-commits] CVS: llvm/win32/doflex.cmd

2006-02-13 Thread Jeff Cohen


Changes in directory llvm/win32:

doflex.cmd updated: 1.2 -> 1.3
---
Log message:

Match changes to unix build system.

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

 doflex.cmd |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/win32/doflex.cmd
diff -u llvm/win32/doflex.cmd:1.2 llvm/win32/doflex.cmd:1.3
--- llvm/win32/doflex.cmd:1.2   Wed Oct 26 20:10:37 2005
+++ llvm/win32/doflex.cmd   Tue Feb 14 00:12:08 2006
@@ -16,5 +16,5 @@
 
 :noflex
 echo Flex not found.  Using pre-generated files.
-copy %~pn3.cpp %2.cpp
+copy %~pn3.cpp.cvs %2.cpp
 exit



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


[llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Makefile

2006-02-13 Thread Chris Lattner


Changes in directory llvm-test/MultiSource/Benchmarks:

Makefile updated: 1.10 -> 1.11
---
Log message:

Add fhourstones 3.1


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

 Makefile |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm-test/MultiSource/Benchmarks/Makefile
diff -u llvm-test/MultiSource/Benchmarks/Makefile:1.10 
llvm-test/MultiSource/Benchmarks/Makefile:1.11
--- llvm-test/MultiSource/Benchmarks/Makefile:1.10  Mon Apr 11 14:19:16 2005
+++ llvm-test/MultiSource/Benchmarks/Makefile   Tue Feb 14 00:11:36 2006
@@ -1,7 +1,8 @@
 # MultiSource/Benchmarks Makefile:  Build all subdirectories automatically
 
 LEVEL = ../..
-PARALLEL_DIRS := Fhourstones McCat Olden OptimizerEval Ptrdist llubenchmark \
+PARALLEL_DIRS := Fhourstones Fhourstones-3.1 \
+ McCat Olden OptimizerEval Ptrdist llubenchmark \
  sim FreeBench MallocBench Prolangs-C Prolangs-C++ SciMark2-C\
 mediabench ASCI_Purple
 



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


[llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Fhourstones-3.1/Game.h LICENSE.txt Makefile SearchGame.c TransGame.h inputs inputs_large

2006-02-13 Thread Chris Lattner


Changes in directory llvm-test/MultiSource/Benchmarks/Fhourstones-3.1:

Game.h added (r1.1)
LICENSE.txt added (r1.1)
Makefile added (r1.1)
SearchGame.c added (r1.1)
TransGame.h added (r1.1)
inputs added (r1.1)
inputs_large added (r1.1)
---
Log message:

New tasty version of fhourstones: 3.1!

This one even includes a LARGE_PROBLEM_SIZE input! :)


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

 Game.h   |  122 
 LICENSE.txt  |   11 +++
 Makefile |   16 
 SearchGame.c |  197 +++
 TransGame.h  |  133 +++
 inputs   |2 
 inputs_large |3 
 7 files changed, 484 insertions(+)


Index: llvm-test/MultiSource/Benchmarks/Fhourstones-3.1/Game.h
diff -c /dev/null llvm-test/MultiSource/Benchmarks/Fhourstones-3.1/Game.h:1.1
*** /dev/null   Tue Feb 14 00:08:44 2006
--- llvm-test/MultiSource/Benchmarks/Fhourstones-3.1/Game.h Tue Feb 14 
00:08:34 2006
***
*** 0 
--- 1,122 
+ // Fhourstones 3.0 Board Logic
+ // (http://www.cwi.nl/~tromp/c4/fhour.html)
+ //
+ // implementation of the well-known game
+ // usually played on a vertical board of 7 columns by 6 rows,
+ // where 2 players take turns in dropping counters in a column.
+ // the first player to get four of his counters
+ // in a horizontal, vertical or diagonal row, wins the game.
+ // if neither player has won after 42 moves, then the game is drawn.
+ //
+ // This software is copyright (c) 1996-2005 by
+ //  John Tromp
+ //  Insulindeweg 908
+ //  1095 DX Amsterdam
+ //  Netherlands
+ // E-mail: [EMAIL PROTECTED]
+ //
+ // This notice must not be removed.
+ // This software must not be sold for profit.
+ // You may redistribute if your distributees have the
+ // same rights and restrictions.
+ 
+ #include 
+ #include 
+ #define WIDTH 7
+ #define HEIGHT 6
+ // bitmask corresponds to board as follows in 7x6 case:
+ //  .  .  .  .  .  .  .  TOP
+ //  5 12 19 26 33 40 47
+ //  4 11 18 25 32 39 46
+ //  3 10 17 24 31 38 45
+ //  2  9 16 23 30 37 44
+ //  1  8 15 22 29 36 43
+ //  0  7 14 21 28 35 42  BOTTOM
+ #define H1 (HEIGHT+1)
+ #define H2 (HEIGHT+2)
+ #define SIZE (HEIGHT*WIDTH)
+ #define SIZE1 (H1*WIDTH)
+ #define ALL1 (((uint64)1<
+ typedef u_int64_t uint64;
+ typedef int64_t int64;
+ 
+ uint64 color[2];  // black and white bitboard
+ int moves[SIZE],nplies;
+ char height[WIDTH]; // holds bit index of lowest free square
+   
+ void reset()
+ {
+   int i;
+   nplies = 0;
+   color[0] = color[1] = 0;
+   for (i=0; i>HEIGHT);
+   if ((y & (y >> 2*HEIGHT)) != 0) // check \ diagonal
+ return 1;
+   y = newboard & (newboard>>H1);
+   if ((y & (y >> 2*H1)) != 0) // check horizontal -
+ return 1;
+   y = newboard & (newboard>>H2); // check / diagonal
+   if ((y & (y >> 2*H2)) != 0)
+ return 1;
+   y = newboard & (newboard>>1); // check vertical |
+   return (y & (y >> 2)) != 0;
+ }
+ 
+ // return whether newboard is legal and includes a win
+ int islegalhaswon(uint64 newboard)
+ {
+   return islegal(newboard) && haswon(newboard);
+ }
+ 
+ void backmove()
+ {
+   int n;
+ 
+   n = moves[--nplies];
+   color[nplies&1] ^= (uint64)1<<--height[n];
+ }
+ 
+ void makemove(int n) 
+ {
+   color[nplies&1] ^= (uint64)1<
+ #include 
+  
+ #define BOOKPLY 0  // full-width search up to this depth
+ #define REPORTPLY -1
+ 
+ uint64 millisecs()
+ {
+   struct rusage rusage;
+   getrusage(RUSAGE_SELF,&rusage);
+   return rusage.ru_utime.tv_sec * 1000 + rusage.ru_utime.tv_usec / 1000;
+ }
+ 
+ int history[2][SIZE1];
+ uint64 nodes, msecs;
+ 
+ int min(int x, int y) { return xy ? x : y; }
+ 
+ void inithistory()
+ {
+   int side,i,h;
+   for (side=0; side<2; side++)
+ for (i=0; i<(WIDTH+1)/2; i++)
+   for (h=0; h= beta)
+ return ttscore;
+ } else return ttscore; // exact score
+   }
+   hashindx = htindex;
+   hashlock = lock;
+   poscnt = posed;
+   besti=0;
+   score = LOSS;
+   for (i = 0; i < nav; i++) {
+ val = history[side][(int)height[av[l = i]]];
+ for (j = i+1; j < nav; j++) {
+   v = history[side][(int)height[av[j]]];
+   if (v > val) {
+ val = v; l = j;
+   }
+ }
+ for (j = av[l]; l>i; l--)
+   av[l] = av[l-1];
+ makemove(av[i] = j);
+ val = LOSSWIN-ab(LOSSWIN-beta,LOSSWIN-alpha);
+ backmove();
+ if (val > score) {
+   besti = i;
+   if ((score=val) > alpha && nplies >= BOOKPLY && (alpha=val) >= beta) {
+ if (score == DRAW && i < nav-1)
+   score = DRAWWIN;
+ if (besti > 0) {
+   for (i = 0; i < besti; i++)
+ history[side][(int)height[av[i]]]--; // punish bad histories
+   history[side][(int)height[av[besti]]] += besti;
+ }
+ break;
+   }
+ }
+   }
+   if (score == LOSSWIN-ttscore) // combine < and >
+ score = DRAW;
+   poscnt = posed - poscnt;
+   for (work=0; (poscnt>>=1) != 0; work++) ; // work=log #positions stored
+   tra

[llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Fhourstones-3.1/

2006-02-13 Thread Chris Lattner


Changes in directory llvm-test/MultiSource/Benchmarks/Fhourstones-3.1:

---
Log message:

Directory 
/home/vadve/shared/PublicCVS/llvm-test/MultiSource/Benchmarks/Fhourstones-3.1 
added to the repository


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

 0 files changed



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


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

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.152 -> 1.153
---
Log message:

now that libcalls don't suck, we can remove this hack


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

 SelectionDAGISel.cpp |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.152 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.153
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.152Mon Feb 13 
06:50:39 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Mon Feb 13 23:39:35 2006
@@ -1098,9 +1098,7 @@
 } else if (Name[0] == 's' && (Name == "sin" || Name == "sinf")) {
   if (I.getNumOperands() == 2 &&   // Basic sanity checks.
   I.getOperand(1)->getType()->isFloatingPoint() &&
-  I.getType() == I.getOperand(1)->getType() &&
-  TLI.isOperationLegal(ISD::FSIN,
- 
TLI.getValueType(I.getOperand(1)->getType( {
+  I.getType() == I.getOperand(1)->getType()) {
 SDOperand Tmp = getValue(I.getOperand(1));
 setValue(&I, DAG.getNode(ISD::FSIN, Tmp.getValueType(), Tmp));
 return;
@@ -1108,9 +1106,7 @@
 } else if (Name[0] == 'c' && (Name == "cos" || Name == "cosf")) {
   if (I.getNumOperands() == 2 &&   // Basic sanity checks.
   I.getOperand(1)->getType()->isFloatingPoint() &&
-  I.getType() == I.getOperand(1)->getType() &&
-  TLI.isOperationLegal(ISD::FCOS,
-  TLI.getValueType(I.getOperand(1)->getType( {
+  I.getType() == I.getOperand(1)->getType()) {
 SDOperand Tmp = getValue(I.getOperand(1));
 setValue(&I, DAG.getNode(ISD::FCOS, Tmp.getValueType(), Tmp));
 return;



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


[llvm-commits] CVS: llvm/Makefile.rules

2006-02-13 Thread Chris Lattner


Changes in directory llvm:

Makefile.rules updated: 1.341 -> 1.342
---
Log message:

Implement an alternative way of handling generated lex files in CVS.  This
should solve the "updating cvs when .l files change give me conflict markers
that break my build" issue.



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

 Makefile.rules |   18 ++
 1 files changed, 14 insertions(+), 4 deletions(-)


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.341 llvm/Makefile.rules:1.342
--- llvm/Makefile.rules:1.341   Mon Feb 13 22:27:15 2006
+++ llvm/Makefile.rules Mon Feb 13 23:12:00 2006
@@ -1204,6 +1204,8 @@
 %.c: %.l
 %.cpp: %.l
 
+all:: $(LexFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs)
+
 # Note the extra sed filtering here, used to cut down on the warnings emited 
 # by GCC.  The last line is a gross hack to work around flex aparently not 
 # being able to resize the buffer on a large token input.  Currently, for 
@@ -1217,10 +1219,18 @@
$(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
$(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
  > $(PROJ_SRC_DIR)/$*.cpp
-   $(Echo) "*** DON'T FORGET TO CHECK IN $*.cpp (generated file)"
+
+# IFF the .l file has changed since it was last checked into CVS, copy the .l
+# file to .l.cvs and the generated .cpp file to .cpp.cvs.  We use this 
mechanism
+# so that people without flex can build LLVM by copying the .cvs files to the 
+# source location and building them.
+$(LexFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs): \
+$(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
+   $(Verb) $(CMP) -s $@ $< || \
+  ($(CP) $< $@; $(CP) $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs)
 
-LexObjs := $(patsubst %.l,$(ObjDir)/%.o,$(LexFiles))
-$(LexObjs): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
+$(LexFiles:%.l=$(ObjDir)/%.o) : \
+$(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
 
 clean-local::
-$(Verb) $(RM) -f $(LexOutput)
@@ -1323,7 +1333,7 @@
 
 # Get the list of dependency files
 DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))
-DependFiles := $(patsubst %,$(PROJ_OBJ_DIR)/$(BuildMode)/%.d,$(DependFiles))
+DependFiles := $(DependFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
 
 -include /dev/null $(DependFiles)
 



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


[llvm-commits] CVS: llvm/Makefile.rules

2006-02-13 Thread Chris Lattner


Changes in directory llvm:

Makefile.rules updated: 1.340 -> 1.341
---
Log message:

Wrap a couple more long lines


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

 Makefile.rules |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.340 llvm/Makefile.rules:1.341
--- llvm/Makefile.rules:1.340   Mon Feb 13 22:25:54 2006
+++ llvm/Makefile.rules Mon Feb 13 22:27:15 2006
@@ -10,7 +10,7 @@
 # This file is included by all of the LLVM makefiles.  For details on how to 
use
 # it properly, please see the document MakefileGuide.html in the docs 
directory.
 #
-#===---
+#===---#
 
 

 # TARGETS: Define standard targets that can be invoked
@@ -961,13 +961,13 @@
 
 $(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
$(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
-   $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< 
-o $@ ; \
+   $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< 
-o $@ ;\
then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
 
 $(ObjDir)/%.lo $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
$(Echo) "Compiling $*.cc for $(BuildMode) build (PIC)"
-   $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< 
-o $@ ; \
+   $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< 
-o $@ ;\
then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
 
@@ -1530,7 +1530,8 @@
done
$(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
  $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
- $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o -name .svn \) 
-print` ;\
+ $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
+  -name .svn \) -print` ;\
  $(MAKE) dist-hook ; \
  $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
-o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \



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


[llvm-commits] CVS: llvm/Makefile.rules

2006-02-13 Thread Chris Lattner


Changes in directory llvm:

Makefile.rules updated: 1.339 -> 1.340
---
Log message:

wrap long lines


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

 Makefile.rules |   25 -
 1 files changed, 16 insertions(+), 9 deletions(-)


Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.339 llvm/Makefile.rules:1.340
--- llvm/Makefile.rules:1.339   Fri Jan 27 16:13:12 2006
+++ llvm/Makefile.rules Mon Feb 13 22:25:54 2006
@@ -930,7 +930,8 @@
$(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
$(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
   $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
-   $(Echo) === Finished Linking $(BuildMode) Executable $(TOOLNAME) 
$(StripWarnMsg) 
+   $(Echo) === Finished Linking $(BuildMode) Executable $(TOOLNAME) \
+  $(StripWarnMsg) 
 
 DestTool = $(PROJ_bindir)/$(TOOLNAME)
 
@@ -1021,19 +1022,22 @@
 
 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
$(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
-   $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" $< 
-o $@ -S -emit-llvm ; \
+   $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" \
+  $< -o $@ -S -emit-llvm ; \
then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
 
 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
$(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
-   $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" $< 
-o $@ -S -emit-llvm ; \
+   $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" \
+  $< -o $@ -S -emit-llvm ; \
then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
 
 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
$(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
-   $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" $< -o 
$@ -S -emit-llvm ; \
+   $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" \
+$< -o $@ -S -emit-llvm ; \
then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \
else $(RM) -f "$(ObjDir)/$*.BCCd"; exit 1; fi
 
@@ -1109,7 +1113,9 @@
 
 ifdef TARGET
 
-TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) 
$(LLVM_SRC_ROOT)/lib/Target/Target.td 
$(LLVM_SRC_ROOT)/lib/Target/TargetSelectionDAG.td)
+TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
+   $(LLVM_SRC_ROOT)/lib/Target/Target.td \
+   $(LLVM_SRC_ROOT)/lib/Target/TargetSelectionDAG.td)
 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
@@ -1578,11 +1584,12 @@
$(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
  cd $(PROJ_SRC_ROOT)/include && \
$(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
- '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' -o -name 
'*.in' ')' \
- -print ')' | grep -v CVS | sed 's#^#$(PROJ_includedir)/#'` ; \
+ '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' \
+-o -name '*.in' ')' -print ')' | \
+grep -v CVS | sed 's#^#$(PROJ_includedir)/#'` ; \
  cd $(PROJ_SRC_ROOT)/include && \
-   $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name 
'*.in' -print ')' \
-   | sed 's#\.in$$##;s#^#$(PROJ_includedir)/#'` ; \
+   $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name 
'*.in' \
+  -print ')' | sed 's#\.in$$##;s#^#$(PROJ_includedir)/#'` ; \
fi
 
 endif



___
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

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

LoopUnswitch.cpp updated: 1.17 -> 1.18
---
Log message:

Use statistics to keep track of what flavors of loops we are unswitching


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

 LoopUnswitch.cpp |   26 +++---
 1 files changed, 19 insertions(+), 7 deletions(-)


Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.17 
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.18
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.17Fri Feb 10 18:43:37 2006
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Mon Feb 13 19:01:41 2006
@@ -44,7 +44,11 @@
 using namespace llvm;
 
 namespace {
-  Statistic<> NumUnswitched("loop-unswitch", "Number of loops unswitched");
+  Statistic<> NumBranches("loop-unswitch", "Number of branches unswitched");
+  Statistic<> NumSwitches("loop-unswitch", "Number of switches unswitched");
+  Statistic<> NumSelects ("loop-unswitch", "Number of selects unswitched");
+  Statistic<> NumTrivial ("loop-unswitch",
+  "Number of unswitches that are trivial");
   cl::opt
   Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"),
 cl::init(10), cl::Hidden);
@@ -267,8 +271,10 @@
 // See if this, or some part of it, is loop invariant.  If so, we can
 // unswitch on it if we desire.
 Value *LoopCond = FindLIVLoopCondition(BI->getCondition(), L, Changed);
-if (LoopCond && UnswitchIfProfitable(LoopCond, ConstantBool::True, L))
+if (LoopCond && UnswitchIfProfitable(LoopCond, ConstantBool::True, L)) 
{
+  ++NumBranches;
   return true;
+}
   }  
 } else if (SwitchInst *SI = dyn_cast(TI)) {
   Value *LoopCond = FindLIVLoopCondition(SI->getCondition(), L, Changed);
@@ -276,8 +282,10 @@
 // Find a value to unswitch on:
 // FIXME: this should chose the most expensive case!
 Constant *UnswitchVal = SI->getCaseValue(1);
-if (UnswitchIfProfitable(LoopCond, UnswitchVal, L))
+if (UnswitchIfProfitable(LoopCond, UnswitchVal, L)) {
+  ++NumSwitches;
   return true;
+}
   }
 }
 
@@ -286,8 +294,10 @@
  BBI != E; ++BBI)
   if (SelectInst *SI = dyn_cast(BBI)) {
 Value *LoopCond = FindLIVLoopCondition(SI->getCondition(), L, Changed);
-if (LoopCond && UnswitchIfProfitable(LoopCond, ConstantBool::True, L))
+if (LoopCond && UnswitchIfProfitable(LoopCond, ConstantBool::True, L)) 
{
+  ++NumSelects;
   return true;
+}
   }
   }
 
@@ -331,7 +341,6 @@
   } else {
 VersionLoop(LoopCond, Val, L, NewLoop1, NewLoop2);
   }
-  ++NumUnswitched;
   
   //std::cerr << "AFTER:\n"; LI->dump();
   
@@ -462,6 +471,7 @@
   // at least eliminate the old branch.
   RewriteLoopBodyWithConditionConstant(L, Cond, ConstantBool::get(EnterOnCond),
true);
+  ++NumTrivial;
 }
 
 
@@ -497,6 +507,7 @@
ExitBlocks.end());
   // Split all of the edges from inside the loop to their exit blocks.  This
   // unswitching trivial: no phi nodes to update.
+  unsigned NumBlocks = L->getBlocks().size();
   for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) {
 BasicBlock *ExitBlock = ExitBlocks[i];
 std::vector Preds(pred_begin(ExitBlock), pred_end(ExitBlock));
@@ -525,8 +536,9 @@
   NewBlocks.reserve(LoopBlocks.size());
   std::map ValueMap;
   for (unsigned i = 0, e = LoopBlocks.size(); i != e; ++i) {
-NewBlocks.push_back(CloneBasicBlock(LoopBlocks[i], ValueMap, ".us", F));
-ValueMap[LoopBlocks[i]] = NewBlocks.back();  // Keep the BB mapping.
+BasicBlock *New = CloneBasicBlock(LoopBlocks[i], ValueMap, ".us", F);
+NewBlocks.push_back(New);
+ValueMap[LoopBlocks[i]] = New;  // Keep the BB mapping.
   }
 
   // Splice the newly inserted blocks into the function right before the



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


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

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.302 -> 1.303
---
Log message:

Fix a latent bug in the call sequence handling stuff.  Some targets (e.g. x86)
create these nodes with flag results.  Remember that we legalized them.


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

 LegalizeDAG.cpp |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.302 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.303
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.302 Mon Feb 13 03:18:02 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Mon Feb 13 18:55:02 2006
@@ -729,8 +729,10 @@
 }
 
 // Remember that the CALLSEQ_START is legalized.
-AddLegalizedOperand(Op, Result);
-
+AddLegalizedOperand(Op.getValue(0), Result);
+if (Node->getNumValues() == 2)// If this has a flag result, remember 
it.
+  AddLegalizedOperand(Op.getValue(1), Result.getValue(1));
+
 // Now that the callseq_start and all of the non-call nodes above this call
 // sequence have been legalized, legalize the call itself.  During this 
 // process, no libcalls can/will be inserted, guaranteeing that no calls
@@ -778,10 +780,15 @@
 Result = DAG.UpdateNodeOperands(Result, Ops);
   }
 }
-assert(IsLegalizingCall && "imbalance between START/END?");
+assert(IsLegalizingCall && "Call sequence imbalance between start/end?");
 // This finishes up call legalization.
 IsLegalizingCall = false;
-break;
+
+// If the CALLSEQ_END node has a flag, remember that we legalized it.
+AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
+if (Node->getNumValues() == 2)
+  AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
+return Result.getValue(Op.ResNo);
   case ISD::DYNAMIC_STACKALLOC: {
 Tmp1 = LegalizeOp(Node->getOperand(0));  // Legalize the chain.
 Tmp2 = LegalizeOp(Node->getOperand(1));  // Legalize the size.



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


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

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.434 -> 1.435
---
Log message:

Implement Instcombine/and.ll:test34


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

 InstructionCombining.cpp |   12 
 1 files changed, 12 insertions(+)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.434 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.435
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.434   Mon Feb 13 
16:41:07 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Feb 13 17:07:23 2006
@@ -2439,6 +2439,18 @@
 InsertNewInstBefore(Or, I);
 return BinaryOperator::createNot(Or);
   }
+  
+  {
+Value *A = 0, *B = 0;
+ConstantInt *C1 = 0, *C2 = 0;
+if (match(Op0, m_Or(m_Value(A), m_Value(B
+  if (A == Op1 || B == Op1)// (A | ?) & A  --> A
+return ReplaceInstUsesWith(I, Op1);
+if (match(Op1, m_Or(m_Value(A), m_Value(B
+  if (A == Op0 || B == Op0)// A & (A | ?)  --> A
+return ReplaceInstUsesWith(I, Op0);
+  }
+  
 
   if (SetCondInst *RHS = dyn_cast(Op1)) {
 // (setcc1 A, B) & (setcc2 A, B) --> (setcc3 A, B)



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


[llvm-commits] CVS: llvm/include/llvm/Support/PatternMatch.h

2006-02-13 Thread Chris Lattner


Changes in directory llvm/include/llvm/Support:

PatternMatch.h updated: 1.6 -> 1.7
---
Log message:

Fix typo that caused build failures for things trying to use m_Or.


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

 PatternMatch.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Support/PatternMatch.h
diff -u llvm/include/llvm/Support/PatternMatch.h:1.6 
llvm/include/llvm/Support/PatternMatch.h:1.7
--- llvm/include/llvm/Support/PatternMatch.h:1.6Tue Sep 27 01:38:05 2005
+++ llvm/include/llvm/Support/PatternMatch.hMon Feb 13 17:06:39 2006
@@ -130,8 +130,8 @@
 }
 
 template
-inline BinaryOp_match m_Or(const LHS &L,
-   const RHS &R) {
+inline BinaryOp_match m_Or(const LHS &L,
+  const RHS &R) {
   return BinaryOp_match(L, R);
 }
 



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


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

2006-02-13 Thread Chris Lattner


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

and.ll updated: 1.29 -> 1.30
---
Log message:

new testcase


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

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


Index: llvm/test/Regression/Transforms/InstCombine/and.ll
diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.29 
llvm/test/Regression/Transforms/InstCombine/and.ll:1.30
--- llvm/test/Regression/Transforms/InstCombine/and.ll:1.29 Sun May  8 
23:54:18 2005
+++ llvm/test/Regression/Transforms/InstCombine/and.ll  Mon Feb 13 17:07:02 2006
@@ -220,3 +220,9 @@
 ret uint %tmp.13
 }
 
+int %test34(int %A, int %B) {
+%tmp.2 = or int %B, %A
+%tmp.4 = and int %tmp.2, %B
+ret int %tmp.4
+}
+



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


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

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.433 -> 1.434
---
Log message:

If any of the sign extended bits are demanded, the input sign bit is demanded
for a sign extension.

This fixes InstCombine/2006-02-13-DemandedMiscompile.ll and Ptrdist/bc.



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

 InstructionCombining.cpp |   12 +---
 1 files changed, 9 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.433 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.434
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.433   Mon Feb 13 
00:09:08 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Feb 13 16:41:07 2006
@@ -889,15 +889,21 @@
   KnownZero |= NewBits;
 } else {
   // Sign extension.
-  if (SimplifyDemandedBits(I->getOperand(0),
-   DemandedMask & SrcTy->getIntegralTypeMask(),
+  uint64_t InSignBit = 1ULL << (SrcTy->getPrimitiveSizeInBits()-1);
+  int64_t InputDemandedBits = DemandedMask & SrcTy->getIntegralTypeMask();
+
+  // If any of the sign extended bits are demanded, we know that the sign
+  // bit is demanded.
+  if (NewBits & DemandedMask)
+InputDemandedBits |= InSignBit;
+  
+  if (SimplifyDemandedBits(I->getOperand(0), InputDemandedBits,
KnownZero, KnownOne, Depth+1))
 return true;
   assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); 
   
   // If the sign bit of the input is known set or clear, then we know the
   // top bits of the result.
-  uint64_t InSignBit = 1ULL << (SrcTy->getPrimitiveSizeInBits()-1);
 
   // If the input sign bit is known zero, or if the NewBits are not 
demanded
   // convert this into a zero extension.



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


[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll

2006-02-13 Thread Chris Lattner


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

2006-02-13-DemandedMiscompile.ll added (r1.1)
---
Log message:

testcase reduced from Ptrdist/bc that is miscompiled by recent instcombine 
changes.


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

 2006-02-13-DemandedMiscompile.ll |9 +
 1 files changed, 9 insertions(+)


Index: 
llvm/test/Regression/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll
diff -c /dev/null 
llvm/test/Regression/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll:1.1
*** /dev/null   Mon Feb 13 16:32:00 2006
--- 
llvm/test/Regression/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll
Mon Feb 13 16:31:50 2006
***
*** 0 
--- 1,9 
+ ; RUN: llvm-as < %s | opt -instcombine -disable-output &&
+ ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep undef
+ 
+ int %test(sbyte %A) {
+   %B = cast sbyte %A to int
+   %C = shr int %B, ubyte 8
+   ret int %C
+ }
+ 



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


[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.252 -> 1.253
---
Log message:

Another hack due to allowing multiple symbols with the same name.


---
Diffs of the changes:  (+52 -11)

 Writer.cpp |   63 ++---
 1 files changed, 52 insertions(+), 11 deletions(-)


Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.252 
llvm/lib/Target/CBackend/Writer.cpp:1.253
--- llvm/lib/Target/CBackend/Writer.cpp:1.252   Fri Jan 20 14:43:57 2006
+++ llvm/lib/Target/CBackend/Writer.cpp Mon Feb 13 16:22:42 2006
@@ -47,10 +47,11 @@
   // Register the target.
   RegisterTarget X("c", "  C backend");
 
-  /// NameAllUsedStructs - This pass inserts names for any unnamed structure
-  /// types that are used by the program.
+  /// CBackendNameAllUsedStructsAndMergeFunctions - This pass inserts names for
+  /// any unnamed structure types that are used by the program, and merges
+  /// external functions with the same name.
   ///
-  class CBackendNameAllUsedStructs : public ModulePass {
+  class CBackendNameAllUsedStructsAndMergeFunctions : public ModulePass {
 void getAnalysisUsage(AnalysisUsage &AU) const {
   AU.addRequired();
 }
@@ -119,7 +120,6 @@
   private :
 void lowerIntrinsics(Function &F);
 
-bool nameAllUsedStructureTypes(Module &M);
 void printModule(Module *M);
 void printModuleTypes(const SymbolTable &ST);
 void printContainedStructs(const Type *Ty, std::set &);
@@ -224,7 +224,7 @@
 /// the program, and removes names from structure types that are not used by 
the
 /// program.
 ///
-bool CBackendNameAllUsedStructs::runOnModule(Module &M) {
+bool CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(Module &M) {
   // Get a set of types that are used by the program...
   std::set UT = getAnalysis().getTypes();
 
@@ -256,6 +256,44 @@
 ++RenameCounter;
   Changed = true;
 }
+  
+  
+  // Loop over all external functions and globals.  If we have two with
+  // identical names, merge them.
+  // FIXME: This code should disappear when we don't allow values with the same
+  // names when they have different types!
+  std::map ExtSymbols;
+  for (Module::iterator I = M.begin(), E = M.end(); I != E;) {
+Function *GV = I++;
+if (GV->isExternal() && GV->hasName()) {
+  std::pair::iterator, bool> X
+= ExtSymbols.insert(std::make_pair(GV->getName(), GV));
+  if (!X.second) {
+// Found a conflict, replace this global with the previous one.
+GlobalValue *OldGV = X.first->second;
+GV->replaceAllUsesWith(ConstantExpr::getCast(OldGV, GV->getType()));
+GV->eraseFromParent();
+Changed = true;
+  }
+}
+  }
+  // Do the same for globals.
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+   I != E;) {
+GlobalVariable *GV = I++;
+if (GV->isExternal() && GV->hasName()) {
+  std::pair::iterator, bool> X
+= ExtSymbols.insert(std::make_pair(GV->getName(), GV));
+  if (!X.second) {
+// Found a conflict, replace this global with the previous one.
+GlobalValue *OldGV = X.first->second;
+GV->replaceAllUsesWith(ConstantExpr::getCast(OldGV, GV->getType()));
+GV->eraseFromParent();
+Changed = true;
+  }
+}
+  }
+  
   return Changed;
 }
 
@@ -845,7 +883,8 @@
   << "#define LLVM_NANSF(NanStr) __builtin_nansf(NanStr) /* Float */\n"
   << "#define LLVM_INF   __builtin_inf() /* Double */\n"
   << "#define LLVM_INFF  __builtin_inff()/* Float */\n"
-  << "#define LLVM_PREFETCH(addr,rw,locality)  
__builtin_prefetch(addr,rw,locality)\n"
+  << "#define LLVM_PREFETCH(addr,rw,locality) "
+  "__builtin_prefetch(addr,rw,locality)\n"
   << "#else\n"
   << "#define LLVM_NAN(NanStr)   ((double)0.0)   /* Double */\n"
   << "#define LLVM_NANF(NanStr)  0.0F/* Float */\n"
@@ -905,7 +944,8 @@
   // Global variable declarations...
   if (!M.global_empty()) {
 Out << "\n/* External Global Variable Declarations */\n";
-for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I 
!= E; ++I) {
+for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+ I != E; ++I) {
   if (I->hasExternalLinkage()) {
 Out << "extern ";
 printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
@@ -935,7 +975,8 @@
   // Output the global variable declarations
   if (!M.global_empty()) {
 Out << "\n\n/* Global Variable Declarations */\n";
-for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I 
!= E; ++I)
+for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+ I != E; ++I)
   if (!I->isExternal()) {
 if (I->hasInternalLinkage())
   Out << "static ";
@@ -954,7 +995,8 @@

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

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/VMCore:

Mangler.cpp updated: 1.26 -> 1.27
---
Log message:

Another work around for the 'symbols with different types can have the same 
name' issue.


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

 Mangler.cpp |4 
 1 files changed, 4 insertions(+)


Index: llvm/lib/VMCore/Mangler.cpp
diff -u llvm/lib/VMCore/Mangler.cpp:1.26 llvm/lib/VMCore/Mangler.cpp:1.27
--- llvm/lib/VMCore/Mangler.cpp:1.26Mon Nov 14 19:32:03 2005
+++ llvm/lib/VMCore/Mangler.cpp Mon Feb 13 15:43:26 2006
@@ -161,6 +161,10 @@
 if (GV->hasExternalLinkage() && !ExistingValue->hasExternalLinkage()) {
   MangledGlobals.insert(ExistingValue);
   ExistingValue = GV;
+} else if (GV->hasExternalLinkage() && 
ExistingValue->hasExternalLinkage()&&
+   GV->isExternal() && ExistingValue->isExternal()) {
+  // If the two globals both have external inkage, and are both external,
+  // don't mangle either of them, we just have some silly type mismatch.
 } else {
   // Otherwise, mangle GV
   MangledGlobals.insert(GV);



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


[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp

2006-02-13 Thread Andrew Lenharth


Changes in directory llvm/lib/Target/Alpha:

AlphaISelDAGToDAG.cpp updated: 1.34 -> 1.35
---
Log message:

improved zap discovery

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

 AlphaISelDAGToDAG.cpp |   33 +
 1 files changed, 33 insertions(+)


Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.34 
llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.35
--- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.34Thu Feb  9 01:17:49 2006
+++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Mon Feb 13 12:52:29 2006
@@ -363,6 +363,39 @@
 }
 break;
 
+  case ISD::AND: {
+ConstantSDNode* SC;
+ConstantSDNode* MC;
+if (N->getOperand(0).getOpcode() == ISD::SRL &&
+   (MC = dyn_cast(N->getOperand(1))) &&
+   (SC = dyn_cast(N->getOperand(0).getOperand(1
+  {
+   uint64_t sval = SC->getValue();
+   uint64_t mval = MC->getValue();
+   if (get_zapImm(mval)) //the result is a zap, let the autogened stuff 
deal
+ break;
+   // given mask X, and shift S, we want to see if there is any zap in the 
mask
+   // if we play around with the botton S bits
+   uint64_t dontcare = (~0ULL) >> (64 - sval);
+   uint64_t mask = mval << sval;
+
+   if (get_zapImm(mask | dontcare))
+ mask = mask | dontcare;
+
+   if (get_zapImm(mask)) {
+ SDOperand Src;
+ Select(Src, N->getOperand(0).getOperand(0));
+ SDOperand Z = 
+   SDOperand(CurDAG->getTargetNode(Alpha::ZAPNOTi, MVT::i64, Src, 
+   getI64Imm(get_zapImm(mask))), 0);
+ Result = SDOperand(CurDAG->getTargetNode(Alpha::SRL, MVT::i64, Z, 
+  getI64Imm(sval)), 0);
+ return;
+   }
+  }
+break;
+  }
+
   }
 
   SelectCode(Result, Op);



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


[llvm-commits] CVS: llvm/test/Regression/CodeGen/Alpha/srl_and.ll

2006-02-13 Thread Andrew Lenharth


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

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

test for improved zap discovery

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

 srl_and.ll |   10 ++
 1 files changed, 10 insertions(+)


Index: llvm/test/Regression/CodeGen/Alpha/srl_and.ll
diff -c /dev/null llvm/test/Regression/CodeGen/Alpha/srl_and.ll:1.1
*** /dev/null   Mon Feb 13 12:52:11 2006
--- llvm/test/Regression/CodeGen/Alpha/srl_and.ll   Mon Feb 13 12:52:01 2006
***
*** 0 
--- 1,10 
+ ; Make sure this testcase codegens to the zapnot instruction
+ ; RUN: llvm-as < %s | llc -march=alpha | grep 'zapnot'
+ 
+ ulong %foo(ulong %y) {
+ entry:
+ %tmp = shr ulong %y, ubyte 3;  [#uses=1]
+ %tmp2 = and ulong %tmp, 8191;  [#uses=1]
+ ret ulong %tmp2
+ }
+ 



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


[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineDebugInfo.h

2006-02-13 Thread Jim Laskey


Changes in directory llvm/include/llvm/CodeGen:

MachineDebugInfo.h updated: 1.15 -> 1.16
---
Log message:

Sync up the tag numbers with gcc4.


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

 MachineDebugInfo.h |   10 +-
 1 files changed, 1 insertion(+), 9 deletions(-)


Index: llvm/include/llvm/CodeGen/MachineDebugInfo.h
diff -u llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.15 
llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.16
--- llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.15   Mon Feb 13 06:50:38 2006
+++ llvm/include/llvm/CodeGen/MachineDebugInfo.hMon Feb 13 10:56:43 2006
@@ -58,17 +58,10 @@
   DIInvalid = ~0U,  // Invalid result indicator.
   
   // DebugInfoDesc type identifying tags.
-  // FIXME - Change over with gcc4.
   DI_TAG_anchor = 0,
-#if 1
-  DI_TAG_compile_unit = DW_TAG_compile_unit,
-  DI_TAG_global_variable = DW_TAG_variable,
-  DI_TAG_subprogram = DW_TAG_subprogram
-#else
   DI_TAG_compile_unit,
   DI_TAG_global_variable,
   DI_TAG_subprogram
-#endif
 };
 
 
//===--===//
@@ -78,8 +71,7 @@
 public:
   DIVisitor() {}
   virtual ~DIVisitor() {}
-  
-  
+
   /// ApplyToFields - Target the visitor to each field of the debug information
   /// descriptor.
   void ApplyToFields(DebugInfoDesc *DD);



___
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

2006-02-13 Thread Jim Laskey


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.151 -> 1.152
---
Log message:

Rename to better reflect usage (current and planned.)


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

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.151 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.152
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.151Fri Feb 10 
19:01:30 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Mon Feb 13 06:50:39 2006
@@ -954,7 +954,7 @@
   // column
   Ops.push_back(getValue(I.getOperand(3)));
 
-  DebugInfoDesc *DD = DebugInfo->Deserialize(I.getOperand(4));
+  DebugInfoDesc *DD = DebugInfo->getDescFor(I.getOperand(4));
   assert(DD && "Not a debug information descriptor");
   CompileUnitDesc *CompileUnit = dyn_cast(DD);
   assert(CompileUnit && "Not a compile unit");



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


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

2006-02-13 Thread Jim Laskey


Changes in directory llvm/lib/CodeGen:

MachineDebugInfo.cpp updated: 1.13 -> 1.14
---
Log message:

Rename to better reflect usage (current and planned.)


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

 MachineDebugInfo.cpp |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.13 
llvm/lib/CodeGen/MachineDebugInfo.cpp:1.14
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.13  Fri Feb 10 19:01:30 2006
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp   Mon Feb 13 06:50:38 2006
@@ -887,9 +887,10 @@
   return false;
 }
 
-/// Deserialize - Convert a Value to a debug information descriptor.
+/// getDescFor - Convert a Value to a debug information descriptor.
 ///
-DebugInfoDesc *MachineDebugInfo::Deserialize(Value *V) {
+// FIXME - use new Value type when available.
+DebugInfoDesc *MachineDebugInfo::getDescFor(Value *V) {
   return DR.Deserialize(V);
 }
 



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


[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineDebugInfo.h

2006-02-13 Thread Jim Laskey


Changes in directory llvm/include/llvm/CodeGen:

MachineDebugInfo.h updated: 1.14 -> 1.15
---
Log message:

Rename to better reflect usage (current and planned.)


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

 MachineDebugInfo.h |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/CodeGen/MachineDebugInfo.h
diff -u llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.14 
llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.15
--- llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.14   Fri Feb 10 19:01:30 2006
+++ llvm/include/llvm/CodeGen/MachineDebugInfo.hMon Feb 13 06:50:38 2006
@@ -584,9 +584,10 @@
   ///
   bool doFinalization();
   
-  /// Deserialize - Convert a Value to a debug information descriptor.
+  /// getDescFor - Convert a Value to a debug information descriptor.
   ///
-  DebugInfoDesc *Deserialize(Value *V);
+  // FIXME - use new Value type when available.
+  DebugInfoDesc *getDescFor(Value *V);
   
   /// Verify - Verify that a Value is debug information descriptor.
   ///



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


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

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

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

Completely rewrite libcall insertion by the legalizer, providing the 
following handy-dandy properties:

1. it is always correct now
2. it is much faster than before
3. it is easier to understand

This implementation builds off of the recent simplifications of the 
legalizer that made it single-pass instead of iterative.

This fixes JM/lencod, JM/ldecod, and 
CodeGen/Generic/2006-02-12-InsertLibcall.ll (at least on PPC).



---
Diffs of the changes:  (+217 -198)

 LegalizeDAG.cpp |  415 +---
 1 files changed, 217 insertions(+), 198 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.301 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.302
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.301 Wed Feb  1 13:05:15 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Mon Feb 13 03:18:02 2006
@@ -41,12 +41,24 @@
   TargetLowering &TLI;
   SelectionDAG &DAG;
 
+  // Libcall insertion helpers.
+  
+  /// LastCALLSEQ_END - This keeps track of the CALLSEQ_END node that has been
+  /// legalized.  We use this to ensure that calls are properly serialized
+  /// against each other, including inserted libcalls.
+  SDOperand LastCALLSEQ_END;
+  
+  /// IsLegalizingCall - This member is used *only* for purposes of providing
+  /// helpful assertions that a libcall isn't created while another call is 
+  /// being legalized (which could lead to non-serialized call sequences).
+  bool IsLegalizingCall;
+  
   enum LegalizeAction {
 Legal,  // The target natively supports this operation.
 Promote,// This operation should be executed in a larger type.
 Expand, // Try to expand this to other ops, otherwise use a libcall.
   };
-
+  
   /// ValueTypeActions - This is a bitvector that contains two bits for each
   /// value type, where the two bits correspond to the LegalizeAction enum.
   /// This can be queried with "getTypeAction(VT)".
@@ -106,6 +118,8 @@
   void ExpandOp(SDOperand O, SDOperand &Lo, SDOperand &Hi);
   SDOperand PromoteOp(SDOperand O);
 
+  bool LegalizeAllNodesNotLeadingTo(SDNode *N, SDNode *Dest);
+
   void LegalizeSetCCOperands(SDOperand &LHS, SDOperand &RHS, SDOperand &CC);
 
   SDOperand ExpandLibCall(const char *Name, SDNode *Node,
@@ -128,7 +142,6 @@
SDOperand &Lo, SDOperand &Hi);
   void ExpandShiftParts(unsigned NodeOp, SDOperand Op, SDOperand Amt,
 SDOperand &Lo, SDOperand &Hi);
-  void SpliceCallInto(const SDOperand &CallResult, SDNode *OutChain);
 
   SDOperand getIntPtrConstant(uint64_t Val) {
 return DAG.getConstant(Val, TLI.getPointerTy());
@@ -174,6 +187,9 @@
 
 
 void SelectionDAGLegalize::LegalizeDAG() {
+  LastCALLSEQ_END = DAG.getEntryNode();
+  IsLegalizingCall = false;
+  
   // The legalize process is inherently a bottom-up recursive process (users
   // legalize their uses before themselves).  Given infinite stack space, we
   // could just start legalizing on the root and traverse the whole graph.  In
@@ -230,6 +246,107 @@
   DAG.RemoveDeadNodes(OldRoot.Val);
 }
 
+
+/// FindCallEndFromCallStart - Given a chained node that is part of a call
+/// sequence, find the CALLSEQ_END node that terminates the call sequence.
+static SDNode *FindCallEndFromCallStart(SDNode *Node) {
+  if (Node->getOpcode() == ISD::CALLSEQ_END)
+return Node;
+  if (Node->use_empty())
+return 0;   // No CallSeqEnd
+  
+  // The chain is usually at the end.
+  SDOperand TheChain(Node, Node->getNumValues()-1);
+  if (TheChain.getValueType() != MVT::Other) {
+// Sometimes it's at the beginning.
+TheChain = SDOperand(Node, 0);
+if (TheChain.getValueType() != MVT::Other) {
+  // Otherwise, hunt for it.
+  for (unsigned i = 1, e = Node->getNumValues(); i != e; ++i)
+if (Node->getValueType(i) == MVT::Other) {
+  TheChain = SDOperand(Node, i);
+  break;
+}
+  
+  // Otherwise, we walked into a node without a chain.  
+  if (TheChain.getValueType() != MVT::Other)
+return 0;
+}
+  }
+  
+  for (SDNode::use_iterator UI = Node->use_begin(),
+   E = Node->use_end(); UI != E; ++UI) {
+
+// Make sure to only follow users of our token chain.
+SDNode *User = *UI;
+for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i)
+  if (User->getOperand(i) == TheChain)
+if (SDNode *Result = FindCallEndFromCallStart(User))
+  return Result;
+  }
+  return 0;
+}
+
+/// FindCallStartFromCallEnd - Given a chained node that is part of a call 
+/// sequence, find the CALLSEQ_START node that initiates the call sequence.
+static SDNode *FindCallStartFromCallEnd(SDNode *Node) {
+  assert(Node && "Didn't find callseq_start for a call??");
+  if (Node->getOpcode() == ISD::CALLSEQ_START) return Node;
+  

[llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelLowering.cpp

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/Target/IA64:

IA64ISelLowering.cpp updated: 1.33 -> 1.34
---
Log message:

Switch targets over to using SelectionDAG::getCALLSEQ_START to create
CALLSEQ_START nodes.


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

 IA64ISelLowering.cpp |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/lib/Target/IA64/IA64ISelLowering.cpp
diff -u llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.33 
llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.34
--- llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.33  Wed Feb  1 01:19:44 2006
+++ llvm/lib/Target/IA64/IA64ISelLowering.cpp   Mon Feb 13 03:00:43 2006
@@ -323,8 +323,7 @@
   //assert(NumBytes==((NumBytes+15) & ~15) && "stack frame not 16-byte 
aligned!");
   NumBytes = (NumBytes+15) & ~15;
   
-  Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
-DAG.getConstant(NumBytes, getPointerTy()));
+  Chain = DAG.getCALLSEQ_START(Chain,DAG.getConstant(NumBytes, 
getPointerTy()));
 
   SDOperand StackPtr, NullSV;
   std::vector Stores;



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

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.79 -> 1.80
---
Log message:

Switch targets over to using SelectionDAG::getCALLSEQ_START to create
CALLSEQ_START nodes.


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

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


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.79 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.80
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.79Tue Feb  7 02:38:37 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Feb 13 03:00:43 2006
@@ -382,8 +382,7 @@
 
   if (Args.empty()) {
 // Save zero bytes.
-Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
-DAG.getConstant(0, getPointerTy()));
+Chain = DAG.getCALLSEQ_START(Chain, DAG.getConstant(0, getPointerTy()));
   } else {
 for (unsigned i = 0, e = Args.size(); i != e; ++i)
   switch (getValueType(Args[i].second)) {
@@ -401,8 +400,8 @@
 break;
   }
 
-Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
-DAG.getConstant(NumBytes, getPointerTy()));
+Chain = DAG.getCALLSEQ_START(Chain,
+ DAG.getConstant(NumBytes, getPointerTy()));
 
 // Arguments go on the stack in reverse order, as specified by the ABI.
 unsigned ArgOffset = 0;
@@ -846,8 +845,7 @@
   if ((NumBytes & 7) == 0)
 NumBytes += 4;
 
-  Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
-  DAG.getConstant(NumBytes, getPointerTy()));
+  Chain = DAG.getCALLSEQ_START(Chain,DAG.getConstant(NumBytes, 
getPointerTy()));
 
   // Arguments go on the stack in reverse order, as specified by the ABI.
   unsigned ArgOffset = 0;



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


[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelLowering.cpp

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/Target/Alpha:

AlphaISelLowering.cpp updated: 1.37 -> 1.38
---
Log message:

Switch targets over to using SelectionDAG::getCALLSEQ_START to create
CALLSEQ_START nodes.


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

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


Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.37 
llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.38
--- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.37Wed Feb  1 01:19:44 2006
+++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Mon Feb 13 03:00:43 2006
@@ -327,8 +327,8 @@
   if (Args.size() > 6)
 NumBytes = (Args.size() - 6) * 8;
 
-  Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
-  DAG.getConstant(NumBytes, getPointerTy()));
+  Chain = DAG.getCALLSEQ_START(Chain,
+   DAG.getConstant(NumBytes, getPointerTy()));
   std::vector args_to_use;
   for (unsigned i = 0, e = Args.size(); i != e; ++i)
   {



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


[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/Target/Sparc:

SparcISelDAGToDAG.cpp updated: 1.83 -> 1.84
---
Log message:

Switch targets over to using SelectionDAG::getCALLSEQ_START to create
CALLSEQ_START nodes.


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

 SparcISelDAGToDAG.cpp |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp
diff -u llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.83 
llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.84
--- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.83Fri Feb 10 01:35:42 2006
+++ llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Mon Feb 13 03:00:43 2006
@@ -481,8 +481,7 @@
   // Keep stack frames 8-byte aligned.
   ArgsSize = (ArgsSize+7) & ~7;
 
-  Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
-  DAG.getConstant(ArgsSize, getPointerTy()));
+  Chain = DAG.getCALLSEQ_START(Chain,DAG.getConstant(ArgsSize, 
getPointerTy()));
   
   SDOperand StackPtr, NullSV;
   std::vector Stores;



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


[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp

2006-02-13 Thread Chris Lattner


Changes in directory llvm/lib/Target/PowerPC:

PPCISelLowering.cpp updated: 1.86 -> 1.87
---
Log message:

Switch to using getCALLSEQ_START instead of using our own creation calls


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

 PPCISelLowering.cpp |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.86 
llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.87
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.86Tue Feb  7 14:16:30 2006
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Feb 13 02:55:29 2006
@@ -730,8 +730,8 @@
   unsigned NumBytes = 24;
   
   if (Args.empty()) {
-Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
-DAG.getConstant(NumBytes, getPointerTy()));
+Chain = DAG.getCALLSEQ_START(Chain,
+ DAG.getConstant(NumBytes, getPointerTy()));
   } else {
 for (unsigned i = 0, e = Args.size(); i != e; ++i) {
   switch (getValueType(Args[i].second)) {
@@ -757,8 +757,8 @@
 
 // Adjust the stack pointer for the new arguments...
 // These operations are automatically eliminated by the prolog/epilog pass
-Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
-DAG.getConstant(NumBytes, getPointerTy()));
+Chain = DAG.getCALLSEQ_START(Chain,
+ DAG.getConstant(NumBytes, getPointerTy()));
 
 // Set up a copy of the stack pointer for use loading and storing any
 // arguments that may not fit in the registers available for argument



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


[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h

2006-02-13 Thread Chris Lattner


Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.97 -> 1.98
---
Log message:

Add a method


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

 SelectionDAG.h |   12 
 1 files changed, 12 insertions(+)


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.97 
llvm/include/llvm/CodeGen/SelectionDAG.h:1.98
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.97   Thu Feb  9 16:11:03 2006
+++ llvm/include/llvm/CodeGen/SelectionDAG.hMon Feb 13 02:54:46 2006
@@ -196,6 +196,18 @@
   /// getZeroExtendInReg - Return the expression required to zero extend the Op
   /// value assuming it was the smaller SrcTy value.
   SDOperand getZeroExtendInReg(SDOperand Op, MVT::ValueType SrcTy);
+  
+  /// getCALLSEQ_START - Return a new CALLSEQ_START node, which always must 
have
+  /// a flag result (to ensure it's not CSE'd).
+  SDOperand getCALLSEQ_START(SDOperand Chain, SDOperand Op) {
+std::vector ResultTys;
+ResultTys.push_back(MVT::Other);
+ResultTys.push_back(MVT::Flag);
+std::vector Ops;
+Ops.push_back(Chain);
+Ops.push_back(Op);
+return getNode(ISD::CALLSEQ_START, ResultTys, Ops);
+  }
 
   /// getNode - Gets or creates the specified node.
   ///



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