remove special handling of bitcast(malloc), it will be handled
authorChris Lattner <sabre@nondot.org>
Sun, 27 Sep 2009 21:29:28 +0000 (21:29 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 27 Sep 2009 21:29:28 +0000 (21:29 +0000)
when the loop inspects the bitcast operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82928 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/FunctionAttrs.cpp

index 58cc909a86c9c6edf418a1b0436ca4ff3a3402c5..7edaa7fbef5e4fad6bfaa1f4657bf6eabf2fc8f1 100644 (file)
@@ -249,9 +249,6 @@ bool FunctionAttrs::IsFunctionMallocLike(Function *F,
       switch (RVI->getOpcode()) {
         // Extend the analysis by looking upwards.
         case Instruction::BitCast:
-          if (isMalloc(RVI))
-            break;
-          // fall through
         case Instruction::GetElementPtr:
           FlowsToReturn.insert(RVI->getOperand(0));
           continue;
@@ -259,12 +256,14 @@ bool FunctionAttrs::IsFunctionMallocLike(Function *F,
           SelectInst *SI = cast<SelectInst>(RVI);
           FlowsToReturn.insert(SI->getTrueValue());
           FlowsToReturn.insert(SI->getFalseValue());
-        } continue;
+          continue;
+        }
         case Instruction::PHI: {
           PHINode *PN = cast<PHINode>(RVI);
           for (int i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
             FlowsToReturn.insert(PN->getIncomingValue(i));
-        } continue;
+          continue;
+        }
 
         // Check whether the pointer came from an allocation.
         case Instruction::Alloca: