Change uses of Function::front to Function::getEntryBlock for readability.
[oota-llvm.git] / lib / Transforms / Scalar / InstructionCombining.cpp
index 1523f01f3773604c9ba4f6ae16b3c26915b83775..12f02f758ecb4a8ea5af76fb6ad386b827d4a2d3 100644 (file)
@@ -9946,7 +9946,8 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
   if (isa<PHINode>(I) || I->mayWriteToMemory()) return false;
 
   // Do not sink alloca instructions out of the entry block.
-  if (isa<AllocaInst>(I) && I->getParent() == &DestBlock->getParent()->front())
+  if (isa<AllocaInst>(I) && I->getParent() ==
+        &DestBlock->getParent()->getEntryBlock())
     return false;
 
   // We can only sink load instructions if there is nothing between the load and