summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
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/IPO
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/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 987703c8679..c9c8835e190 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -678,7 +678,7 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV,
(unsigned)NElements->getRawValue());
MallocInst *NewMI =
new MallocInst(NewTy, Constant::getNullValue(Type::UIntTy),
- MI->getName(), MI);
+ MI->getAlignment(), MI->getName(), MI);
std::vector<Value*> Indices;
Indices.push_back(Constant::getNullValue(Type::IntTy));
Indices.push_back(Indices[0]);
@@ -950,6 +950,7 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
DEBUG(std::cerr << "LOCALIZING GLOBAL: " << *GV);
Instruction* FirstI = GS.AccessingFunction->getEntryBlock().begin();
const Type* ElemTy = GV->getType()->getElementType();
+ // FIXME: Pass Global's alignment when globals have alignment
AllocaInst* Alloca = new AllocaInst(ElemTy, NULL, GV->getName(), FirstI);
if (!isa<UndefValue>(GV->getInitializer()))
new StoreInst(GV->getInitializer(), Alloca, FirstI);
OpenPOWER on IntegriCloud