Change a place to use an arbitrary value instead of null, when possible
authorChris Lattner <sabre@nondot.org>
Tue, 2 Aug 2005 23:29:23 +0000 (23:29 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 2 Aug 2005 23:29:23 +0000 (23:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22605 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/SimplifyCFG.cpp

index c060127e2c09df8b6af035f9e8a92e188d2fe3b3..d8ede2734e564459f7d03543e1222cc10498b9f9 100644 (file)
@@ -849,13 +849,13 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
     while (!BB->empty()) {
       Instruction &I = BB->back();
       // If this instruction is used, replace uses with an arbitrary
-      // constant value.  Because control flow can't get here, we don't care
+      // value.  Because control flow can't get here, we don't care
       // what we replace the value with.  Note that since this block is
       // unreachable, and all values contained within it must dominate their
       // uses, that all uses will eventually be removed.
       if (!I.use_empty())
-        // Make all users of this instruction reference the constant instead
-        I.replaceAllUsesWith(Constant::getNullValue(I.getType()));
+        // Make all users of this instruction use undef instead
+        I.replaceAllUsesWith(UndefValue::get(I.getType()));
 
       // Remove the instruction from the basic block
       BB->getInstList().pop_back();