summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-11-05 09:21:28 +0000
committerNate Begeman <natebegeman@mac.com>2005-11-05 09:21:28 +0000
commit848622f87f00b81bdfef2aed8c26f80e38217713 (patch)
treecef0c6b2b461e20d131912b80cd6b21e5f895520 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parent75fe59c4ead311d292bec997ff6a08c00e644b6d (diff)
downloadbcm5719-llvm-848622f87f00b81bdfef2aed8c26f80e38217713.tar.gz
bcm5719-llvm-848622f87f00b81bdfef2aed8c26f80e38217713.zip
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. llvm-svn: 24196
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 1164fb2e03e..6934fe27a49 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud