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

2007-03-17 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.388 - 1.389
---
Log message:

Use SmallSet instead of std::set.

---
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.388 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.389
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.388Sat Mar 17 
03:22:49 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Sat Mar 17 03:53:30 2007
@@ -3983,7 +3983,7 @@
 return false;
 
   // DestBBs - These are the blocks where a copy of BinOp will be inserted.
-  std::setBasicBlock* DestBBs;
+  SmallSetBasicBlock*, 8 DestBBs;
   BasicBlock *DefBB = BinOp-getParent();
   bool MadeChange = false;
   for (Value::use_iterator UI = BinOp-use_begin(), E = BinOp-use_end(); 



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


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

2007-03-17 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen:

LiveIntervalAnalysis.cpp updated: 1.221 - 1.222
---
Log message:

Joining a live interval of a physical register with a virtual one can turn out
to be really bad. Once they are joined they are not broken apart. Also, physical
intervals cannot be spilled!

Added a heuristic as a workaround for this. Be careful coalescing with a
physical register if the virtual register uses are far. Check if there are
uses in the same loop as the source (copy instruction). Check if it is in the
loop preheader, etc.

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

 LiveIntervalAnalysis.cpp |   54 +++
 1 files changed, 54 insertions(+)


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.221 
llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.222
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.221 Thu Mar 15 16:19:28 2007
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp   Sat Mar 17 04:27:35 2007
@@ -41,6 +41,8 @@
 STATISTIC(numJoins, Number of interval joins performed);
 STATISTIC(numPeep , Number of identity moves eliminated after 
coalescing);
 STATISTIC(numFolded   , Number of loads/stores folded into instructions);
+STATISTIC(numAborts   , Number of times interval joining aborted);
+static cl::optbool ReduceJoinPhys(reduce-joining-phy-regs, cl::Hidden);
 
 namespace {
   RegisterPassLiveIntervals X(liveintervals, Live Interval Analysis);
@@ -931,6 +933,58 @@
   isShorten = true;
   }
 
+  // We need to be careful about coalescing a source physical register with a
+  // virtual register. Once the coalescing is done, it cannot be broken and
+  // these are not spillable! If the destination interval uses are far away,
+  // think twice about coalescing them!
+  if (ReduceJoinPhys  !isDead 
+  MRegisterInfo::isPhysicalRegister(repSrcReg)) {
+// Small function. No need to worry!
+if (r2iMap_.size() = allocatableRegs_.size() * 2)
+  goto TryJoin;
+
+LiveVariables::VarInfo dvi = lv_-getVarInfo(repDstReg);
+// Is the value used in the current BB or any immediate successroe BB?
+MachineBasicBlock *SrcBB = CopyMI-getParent();
+if (!dvi.UsedBlocks[SrcBB-getNumber()]) {
+  for (MachineBasicBlock::succ_iterator SI = SrcBB-succ_begin(),
+ SE = SrcBB-succ_end(); SI != SE; ++SI) {
+MachineBasicBlock *SuccMBB = *SI;
+if (dvi.UsedBlocks[SuccMBB-getNumber()])
+  goto TryJoin;
+  }
+}
+
+// Ok, no use in this BB and no use in immediate successor BB's. Be really
+// careful now!
+// It's only used in one BB, forget about it!
+if (dvi.UsedBlocks.count() = 1) {
+  ++numAborts;
+  return false;
+}
+
+// Examine all the blocks where the value is used. If any is in the same
+// loop, then it's ok. Or if the current BB is a preheader of any of the
+// loop that uses this value, that's ok as well.
+const LoopInfo LI = getAnalysisLoopInfo();
+const Loop *L = LI.getLoopFor(SrcBB-getBasicBlock());
+int UseBBNum = dvi.UsedBlocks.find_first();
+while (UseBBNum != -1) {
+  MachineBasicBlock *UseBB = mf_-getBlockNumbered(UseBBNum);
+  const Loop *UL = LI.getLoopFor(UseBB-getBasicBlock());
+  if ((UL  UL == L) ||  // A use in the same loop
+  (UL  L  // A use in a loop and this BB is the preheader
+   UL-getLoopPreheader() == SrcBB-getBasicBlock()))
+goto TryJoin;
+  UseBBNum = dvi.UsedBlocks.find_next(UseBBNum);
+}
+
+// Don't do it!
+++numAborts;
+return false;
+  }
+
+TryJoin:
   // Okay, attempt to join these two intervals.  On failure, this returns 
false.
   // Otherwise, if one of the intervals being joined is a physreg, this method
   // always canonicalizes DestInt to be it.  The output SrcInt will not have



___
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/LiveVariables.h

2007-03-17 Thread Evan Cheng


Changes in directory llvm/include/llvm/CodeGen:

LiveVariables.h updated: 1.35 - 1.36
---
Log message:

Track the BB's where each virtual register is used.

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

 LiveVariables.h |6 ++
 1 files changed, 6 insertions(+)


Index: llvm/include/llvm/CodeGen/LiveVariables.h
diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.35 
llvm/include/llvm/CodeGen/LiveVariables.h:1.36
--- llvm/include/llvm/CodeGen/LiveVariables.h:1.35  Mon Feb 19 15:49:53 2007
+++ llvm/include/llvm/CodeGen/LiveVariables.h   Sat Mar 17 04:29:54 2007
@@ -79,6 +79,10 @@
 ///
 BitVector AliveBlocks;
 
+/// UsedBlocks - Set of blocks of which this value is actually used. This
+/// is a bit set which uses the basic block number as an index.
+BitVector UsedBlocks;
+
 /// Kills - List of MachineInstruction's which are the last use of this
 /// virtual register (kill it) in their basic block.
 ///
@@ -116,6 +120,8 @@
   BitVector ReservedRegisters;
 
 private:   // Intermediate data structures
+  MachineFunction *MF;
+
   const MRegisterInfo *RegInfo;
 
   MachineInstr **PhysRegInfo;



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


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

2007-03-17 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen:

LiveVariables.cpp updated: 1.70 - 1.71
---
Log message:

Track the BB's where each virtual register is used.

---
Diffs of the changes:  (+22 -15)

 LiveVariables.cpp |   37 ++---
 1 files changed, 22 insertions(+), 15 deletions(-)


Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.70 
llvm/lib/CodeGen/LiveVariables.cpp:1.71
--- llvm/lib/CodeGen/LiveVariables.cpp:1.70 Fri Mar  9 03:48:56 2007
+++ llvm/lib/CodeGen/LiveVariables.cpp  Sat Mar 17 04:29:54 2007
@@ -48,6 +48,9 @@
   cerrAlive in blocks: ;
   for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i)
 if (AliveBlocks[i]) cerr  i  , ;
