[llvm-commits] [llvm] r122168 - in /llvm/trunk: lib/Transforms/Scalar/CodeGenPrepare.cpp test/Transforms/CodeGenPrepare/basic.ll

Chris Lattner sabre at nondot.org
Sat Dec 18 20:23:03 PST 2010


Author: lattner
Date: Sat Dec 18 22:23:03 2010
New Revision: 122168

URL: http://llvm.org/viewvc/llvm-project?rev=122168&view=rev
Log:
revert r122164, I'm going to go with a different approach.

Removed:
    llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll
Modified:
    llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=122168&r1=122167&r2=122168&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Sat Dec 18 22:23:03 2010
@@ -211,17 +211,6 @@
   const PHINode *DestBBPN = dyn_cast<PHINode>(DestBB->begin());
   if (!DestBBPN) return true;  // no conflict.
 
-  // Walk all the PHI nodes in DestBB.  If any of the input values to the PHI
-  // are trapping constant exprs, then merging this block would introduce the
-  // possible trap into new control flow if we have any critical predecessor
-  // edges.
-  for (BasicBlock::const_iterator I = DestBB->begin(); isa<PHINode>(I); ++I) {
-    const PHINode *PN = cast<PHINode>(I);
-    if (const Constant *C =dyn_cast<Constant>(PN->getIncomingValueForBlock(BB)))
-      if (C->canTrap())
-        return false;
-  }
-  
   // Collect the preds of BB.
   SmallPtrSet<const BasicBlock*, 16> BBPreds;
   if (const PHINode *BBPN = dyn_cast<PHINode>(BB->begin())) {

Removed: llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll?rev=122167&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll (original)
+++ llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll (removed)
@@ -1,31 +0,0 @@
-; RUN: opt -codegenprepare %s -S | FileCheck %s
-; PR8642
-
-%0 = type <{ %1, %1 }>
-%1 = type { i8, i8, i8, i8 }
-
- at g_2 = global %0 <{ %1 { i8 1, i8 0, i8 0, i8 undef }, %1 { i8 2, i8 0, i8 0, i8 undef } }>, align 4
- at g_4 = global %1 { i8 3, i8 0, i8 0, i8 undef }, align 4
-
-; CGP shouldn't fold away the empty cond.false.i block, because the constant
-; expr that will get dropped into it could trap.
-define i16 @test1(i8** %argv, i1 %c) nounwind ssp {
-entry:
-  br i1 %c, label %cond.end.i, label %cond.false.i
-
-cond.false.i:                                     ; preds = %entry
-  br label %foo.exit
-
-cond.end.i:                                       ; preds = %entry
-  store i8* null, i8** %argv
-  br label %foo.exit
-
-foo.exit:                                         ; preds = %cond.end.i, %cond.false.i
-  %call1 = phi i16 [ trunc (i32 srem (i32 1, i32 zext (i1 icmp eq (%1* bitcast (i8* getelementptr inbounds (%0* @g_2, i64 0, i32 1, i32 0) to %1*), %1* @g_4) to i32)) to i16), %cond.false.i ], [ 1, %cond.end.i ]
-  ret i16 %call1
-  
-; CHECK: @test1
-; CHECK: cond.false.i:
-; CHECK-NEXT:  br label %foo.exit
-}
-





More information about the llvm-commits mailing list