Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jul 2013 17:57:11 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253042 - head/contrib/llvm/lib/CodeGen/SelectionDAG
Message-ID:  <201307081757.r68HvB2i059785@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Mon Jul  8 17:57:11 2013
New Revision: 253042
URL: http://svnweb.freebsd.org/changeset/base/253042

Log:
  Pull in r185616 from llvm trunk:
  
    FastISel can only append to basic blocks.
  
    Compute the insertion point from the end of the basic block instead of
    skipping labels from the front.
  
    This caused failures in landing pads when live-in copies where inserted
    before instruction selection.
  
  I missed this change in r252720; without it, certain compilation flags
  can cause exception labels to not be generated, but still referenced,
  leading to link errors.
  
  Reported by:	zeising
  MFC after:	3 days

Modified:
  head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp

Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
==============================================================================
--- head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp	Mon Jul  8 17:20:05 2013	(r253041)
+++ head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp	Mon Jul  8 17:57:11 2013	(r253042)
@@ -75,15 +75,12 @@ STATISTIC(NumFastIselDead, "Number of de
 void FastISel::startNewBlock() {
   LocalValueMap.clear();
 
+  // Instructions are appended to FuncInfo.MBB. If the basic block already
+  // contains labels or copies, use the last instruction as the last local
+  // value.
   EmitStartPt = 0;
-
-  // Advance the emit start point past any EH_LABEL instructions.
-  MachineBasicBlock::iterator
-    I = FuncInfo.MBB->begin(), E = FuncInfo.MBB->end();
-  while (I != E && I->getOpcode() == TargetOpcode::EH_LABEL) {
-    EmitStartPt = I;
-    ++I;
-  }
+  if (!FuncInfo.MBB->empty())
+    EmitStartPt = &FuncInfo.MBB->back();
   LastLocalValue = EmitStartPt;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307081757.r68HvB2i059785>