diff options
author | Chris Lattner <sabre@nondot.org> | 2004-03-03 01:40:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-03-03 01:40:53 +0000 |
commit | 0a94348fb9285088a6db78f66b4b97e47bdd431e (patch) | |
tree | 32df24c26bdbf8782525679f9b6d25d1ef92e9bd /lib/Transforms/Utils/LowerAllocations.cpp | |
parent | 7252939af0c063e7db573d746061ed0a8bc0cf4e (diff) | |
download | external_llvm-0a94348fb9285088a6db78f66b4b97e47bdd431e.zip external_llvm-0a94348fb9285088a6db78f66b4b97e47bdd431e.tar.gz external_llvm-0a94348fb9285088a6db78f66b4b97e47bdd431e.tar.bz2 |
Don't emit things like malloc(16*1). Allocation instructions are fixed arity now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12086 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LowerAllocations.cpp')
-rw-r--r-- | lib/Transforms/Utils/LowerAllocations.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 23a705b..53b4c3a 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -101,7 +101,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) { Value *MallocArg = ConstantUInt::get(Type::UIntTy, Size); if (MI->getNumOperands() && Size == 1) { MallocArg = MI->getOperand(0); // Operand * 1 = Operand - } else if (MI->getNumOperands()) { + } else if (MI->isArrayAllocation()) { // Multiply it by the array size if necessary... MallocArg = BinaryOperator::create(Instruction::Mul, MI->getOperand(0), MallocArg, "", I); |