]> granicus.if.org Git - llvm/commitdiff
[InstSimplify] Don't try to constant fold AllocaInsts since it won't do anything.
authorCraig Topper <craig.topper@gmail.com>
Wed, 12 Apr 2017 22:54:24 +0000 (22:54 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 12 Apr 2017 22:54:24 +0000 (22:54 +0000)
Should give a small compile time improvement.

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

lib/Analysis/InstructionSimplify.cpp

index 0e522cb4e495c6e3f1ed2cb3d0b29f61d4b2bbea..e12f640394e65ab00f255e19813ea03ef61b6649 100644 (file)
@@ -4627,6 +4627,10 @@ Value *llvm::SimplifyInstruction(Instruction *I, const DataLayout &DL,
     Result = SimplifyCastInst(I->getOpcode(), I->getOperand(0), I->getType(),
                               DL, TLI, DT, AC, I);
     break;
+  case Instruction::Alloca:
+    // No simplifications for Alloca and it can't be constant folded.
+    Result = nullptr;
+    break;
   }
 
   // In general, it is possible for computeKnownBits to determine all bits in a