[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LowerAllocations.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Mar 2 19:41:01 PST 2004


Changes in directory llvm/lib/Transforms/Scalar:

LowerAllocations.cpp updated: 1.45 -> 1.46

---
Log message:

Don't emit things like malloc(16*1).  Allocation instructions are fixed arity now.


---
Diffs of the changes:  (+1 -1)

Index: llvm/lib/Transforms/Scalar/LowerAllocations.cpp
diff -u llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.45 llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.46
--- llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.45	Sat Feb 28 12:51:45 2004
+++ llvm/lib/Transforms/Scalar/LowerAllocations.cpp	Tue Mar  2 19:40:53 2004
@@ -101,7 +101,7 @@
       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);





More information about the llvm-commits mailing list