diff options
author | Nate Begeman <natebegeman@mac.com> | 2005-11-05 09:21:28 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2005-11-05 09:21:28 +0000 |
commit | 14b0529532904b9e5a1e34526b4a3209f3e5bc62 (patch) | |
tree | 43e99ef7bb1cdfbb2828eea5617026f6d426e787 /lib/Transforms/Scalar/InstructionCombining.cpp | |
parent | ae4664a9f2da955c9d2a3f38b28f0a4395851ace (diff) |
Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.
No targets currently do anything with this information, nor is it presrved
in the bytecode representation. That's coming up next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 1164fb2e03..6934fe27a4 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3936,9 +3936,9 @@ Instruction *InstCombiner::PromoteCastOfAllocation(CastInst &CI, std::string Name = AI.getName(); AI.setName(""); AllocationInst *New; if (isa<MallocInst>(AI)) - New = new MallocInst(CastElTy, Amt, Name); + New = new MallocInst(CastElTy, Amt, AI.getAlignment(), Name); else - New = new AllocaInst(CastElTy, Amt, Name); + New = new AllocaInst(CastElTy, Amt, AI.getAlignment(), Name); InsertNewInstBefore(New, AI); // If the allocation has multiple uses, insert a cast and change all things @@ -5266,10 +5266,10 @@ Instruction *InstCombiner::visitAllocationInst(AllocationInst &AI) { // Create and insert the replacement instruction... if (isa<MallocInst>(AI)) - New = new MallocInst(NewTy, 0, AI.getName()); + New = new MallocInst(NewTy, 0, AI.getAlignment(), AI.getName()); else { assert(isa<AllocaInst>(AI) && "Unknown type of allocation inst!"); - New = new AllocaInst(NewTy, 0, AI.getName()); + New = new AllocaInst(NewTy, 0, AI.getAlignment(), AI.getName()); } InsertNewInstBefore(New, AI); |