+  cerrUsed in blocks: ;
+  for (unsigned i = 0, e = UsedBlocks.size(); i != e; ++i)
+if (UsedBlocks[i]) cerr  i  , ;
   cerr  \n  Killed by:;
   if (Kills.empty())
 cerr   No instructions.\n;
@@ -68,7 +71,10 @@
 else
   VirtRegInfo.resize(2*VirtRegInfo.size());
   }
-  return VirtRegInfo[RegIdx];
+  VarInfo VI = VirtRegInfo[RegIdx];
+  VI.AliveBlocks.resize(MF-getNumBlockIDs());
+  VI.UsedBlocks.resize(MF-getNumBlockIDs());
+  return VI;
 }
 
 bool LiveVariables::KillsRegister(MachineInstr *MI, unsigned Reg) const {
@@ -117,9 +123,6 @@
 
   if (MBB == VRInfo.DefInst-getParent()) return;  // Terminate recursion
 
-  if (VRInfo.AliveBlocks.size() = BBNum)
-VRInfo.AliveBlocks.resize(BBNum+1);  // Make space...
-
   if (VRInfo.AliveBlocks[BBNum])
 return;  // We already know the block is live
 
@@ -135,6 +138,10 @@
  MachineInstr *MI) {
   assert(VRInfo.DefInst  Register use before def!);
 
+  unsigned BBNum = MBB-getNumber();
+
+  VRInfo.UsedBlocks[BBNum] = true;
+
   // Check to see if this basic block is already a kill block...
   if (!VRInfo.Kills.empty()  VRInfo.Kills.back()-getParent() == MBB) {
 // Yes, this register is killed in this basic block already.  Increase the
@@ -152,11 +159,10 @@
  Should have kill for defblock!);
 
   // Add a new kill entry for this basic block.
-  unsigned BBNum = MBB-getNumber();
   // If this virtual register is already marked as alive in this basic block,
   // that means it is alive in at least one of the successor block, it's not
   // a kill.
-  if (VRInfo.AliveBlocks.size() = BBNum || !VRInfo.AliveBlocks[BBNum])
+  if (!VRInfo.AliveBlocks[BBNum])
 VRInfo.Kills.push_back(MI);
 
   // Update all dominating blocks to mark them known live.
@@ -220,12 +226,13 @@
   }
 }
 
