[llvm] r300125 - [InstSimplify] Don't try to constant fold AllocaInsts since it won't do anything.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 15:54:24 PDT 2017


Author: ctopper
Date: Wed Apr 12 17:54:24 2017
New Revision: 300125

URL: http://llvm.org/viewvc/llvm-project?rev=300125&view=rev
Log:
[InstSimplify] Don't try to constant fold AllocaInsts since it won't do anything.

Should give a small compile time improvement.


Modified:
    llvm/trunk/lib/Analysis/InstructionSimplify.cpp

Modified: llvm/trunk/lib/Analysis/InstructionSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=300125&r1=300124&r2=300125&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InstructionSimplify.cpp (original)
+++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp Wed Apr 12 17:54:24 2017
@@ -4627,6 +4627,10 @@ Value *llvm::SimplifyInstruction(Instruc
     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




More information about the llvm-commits mailing list