-bool LiveVariables::runOnMachineFunction(MachineFunction MF) {
-  const TargetInstrInfo TII = *MF.getTarget().getInstrInfo();
-  RegInfo = MF.getTarget().getRegisterInfo();
+bool LiveVariables::runOnMachineFunction(MachineFunction mf) {
+  MF = mf;
+  const TargetInstrInfo TII = *MF-getTarget().getInstrInfo();
+  RegInfo = MF-getTarget().getRegisterInfo();
   assert(RegInfo  Target doesn't have register information?);
 
-  ReservedRegisters = RegInfo-getReservedRegs(MF);
+  ReservedRegisters = RegInfo-getReservedRegs(mf);
 
   // PhysRegInfo - Keep track of which instruction was the last use of a
   // physical register.  This is a purely local property, because all physical
@@ -239,14 +246,14 @@
   /// Get some space for a respectable number of registers...
   VirtRegInfo.resize(64);
 
-  analyzePHINodes(MF);
+  analyzePHINodes(mf);
 
   // Calculate live variable information in depth first order on the CFG of the
   // function.  This guarantees that we will see the definition of a virtual
   // register before its uses due to dominance properties of SSA (except for 
PHI
   // nodes, which are treated as a special case).
   //
-  MachineBasicBlock *Entry = MF.begin();
+  MachineBasicBlock *Entry = MF-begin();
   std::setMachineBasicBlock* Visited;
   for (df_ext_iteratorMachineBasicBlock* DFI = df_ext_begin(Entry, Visited),
  E = df_ext_end(Entry, Visited); DFI != E; ++DFI) {
@@ -326,8 +333,8 @@
 // it as using all of the live-out values in the function.
 if (!MBB-empty()  TII.isReturn(MBB-back().getOpcode())) {
   MachineInstr *Ret = MBB-back();
-  for (MachineFunction::liveout_iterator I = MF.liveout_begin(),
- E = MF.liveout_end(); I != E; ++I) {
+  for (MachineFunction::liveout_iterator I = MF-liveout_begin(),
+ E = MF-liveout_end(); I != E; ++I) {
 assert(MRegisterInfo::isPhysicalRegister(*I) 
Cannot have a live-in virtual register!);
 HandlePhysRegUse(*I, Ret);
@@ -360,7 +367,7 @@
   // function.  If so, it is due to a bug in the instruction selector or some
   // other part of the code generator if this happens.
 #ifndef NDEBUG
-  for(MachineFunction::iterator i = MF.begin(), e = MF.end(); i != e; ++i)
+  for(MachineFunction::iterator i = MF-begin(), e = MF-end(); i != e; ++i)
 assert(Visited.count(*i) != 0  unreachable basic block found);
 #endif
 



___
llvm-commits 

[llvm-commits] CVS: llvm-test/Makefile.programs

2007-03-17 Thread Evan Cheng


Changes in directory llvm-test:

Makefile.programs updated: 1.260 - 1.261
---
Log message:

Test -reduce-joining-phy-regs as X86 llcbeta.

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

 Makefile.programs |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.260 llvm-test/Makefile.programs:1.261
--- llvm-test/Makefile.programs:1.260   Fri Mar 16 03:47:44 2007
+++ llvm-test/Makefile.programs Sat Mar 17 04:31:11 2007
@@ -223,7 +223,7 @@
 LLCBETAOPTION := -sched=simple 
 endif
 ifeq ($(ARCH),x86)
-LLCBETAOPTION := -enable-gep-index-sinking
+LLCBETAOPTION := -reduce-joining-phy-regs
 #--enable-tail-merge
 #-regalloc=local -fast
 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/PredicateSimplifier.cpp

2007-03-17 Thread Anton Korobeynikov


Changes in directory llvm/lib/Transforms/Scalar:

PredicateSimplifier.cpp updated: 1.57 - 1.58
---
Log message:

Silence warning


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

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


Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.57 
llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.58
--- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.57 Thu Mar 15 
21:37:39 2007
+++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp  Sat Mar 17 09:48:06 2007
@@ -2054,8 +2054,8 @@
 case ICmpInst::ICMP_SLT:
 case ICmpInst::ICMP_ULT:
   if (Op1-getValue() != 0)
-NextVal = castConstantInt(ConstantExpr::getAdd(
-  Op1, ConstantInt::get(Op1-getType(), -1)));
+NextVal = castConstantInt(ConstantExpr::getSub(
+  Op1, ConstantInt::get(Op1-getType(), 1)));
  break;
 case ICmpInst::ICMP_SGT:
 case ICmpInst::ICMP_UGT:



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


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

2007-03-17 Thread Reid Spencer


Changes in directory llvm-www:

developers.txt updated: 1.10 - 1.11
---
Log message:

Change Henrik Bach's email address per his request.


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

 developers.txt |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-www/developers.txt
diff -u llvm-www/developers.txt:1.10 llvm-www/developers.txt:1.11
--- llvm-www/developers.txt:1.10Sun Mar  4 15:09:17 2007
+++ llvm-www/developers.txt Sat Mar 17 12:14:55 2007
@@ -1,6 +1,6 @@
 Vikram Advehref=http://www-sal.cs.uiuc.edu/~vadve/ img=PhotoVikram.jpg 
width=120   height=120  alt=vadve
 Owen   Andersonhref=http://www.silentcentre.net/   
img=PhotoOwen.jpg   width=154   height=175  alt=Resistor
-Henrik Bachhref=mailto:[EMAIL PROTECTED]   img=PhotoHenrik.jpg 
width=156   height=178  alt=Henrik
+Henrik Bachhref=mailto:[EMAIL PROTECTED]   img=PhotoHenrik.jpg 
width=156   height=178  alt=Henrik
 Nate   Begeman href=http://sampo.lasthome.net/ img=PhotoNate.jpg   
width=160   height=130  alt=Sampo
 RobBocchino href=http://llvm.cs.uiuc.edu/~bocchino img=PhotoRob.jpg
width=140   height=187  alt=Rob
 Misha  Brukman href=http://misha.brukman.net/code/llvm/
img=PhotoMisha.png  width=175   height=198  alt=Misha



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


[llvm-commits] CVS: llvm/test/Transforms/PredicateSimplifier/2007-03-17-OpsToDefVRP.ll

2007-03-17 Thread Nick Lewycky


Changes in directory llvm/test/Transforms/PredicateSimplifier:

2007-03-17-OpsToDefVRP.ll added (r1.1)
---
Log message:

Propagate ValueRanges across equality.

Add some more micro-optimizations: x * 0 = 0, a - x = a -- x = 0.


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

 2007-03-17-OpsToDefVRP.ll |   19 +++
 1 files changed, 19 insertions(+)


Index: llvm/test/Transforms/PredicateSimplifier/2007-03-17-OpsToDefVRP.ll
diff -c /dev/null 
llvm/test/Transforms/PredicateSimplifier/2007-03-17-OpsToDefVRP.ll:1.1
*** /dev/null   Sat Mar 17 20:09:42 2007
--- llvm/test/Transforms/PredicateSimplifier/2007-03-17-OpsToDefVRP.ll  Sat Mar 
17 20:09:32 2007
***
*** 0 
--- 1,19 
+ ; RUN: llvm-as  %s | opt -predsimplify | llvm-dis | grep -v %c
+ define void @foo(i8* %X, i8* %Y) {
+ entry:
+   %A = load i8* %X
+   %B = load i8* %Y
+   %a = icmp ult i8 %B, 10
+   br i1 %a, label %cond_true, label %URB
+ cond_true:
+   %b = icmp eq i8 %A, %B
+   br i1 %b, label %cond_true2, label %URB
+ cond_true2:
+   %c = icmp ult i8 %A, 11
+   call i8 @bar(i1 %c)
+   ret void
+ URB:
+   ret void
+ }
+ 
+ declare i8 @bar(i1)



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

2007-03-17 Thread Nick Lewycky


Changes in directory llvm/lib/Transforms/Scalar:

PredicateSimplifier.cpp updated: 1.58 - 1.59
---
Log message:

Propagate ValueRanges across equality.

Add some more micro-optimizations: x * 0 = 0, a - x = a -- x = 0.


---
Diffs of the changes:  (+157 -65)

 PredicateSimplifier.cpp |  222 +---
 1 files changed, 157 insertions(+), 65 deletions(-)


Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.58 
llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.59
--- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.58 Sat Mar 17 
09:48:06 2007
+++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp  Sat Mar 17 20:09:32 2007
@@ -833,6 +833,10 @@
   return 0;
 }
 
+#ifndef NDEBUG
+bool isCanonical(Value *V, ETNode *Subtree, VRPSolver *VRP);
+#endif
+
   public:
 
 bool isRelatedBy(Value *V1, Value *V2, ETNode *Subtree, LatticeVal LV) {
@@ -893,10 +897,38 @@
 void addToWorklist(Value *V, const APInt *I, ICmpInst::Predicate Pred,
VRPSolver *VRP);
 
+void mergeInto(Value **I, unsigned n, Value *New, ETNode *Subtree,
+   VRPSolver *VRP) {
+  assert(isCanonical(New, Subtree, VRP)  Best choice not canonical?);
+
+  uint32_t W = widthOfValue(New);
+  if (!W) return;
+
+  ConstantRange CR_New = rangeFromValue(New, Subtree, W);
+  ConstantRange Merged = CR_New;
+
+  for (; n != 0; ++I, --n) {
+ConstantRange CR_Kill = rangeFromValue(*I, Subtree, W);
+if (CR_Kill.isFullSet()) continue;
+Merged = Merged.intersectWith(CR_Kill);
+  }
+
+  if (Merged.isFullSet() || Merged == CR_New) return;
+
+  if (Merged.isSingleElement())
+addToWorklist(New, Merged.getSingleElement(),
+  ICmpInst::ICMP_EQ, VRP);
+  else
+update(New, Merged, Subtree);
+}
+
 void addInequality(Value *V1, Value *V2, ETNode *Subtree, LatticeVal LV,
VRPSolver *VRP) {
   assert(!isRelatedBy(V1, V2, Subtree, LV)  Asked to do useless work.);
 
+  assert(isCanonical(V1, Subtree, VRP)  Value not canonical.);
+  assert(isCanonical(V2, Subtree, VRP)  Value not canonical.);
+
   if (LV == NE) return; // we can't represent those.
   // XXX: except in the case where isSingleElement and equal to either
   // Lower or Upper. That's probably not profitable. (Type::Int1Ty?)
@@ -1150,7 +1182,7 @@
   // The first iteration through this loop operates on V2 before going
   // through the Remove list and operating on those too. If all of the
   // iterations performed simple replacements then we exit early.
-  bool exitEarly = true;
+  bool mergeIGNode = false;
   unsigned i = 0;
   for (Value *R = V2; i == 0 || i  Remove.size(); ++i) {
 if (i) R = IG.node(Remove[i])-getValue(); // skip n2.
@@ -1206,64 +1238,98 @@
 
 // If we make it to here, then we will need to create a node for N1.
 // Otherwise, we can skip out early!
-exitEarly = false;
+mergeIGNode = true;
   }
 
-  if (exitEarly) return true;
+  if (!isaConstant(V1)) {
+if (Remove.empty()) {
+  VR.mergeInto(V2, 1, V1, Top, this);
+} else {
+  std::vectorValue* RemoveVals;
+  RemoveVals.reserve(Remove.size());
 
-  // Create N1.
-  if (!n1) n1 = IG.newNode(V1);
+  for (SetVectorunsigned::iterator I = Remove.begin(),
+   E = Remove.end(); I != E; ++I) {
+Value *V = IG.node(*I)-getValue();
+if (!V-use_empty())
+  RemoveVals.push_back(V);
+  }
+  VR.mergeInto(RemoveVals[0], RemoveVals.size(), V1, Top, this);
+}
+  }
 
-  // Migrate relationships from removed nodes to N1.
-  Node *N1 = IG.node(n1);
-  for (SetVectorunsigned::iterator I = Remove.begin(), E = Remove.end();
-   I != E; ++I) {
-unsigned n = *I;
-Node *N = IG.node(n);
-for (Node::iterator NI = N-begin(), NE = N-end(); NI != NE; ++NI) {
-  if (NI-Subtree-DominatedBy(Top)) {
-if (NI-To == n1) {
-  assert((NI-LV  EQ_BIT)  Node inequal to itself.);
-  continue;
+  if (mergeIGNode) {
+// Create N1.
+if (!n1) n1 = IG.newNode(V1);
+
+// Migrate relationships from removed nodes to N1.
+Node *N1 = IG.node(n1);
+for (SetVectorunsigned::iterator I = Remove.begin(), E = 
Remove.end();
+ I != E; ++I) {
+  unsigned n = *I;
+  Node *N = IG.node(n);
+  for (Node::iterator NI = N-begin(), NE = N-end(); NI != NE; ++NI) {
+if (NI-Subtree-DominatedBy(Top)) {
+  if (NI-To == n1) {
+assert((NI-LV  EQ_BIT)  Node inequal to itself.);
+continue;
+  }
+  if (Remove.count(NI-To))
+continue;
+

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

2007-03-17 Thread Evan Cheng


Changes in directory llvm/include/llvm/CodeGen:

RegisterScavenging.h updated: 1.9 - 1.10
---
Log message:

Fix comment.

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

 RegisterScavenging.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/CodeGen/RegisterScavenging.h
diff -u llvm/include/llvm/CodeGen/RegisterScavenging.h:1.9 
llvm/include/llvm/CodeGen/RegisterScavenging.h:1.10
--- llvm/include/llvm/CodeGen/RegisterScavenging.h:1.9  Tue Mar  6 20:36:16 2007
+++ llvm/include/llvm/CodeGen/RegisterScavenging.h  Sat Mar 17 22:26:04 2007
@@ -71,7 +71,7 @@
   void backward();
 
   /// forward / backward - Move the internal MBB iterator and update register
-  /// states until it has reached but not processed the specific iterator.
+  /// states until it has processed the specific iterator.
   void forward(MachineBasicBlock::iterator I) {
 while (MBBI != I) forward();
   }



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